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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 bool UpdateShortcutLink(const wchar_t *source, const wchar_t *destination, | 230 bool UpdateShortcutLink(const wchar_t *source, const wchar_t *destination, |
231 const wchar_t *working_dir, const wchar_t *arguments, | 231 const wchar_t *working_dir, const wchar_t *arguments, |
232 const wchar_t *description, const wchar_t *icon, | 232 const wchar_t *description, const wchar_t *icon, |
233 int icon_index); | 233 int icon_index); |
234 | 234 |
235 // Return true if the given directory is empty | 235 // Return true if the given directory is empty |
236 bool IsDirectoryEmpty(const std::wstring& dir_path); | 236 bool IsDirectoryEmpty(const std::wstring& dir_path); |
237 | 237 |
238 #endif | 238 #endif |
239 | 239 |
240 | |
241 // Get the temporary directory provided by the system. | 240 // Get the temporary directory provided by the system. |
242 bool GetTempDir(FilePath* path); | 241 bool GetTempDir(FilePath* path); |
243 // Deprecated temporary compatibility function. | 242 // Deprecated temporary compatibility function. |
244 bool GetTempDir(std::wstring* path); | 243 bool GetTempDir(std::wstring* path); |
245 | 244 |
246 // Creates a temporary file. The full path is placed in 'temp_file', and the | 245 // Creates a temporary file. The full path is placed in |path|, and the |
247 // function returns true if was successful in creating the file. The file will | 246 // function returns true if was successful in creating the file. The file will |
248 // be empty and all handles closed after this function returns. | 247 // be empty and all handles closed after this function returns. |
249 // TODO(erikkay): rename this function and track down all of the callers. | 248 // TODO(erikkay): rename this function and track down all of the callers. |
| 249 bool CreateTemporaryFileName(FilePath* path); |
| 250 // Deprecated temporary compatibility function. |
250 bool CreateTemporaryFileName(std::wstring* temp_file); | 251 bool CreateTemporaryFileName(std::wstring* temp_file); |
251 | 252 |
252 // Same as CreateTemporaryFileName but the file is created in |dir|. | 253 // Same as CreateTemporaryFileName but the file is created in |dir|. |
253 bool CreateTemporaryFileNameInDir(const std::wstring& dir, | 254 bool CreateTemporaryFileNameInDir(const std::wstring& dir, |
254 std::wstring* temp_file); | 255 std::wstring* temp_file); |
255 | 256 |
256 // Create a new directory under TempPath. If prefix is provided, the new | 257 // Create a new directory under TempPath. If prefix is provided, the new |
257 // directory name is in the format of prefixyyyy. | 258 // directory name is in the format of prefixyyyy. |
258 // If success, return true and output the full path of the directory created. | 259 // If success, return true and output the full path of the directory created. |
259 bool CreateNewTempDirectory(const std::wstring& prefix, | 260 bool CreateNewTempDirectory(const std::wstring& prefix, |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 | 385 |
385 // Renames a file using the SHFileOperation API to ensure that the target file | 386 // Renames a file using the SHFileOperation API to ensure that the target file |
386 // gets the correct default security descriptor in the new path. | 387 // gets the correct default security descriptor in the new path. |
387 bool RenameFileAndResetSecurityDescriptor( | 388 bool RenameFileAndResetSecurityDescriptor( |
388 const std::wstring& source_file_path, | 389 const std::wstring& source_file_path, |
389 const std::wstring& target_file_path); | 390 const std::wstring& target_file_path); |
390 | 391 |
391 } // namespace file_util | 392 } // namespace file_util |
392 | 393 |
393 #endif // BASE_FILE_UTIL_H_ | 394 #endif // BASE_FILE_UTIL_H_ |
OLD | NEW |