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

Unified Diff: base/file_util.h

Issue 13315: Move file enumeration to filepaths. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/file_path.cc ('k') | base/file_util_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util.h
===================================================================
--- base/file_util.h (revision 6739)
+++ base/file_util.h (working copy)
@@ -51,6 +51,8 @@
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 @@
// 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 @@
// 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_;
« no previous file with comments | « base/file_path.cc ('k') | base/file_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698