Experimental push messaging api reference docs.
[chromium-blink-merge.git] / webkit / fileapi / file_util_helper.h
blob47e660574270b94b92555c811912a025f5f69298
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
3 // found in the LICENSE file.
5 #ifndef WEBKIT_FILEAPI_FILE_UTIL_HELPER_H_
6 #define WEBKIT_FILEAPI_FILE_UTIL_HELPER_H_
8 #include <vector>
10 #include "base/file_util_proxy.h"
11 #include "base/platform_file.h"
12 #include "webkit/fileapi/fileapi_export.h"
14 namespace fileapi {
16 class FileSystemFileUtil;
17 class FileSystemOperationContext;
18 class FileSystemURL;
20 // A collection of static methods that are usually called by
21 // FileSystemFileUtilProxy. The method should be called on FILE thread.
22 class FILEAPI_EXPORT_PRIVATE FileUtilHelper {
23 public:
24 static bool PathExists(
25 FileSystemOperationContext* context,
26 FileSystemFileUtil* file_util,
27 const FileSystemURL& url);
29 static bool DirectoryExists(
30 FileSystemOperationContext* context,
31 FileSystemFileUtil* file_util,
32 const FileSystemURL& url);
34 static base::PlatformFileError Copy(
35 FileSystemOperationContext* context,
36 FileSystemFileUtil* src_file_util,
37 FileSystemFileUtil* dest_file_utile,
38 const FileSystemURL& src_root_url,
39 const FileSystemURL& dest_root_url);
41 static base::PlatformFileError Move(
42 FileSystemOperationContext* context,
43 FileSystemFileUtil* src_file_util,
44 FileSystemFileUtil* dest_file_utile,
45 const FileSystemURL& src_root_url,
46 const FileSystemURL& dest_root_url);
48 static base::PlatformFileError Delete(
49 FileSystemOperationContext* context,
50 FileSystemFileUtil* file_util,
51 const FileSystemURL& url,
52 bool recursive);
54 static base::PlatformFileError ReadDirectory(
55 FileSystemOperationContext* context,
56 FileSystemFileUtil* file_util,
57 const FileSystemURL& url,
58 std::vector<base::FileUtilProxy::Entry>* entries);
60 private:
61 static base::PlatformFileError DeleteDirectoryRecursive(
62 FileSystemOperationContext* context,
63 FileSystemFileUtil* file_util,
64 const FileSystemURL& url);
67 } // namespace fileapi
69 #endif // WEBKIT_FILEAPI_FILE_UTIL_HELPER_H_