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

Side by Side Diff: base/file_util.cc

Issue 7618037: base: Rename FileEnumerator::FILE_TYPE to FileEnumerator::FileType. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/file_util.h ('k') | base/file_util_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/file_util.h" 5 #include "base/file_util.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <io.h> 8 #include <io.h>
9 #endif 9 #endif
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 if (contents) 153 if (contents)
154 contents->append(buf, len); 154 contents->append(buf, len);
155 } 155 }
156 CloseFile(file); 156 CloseFile(file);
157 157
158 return true; 158 return true;
159 } 159 }
160 160
161 bool IsDirectoryEmpty(const FilePath& dir_path) { 161 bool IsDirectoryEmpty(const FilePath& dir_path) {
162 FileEnumerator files(dir_path, false, 162 FileEnumerator files(dir_path, false,
163 static_cast<FileEnumerator::FILE_TYPE>( 163 static_cast<FileEnumerator::FileType>(
164 FileEnumerator::FILES | FileEnumerator::DIRECTORIES)); 164 FileEnumerator::FILES | FileEnumerator::DIRECTORIES));
165 if (files.Next().value().empty()) 165 if (files.Next().value().empty())
166 return true; 166 return true;
167 return false; 167 return false;
168 } 168 }
169 169
170 FILE* CreateAndOpenTemporaryFile(FilePath* path) { 170 FILE* CreateAndOpenTemporaryFile(FilePath* path) {
171 FilePath directory; 171 FilePath directory;
172 if (!GetTempDir(&directory)) 172 if (!GetTempDir(&directory))
173 return NULL; 173 return NULL;
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 // FileEnumerator 393 // FileEnumerator
394 // 394 //
395 // Note: the main logic is in file_util_<platform>.cc 395 // Note: the main logic is in file_util_<platform>.cc
396 396
397 bool FileEnumerator::ShouldSkip(const FilePath& path) { 397 bool FileEnumerator::ShouldSkip(const FilePath& path) {
398 FilePath::StringType basename = path.BaseName().value(); 398 FilePath::StringType basename = path.BaseName().value();
399 return IsDot(path) || (IsDotDot(path) && !(INCLUDE_DOT_DOT & file_type_)); 399 return IsDot(path) || (IsDotDot(path) && !(INCLUDE_DOT_DOT & file_type_));
400 } 400 }
401 401
402 } // namespace 402 } // namespace
OLDNEW
« no previous file with comments | « base/file_util.h ('k') | base/file_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698