| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // at all, making them safe to use without fear of blocking on I/O operations. | 46 // at all, making them safe to use without fear of blocking on I/O operations. |
| 47 // These methods do not function as mutators but instead return distinct | 47 // These methods do not function as mutators but instead return distinct |
| 48 // instances of FilePath objects, and are therefore safe to use on const | 48 // instances of FilePath objects, and are therefore safe to use on const |
| 49 // objects. The objects themselves are safe to share between threads. | 49 // objects. The objects themselves are safe to share between threads. |
| 50 // | 50 // |
| 51 // To aid in initialization of FilePath objects from string literals, a | 51 // To aid in initialization of FilePath objects from string literals, a |
| 52 // FILE_PATH_LITERAL macro is provided, which accounts for the difference | 52 // FILE_PATH_LITERAL macro is provided, which accounts for the difference |
| 53 // between char[]-based pathnames on POSIX systems and wchar_t[]-based | 53 // between char[]-based pathnames on POSIX systems and wchar_t[]-based |
| 54 // pathnames on Windows. | 54 // pathnames on Windows. |
| 55 // | 55 // |
| 56 // Paths can't contain NULs as a precaution agaist premature truncation. |
| 57 // |
| 56 // Because a FilePath object should not be instantiated at the global scope, | 58 // Because a FilePath object should not be instantiated at the global scope, |
| 57 // instead, use a FilePath::CharType[] and initialize it with | 59 // instead, use a FilePath::CharType[] and initialize it with |
| 58 // FILE_PATH_LITERAL. At runtime, a FilePath object can be created from the | 60 // FILE_PATH_LITERAL. At runtime, a FilePath object can be created from the |
| 59 // character array. Example: | 61 // character array. Example: |
| 60 // | 62 // |
| 61 // | const FilePath::CharType kLogFileName[] = FILE_PATH_LITERAL("log.txt"); | 63 // | const FilePath::CharType kLogFileName[] = FILE_PATH_LITERAL("log.txt"); |
| 62 // | | 64 // | |
| 63 // | void Function() { | 65 // | void Function() { |
| 64 // | FilePath log_file_path(kLogFileName); | 66 // | FilePath log_file_path(kLogFileName); |
| 65 // | [...] | 67 // | [...] |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 | 429 |
| 428 inline size_t hash_value(const FilePath& f) { | 430 inline size_t hash_value(const FilePath& f) { |
| 429 return hash_value(f.value()); | 431 return hash_value(f.value()); |
| 430 } | 432 } |
| 431 | 433 |
| 432 #endif // COMPILER | 434 #endif // COMPILER |
| 433 | 435 |
| 434 } // namespace BASE_HASH_NAMESPACE | 436 } // namespace BASE_HASH_NAMESPACE |
| 435 | 437 |
| 436 #endif // BASE_FILE_PATH_H_ | 438 #endif // BASE_FILE_PATH_H_ |
| OLD | NEW |