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 // 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 // Windows-style drive letter support and pathname separator characters can be | 118 // Windows-style drive letter support and pathname separator characters can be |
119 // enabled and disabled independently, to aid testing. These #defines are | 119 // enabled and disabled independently, to aid testing. These #defines are |
120 // here so that the same setting can be used in both the implementation and | 120 // here so that the same setting can be used in both the implementation and |
121 // in the unit test. | 121 // in the unit test. |
122 #if defined(OS_WIN) | 122 #if defined(OS_WIN) |
123 #define FILE_PATH_USES_DRIVE_LETTERS | 123 #define FILE_PATH_USES_DRIVE_LETTERS |
124 #define FILE_PATH_USES_WIN_SEPARATORS | 124 #define FILE_PATH_USES_WIN_SEPARATORS |
125 #endif // OS_WIN | 125 #endif // OS_WIN |
126 | 126 |
| 127 namespace base { |
| 128 |
127 class Pickle; | 129 class Pickle; |
128 class PickleIterator; | 130 class PickleIterator; |
129 | 131 |
130 namespace base { | |
131 | |
132 // An abstraction to isolate users from the differences between native | 132 // An abstraction to isolate users from the differences between native |
133 // pathnames on different platforms. | 133 // pathnames on different platforms. |
134 class BASE_EXPORT FilePath { | 134 class BASE_EXPORT FilePath { |
135 public: | 135 public: |
136 #if defined(OS_POSIX) | 136 #if defined(OS_POSIX) |
137 // On most platforms, native pathnames are char arrays, and the encoding | 137 // On most platforms, native pathnames are char arrays, and the encoding |
138 // may or may not be specified. On Mac OS X, native pathnames are encoded | 138 // may or may not be specified. On Mac OS X, native pathnames are encoded |
139 // in UTF-8. | 139 // in UTF-8. |
140 typedef std::string StringType; | 140 typedef std::string StringType; |
141 #elif defined(OS_WIN) | 141 #elif defined(OS_WIN) |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 template<> | 460 template<> |
461 struct hash<base::FilePath> { | 461 struct hash<base::FilePath> { |
462 size_t operator()(const base::FilePath& f) const { | 462 size_t operator()(const base::FilePath& f) const { |
463 return hash<base::FilePath::StringType>()(f.value()); | 463 return hash<base::FilePath::StringType>()(f.value()); |
464 } | 464 } |
465 }; | 465 }; |
466 | 466 |
467 } // namespace BASE_HASH_NAMESPACE | 467 } // namespace BASE_HASH_NAMESPACE |
468 | 468 |
469 #endif // BASE_FILES_FILE_PATH_H_ | 469 #endif // BASE_FILES_FILE_PATH_H_ |
OLD | NEW |