OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/callback.h" | 8 #include "base/callback.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 const FilePath& file_path); | 215 const FilePath& file_path); |
216 | 216 |
217 // It will be implemented by each subclass such as FileSystemFileEnumerator. | 217 // It will be implemented by each subclass such as FileSystemFileEnumerator. |
218 class AbstractFileEnumerator { | 218 class AbstractFileEnumerator { |
219 public: | 219 public: |
220 virtual ~AbstractFileEnumerator() {} | 220 virtual ~AbstractFileEnumerator() {} |
221 | 221 |
222 // Returns an empty string if there are no more results. | 222 // Returns an empty string if there are no more results. |
223 virtual FilePath Next() = 0; | 223 virtual FilePath Next() = 0; |
224 | 224 |
| 225 virtual int64 Size() = 0; |
225 virtual bool IsDirectory() = 0; | 226 virtual bool IsDirectory() = 0; |
226 }; | 227 }; |
227 | 228 |
228 class EmptyFileEnumerator : public AbstractFileEnumerator { | 229 class EmptyFileEnumerator : public AbstractFileEnumerator { |
229 virtual FilePath Next() { return FilePath(); } | 230 virtual FilePath Next() OVERRIDE { return FilePath(); } |
230 virtual bool IsDirectory() { return false; } | 231 virtual int64 Size() OVERRIDE { return 0; } |
| 232 virtual bool IsDirectory() OVERRIDE { return false; } |
231 }; | 233 }; |
232 | 234 |
233 // Returns a pointer to a new instance of AbstractFileEnumerator which is | 235 // Returns a pointer to a new instance of AbstractFileEnumerator which is |
234 // implemented for each FileUtil subclass. The instance needs to be freed | 236 // implemented for each FileUtil subclass. The instance needs to be freed |
235 // by the caller, and its lifetime should not extend past when the current | 237 // by the caller, and its lifetime should not extend past when the current |
236 // call returns to the main FILE message loop. | 238 // call returns to the main FILE message loop. |
237 virtual AbstractFileEnumerator* CreateFileEnumerator( | 239 virtual AbstractFileEnumerator* CreateFileEnumerator( |
238 FileSystemOperationContext* unused, | 240 FileSystemOperationContext* unused, |
239 const FilePath& root_path); | 241 const FilePath& root_path); |
240 | 242 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 const FilePath& src_file_path, | 279 const FilePath& src_file_path, |
278 const FilePath& dest_file_path, | 280 const FilePath& dest_file_path, |
279 bool copy); | 281 bool copy); |
280 | 282 |
281 DISALLOW_COPY_AND_ASSIGN(FileSystemFileUtil); | 283 DISALLOW_COPY_AND_ASSIGN(FileSystemFileUtil); |
282 }; | 284 }; |
283 | 285 |
284 } // namespace fileapi | 286 } // namespace fileapi |
285 | 287 |
286 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ | 288 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ |
OLD | NEW |