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

Unified Diff: base/file_util.cc

Issue 2153002: file_util: Convert the wstring version of IsDirectoryEmpty to FilePath. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: fix nit Created 10 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/file_util.h ('k') | base/file_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util.cc
diff --git a/base/file_util.cc b/base/file_util.cc
index 5bc73cef08161eb9576dfad8aa73c2dad000196a..aea6e626b9b0bb8d8dbcb08068e76a240919ac58 100644
--- a/base/file_util.cc
+++ b/base/file_util.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -194,6 +194,15 @@ bool ReadFileToString(const FilePath& path, std::string* contents) {
return true;
}
+bool IsDirectoryEmpty(const FilePath& dir_path) {
+ FileEnumerator files(dir_path, false,
+ static_cast<FileEnumerator::FILE_TYPE>(
+ FileEnumerator::FILES | FileEnumerator::DIRECTORIES));
+ if (files.Next().value().empty())
+ return true;
+ return false;
+}
+
FILE* CreateAndOpenTemporaryFile(FilePath* path) {
FilePath directory;
if (!GetTempDir(&directory))
« no previous file with comments | « base/file_util.h ('k') | base/file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698