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 // TODO(dmikurube): Add unit tests for NativeFileUtil. |
| 24 // This class handles accessing the OS native filesystem. |
| 25 class NativeFileUtil : public FileSystemFileUtil { |
| 26 public: |
| 27 NativeFileUtil() {} |
| 28 virtual ~NativeFileUtil() {} |
| 29 |
| 30 virtual PlatformFileError CreateOrOpen( |
| 31 FileSystemOperationContext* unused, |
| 32 const FilePath& file_path, |
| 33 int file_flags, |
| 34 PlatformFile* file_handle, |
| 35 bool* created) OVERRIDE; |
| 36 virtual PlatformFileError Close( |
| 37 FileSystemOperationContext* unused, |
| 38 PlatformFile) OVERRIDE; |
| 39 virtual PlatformFileError EnsureFileExists( |
| 40 FileSystemOperationContext* unused, |
| 41 const FilePath& file_path, bool* created) OVERRIDE; |
| 42 virtual PlatformFileError CreateDirectory( |
| 43 FileSystemOperationContext* context, |
| 44 const FilePath& file_path, |
| 45 bool exclusive, |
| 46 bool recursive) OVERRIDE; |
| 47 virtual PlatformFileError GetFileInfo( |
| 48 FileSystemOperationContext* unused, |
| 49 const FilePath& file_, |
| 50 base::PlatformFileInfo* file_info, |
| 51 FilePath* platform_path) OVERRIDE; |
| 52 virtual PlatformFileError ReadDirectory( |
| 53 FileSystemOperationContext* unused, |
| 54 const FilePath& file_path, |
| 55 std::vector<base::FileUtilProxy::Entry>* entries) OVERRIDE; |
| 56 virtual AbstractFileEnumerator* CreateFileEnumerator( |
| 57 FileSystemOperationContext* unused, |
| 58 const FilePath& root_path) OVERRIDE; |
| 59 virtual PlatformFileError GetLocalFilePath( |
| 60 FileSystemOperationContext* unused, |
| 61 const FilePath& virtual_path, |
| 62 FilePath* local_path) OVERRIDE; |
| 63 virtual PlatformFileError Touch( |
| 64 FileSystemOperationContext* unused, |
| 65 const FilePath& file_path, |
| 66 const base::Time& last_access_time, |
| 67 const base::Time& last_modified_time) OVERRIDE; |
| 68 virtual PlatformFileError Truncate( |
| 69 FileSystemOperationContext* unused, |
| 70 const FilePath& path, |
| 71 int64 length) OVERRIDE; |
| 72 virtual bool PathExists( |
| 73 FileSystemOperationContext* unused, |
| 74 const FilePath& file_path) OVERRIDE; |
| 75 virtual bool DirectoryExists( |
| 76 FileSystemOperationContext* unused, |
| 77 const FilePath& file_path) OVERRIDE; |
| 78 virtual bool IsDirectoryEmpty( |
| 79 FileSystemOperationContext* unused, |
| 80 const FilePath& file_path) OVERRIDE; |
| 81 virtual PlatformFileError CopyOrMoveFile( |
| 82 FileSystemOperationContext* unused, |
| 83 const FilePath& src_file_path, |
| 84 const FilePath& dest_file_path, |
| 85 bool copy) OVERRIDE; |
| 86 virtual PlatformFileError CopyInForeignFile( |
| 87 FileSystemOperationContext* unused, |
| 88 const FilePath& src_file_path, |
| 89 const FilePath& dest_file_path) OVERRIDE; |
| 90 virtual PlatformFileError DeleteFile( |
| 91 FileSystemOperationContext* unused, |
| 92 const FilePath& file_path) OVERRIDE; |
| 93 virtual PlatformFileError DeleteSingleDirectory( |
| 94 FileSystemOperationContext* unused, |
| 95 const FilePath& file_path) OVERRIDE; |
| 96 |
| 97 private: |
| 98 DISALLOW_COPY_AND_ASSIGN(NativeFileUtil); |
| 99 }; |
| 100 |
| 101 } // namespace fileapi |
| 102 |
| 103 #endif // WEBKIT_FILEAPI_NATIVE_FILE_UTIL_H_ |
OLD | NEW |