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/fileapi_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 FileApiFileUtil { |
| 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 GetLocalFilePath( |
| 45 FileSystemOperationContext* unused, |
| 46 const FilePath& virtual_path, |
| 47 FilePath* local_path) OVERRIDE; |
| 48 |
| 49 virtual PlatformFileError GetFileInfo( |
| 50 FileSystemOperationContext* unused, |
| 51 const FilePath& file_, |
| 52 base::PlatformFileInfo* file_info, |
| 53 FilePath* platform_path) OVERRIDE; |
| 54 |
| 55 virtual PlatformFileError ReadDirectory( |
| 56 FileSystemOperationContext* unused, |
| 57 const FilePath& file_path, |
| 58 std::vector<base::FileUtilProxy::Entry>* entries) OVERRIDE; |
| 59 |
| 60 virtual PlatformFileError CreateDirectory( |
| 61 FileSystemOperationContext* context, |
| 62 const FilePath& file_path, |
| 63 bool exclusive, |
| 64 bool recursive) OVERRIDE; |
| 65 |
| 66 virtual PlatformFileError CopyOrMoveFile( |
| 67 FileSystemOperationContext* unused, |
| 68 const FilePath& src_file_path, |
| 69 const FilePath& dest_file_path, |
| 70 bool copy) OVERRIDE; |
| 71 |
| 72 virtual PlatformFileError CopyInForeignFile( |
| 73 FileSystemOperationContext* unused, |
| 74 const FilePath& src_file_path, |
| 75 const FilePath& dest_file_path) OVERRIDE; |
| 76 |
| 77 virtual PlatformFileError DeleteFile( |
| 78 FileSystemOperationContext* unused, |
| 79 const FilePath& file_path) OVERRIDE; |
| 80 |
| 81 virtual PlatformFileError DeleteSingleDirectory( |
| 82 FileSystemOperationContext* unused, |
| 83 const FilePath& file_path) OVERRIDE; |
| 84 |
| 85 virtual PlatformFileError Touch( |
| 86 FileSystemOperationContext* unused, |
| 87 const FilePath& file_path, |
| 88 const base::Time& last_access_time, |
| 89 const base::Time& last_modified_time) OVERRIDE; |
| 90 |
| 91 virtual PlatformFileError Truncate( |
| 92 FileSystemOperationContext* unused, |
| 93 const FilePath& path, |
| 94 int64 length) OVERRIDE; |
| 95 |
| 96 virtual bool PathExists( |
| 97 FileSystemOperationContext* unused, |
| 98 const FilePath& file_path) OVERRIDE; |
| 99 |
| 100 virtual bool DirectoryExists( |
| 101 FileSystemOperationContext* unused, |
| 102 const FilePath& file_path) OVERRIDE; |
| 103 |
| 104 virtual bool IsDirectoryEmpty( |
| 105 FileSystemOperationContext* unused, |
| 106 const FilePath& file_path) OVERRIDE; |
| 107 |
| 108 virtual AbstractFileEnumerator* CreateFileEnumerator( |
| 109 FileSystemOperationContext* unused, |
| 110 const FilePath& root_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 |