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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 // Get the temporary directory provided by the system. | 212 // Get the temporary directory provided by the system. |
213 bool GetTempDir(std::wstring* path); | 213 bool GetTempDir(std::wstring* path); |
214 | 214 |
215 // Creates a temporary file. The full path is placed in 'temp_file', and the | 215 // Creates a temporary file. The full path is placed in 'temp_file', and the |
216 // function returns true if was successful in creating the file. The file will | 216 // function returns true if was successful in creating the file. The file will |
217 // be empty and all handles closed after this function returns. | 217 // be empty and all handles closed after this function returns. |
218 // TODO(erikkay): rename this function and track down all of the callers. | 218 // TODO(erikkay): rename this function and track down all of the callers. |
219 bool CreateTemporaryFileName(std::wstring* temp_file); | 219 bool CreateTemporaryFileName(std::wstring* temp_file); |
220 | 220 |
| 221 // Same as CreateTemporaryFileName but the file is created in |dir|. |
| 222 bool CreateTemporaryFileNameInDir(const std::wstring& dir, |
| 223 std::wstring* temp_file); |
| 224 |
221 // Create a new directory under TempPath. If prefix is provided, the new | 225 // Create a new directory under TempPath. If prefix is provided, the new |
222 // directory name is in the format of prefixyyyy. | 226 // directory name is in the format of prefixyyyy. |
223 // If success, return true and output the full path of the directory created. | 227 // If success, return true and output the full path of the directory created. |
224 bool CreateNewTempDirectory(const std::wstring& prefix, | 228 bool CreateNewTempDirectory(const std::wstring& prefix, |
225 std::wstring* new_temp_path); | 229 std::wstring* new_temp_path); |
226 | 230 |
227 // Creates a directory, as well as creating any parent directories, if they | 231 // Creates a directory, as well as creating any parent directories, if they |
228 // don't exist. Returns 'true' on successful creation, or if the directory | 232 // don't exist. Returns 'true' on successful creation, or if the directory |
229 // already exists. | 233 // already exists. |
230 bool CreateDirectory(const std::wstring& full_path); | 234 bool CreateDirectory(const std::wstring& full_path); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 | 335 |
332 // Renames a file using the MoveFileEx API and ensures that the target file gets | 336 // Renames a file using the MoveFileEx API and ensures that the target file gets |
333 // the correct security descriptor in the new path. | 337 // the correct security descriptor in the new path. |
334 bool RenameFileAndResetSecurityDescriptor( | 338 bool RenameFileAndResetSecurityDescriptor( |
335 const std::wstring& source_file_path, | 339 const std::wstring& source_file_path, |
336 const std::wstring& target_file_path); | 340 const std::wstring& target_file_path); |
337 | 341 |
338 } // namespace file_util | 342 } // namespace file_util |
339 | 343 |
340 #endif // BASE_FILE_UTIL_H_ | 344 #endif // BASE_FILE_UTIL_H_ |
OLD | NEW |