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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
380 static StringType GetHFSDecomposedForm(const FilePath::StringType& string); | 380 static StringType GetHFSDecomposedForm(const FilePath::StringType& string); |
381 | 381 |
382 // Special UTF-8 version of FastUnicodeCompare. Cf: | 382 // Special UTF-8 version of FastUnicodeCompare. Cf: |
383 // http://developer.apple.com/mac/library/technotes/tn/tn1150.html#StringCompa risonAlgorithm | 383 // http://developer.apple.com/mac/library/technotes/tn/tn1150.html#StringCompa risonAlgorithm |
384 // IMPORTANT: The input strings must be in the special HFS decomposed form! | 384 // IMPORTANT: The input strings must be in the special HFS decomposed form! |
385 // (cf. above GetHFSDecomposedForm method) | 385 // (cf. above GetHFSDecomposedForm method) |
386 static int HFSFastUnicodeCompare(const StringType& string1, | 386 static int HFSFastUnicodeCompare(const StringType& string1, |
387 const StringType& string2); | 387 const StringType& string2); |
388 #endif | 388 #endif |
389 | 389 |
390 #if defined(OS_ANDROID) | |
391 // Returns true if the path is a content url, which starts with content://. | |
kinuko
2013/10/31 06:10:51
Would be nice to add a few more (generic) comment
qinmin
2013/11/05 01:41:31
Done.
| |
392 bool IsContentUrl() const; | |
393 #endif | |
394 | |
390 private: | 395 private: |
391 // Remove trailing separators from this object. If the path is absolute, it | 396 // Remove trailing separators from this object. If the path is absolute, it |
392 // will never be stripped any more than to refer to the absolute root | 397 // will never be stripped any more than to refer to the absolute root |
393 // directory, so "////" will become "/", not "". A leading pair of | 398 // directory, so "////" will become "/", not "". A leading pair of |
394 // separators is never stripped, to support alternate roots. This is used to | 399 // separators is never stripped, to support alternate roots. This is used to |
395 // support UNC paths on Windows. | 400 // support UNC paths on Windows. |
396 void StripTrailingSeparatorsInternal(); | 401 void StripTrailingSeparatorsInternal(); |
397 | 402 |
398 StringType path_; | 403 StringType path_; |
399 }; | 404 }; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
431 | 436 |
432 inline size_t hash_value(const base::FilePath& f) { | 437 inline size_t hash_value(const base::FilePath& f) { |
433 return hash_value(f.value()); | 438 return hash_value(f.value()); |
434 } | 439 } |
435 | 440 |
436 #endif // COMPILER | 441 #endif // COMPILER |
437 | 442 |
438 } // namespace BASE_HASH_NAMESPACE | 443 } // namespace BASE_HASH_NAMESPACE |
439 | 444 |
440 #endif // BASE_FILES_FILE_PATH_H_ | 445 #endif // BASE_FILES_FILE_PATH_H_ |
OLD | NEW |