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

Unified Diff: base/file_util_win.cc

Issue 73075: First step to port file_util::CountFilesCreatedAfter().... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 11 years, 8 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_unittest.cc ('k') | chrome/test/automated_ui_tests/automated_ui_tests.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_win.cc
===================================================================
--- base/file_util_win.cc (revision 13738)
+++ base/file_util_win.cc (working copy)
@@ -14,6 +14,7 @@
#include "base/logging.h"
#include "base/scoped_handle.h"
#include "base/string_util.h"
+#include "base/time.h"
#include "base/win_util.h"
namespace file_util {
@@ -39,12 +40,14 @@
return true;
}
-int CountFilesCreatedAfter(const std::wstring& path,
- const FILETIME& comparison_time) {
+int CountFilesCreatedAfter(const FilePath& path,
+ const base::Time& comparison_time) {
int file_count = 0;
+ FILETIME comparison_filetime(comparison_time.ToFileTime());
WIN32_FIND_DATA find_file_data;
- std::wstring filename_spec = path + L"\\*"; // All files in given dir
+ // All files in given dir
+ std::wstring filename_spec = path.Append(L"*").value();
HANDLE find_handle = FindFirstFile(filename_spec.c_str(), &find_file_data);
if (find_handle != INVALID_HANDLE_VALUE) {
do {
@@ -54,7 +57,7 @@
continue;
long result = CompareFileTime(&find_file_data.ftCreationTime,
- &comparison_time);
+ &comparison_filetime);
// File was created after or on comparison time
if ((result == 1) || (result == 0))
++file_count;
« no previous file with comments | « base/file_util_unittest.cc ('k') | chrome/test/automated_ui_tests/automated_ui_tests.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698