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/platform_file.h" | 10 #include "base/platform_file.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 class AbstractFileEnumerator { | 31 class AbstractFileEnumerator { |
32 public: | 32 public: |
33 virtual ~AbstractFileEnumerator() {} | 33 virtual ~AbstractFileEnumerator() {} |
34 | 34 |
35 // Returns an empty string if there are no more results. | 35 // Returns an empty string if there are no more results. |
36 virtual FilePath Next() = 0; | 36 virtual FilePath Next() = 0; |
37 | 37 |
38 virtual int64 Size() = 0; | 38 virtual int64 Size() = 0; |
39 virtual base::Time LastModifiedTime() = 0; | 39 virtual base::Time LastModifiedTime() = 0; |
40 virtual bool IsDirectory() = 0; | 40 virtual bool IsDirectory() = 0; |
| 41 virtual bool IsLink() = 0; |
41 }; | 42 }; |
42 | 43 |
43 class EmptyFileEnumerator : public AbstractFileEnumerator { | 44 class EmptyFileEnumerator : public AbstractFileEnumerator { |
44 virtual FilePath Next() OVERRIDE { return FilePath(); } | 45 virtual FilePath Next() OVERRIDE { return FilePath(); } |
45 virtual int64 Size() OVERRIDE { return 0; } | 46 virtual int64 Size() OVERRIDE { return 0; } |
46 virtual base::Time LastModifiedTime() OVERRIDE { return base::Time(); } | 47 virtual base::Time LastModifiedTime() OVERRIDE { return base::Time(); } |
47 virtual bool IsDirectory() OVERRIDE { return false; } | 48 virtual bool IsDirectory() OVERRIDE { return false; } |
| 49 virtual bool IsLink() OVERRIDE { return false; } |
48 }; | 50 }; |
49 | 51 |
50 virtual ~FileSystemFileUtil(); | 52 virtual ~FileSystemFileUtil(); |
51 | 53 |
52 // Creates or opens a file with the given flags. | 54 // Creates or opens a file with the given flags. |
53 // If PLATFORM_FILE_CREATE is set in |file_flags| it always tries to create | 55 // If PLATFORM_FILE_CREATE is set in |file_flags| it always tries to create |
54 // a new file at the given |path| and calls back with | 56 // a new file at the given |path| and calls back with |
55 // PLATFORM_FILE_ERROR_FILE_EXISTS if the |path| already exists. | 57 // PLATFORM_FILE_ERROR_FILE_EXISTS if the |path| already exists. |
56 virtual PlatformFileError CreateOrOpen( | 58 virtual PlatformFileError CreateOrOpen( |
57 FileSystemOperationContext* context, | 59 FileSystemOperationContext* context, |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 189 |
188 private: | 190 private: |
189 scoped_ptr<FileSystemFileUtil> underlying_file_util_; | 191 scoped_ptr<FileSystemFileUtil> underlying_file_util_; |
190 | 192 |
191 DISALLOW_COPY_AND_ASSIGN(FileSystemFileUtil); | 193 DISALLOW_COPY_AND_ASSIGN(FileSystemFileUtil); |
192 }; | 194 }; |
193 | 195 |
194 } // namespace fileapi | 196 } // namespace fileapi |
195 | 197 |
196 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ | 198 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ |
OLD | NEW |