OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_UTIL_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_UTIL_H_ |
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_UTIL_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "webkit/fileapi/file_system_types.h" | 10 #include "webkit/fileapi/file_system_types.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // Example: | 85 // Example: |
86 // "http://www.example.com:80/"'s identifier should look like: | 86 // "http://www.example.com:80/"'s identifier should look like: |
87 // "http_www.example.host_80" | 87 // "http_www.example.host_80" |
88 std::string GetOriginIdentifierFromURL(const GURL& url); | 88 std::string GetOriginIdentifierFromURL(const GURL& url); |
89 GURL GetOriginURLFromIdentifier(const std::string& origin_identifier); | 89 GURL GetOriginURLFromIdentifier(const std::string& origin_identifier); |
90 | 90 |
91 // Returns the string representation of the given filesystem |type|. | 91 // Returns the string representation of the given filesystem |type|. |
92 // Returns an empty string if the |type| is invalid. | 92 // Returns an empty string if the |type| is invalid. |
93 std::string GetFileSystemTypeString(FileSystemType type); | 93 std::string GetFileSystemTypeString(FileSystemType type); |
94 | 94 |
| 95 // Encodes |file_path| to a string. |
| 96 // Following conditions should be held: |
| 97 // - StringToFilePath(FilePathToString(path)) == path |
| 98 // - StringToFilePath(FilePathToString(path) + "/" + "SubDirectory") == |
| 99 // path.AppendASCII("SubDirectory"); |
| 100 // |
| 101 // TODO(tzik): Replace CreateFilePath and FilePathToString in |
| 102 // third_party/leveldatabase/env_chromium.cc with them. |
| 103 std::string FilePathToString(const FilePath& file_path); |
| 104 |
| 105 // Decode a file path from |file_path_string|. |
| 106 FilePath StringToFilePath(const std::string& file_path_string); |
| 107 |
95 } // namespace fileapi | 108 } // namespace fileapi |
96 | 109 |
97 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_UTIL_H_ | 110 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_UTIL_H_ |
OLD | NEW |