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. If |
| 292 // the input path is empty, an empty FilePath will be returned. |
| 293 FilePath AsEndingWithSeparator() const WARN_UNUSED_RESULT; |
| 294 |
288 // Returns a copy of this FilePath that does not end with a trailing | 295 // Returns a copy of this FilePath that does not end with a trailing |
289 // separator. | 296 // separator. |
290 FilePath StripTrailingSeparators() const WARN_UNUSED_RESULT; | 297 FilePath StripTrailingSeparators() const WARN_UNUSED_RESULT; |
291 | 298 |
292 // Returns true if this FilePath contains any attempt to reference a parent | 299 // Returns true if this FilePath contains any attempt to reference a parent |
293 // directory (i.e. has a path component that is ".." | 300 // directory (i.e. has a path component that is ".." |
294 bool ReferencesParent() const; | 301 bool ReferencesParent() const; |
295 | 302 |
296 // Return a Unicode human-readable version of this path. | 303 // 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 | 304 // 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 | 440 |
434 inline size_t hash_value(const base::FilePath& f) { | 441 inline size_t hash_value(const base::FilePath& f) { |
435 return hash_value(f.value()); | 442 return hash_value(f.value()); |
436 } | 443 } |
437 | 444 |
438 #endif // COMPILER | 445 #endif // COMPILER |
439 | 446 |
440 } // namespace BASE_HASH_NAMESPACE | 447 } // namespace BASE_HASH_NAMESPACE |
441 | 448 |
442 #endif // BASE_FILES_FILE_PATH_H_ | 449 #endif // BASE_FILES_FILE_PATH_H_ |
OLD | NEW |