OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 BASE_FILE_UTIL_PROXY_H_ | 5 #ifndef BASE_FILE_UTIL_PROXY_H_ |
6 #define BASE_FILE_UTIL_PROXY_H_ | 6 #define BASE_FILE_UTIL_PROXY_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 const FilePath& src_file_path, | 90 const FilePath& src_file_path, |
91 const FilePath& dest_file_path, | 91 const FilePath& dest_file_path, |
92 StatusCallback* callback); | 92 StatusCallback* callback); |
93 | 93 |
94 // Creates directory at given path. It's an error to create | 94 // Creates directory at given path. It's an error to create |
95 // if |exclusive| is true and dir already exists. | 95 // if |exclusive| is true and dir already exists. |
96 static bool CreateDirectory( | 96 static bool CreateDirectory( |
97 scoped_refptr<MessageLoopProxy> message_loop_proxy, | 97 scoped_refptr<MessageLoopProxy> message_loop_proxy, |
98 const FilePath& file_path, | 98 const FilePath& file_path, |
99 bool exclusive, | 99 bool exclusive, |
| 100 bool recursive, |
100 StatusCallback* callback); | 101 StatusCallback* callback); |
101 | 102 |
102 // Deletes a file or empty directory. | 103 // Deletes a file or empty directory. |
103 static bool Delete(scoped_refptr<MessageLoopProxy> message_loop_proxy, | 104 static bool Delete(scoped_refptr<MessageLoopProxy> message_loop_proxy, |
104 const FilePath& file_path, | 105 const FilePath& file_path, |
105 StatusCallback* callback); | 106 StatusCallback* callback); |
106 | 107 |
107 // Moves a file or a directory from src_file_path to dest_file_path. | 108 // Moves a file or a directory from src_file_path to dest_file_path. |
108 // Error cases are similar to Copy method's error cases. | 109 // Error cases are similar to Copy method's error cases. |
109 static bool Move( | 110 static bool Move( |
110 scoped_refptr<MessageLoopProxy> message_loop_proxy, | 111 scoped_refptr<MessageLoopProxy> message_loop_proxy, |
111 const FilePath& src_file_path, | 112 const FilePath& src_file_path, |
112 const FilePath& dest_file_path, | 113 const FilePath& dest_file_path, |
113 StatusCallback* callback); | 114 StatusCallback* callback); |
114 | 115 |
115 // Deletes a directory and all of its contents. | 116 // Deletes a directory and all of its contents. |
116 static bool RecursiveDelete( | 117 static bool RecursiveDelete( |
117 scoped_refptr<MessageLoopProxy> message_loop_proxy, | 118 scoped_refptr<MessageLoopProxy> message_loop_proxy, |
118 const FilePath& file_path, | 119 const FilePath& file_path, |
119 StatusCallback* callback); | 120 StatusCallback* callback); |
120 | 121 |
121 private: | 122 private: |
122 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilProxy); | 123 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilProxy); |
123 }; | 124 }; |
124 | 125 |
125 } // namespace base | 126 } // namespace base |
126 | 127 |
127 #endif // BASE_FILE_UTIL_PROXY_H_ | 128 #endif // BASE_FILE_UTIL_PROXY_H_ |
OLD | NEW |