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_util.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_util.h')
-rw-r--r-- | base/file_util.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/base/file_util.h b/base/file_util.h index 41bc70b..7bc7e820 100644 --- a/base/file_util.h +++ b/base/file_util.h @@ -51,6 +51,8 @@ bool EndsWithSeparator(const std::wstring& path); bool EnsureEndsWithSeparator(FilePath* path); // Modifies a string by trimming all trailing separators from the end. +// Deprecated. FilePath does this automatically, and if it's constructed from a +// path with a trailing separator, StripTrailingSeparators() may be used. void TrimTrailingSeparator(std::wstring* dir); // Strips the topmost directory from the end of 'dir'. Assumes 'dir' does not @@ -373,26 +375,26 @@ class FileEnumerator { // NOTE: the pattern only matches the contents of root_path, not files in // recursive subdirectories. // TODO(erikkay): Fix the pattern matching to work at all levels. - FileEnumerator(const std::wstring& root_path, + FileEnumerator(const FilePath& root_path, bool recursive, FileEnumerator::FILE_TYPE file_type); - FileEnumerator(const std::wstring& root_path, + FileEnumerator(const FilePath& root_path, bool recursive, FileEnumerator::FILE_TYPE file_type, - const std::wstring& pattern); + const FilePath::StringType& pattern); ~FileEnumerator(); // Returns an empty string if there are no more results. - std::wstring Next(); + FilePath Next(); // Write the file info into |info|. void GetFindInfo(FindInfo* info); private: - std::wstring root_path_; + FilePath root_path_; bool recursive_; FILE_TYPE file_type_; - std::wstring pattern_; // Empty when we want to find everything. + FilePath pattern_; // Empty when we want to find everything. // Set to true when there is a find operation open. This way, we can lazily // start the operations when the caller calls Next(). @@ -400,7 +402,7 @@ class FileEnumerator { // A stack that keeps track of which subdirectories we still need to // enumerate in the breadth-first search. - std::stack<std::wstring> pending_paths_; + std::stack<FilePath> pending_paths_; #if defined(OS_WIN) WIN32_FIND_DATA find_data_; |