| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // FilePath is a container for pathnames stored in a platform's native string | 5 // FilePath is a container for pathnames stored in a platform's native string |
| 6 // type, providing containers for manipulation in according with the | 6 // type, providing containers for manipulation in according with the |
| 7 // platform's conventions for pathnames. It supports the following path | 7 // platform's conventions for pathnames. It supports the following path |
| 8 // types: | 8 // types: |
| 9 // | 9 // |
| 10 // POSIX Windows | 10 // POSIX Windows |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 // try to convert the API into using FilePath. | 305 // try to convert the API into using FilePath. |
| 306 // - Am I interacting with OS-native calls? Then use value() to get at an | 306 // - Am I interacting with OS-native calls? Then use value() to get at an |
| 307 // OS-native string format. | 307 // OS-native string format. |
| 308 // - Am I using well-known file names, like "config.ini"? Then use the | 308 // - Am I using well-known file names, like "config.ini"? Then use the |
| 309 // ASCII functions (we require paths to always be supersets of ASCII). | 309 // ASCII functions (we require paths to always be supersets of ASCII). |
| 310 // - Am I displaying a string to the user in some UI? Then use the | 310 // - Am I displaying a string to the user in some UI? Then use the |
| 311 // LossyDisplayName() function, but keep in mind that you can't | 311 // LossyDisplayName() function, but keep in mind that you can't |
| 312 // ever use the result of that again as a path. | 312 // ever use the result of that again as a path. |
| 313 static FilePath FromWStringHack(const std::wstring& wstring); | 313 static FilePath FromWStringHack(const std::wstring& wstring); |
| 314 | 314 |
| 315 // Static helper method to write a StringType to a pickle. | |
| 316 static void WriteStringTypeToPickle(Pickle* pickle, | |
| 317 const FilePath::StringType& path); | |
| 318 static bool ReadStringTypeFromPickle(Pickle* pickle, void** iter, | |
| 319 FilePath::StringType* path); | |
| 320 | |
| 321 void WriteToPickle(Pickle* pickle); | 315 void WriteToPickle(Pickle* pickle); |
| 322 bool ReadFromPickle(Pickle* pickle, void** iter); | 316 bool ReadFromPickle(Pickle* pickle, void** iter); |
| 323 | 317 |
| 324 #if defined(FILE_PATH_USES_WIN_SEPARATORS) | 318 #if defined(FILE_PATH_USES_WIN_SEPARATORS) |
| 325 // Normalize all path separators to backslash. | 319 // Normalize all path separators to backslash. |
| 326 FilePath NormalizeWindowsPathSeparators() const; | 320 FilePath NormalizeWindowsPathSeparators() const; |
| 327 #endif | 321 #endif |
| 328 | 322 |
| 329 // Compare two strings in the same way the file system does. | 323 // Compare two strings in the same way the file system does. |
| 330 // Note that these always ignore case, even on file systems that are case- | 324 // Note that these always ignore case, even on file systems that are case- |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 namespace stdext { | 395 namespace stdext { |
| 402 | 396 |
| 403 inline size_t hash_value(const FilePath& f) { | 397 inline size_t hash_value(const FilePath& f) { |
| 404 return hash_value(f.value()); | 398 return hash_value(f.value()); |
| 405 } | 399 } |
| 406 | 400 |
| 407 } // namespace stdext | 401 } // namespace stdext |
| 408 #endif // COMPILER | 402 #endif // COMPILER |
| 409 | 403 |
| 410 #endif // BASE_FILE_PATH_H_ | 404 #endif // BASE_FILE_PATH_H_ |
| OLD | NEW |