OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_FILES_FILE_H_ | 5 #ifndef BASE_FILES_FILE_H_ |
6 #define BASE_FILES_FILE_H_ | 6 #define BASE_FILES_FILE_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 121 |
122 // This explicit mapping matches both FILE_ on Windows and SEEK_ on Linux. | 122 // This explicit mapping matches both FILE_ on Windows and SEEK_ on Linux. |
123 enum Whence { | 123 enum Whence { |
124 FROM_BEGIN = 0, | 124 FROM_BEGIN = 0, |
125 FROM_CURRENT = 1, | 125 FROM_CURRENT = 1, |
126 FROM_END = 2 | 126 FROM_END = 2 |
127 }; | 127 }; |
128 | 128 |
129 // Used to hold information about a given file. | 129 // Used to hold information about a given file. |
130 // If you add more fields to this structure (platform-specific fields are OK), | 130 // If you add more fields to this structure (platform-specific fields are OK), |
131 // make sure to update all functions that use it in file_util_{win|posix}.cc | 131 // make sure to update all functions that use it in file_util_{win|posix}.cc, |
132 // too, and the ParamTraits<base::PlatformFileInfo> implementation in | 132 // too, and the ParamTraits<base::File::Info> implementation in |
133 // chrome/common/common_param_traits.cc. | 133 // ipc/ipc_message_utils.cc. |
134 struct BASE_EXPORT Info { | 134 struct BASE_EXPORT Info { |
135 Info(); | 135 Info(); |
136 ~Info(); | 136 ~Info(); |
137 #if defined(OS_POSIX) | 137 #if defined(OS_POSIX) |
138 // Fills this struct with values from |stat_info|. | 138 // Fills this struct with values from |stat_info|. |
139 void FromStat(const stat_wrapper_t& stat_info); | 139 void FromStat(const stat_wrapper_t& stat_info); |
140 #endif | 140 #endif |
141 | 141 |
142 // The size of the file in bytes. Undefined when is_directory is true. | 142 // The size of the file in bytes. Undefined when is_directory is true. |
143 int64 size; | 143 int64 size; |
144 | 144 |
145 // True if the file corresponds to a directory. | 145 // True if the file corresponds to a directory. |
146 bool is_directory; | 146 bool is_directory; |
147 | 147 |
148 // True if the file corresponds to a symbolic link. | 148 // True if the file corresponds to a symbolic link. For Windows currently |
| 149 // not supported and thus always false. |
149 bool is_symbolic_link; | 150 bool is_symbolic_link; |
150 | 151 |
151 // The last modified time of a file. | 152 // The last modified time of a file. |
152 base::Time last_modified; | 153 base::Time last_modified; |
153 | 154 |
154 // The last accessed time of a file. | 155 // The last accessed time of a file. |
155 base::Time last_accessed; | 156 base::Time last_accessed; |
156 | 157 |
157 // The creation time of a file. | 158 // The creation time of a file. |
158 base::Time creation_time; | 159 base::Time creation_time; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 #endif | 356 #endif |
356 | 357 |
357 Error error_details_; | 358 Error error_details_; |
358 bool created_; | 359 bool created_; |
359 bool async_; | 360 bool async_; |
360 }; | 361 }; |
361 | 362 |
362 } // namespace base | 363 } // namespace base |
363 | 364 |
364 #endif // BASE_FILES_FILE_H_ | 365 #endif // BASE_FILES_FILE_H_ |
OLD | NEW |