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 STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_H_ | 5 #ifndef STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
6 #define STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_H_ | 6 #define STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 // No additional operation. | 220 // No additional operation. |
221 OPTION_NONE, | 221 OPTION_NONE, |
222 | 222 |
223 // Preserves last modified time if possible. If the operation to update | 223 // Preserves last modified time if possible. If the operation to update |
224 // last modified time is not supported on the file system for the | 224 // last modified time is not supported on the file system for the |
225 // destination file, this option would be simply ignored (i.e. Copy would | 225 // destination file, this option would be simply ignored (i.e. Copy would |
226 // be successfully done without preserving last modified time). | 226 // be successfully done without preserving last modified time). |
227 OPTION_PRESERVE_LAST_MODIFIED, | 227 OPTION_PRESERVE_LAST_MODIFIED, |
228 }; | 228 }; |
229 | 229 |
| 230 // Fields requested for the GetMetadata method. Used as a bitmask. |
| 231 enum GetMetadataField { |
| 232 GET_METADATA_FIELD_NONE = 0, |
| 233 GET_METADATA_FIELD_SIZE = 1 << 0, |
| 234 GET_METADATA_FIELD_IS_DIRECTORY = 1 << 1, |
| 235 GET_METADATA_FIELD_LAST_MODIFIED = 1 << 2 |
| 236 }; |
| 237 |
230 // Used for Write(). | 238 // Used for Write(). |
231 typedef base::Callback<void(base::File::Error result, | 239 typedef base::Callback<void(base::File::Error result, |
232 int64 bytes, | 240 int64 bytes, |
233 bool complete)> WriteCallback; | 241 bool complete)> WriteCallback; |
234 | 242 |
235 // Creates a file at |path|. If |exclusive| is true, an error is raised | 243 // Creates a file at |path|. If |exclusive| is true, an error is raised |
236 // in case a file is already present at the URL. | 244 // in case a file is already present at the URL. |
237 virtual void CreateFile(const FileSystemURL& path, | 245 virtual void CreateFile(const FileSystemURL& path, |
238 bool exclusive, | 246 bool exclusive, |
239 const StatusCallback& callback) = 0; | 247 const StatusCallback& callback) = 0; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 // Checks if a directory is present at |path|. | 303 // Checks if a directory is present at |path|. |
296 virtual void DirectoryExists(const FileSystemURL& path, | 304 virtual void DirectoryExists(const FileSystemURL& path, |
297 const StatusCallback& callback) = 0; | 305 const StatusCallback& callback) = 0; |
298 | 306 |
299 // Checks if a file is present at |path|. | 307 // Checks if a file is present at |path|. |
300 virtual void FileExists(const FileSystemURL& path, | 308 virtual void FileExists(const FileSystemURL& path, |
301 const StatusCallback& callback) = 0; | 309 const StatusCallback& callback) = 0; |
302 | 310 |
303 // Gets the metadata of a file or directory at |path|. | 311 // Gets the metadata of a file or directory at |path|. |
304 virtual void GetMetadata(const FileSystemURL& path, | 312 virtual void GetMetadata(const FileSystemURL& path, |
| 313 int fields, |
305 const GetMetadataCallback& callback) = 0; | 314 const GetMetadataCallback& callback) = 0; |
306 | 315 |
307 // Reads contents of a directory at |path|. | 316 // Reads contents of a directory at |path|. |
308 virtual void ReadDirectory(const FileSystemURL& path, | 317 virtual void ReadDirectory(const FileSystemURL& path, |
309 const ReadDirectoryCallback& callback) = 0; | 318 const ReadDirectoryCallback& callback) = 0; |
310 | 319 |
311 // Removes a file or directory at |path|. If |recursive| is true, remove | 320 // Removes a file or directory at |path|. If |recursive| is true, remove |
312 // all files and directories under the directory at |path| recursively. | 321 // all files and directories under the directory at |path| recursively. |
313 virtual void Remove(const FileSystemURL& path, bool recursive, | 322 virtual void Remove(const FileSystemURL& path, bool recursive, |
314 const StatusCallback& callback) = 0; | 323 const StatusCallback& callback) = 0; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 kOperationOpenFile, | 496 kOperationOpenFile, |
488 kOperationCloseFile, | 497 kOperationCloseFile, |
489 kOperationGetLocalPath, | 498 kOperationGetLocalPath, |
490 kOperationCancel, | 499 kOperationCancel, |
491 }; | 500 }; |
492 }; | 501 }; |
493 | 502 |
494 } // namespace storage | 503 } // namespace storage |
495 | 504 |
496 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_H_ | 505 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
OLD | NEW |