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 WEBKIT_FILEAPI_NATIVE_FILE_UTIL_H_ | 5 #ifndef WEBKIT_FILEAPI_NATIVE_FILE_UTIL_H_ |
6 #define WEBKIT_FILEAPI_NATIVE_FILE_UTIL_H_ | 6 #define WEBKIT_FILEAPI_NATIVE_FILE_UTIL_H_ |
7 | 7 |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/files/file_util_proxy.h" | 9 #include "base/files/file_util_proxy.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // FileSystemFileUtil interface (webkit/fileapi/file_system_file_util.h). | 26 // FileSystemFileUtil interface (webkit/fileapi/file_system_file_util.h). |
27 // | 27 // |
28 // Note that all the methods of this class are static and this does NOT | 28 // Note that all the methods of this class are static and this does NOT |
29 // inherit from FileSystemFileUtil. | 29 // inherit from FileSystemFileUtil. |
30 // | 30 // |
31 // TODO(dmikurube): Add unit tests for NativeFileUtil. | 31 // TODO(dmikurube): Add unit tests for NativeFileUtil. |
32 // http://crbug.com/170564 | 32 // http://crbug.com/170564 |
33 class WEBKIT_STORAGE_EXPORT_PRIVATE NativeFileUtil { | 33 class WEBKIT_STORAGE_EXPORT_PRIVATE NativeFileUtil { |
34 public: | 34 public: |
35 static base::PlatformFileError CreateOrOpen( | 35 static base::PlatformFileError CreateOrOpen( |
36 const FilePath& path, | 36 const base::FilePath& path, |
37 int file_flags, | 37 int file_flags, |
38 base::PlatformFile* file_handle, | 38 base::PlatformFile* file_handle, |
39 bool* created); | 39 bool* created); |
40 static base::PlatformFileError Close(base::PlatformFile file); | 40 static base::PlatformFileError Close(base::PlatformFile file); |
41 static base::PlatformFileError EnsureFileExists(const FilePath& path, | 41 static base::PlatformFileError EnsureFileExists(const base::FilePath& path, |
42 bool* created); | 42 bool* created); |
43 static base::PlatformFileError CreateDirectory(const FilePath& path, | 43 static base::PlatformFileError CreateDirectory(const base::FilePath& path, |
44 bool exclusive, | 44 bool exclusive, |
45 bool recursive); | 45 bool recursive); |
46 static base::PlatformFileError GetFileInfo(const FilePath& path, | 46 static base::PlatformFileError GetFileInfo(const base::FilePath& path, |
47 base::PlatformFileInfo* file_info); | 47 base::PlatformFileInfo* file_info); |
48 static scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> | 48 static scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> |
49 CreateFileEnumerator(const FilePath& root_path, | 49 CreateFileEnumerator(const base::FilePath& root_path, |
50 bool recursive); | 50 bool recursive); |
51 static base::PlatformFileError Touch(const FilePath& path, | 51 static base::PlatformFileError Touch(const base::FilePath& path, |
52 const base::Time& last_access_time, | 52 const base::Time& last_access_time, |
53 const base::Time& last_modified_time); | 53 const base::Time& last_modified_time); |
54 static base::PlatformFileError Truncate(const FilePath& path, int64 length); | 54 static base::PlatformFileError Truncate(const base::FilePath& path, int64 leng
th); |
55 static bool PathExists(const FilePath& path); | 55 static bool PathExists(const base::FilePath& path); |
56 static bool DirectoryExists(const FilePath& path); | 56 static bool DirectoryExists(const base::FilePath& path); |
57 static base::PlatformFileError CopyOrMoveFile(const FilePath& src_path, | 57 static base::PlatformFileError CopyOrMoveFile(const base::FilePath& src_path, |
58 const FilePath& dest_path, | 58 const base::FilePath& dest_path, |
59 bool copy); | 59 bool copy); |
60 static base::PlatformFileError DeleteFile(const FilePath& path); | 60 static base::PlatformFileError DeleteFile(const base::FilePath& path); |
61 static base::PlatformFileError DeleteDirectory(const FilePath& path); | 61 static base::PlatformFileError DeleteDirectory(const base::FilePath& path); |
62 | 62 |
63 private: | 63 private: |
64 DISALLOW_IMPLICIT_CONSTRUCTORS(NativeFileUtil); | 64 DISALLOW_IMPLICIT_CONSTRUCTORS(NativeFileUtil); |
65 }; | 65 }; |
66 | 66 |
67 } // namespace fileapi | 67 } // namespace fileapi |
68 | 68 |
69 #endif // WEBKIT_FILEAPI_NATIVE_FILE_UTIL_H_ | 69 #endif // WEBKIT_FILEAPI_NATIVE_FILE_UTIL_H_ |
OLD | NEW |