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. |
133 // chrome/common/common_param_traits.cc. | |
rvargas (doing something else)
2015/03/13 18:37:01
This is now ParamTraits<base::File::Info>... but I
Thiemo Nagel
2015/03/16 16:28:39
I couldn't find it and thought it had been removed
| |
134 struct BASE_EXPORT Info { | 133 struct BASE_EXPORT Info { |
135 Info(); | 134 Info(); |
136 ~Info(); | 135 ~Info(); |
137 #if defined(OS_POSIX) | 136 #if defined(OS_POSIX) |
138 // Fills this struct with values from |stat_info|. | 137 // Fills this struct with values from |stat_info|. |
139 void FromStat(const stat_wrapper_t& stat_info); | 138 void FromStat(const stat_wrapper_t& stat_info); |
140 #endif | 139 #endif |
141 | 140 |
142 // The size of the file in bytes. Undefined when is_directory is true. | 141 // The size of the file in bytes. Undefined when is_directory is true. |
143 int64 size; | 142 int64 size; |
144 | 143 |
145 // True if the file corresponds to a directory. | 144 // True if the file corresponds to a directory. Always false on Windows. |
rvargas (doing something else)
2015/03/13 18:37:01
I don't think this is true.
rvargas (doing something else)
2015/03/13 18:44:20
To be clear, if the File points to a directory, Ge
Thiemo Nagel
2015/03/16 16:28:39
I thought you couldn't even open a directory in Wi
rvargas (doing something else)
2015/03/16 19:57:14
It requires File::Flags::FLAG_BACKUP_SEMANTICS (to
Thiemo Nagel
2015/03/17 19:48:35
I have overlooked that. :(
| |
146 bool is_directory; | 145 bool is_directory; |
147 | 146 |
148 // True if the file corresponds to a symbolic link. | 147 // True if the file corresponds to a symbolic link. Always false on |
148 // Windows. | |
rvargas (doing something else)
2015/03/13 18:37:00
Reflects the current implementation, but may not b
rvargas (doing something else)
2015/03/13 18:44:20
(and I'm basically fine either way)
Thiemo Nagel
2015/03/16 16:28:39
There is no specific use case. It's just me tryin
rvargas (doing something else)
2015/03/16 19:57:14
Could you make the comment state that this is an i
Thiemo Nagel
2015/03/17 19:48:35
Done.
| |
149 bool is_symbolic_link; | 149 bool is_symbolic_link; |
150 | 150 |
151 // The last modified time of a file. | 151 // The last modified time of a file. |
152 base::Time last_modified; | 152 base::Time last_modified; |
153 | 153 |
154 // The last accessed time of a file. | 154 // The last accessed time of a file. |
155 base::Time last_accessed; | 155 base::Time last_accessed; |
156 | 156 |
157 // The creation time of a file. | 157 // The creation time of a file. |
158 base::Time creation_time; | 158 base::Time creation_time; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
355 #endif | 355 #endif |
356 | 356 |
357 Error error_details_; | 357 Error error_details_; |
358 bool created_; | 358 bool created_; |
359 bool async_; | 359 bool async_; |
360 }; | 360 }; |
361 | 361 |
362 } // namespace base | 362 } // namespace base |
363 | 363 |
364 #endif // BASE_FILES_FILE_H_ | 364 #endif // BASE_FILES_FILE_H_ |
OLD | NEW |