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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 // Similar to FromUTF8Unsafe, but accepts UTF-16 instead. | 367 // Similar to FromUTF8Unsafe, but accepts UTF-16 instead. |
368 static FilePath FromUTF16Unsafe(const string16& utf16); | 368 static FilePath FromUTF16Unsafe(const string16& utf16); |
369 | 369 |
370 void WriteToPickle(Pickle* pickle) const; | 370 void WriteToPickle(Pickle* pickle) const; |
371 bool ReadFromPickle(PickleIterator* iter); | 371 bool ReadFromPickle(PickleIterator* iter); |
372 | 372 |
373 // Normalize all path separators to backslash on Windows | 373 // Normalize all path separators to backslash on Windows |
374 // (if FILE_PATH_USES_WIN_SEPARATORS is true), or do nothing on POSIX systems. | 374 // (if FILE_PATH_USES_WIN_SEPARATORS is true), or do nothing on POSIX systems. |
375 FilePath NormalizePathSeparators() const; | 375 FilePath NormalizePathSeparators() const; |
376 | 376 |
| 377 // Normalize all path separattors to given type on Windows |
| 378 // (if FILE_PATH_USES_WIN_SEPARATORS is true), or do nothing on POSIX systems. |
| 379 FilePath NormalizePathSeparatorsTo(CharType separator) const; |
| 380 |
377 // Compare two strings in the same way the file system does. | 381 // Compare two strings in the same way the file system does. |
378 // Note that these always ignore case, even on file systems that are case- | 382 // Note that these always ignore case, even on file systems that are case- |
379 // sensitive. If case-sensitive comparison is ever needed, add corresponding | 383 // sensitive. If case-sensitive comparison is ever needed, add corresponding |
380 // methods here. | 384 // methods here. |
381 // The methods are written as a static method so that they can also be used | 385 // The methods are written as a static method so that they can also be used |
382 // on parts of a file path, e.g., just the extension. | 386 // on parts of a file path, e.g., just the extension. |
383 // CompareIgnoreCase() returns -1, 0 or 1 for less-than, equal-to and | 387 // CompareIgnoreCase() returns -1, 0 or 1 for less-than, equal-to and |
384 // greater-than respectively. | 388 // greater-than respectively. |
385 static int CompareIgnoreCase(const StringType& string1, | 389 static int CompareIgnoreCase(const StringType& string1, |
386 const StringType& string2); | 390 const StringType& string2); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 | 466 |
463 inline size_t hash_value(const base::FilePath& f) { | 467 inline size_t hash_value(const base::FilePath& f) { |
464 return hash_value(f.value()); | 468 return hash_value(f.value()); |
465 } | 469 } |
466 | 470 |
467 #endif // COMPILER | 471 #endif // COMPILER |
468 | 472 |
469 } // namespace BASE_HASH_NAMESPACE | 473 } // namespace BASE_HASH_NAMESPACE |
470 | 474 |
471 #endif // BASE_FILES_FILE_PATH_H_ | 475 #endif // BASE_FILES_FILE_PATH_H_ |
OLD | NEW |