summaryrefslogtreecommitdiffstats
path: root/base/platform_file.h
diff options
context:
space:
mode:
authordumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-03 02:28:37 +0000
committerdumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-03 02:28:37 +0000
commit2f0193c279b1b40a82a6ad027ec9468272eb25b2 (patch)
tree9d2e2f5bcf09837a1189723567906fb8de45c7e2 /base/platform_file.h
parent4c56ef5fbed46794f2b16b9f8ed88ac179d65309 (diff)
downloadchromium_src-2f0193c279b1b40a82a6ad027ec9468272eb25b2.zip
chromium_src-2f0193c279b1b40a82a6ad027ec9468272eb25b2.tar.gz
chromium_src-2f0193c279b1b40a82a6ad027ec9468272eb25b2.tar.bz2
Moving file_util::FileInfo to base::PlatformFileInfo, and adding the
last_accessed and creation_time fields. BUG=none TEST=none Review URL: http://codereview.chromium.org/3347005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58454 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/platform_file.h')
-rw-r--r--base/platform_file.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/base/platform_file.h b/base/platform_file.h
index 0e4d05c..802102c 100644
--- a/base/platform_file.h
+++ b/base/platform_file.h
@@ -6,7 +6,9 @@
#define BASE_PLATFORM_FILE_H_
#pragma once
+#include "base/basictypes.h"
#include "build/build_config.h"
+#include "base/time.h"
#if defined(OS_WIN)
#include <windows.h>
#endif
@@ -55,6 +57,28 @@ enum PlatformFileError {
PLATFORM_FILE_ERROR_INVALID_OPERATION = -10
};
+// Used to hold information about a given file.
+// If you add more fields to this structure (platform-specific fields are OK),
+// make sure to update all functions that use it in file_util_{win|posix}.cc
+// too, and the ParamTraits<base::PlatformFileInfo> implementation in
+// chrome/common/common_param_traits.cc.
+struct PlatformFileInfo {
+ // The size of the file in bytes. Undefined when is_directory is true.
+ int64 size;
+
+ // True if the file corresponds to a directory.
+ bool is_directory;
+
+ // The last modified time of a file.
+ base::Time last_modified;
+
+ // The last accessed time of a file.
+ base::Time last_accessed;
+
+ // The creation time of a file.
+ base::Time creation_time;
+};
+
// Creates or opens the given file. If PLATFORM_FILE_OPEN_ALWAYS is used, and
// |created| is provided, |created| will be set to true if the file was created
// or to false in case the file was just opened. |error_code| can be NULL.