summaryrefslogtreecommitdiffstats
path: root/base/file_util_win.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/file_util_win.cc')
-rw-r--r--base/file_util_win.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index fc53dc9..8253e53 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -365,6 +365,13 @@ bool UpdateShortcutLink(const wchar_t *source, const wchar_t *destination,
return SUCCEEDED(result);
}
+bool IsDirectoryEmpty(const std::wstring& dir_path) {
+ FileEnumerator files(dir_path, false, FileEnumerator::FILES_AND_DIRECTORIES);
+ if (files.Next().empty())
+ return true;
+ return false;
+}
+
bool GetTempDir(std::wstring* path) {
wchar_t temp_path[MAX_PATH + 1];
DWORD path_len = ::GetTempPath(MAX_PATH, temp_path);