OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_PLATFORM_FILE_H_ | 5 #ifndef BASE_PLATFORM_FILE_H_ |
6 #define BASE_PLATFORM_FILE_H_ | 6 #define BASE_PLATFORM_FILE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "base/file_path.h" |
11 #include "base/time.h" | 12 #include "base/time.h" |
12 #if defined(OS_WIN) | 13 #if defined(OS_WIN) |
13 #include <windows.h> | 14 #include <windows.h> |
14 #endif | 15 #endif |
15 | 16 |
16 #include <string> | 17 #include <string> |
17 | 18 |
18 class FilePath; | |
19 | |
20 namespace base { | 19 namespace base { |
21 | 20 |
22 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
23 typedef HANDLE PlatformFile; | 22 typedef HANDLE PlatformFile; |
24 const PlatformFile kInvalidPlatformFileValue = INVALID_HANDLE_VALUE; | 23 const PlatformFile kInvalidPlatformFileValue = INVALID_HANDLE_VALUE; |
25 #elif defined(OS_POSIX) | 24 #elif defined(OS_POSIX) |
26 typedef int PlatformFile; | 25 typedef int PlatformFile; |
27 const PlatformFile kInvalidPlatformFileValue = -1; | 26 const PlatformFile kInvalidPlatformFileValue = -1; |
28 #endif | 27 #endif |
29 | 28 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 bool is_symbolic_link; | 83 bool is_symbolic_link; |
85 | 84 |
86 // The last modified time of a file. | 85 // The last modified time of a file. |
87 base::Time last_modified; | 86 base::Time last_modified; |
88 | 87 |
89 // The last accessed time of a file. | 88 // The last accessed time of a file. |
90 base::Time last_accessed; | 89 base::Time last_accessed; |
91 | 90 |
92 // The creation time of a file. | 91 // The creation time of a file. |
93 base::Time creation_time; | 92 base::Time creation_time; |
| 93 |
| 94 // The full path of a file. Currently only used by FileSystemFileUtil during |
| 95 // a GetMetadata operation. |
| 96 FilePath path; |
94 }; | 97 }; |
95 | 98 |
96 // Creates or opens the given file. If PLATFORM_FILE_OPEN_ALWAYS is used, and | 99 // Creates or opens the given file. If PLATFORM_FILE_OPEN_ALWAYS is used, and |
97 // |created| is provided, |created| will be set to true if the file was created | 100 // |created| is provided, |created| will be set to true if the file was created |
98 // or to false in case the file was just opened. |error_code| can be NULL. | 101 // or to false in case the file was just opened. |error_code| can be NULL. |
99 PlatformFile CreatePlatformFile(const FilePath& name, | 102 PlatformFile CreatePlatformFile(const FilePath& name, |
100 int flags, | 103 int flags, |
101 bool* created, | 104 bool* created, |
102 PlatformFileError* error_code); | 105 PlatformFileError* error_code); |
103 | 106 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 return temp; | 166 return temp; |
164 } | 167 } |
165 | 168 |
166 private: | 169 private: |
167 PlatformFile* value_; | 170 PlatformFile* value_; |
168 }; | 171 }; |
169 | 172 |
170 } // namespace base | 173 } // namespace base |
171 | 174 |
172 #endif // BASE_PLATFORM_FILE_H_ | 175 #endif // BASE_PLATFORM_FILE_H_ |
OLD | NEW |