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

Unified Diff: base/file_util.h

Issue 11507: Port directory lister. Don't break mac build. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 1 month 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 | « no previous file | base/file_util_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util.h
===================================================================
--- base/file_util.h (revision 5731)
+++ base/file_util.h (working copy)
@@ -14,6 +14,7 @@
#include <windows.h>
#elif defined(OS_POSIX)
#include <fts.h>
+#include <sys/stat.h>
#endif
#include <stdio.h>
@@ -323,6 +324,15 @@
// program where latency does not matter. This class is blocking.
class FileEnumerator {
public:
+#if defined(OS_WIN)
+ typedef WIN32_FIND_DATA FindInfo;
+#elif defined(OS_POSIX)
+ typedef struct {
+ struct stat stat;
+ std::string filename;
+ } FindInfo;
+#endif
+
enum FILE_TYPE {
FILES = 0x1,
DIRECTORIES = 0x2,
@@ -361,6 +371,9 @@
// Returns an empty string if there are no more results.
std::wstring Next();
+ // Write the file info into |info|.
+ void GetFindInfo(FindInfo* info);
+
private:
std::wstring root_path_;
bool recursive_;
@@ -380,6 +393,7 @@
HANDLE find_handle_;
#elif defined(OS_POSIX)
FTS* fts_;
+ FTSENT* fts_ent_;
#endif
DISALLOW_EVIL_CONSTRUCTORS(FileEnumerator);
« no previous file with comments | « no previous file | base/file_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698