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

Unified Diff: base/files/file.h

Issue 203873002: Base: Make file_util and file use the same code to translate from stat to File::Info (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove TODO Created 6 years, 9 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_posix.cc ('k') | base/files/file_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file.h
diff --git a/base/files/file.h b/base/files/file.h
index a4aea07f704a151e4de77493840e2276626adb61..f1a83774becfa65649cf23913363d59db7cd92c9 100644
--- a/base/files/file.h
+++ b/base/files/file.h
@@ -10,6 +10,10 @@
#include <windows.h>
#endif
+#if defined(OS_POSIX)
+#include <sys/stat.h>
+#endif
+
#include "base/base_export.h"
#include "base/basictypes.h"
#include "base/files/scoped_file.h"
@@ -28,8 +32,13 @@ class FilePath;
typedef HANDLE PlatformFile;
#elif defined(OS_POSIX)
typedef int PlatformFile;
-#endif
+#if defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL)
+typedef struct stat stat_wrapper_t;
+#else
+typedef struct stat64 stat_wrapper_t;
+#endif
+#endif // defined(OS_POSIX)
// Thin wrapper around an OS-level file.
// Note that this class does not provide any support for asynchronous IO, other
@@ -120,6 +129,10 @@ class BASE_EXPORT File {
struct BASE_EXPORT Info {
Info();
~Info();
+#if defined(OS_POSIX)
+ // Fills this struct with values from |stat_info|.
+ void FromStat(const stat_wrapper_t& stat_info);
+#endif
// The size of the file in bytes. Undefined when is_directory is true.
int64 size;
« no previous file with comments | « base/file_util_posix.cc ('k') | base/files/file_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698