| 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 // 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 int icon_index, const wchar_t* app_id); | 205 int icon_index, const wchar_t* app_id); |
| 206 | 206 |
| 207 // Pins a shortcut to the Windows 7 taskbar. The shortcut file must already | 207 // Pins a shortcut to the Windows 7 taskbar. The shortcut file must already |
| 208 // exist and be a shortcut that points to an executable. | 208 // exist and be a shortcut that points to an executable. |
| 209 bool TaskbarPinShortcutLink(const wchar_t* shortcut); | 209 bool TaskbarPinShortcutLink(const wchar_t* shortcut); |
| 210 | 210 |
| 211 // Unpins a shortcut from the Windows 7 taskbar. The shortcut must exist and | 211 // Unpins a shortcut from the Windows 7 taskbar. The shortcut must exist and |
| 212 // already be pinned to the taskbar. | 212 // already be pinned to the taskbar. |
| 213 bool TaskbarUnpinShortcutLink(const wchar_t* shortcut); | 213 bool TaskbarUnpinShortcutLink(const wchar_t* shortcut); |
| 214 | 214 |
| 215 // Return true if the given directory is empty | |
| 216 bool IsDirectoryEmpty(const std::wstring& dir_path); | |
| 217 | |
| 218 // Copy from_path to to_path recursively and then delete from_path recursively. | 215 // Copy from_path to to_path recursively and then delete from_path recursively. |
| 219 // Returns true if all operations succeed. | 216 // Returns true if all operations succeed. |
| 220 // This function simulates Move(), but unlike Move() it works across volumes. | 217 // This function simulates Move(), but unlike Move() it works across volumes. |
| 221 // This fuction is not transactional. | 218 // This fuction is not transactional. |
| 222 bool CopyAndDeleteDirectory(const FilePath& from_path, | 219 bool CopyAndDeleteDirectory(const FilePath& from_path, |
| 223 const FilePath& to_path); | 220 const FilePath& to_path); |
| 224 #endif | 221 #endif // defined(OS_WIN) |
| 222 |
| 223 // Return true if the given directory is empty |
| 224 bool IsDirectoryEmpty(const FilePath& dir_path); |
| 225 | 225 |
| 226 // Get the temporary directory provided by the system. | 226 // Get the temporary directory provided by the system. |
| 227 bool GetTempDir(FilePath* path); | 227 bool GetTempDir(FilePath* path); |
| 228 // Get a temporary directory for shared memory files. | 228 // Get a temporary directory for shared memory files. |
| 229 // Only useful on POSIX; redirects to GetTempDir() on Windows. | 229 // Only useful on POSIX; redirects to GetTempDir() on Windows. |
| 230 bool GetShmemTempDir(FilePath* path); | 230 bool GetShmemTempDir(FilePath* path); |
| 231 | 231 |
| 232 // Get the home directory. This is more complicated than just getenv("HOME") | 232 // Get the home directory. This is more complicated than just getenv("HOME") |
| 233 // as it knows to fall back on getpwent() etc. | 233 // as it knows to fall back on getpwent() etc. |
| 234 FilePath GetHomeDir(); | 234 FilePath GetHomeDir(); |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 | 578 |
| 579 #endif // UNIT_TEST | 579 #endif // UNIT_TEST |
| 580 | 580 |
| 581 } // namespace file_util | 581 } // namespace file_util |
| 582 | 582 |
| 583 // Deprecated functions have been moved to this separate header file, | 583 // Deprecated functions have been moved to this separate header file, |
| 584 // which must be included last after all the above definitions. | 584 // which must be included last after all the above definitions. |
| 585 #include "base/file_util_deprecated.h" | 585 #include "base/file_util_deprecated.h" |
| 586 | 586 |
| 587 #endif // BASE_FILE_UTIL_H_ | 587 #endif // BASE_FILE_UTIL_H_ |
| OLD | NEW |