OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WEBKIT_FILEAPI_NATIVE_FILE_UTIL_H_ |
| 6 #define WEBKIT_FILEAPI_NATIVE_FILE_UTIL_H_ |
| 7 |
| 8 #include "base/file_path.h" |
| 9 #include "base/file_util_proxy.h" |
| 10 #include "base/platform_file.h" |
| 11 #include "webkit/fileapi/file_system_file_util.h" |
| 12 |
| 13 namespace base { |
| 14 class Time; |
| 15 } |
| 16 |
| 17 namespace fileapi { |
| 18 |
| 19 using base::PlatformFile; |
| 20 using base::PlatformFileError; |
| 21 class FileSystemOperationContext; |
| 22 |
| 23 // This class handles accessing to the OS native filesystem. |
| 24 class NativeFileUtil : public FileSystemFileUtil { |
| 25 public: |
| 26 NativeFileUtil() {} |
| 27 virtual ~NativeFileUtil() {} |
| 28 |
| 29 virtual PlatformFileError CreateOrOpen( |
| 30 FileSystemOperationContext* unused, |
| 31 const FilePath& file_path, |
| 32 int file_flags, |
| 33 PlatformFile* file_handle, |
| 34 bool* created) OVERRIDE; |
| 35 |
| 36 virtual PlatformFileError Close( |
| 37 FileSystemOperationContext* unused, |
| 38 PlatformFile) OVERRIDE; |
| 39 |
| 40 virtual PlatformFileError EnsureFileExists( |
| 41 FileSystemOperationContext* unused, |
| 42 const FilePath& file_path, bool* created) OVERRIDE; |
| 43 |
| 44 virtual PlatformFileError CreateDirectory( |
| 45 FileSystemOperationContext* context, |
| 46 const FilePath& file_path, |
| 47 bool exclusive, |
| 48 bool recursive) OVERRIDE; |
| 49 |
| 50 virtual PlatformFileError GetFileInfo( |
| 51 FileSystemOperationContext* unused, |
| 52 const FilePath& file_, |
| 53 base::PlatformFileInfo* file_info, |
| 54 FilePath* platform_path) OVERRIDE; |
| 55 |
| 56 virtual PlatformFileError ReadDirectory( |
| 57 FileSystemOperationContext* unused, |
| 58 const FilePath& file_path, |
| 59 std::vector<base::FileUtilProxy::Entry>* entries) OVERRIDE; |
| 60 |
| 61 virtual AbstractFileEnumerator* CreateFileEnumerator( |
| 62 FileSystemOperationContext* unused, |
| 63 const FilePath& root_path) OVERRIDE; |
| 64 |
| 65 virtual PlatformFileError GetLocalFilePath( |
| 66 FileSystemOperationContext* unused, |
| 67 const FilePath& virtual_path, |
| 68 FilePath* local_path) OVERRIDE; |
| 69 |
| 70 virtual PlatformFileError Touch( |
| 71 FileSystemOperationContext* unused, |
| 72 const FilePath& file_path, |
| 73 const base::Time& last_access_time, |
| 74 const base::Time& last_modified_time) OVERRIDE; |
| 75 |
| 76 virtual PlatformFileError Truncate( |
| 77 FileSystemOperationContext* unused, |
| 78 const FilePath& path, |
| 79 int64 length) OVERRIDE; |
| 80 |
| 81 virtual bool PathExists( |
| 82 FileSystemOperationContext* unused, |
| 83 const FilePath& file_path) OVERRIDE; |
| 84 |
| 85 virtual bool DirectoryExists( |
| 86 FileSystemOperationContext* unused, |
| 87 const FilePath& file_path) OVERRIDE; |
| 88 |
| 89 virtual bool IsDirectoryEmpty( |
| 90 FileSystemOperationContext* unused, |
| 91 const FilePath& file_path) OVERRIDE; |
| 92 |
| 93 virtual PlatformFileError CopyOrMoveFile( |
| 94 FileSystemOperationContext* unused, |
| 95 const FilePath& src_file_path, |
| 96 const FilePath& dest_file_path, |
| 97 bool copy) OVERRIDE; |
| 98 |
| 99 virtual PlatformFileError CopyInForeignFile( |
| 100 FileSystemOperationContext* unused, |
| 101 const FilePath& src_file_path, |
| 102 const FilePath& dest_file_path) OVERRIDE; |
| 103 |
| 104 virtual PlatformFileError DeleteFile( |
| 105 FileSystemOperationContext* unused, |
| 106 const FilePath& file_path) OVERRIDE; |
| 107 |
| 108 virtual PlatformFileError DeleteSingleDirectory( |
| 109 FileSystemOperationContext* unused, |
| 110 const FilePath& file_path) OVERRIDE; |
| 111 |
| 112 private: |
| 113 DISALLOW_COPY_AND_ASSIGN(NativeFileUtil); |
| 114 }; |
| 115 |
| 116 } // namespace fileapi |
| 117 |
| 118 #endif // WEBKIT_FILEAPI_NATIVE_FILE_UTIL_H_ |
OLD | NEW |