summaryrefslogtreecommitdiffstats
path: root/base/file_util.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-11 23:27:47 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-11 23:27:47 +0000
commit1525c68ec291218d831e29ea34aaf5a516daf855 (patch)
tree50dfc5908f79cdee9ceca8a6d82bcd13c6427000 /base/file_util.cc
parentd7e2df1d26c084d299feec37695aacd211dae073 (diff)
downloadchromium_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.cc')
-rw-r--r--base/file_util.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/base/file_util.cc b/base/file_util.cc
index 1160e39..e0e6772 100644
--- a/base/file_util.cc
+++ b/base/file_util.cc
@@ -209,6 +209,14 @@ bool GetFileSize(const FilePath& file_path, int64* file_size) {
return true;
}
+bool IsDot(const FilePath& path) {
+ return FILE_PATH_LITERAL(".") == path.BaseName().value();
+}
+
+bool IsDotDot(const FilePath& path) {
+ return FILE_PATH_LITERAL("..") == path.BaseName().value();
+}
+
bool CloseFile(FILE* file) {
if (file == NULL)
return true;
@@ -421,12 +429,4 @@ bool FileEnumerator::ShouldSkip(const FilePath& path) {
return IsDot(path) || (IsDotDot(path) && !(INCLUDE_DOT_DOT & file_type_));
}
-bool FileEnumerator::IsDot(const FilePath& path) {
- return FILE_PATH_LITERAL(".") == path.BaseName().value();
-}
-
-bool FileEnumerator::IsDotDot(const FilePath& path) {
- return FILE_PATH_LITERAL("..") == path.BaseName().value();
-}
-
} // namespace