OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This file contains utility functions for dealing with the local | 5 // This file contains utility functions for dealing with the local |
6 // filesystem. | 6 // filesystem. |
7 | 7 |
8 #ifndef BASE_FILE_UTIL_H_ | 8 #ifndef BASE_FILE_UTIL_H_ |
9 #define BASE_FILE_UTIL_H_ | 9 #define BASE_FILE_UTIL_H_ |
10 | 10 |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 // file to be updated. For best results pass the filename with the .lnk | 247 // file to be updated. For best results pass the filename with the .lnk |
248 // extension. | 248 // extension. |
249 bool UpdateShortcutLink(const wchar_t *source, const wchar_t *destination, | 249 bool UpdateShortcutLink(const wchar_t *source, const wchar_t *destination, |
250 const wchar_t *working_dir, const wchar_t *arguments, | 250 const wchar_t *working_dir, const wchar_t *arguments, |
251 const wchar_t *description, const wchar_t *icon, | 251 const wchar_t *description, const wchar_t *icon, |
252 int icon_index); | 252 int icon_index); |
253 | 253 |
254 // Return true if the given directory is empty | 254 // Return true if the given directory is empty |
255 bool IsDirectoryEmpty(const std::wstring& dir_path); | 255 bool IsDirectoryEmpty(const std::wstring& dir_path); |
256 | 256 |
| 257 // Copy from_path to to_path recursively and then delete from_path recursively. |
| 258 // Returns true if all operations succeed. |
| 259 // This function simulates Move(), but unlike Move() it works across volumes. |
| 260 // This fuction is not transactional. |
| 261 bool CopyAndDeleteDirectory(const FilePath& from_path, |
| 262 const FilePath& to_path); |
257 #endif | 263 #endif |
258 | 264 |
259 // Get the temporary directory provided by the system. | 265 // Get the temporary directory provided by the system. |
260 bool GetTempDir(FilePath* path); | 266 bool GetTempDir(FilePath* path); |
261 // Deprecated temporary compatibility function. | 267 // Deprecated temporary compatibility function. |
262 bool GetTempDir(std::wstring* path); | 268 bool GetTempDir(std::wstring* path); |
263 // Get a temporary directory for shared memory files. | 269 // Get a temporary directory for shared memory files. |
264 // Only useful on POSIX; redirects to GetTempDir() on Windows. | 270 // Only useful on POSIX; redirects to GetTempDir() on Windows. |
265 bool GetShmemTempDir(FilePath* path); | 271 bool GetShmemTempDir(FilePath* path); |
266 | 272 |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 | 501 |
496 // Renames a file using the SHFileOperation API to ensure that the target file | 502 // Renames a file using the SHFileOperation API to ensure that the target file |
497 // gets the correct default security descriptor in the new path. | 503 // gets the correct default security descriptor in the new path. |
498 bool RenameFileAndResetSecurityDescriptor( | 504 bool RenameFileAndResetSecurityDescriptor( |
499 const FilePath& source_file_path, | 505 const FilePath& source_file_path, |
500 const FilePath& target_file_path); | 506 const FilePath& target_file_path); |
501 | 507 |
502 } // namespace file_util | 508 } // namespace file_util |
503 | 509 |
504 #endif // BASE_FILE_UTIL_H_ | 510 #endif // BASE_FILE_UTIL_H_ |
OLD | NEW |