Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: base/files/file_path.h

Issue 13196006: Move path functions from file_util to FilePath object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git try Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698