| 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 // On android, file selection dialog can return a file with content uri | |
| 392 // scheme(starting with content://). Content uri needs to be opened with | |
| 393 // ContentResolver to guarantee that the app has appropriate permissions | |
| 394 // to access it. | |
| 395 // Returns true if the path is a content uri, or false otherwise. | |
| 396 bool IsContentUri() const; | |
| 397 #endif | |
| 398 | |
| 399 private: | 390 private: |
| 400 // Remove trailing separators from this object. If the path is absolute, it | 391 // Remove trailing separators from this object. If the path is absolute, it |
| 401 // will never be stripped any more than to refer to the absolute root | 392 // will never be stripped any more than to refer to the absolute root |
| 402 // directory, so "////" will become "/", not "". A leading pair of | 393 // directory, so "////" will become "/", not "". A leading pair of |
| 403 // separators is never stripped, to support alternate roots. This is used to | 394 // separators is never stripped, to support alternate roots. This is used to |
| 404 // support UNC paths on Windows. | 395 // support UNC paths on Windows. |
| 405 void StripTrailingSeparatorsInternal(); | 396 void StripTrailingSeparatorsInternal(); |
| 406 | 397 |
| 407 StringType path_; | 398 StringType path_; |
| 408 }; | 399 }; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 | 431 |
| 441 inline size_t hash_value(const base::FilePath& f) { | 432 inline size_t hash_value(const base::FilePath& f) { |
| 442 return hash_value(f.value()); | 433 return hash_value(f.value()); |
| 443 } | 434 } |
| 444 | 435 |
| 445 #endif // COMPILER | 436 #endif // COMPILER |
| 446 | 437 |
| 447 } // namespace BASE_HASH_NAMESPACE | 438 } // namespace BASE_HASH_NAMESPACE |
| 448 | 439 |
| 449 #endif // BASE_FILES_FILE_PATH_H_ | 440 #endif // BASE_FILES_FILE_PATH_H_ |
| OLD | NEW |