Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: base/files/file_util_proxy.h

Issue 1647803004: Move base to DEPS (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/files/file_util_posix.cc ('k') | base/files/file_util_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef BASE_FILES_FILE_UTIL_PROXY_H_
6 #define BASE_FILES_FILE_UTIL_PROXY_H_
7
8 #include "base/base_export.h"
9 #include "base/callback_forward.h"
10 #include "base/files/file.h"
11 #include "base/files/file_path.h"
12
13 namespace base {
14
15 class TaskRunner;
16 class Time;
17
18 // This class provides asynchronous access to common file routines.
19 class BASE_EXPORT FileUtilProxy {
20 public:
21 // This callback is used by methods that report only an error code. It is
22 // valid to pass a null callback to any function that takes a StatusCallback,
23 // in which case the operation will complete silently.
24 typedef Callback<void(File::Error)> StatusCallback;
25
26 typedef Callback<void(File::Error,
27 const File::Info&)> GetFileInfoCallback;
28
29 // Retrieves the information about a file. It is invalid to pass a null
30 // callback.
31 // This returns false if task posting to |task_runner| has failed.
32 static bool GetFileInfo(
33 TaskRunner* task_runner,
34 const FilePath& file_path,
35 const GetFileInfoCallback& callback);
36
37 // Deletes a file or a directory.
38 // It is an error to delete a non-empty directory with recursive=false.
39 // This returns false if task posting to |task_runner| has failed.
40 static bool DeleteFile(TaskRunner* task_runner,
41 const FilePath& file_path,
42 bool recursive,
43 const StatusCallback& callback);
44
45 // Touches a file. The callback can be null.
46 // This returns false if task posting to |task_runner| has failed.
47 static bool Touch(
48 TaskRunner* task_runner,
49 const FilePath& file_path,
50 const Time& last_access_time,
51 const Time& last_modified_time,
52 const StatusCallback& callback);
53
54 private:
55 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilProxy);
56 };
57
58 } // namespace base
59
60 #endif // BASE_FILES_FILE_UTIL_PROXY_H_
OLDNEW
« no previous file with comments | « base/files/file_util_posix.cc ('k') | base/files/file_util_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698