diff options
author | avi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-11 14:55:12 +0000 |
---|---|---|
committer | avi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-11 14:55:12 +0000 |
commit | 0b733220c5fbef986647fce040c1b5d5e48be2b6 (patch) | |
tree | 72caaec198bd07c1e468c2a4805b00067da78126 /base/file_path.h | |
parent | 64596e5e583f0c64124da1a79e496d6e063c25fa (diff) | |
download | chromium_src-0b733220c5fbef986647fce040c1b5d5e48be2b6.zip chromium_src-0b733220c5fbef986647fce040c1b5d5e48be2b6.tar.gz chromium_src-0b733220c5fbef986647fce040c1b5d5e48be2b6.tar.bz2 |
Move file enumeration to filepaths.
Review URL: http://codereview.chromium.org/13315
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6784 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_path.h')
-rw-r--r-- | base/file_path.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/base/file_path.h b/base/file_path.h index fb2cc57..9049176 100644 --- a/base/file_path.h +++ b/base/file_path.h @@ -67,8 +67,8 @@ #include <string> -#include "base/compiler_specific.h" #include "base/basictypes.h" +#include "base/compiler_specific.h" // Windows-style drive letter support and pathname separator characters can be // enabled and disabled independently, to aid testing. These #defines are @@ -121,6 +121,11 @@ class FilePath { return path_ == that.path_; } + // Required for some STL containers and operations + bool operator<(const FilePath& that) const { + return path_ < that.path_; + } + const StringType& value() const { return path_; } // Returns true if |character| is in kSeparators. @@ -154,6 +159,10 @@ class FilePath { // platforms, an absolute path begins with a separator character. bool IsAbsolute() const; + // Returns a copy of this FilePath that does not end with a trailing + // separator. + FilePath StripTrailingSeparators() const; + // Older Chromium code assumes that paths are always wstrings. // This function converts a wstring to a FilePath, and is useful to smooth // porting that old code to the FilePath API. @@ -174,7 +183,7 @@ class FilePath { // directory, so "////" will become "/", not "". A leading pair of // separators is never stripped, to support alternate roots. This is used to // support UNC paths on Windows. - void StripTrailingSeparators(); + void StripTrailingSeparatorsInternal(); StringType path_; }; |