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"); | |
kinuko
2012/03/26 08:43:45
Do we want to mention the corresponding routines i
tzik
2012/03/26 11:27:38
Done.
| |
100 std::string FilePathToString(const FilePath& file_path); | |
101 | |
102 // Decode a file path from |file_path_string|. | |
103 FilePath StringToFilePath(const std::string& file_path_string); | |
104 | |
95 } // namespace fileapi | 105 } // namespace fileapi |
96 | 106 |
97 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_UTIL_H_ | 107 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_UTIL_H_ |
OLD | NEW |