| 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 // system paths will always be ASCII. | 278 // system paths will always be ASCII. |
| 279 FilePath AppendASCII(const base::StringPiece& component) | 279 FilePath AppendASCII(const base::StringPiece& component) |
| 280 const WARN_UNUSED_RESULT; | 280 const WARN_UNUSED_RESULT; |
| 281 | 281 |
| 282 // Returns true if this FilePath contains an absolute path. On Windows, an | 282 // Returns true if this FilePath contains an absolute path. On Windows, an |
| 283 // absolute path begins with either a drive letter specification followed by | 283 // absolute path begins with either a drive letter specification followed by |
| 284 // a separator character, or with two separator characters. On POSIX | 284 // a separator character, or with two separator characters. On POSIX |
| 285 // platforms, an absolute path begins with a separator character. | 285 // platforms, an absolute path begins with a separator character. |
| 286 bool IsAbsolute() const; | 286 bool IsAbsolute() const; |
| 287 | 287 |
| 288 // Returns true if the patch ends with a path separator character. |
| 289 bool EndsWithSeparator() const WARN_UNUSED_RESULT; |
| 290 |
| 291 // Returns a copy of this FilePath that ends with a trailing separator. |
| 292 FilePath AsEndingWithSeparator() const WARN_UNUSED_RESULT; |
| 293 |
| 288 // Returns a copy of this FilePath that does not end with a trailing | 294 // Returns a copy of this FilePath that does not end with a trailing |
| 289 // separator. | 295 // separator. |
| 290 FilePath StripTrailingSeparators() const WARN_UNUSED_RESULT; | 296 FilePath StripTrailingSeparators() const WARN_UNUSED_RESULT; |
| 291 | 297 |
| 292 // Returns true if this FilePath contains any attempt to reference a parent | 298 // Returns true if this FilePath contains any attempt to reference a parent |
| 293 // directory (i.e. has a path component that is ".." | 299 // directory (i.e. has a path component that is ".." |
| 294 bool ReferencesParent() const; | 300 bool ReferencesParent() const; |
| 295 | 301 |
| 296 // Return a Unicode human-readable version of this path. | 302 // Return a Unicode human-readable version of this path. |
| 297 // Warning: you can *not*, in general, go from a display name back to a real | 303 // Warning: you can *not*, in general, go from a display name back to a real |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 | 439 |
| 434 inline size_t hash_value(const base::FilePath& f) { | 440 inline size_t hash_value(const base::FilePath& f) { |
| 435 return hash_value(f.value()); | 441 return hash_value(f.value()); |
| 436 } | 442 } |
| 437 | 443 |
| 438 #endif // COMPILER | 444 #endif // COMPILER |
| 439 | 445 |
| 440 } // namespace BASE_HASH_NAMESPACE | 446 } // namespace BASE_HASH_NAMESPACE |
| 441 | 447 |
| 442 #endif // BASE_FILES_FILE_PATH_H_ | 448 #endif // BASE_FILES_FILE_PATH_H_ |
| OLD | NEW |