Chromium Code Reviews| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 // The last modified time of a file. | 148 // The last modified time of a file. |
| 149 base::Time last_modified; | 149 base::Time last_modified; |
| 150 | 150 |
| 151 // The last accessed time of a file. | 151 // The last accessed time of a file. |
| 152 base::Time last_accessed; | 152 base::Time last_accessed; |
| 153 | 153 |
| 154 // The creation time of a file. | 154 // The creation time of a file. |
| 155 base::Time creation_time; | 155 base::Time creation_time; |
| 156 }; | 156 }; |
| 157 | 157 |
| 158 // Used to hold information about a region [offset + size] of a file. | |
| 159 struct BASE_EXPORT Region { | |
| 160 Region(int64 offset, int64 size); | |
| 161 | |
| 162 // Retrieves a region which covers the entire file. | |
| 163 explicit Region(File& file); | |
|
Primiano Tucci (use gerrit)
2014/07/16 23:14:39
Shame that this cannot be const. Unfortunately Get
| |
| 164 | |
| 165 ~Region(); | |
| 166 | |
| 167 // Start of the region (measured in bytes from the beginning of the file). | |
| 168 int64 offset; | |
| 169 | |
| 170 // Length of the region. | |
| 171 int64 size; | |
| 172 }; | |
| 173 | |
| 158 File(); | 174 File(); |
| 159 | 175 |
| 160 // Creates or opens the given file. This will fail with 'access denied' if the | 176 // Creates or opens the given file. This will fail with 'access denied' if the |
| 161 // |name| contains path traversal ('..') components. | 177 // |name| contains path traversal ('..') components. |
| 162 File(const FilePath& name, uint32 flags); | 178 File(const FilePath& name, uint32 flags); |
| 163 | 179 |
| 164 // Takes ownership of |platform_file|. | 180 // Takes ownership of |platform_file|. |
| 165 explicit File(PlatformFile platform_file); | 181 explicit File(PlatformFile platform_file); |
| 166 | 182 |
| 167 // Creates an object with a specific error_details code. | 183 // Creates an object with a specific error_details code. |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 304 #endif | 320 #endif |
| 305 | 321 |
| 306 Error error_details_; | 322 Error error_details_; |
| 307 bool created_; | 323 bool created_; |
| 308 bool async_; | 324 bool async_; |
| 309 }; | 325 }; |
| 310 | 326 |
| 311 } // namespace base | 327 } // namespace base |
| 312 | 328 |
| 313 #endif // BASE_FILES_FILE_H_ | 329 #endif // BASE_FILES_FILE_H_ |
| OLD | NEW |