diff options
author | yuzo@chromium.org <yuzo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-09 05:57:38 +0000 |
---|---|---|
committer | yuzo@chromium.org <yuzo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-09 05:57:38 +0000 |
commit | 8199b3ae54cd41ff1012a4cae3640028043b0bb4 (patch) | |
tree | 5718d8e8cdc3889a7c82271f0beb8094b0914531 /base/file_util.h | |
parent | 9c0b3e3a30ab2246a9385b978e86003d4fc8ceb9 (diff) | |
download | chromium_src-8199b3ae54cd41ff1012a4cae3640028043b0bb4.zip chromium_src-8199b3ae54cd41ff1012a4cae3640028043b0bb4.tar.gz chromium_src-8199b3ae54cd41ff1012a4cae3640028043b0bb4.tar.bz2 |
Include a parent directory link in the file list for file:///somepath
Also, order files/directories lexicographically.
TEST=on linux, type file:///usr/ in the address bar and make sure the contents
are sorted and include an entry for '..', which is [parent directory].
On windows, type file:///C:/Users/ .
BUG=12621, 12812
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17933 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util.h')
-rw-r--r-- | base/file_util.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/base/file_util.h b/base/file_util.h index 3686a18..39d8f09 100644 --- a/base/file_util.h +++ b/base/file_util.h @@ -409,9 +409,9 @@ class FileEnumerator { #endif enum FILE_TYPE { - FILES = 0x1, - DIRECTORIES = 0x2, - FILES_AND_DIRECTORIES = 0x3 + FILES = 1 << 0, + DIRECTORIES = 1 << 1, + INCLUDE_DOT_DOT = 1 << 2, }; // |root_path| is the starting directory to search for. It may or may not end @@ -463,6 +463,15 @@ class FileEnumerator { // enumerate in the breadth-first search. std::stack<FilePath> pending_paths_; + // Returns true if the given path should be skipped in enumeration. + bool ShouldSkip(const FilePath& path); + + // Returns true if the given path's base name is ".". + bool IsDot(const FilePath& path); + + // Returns true if the given path's base name is "..". + bool IsDotDot(const FilePath& path); + #if defined(OS_WIN) WIN32_FIND_DATA find_data_; HANDLE find_handle_; |