| 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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 } // namespace base | 436 } // namespace base |
| 437 | 437 |
| 438 // This is required by googletest to print a readable output on test failures. | 438 // This is required by googletest to print a readable output on test failures. |
| 439 BASE_EXPORT extern void PrintTo(const base::FilePath& path, std::ostream* out); | 439 BASE_EXPORT extern void PrintTo(const base::FilePath& path, std::ostream* out); |
| 440 | 440 |
| 441 // Macros for string literal initialization of FilePath::CharType[], and for | 441 // Macros for string literal initialization of FilePath::CharType[], and for |
| 442 // using a FilePath::CharType[] in a printf-style format string. | 442 // using a FilePath::CharType[] in a printf-style format string. |
| 443 #if defined(OS_POSIX) | 443 #if defined(OS_POSIX) |
| 444 #define FILE_PATH_LITERAL(x) x | 444 #define FILE_PATH_LITERAL(x) x |
| 445 #define PRFilePath "s" | 445 #define PRFilePath "s" |
| 446 #define PRFilePathLiteral "%s" | |
| 447 #elif defined(OS_WIN) | 446 #elif defined(OS_WIN) |
| 448 #define FILE_PATH_LITERAL(x) L ## x | 447 #define FILE_PATH_LITERAL(x) L ## x |
| 449 #define PRFilePath "ls" | 448 #define PRFilePath "ls" |
| 450 #define PRFilePathLiteral L"%ls" | |
| 451 #endif // OS_WIN | 449 #endif // OS_WIN |
| 452 | 450 |
| 453 // Provide a hash function so that hash_sets and maps can contain FilePath | 451 // Provide a hash function so that hash_sets and maps can contain FilePath |
| 454 // objects. | 452 // objects. |
| 455 namespace BASE_HASH_NAMESPACE { | 453 namespace BASE_HASH_NAMESPACE { |
| 456 | 454 |
| 457 template<> | 455 template<> |
| 458 struct hash<base::FilePath> { | 456 struct hash<base::FilePath> { |
| 459 size_t operator()(const base::FilePath& f) const { | 457 size_t operator()(const base::FilePath& f) const { |
| 460 return hash<base::FilePath::StringType>()(f.value()); | 458 return hash<base::FilePath::StringType>()(f.value()); |
| 461 } | 459 } |
| 462 }; | 460 }; |
| 463 | 461 |
| 464 } // namespace BASE_HASH_NAMESPACE | 462 } // namespace BASE_HASH_NAMESPACE |
| 465 | 463 |
| 466 #endif // BASE_FILES_FILE_PATH_H_ | 464 #endif // BASE_FILES_FILE_PATH_H_ |
| OLD | NEW |