From 0b733220c5fbef986647fce040c1b5d5e48be2b6 Mon Sep 17 00:00:00 2001 From: "avi@google.com" Date: Thu, 11 Dec 2008 14:55:12 +0000 Subject: 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 --- base/file_path.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'base/file_path.h') 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 -#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_; }; -- cgit v1.1