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