diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-11 23:27:47 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-11 23:27:47 +0000 |
commit | 1525c68ec291218d831e29ea34aaf5a516daf855 (patch) | |
tree | 50dfc5908f79cdee9ceca8a6d82bcd13c6427000 /base/file_util.h | |
parent | d7e2df1d26c084d299feec37695aacd211dae073 (diff) | |
download | chromium_src-1525c68ec291218d831e29ea34aaf5a516daf855.zip chromium_src-1525c68ec291218d831e29ea34aaf5a516daf855.tar.gz chromium_src-1525c68ec291218d831e29ea34aaf5a516daf855.tar.bz2 |
Make sure the parent directory always comes first when listing directories.
BUG=35288
TEST=see bug
Review URL: http://codereview.chromium.org/596054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38854 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util.h')
-rw-r--r-- | base/file_util.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/base/file_util.h b/base/file_util.h index efa4633..cdedfc4 100644 --- a/base/file_util.h +++ b/base/file_util.h @@ -307,6 +307,12 @@ bool GetFileSize(const FilePath& file_path, int64* file_size); // Deprecated temporary compatibility function. bool GetFileSize(const std::wstring& file_path, int64* file_size); +// 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); + // Used to hold information about a given file path. See GetFileInfo below. struct FileInfo { // The size of the file in bytes. Undefined when is_directory is true. @@ -457,15 +463,12 @@ class FileEnumerator { // Looks inside a FindInfo and determines if it's a directory. static bool IsDirectory(const FindInfo& info); + static FilePath GetFilename(const FindInfo& find_info); + private: // 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_; |