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_FILE_SYSTEM_FILE_UTIL_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ |
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ |
7 | 7 |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util_proxy.h" | 9 #include "base/file_util_proxy.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 const base::Time& last_access_time, | 142 const base::Time& last_access_time, |
143 const base::Time& last_modified_time) = 0; | 143 const base::Time& last_modified_time) = 0; |
144 | 144 |
145 // Truncates a file to the given length. If |length| is greater than the | 145 // Truncates a file to the given length. If |length| is greater than the |
146 // current length of the file, the file will be extended with zeroes. | 146 // current length of the file, the file will be extended with zeroes. |
147 virtual PlatformFileError Truncate( | 147 virtual PlatformFileError Truncate( |
148 FileSystemOperationContext* context, | 148 FileSystemOperationContext* context, |
149 const FileSystemURL& url, | 149 const FileSystemURL& url, |
150 int64 length) = 0; | 150 int64 length) = 0; |
151 | 151 |
152 // Returns true if a given |url| exists. | |
153 virtual bool PathExists( | |
154 FileSystemOperationContext* context, | |
155 const FileSystemURL& url) = 0; | |
156 | |
157 // Returns true if a given |url| exists and is a directory. | |
158 virtual bool DirectoryExists( | |
159 FileSystemOperationContext* context, | |
160 const FileSystemURL& url) = 0; | |
161 | |
162 // Returns true if a given |url| is an empty directory. | 152 // Returns true if a given |url| is an empty directory. |
163 virtual bool IsDirectoryEmpty( | 153 virtual bool IsDirectoryEmpty( |
164 FileSystemOperationContext* context, | 154 FileSystemOperationContext* context, |
165 const FileSystemURL& url) = 0; | 155 const FileSystemURL& url) = 0; |
166 | 156 |
167 // Copies or moves a single file from |src_url| to |dest_url|. | 157 // Copies or moves a single file from |src_url| to |dest_url|. |
168 virtual PlatformFileError CopyOrMoveFile( | 158 virtual PlatformFileError CopyOrMoveFile( |
169 FileSystemOperationContext* context, | 159 FileSystemOperationContext* context, |
170 const FileSystemURL& src_url, | 160 const FileSystemURL& src_url, |
171 const FileSystemURL& dest_url, | 161 const FileSystemURL& dest_url, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 protected: | 201 protected: |
212 FileSystemFileUtil() {} | 202 FileSystemFileUtil() {} |
213 | 203 |
214 private: | 204 private: |
215 DISALLOW_COPY_AND_ASSIGN(FileSystemFileUtil); | 205 DISALLOW_COPY_AND_ASSIGN(FileSystemFileUtil); |
216 }; | 206 }; |
217 | 207 |
218 } // namespace fileapi | 208 } // namespace fileapi |
219 | 209 |
220 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ | 210 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ |
OLD | NEW |