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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 | 318 |
319 // Closes file opened by OpenFile. Returns true on success. | 319 // Closes file opened by OpenFile. Returns true on success. |
320 bool CloseFile(FILE* file); | 320 bool CloseFile(FILE* file); |
321 | 321 |
322 // Truncates an open file to end at the location of the current file pointer. | 322 // Truncates an open file to end at the location of the current file pointer. |
323 // This is a cross-platform analog to Windows' SetEndOfFile() function. | 323 // This is a cross-platform analog to Windows' SetEndOfFile() function. |
324 bool TruncateFile(FILE* file); | 324 bool TruncateFile(FILE* file); |
325 | 325 |
326 // Reads the given number of bytes from the file into the buffer. Returns | 326 // Reads the given number of bytes from the file into the buffer. Returns |
327 // the number of read bytes, or -1 on error. | 327 // the number of read bytes, or -1 on error. |
| 328 int ReadFile(const FilePath& filename, char* data, int size); |
| 329 // Deprecated temporary compatibility function. |
328 int ReadFile(const std::wstring& filename, char* data, int size); | 330 int ReadFile(const std::wstring& filename, char* data, int size); |
329 | 331 |
330 // Writes the given buffer into the file, overwriting any data that was | 332 // Writes the given buffer into the file, overwriting any data that was |
331 // previously there. Returns the number of bytes written, or -1 on error. | 333 // previously there. Returns the number of bytes written, or -1 on error. |
| 334 int WriteFile(const FilePath& filename, const char* data, int size); |
| 335 // Deprecated temporary compatibility function. |
332 int WriteFile(const std::wstring& filename, const char* data, int size); | 336 int WriteFile(const std::wstring& filename, const char* data, int size); |
333 | 337 |
334 // Gets the current working directory for the process. | 338 // Gets the current working directory for the process. |
335 bool GetCurrentDirectory(FilePath* path); | 339 bool GetCurrentDirectory(FilePath* path); |
336 // Deprecated temporary compatibility function. | 340 // Deprecated temporary compatibility function. |
337 bool GetCurrentDirectory(std::wstring* path); | 341 bool GetCurrentDirectory(std::wstring* path); |
338 | 342 |
339 // Sets the current working directory for the process. | 343 // Sets the current working directory for the process. |
340 bool SetCurrentDirectory(const FilePath& path); | 344 bool SetCurrentDirectory(const FilePath& path); |
341 // Deprecated temporary compatibility function. | 345 // Deprecated temporary compatibility function. |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 | 481 |
478 // Renames a file using the SHFileOperation API to ensure that the target file | 482 // Renames a file using the SHFileOperation API to ensure that the target file |
479 // gets the correct default security descriptor in the new path. | 483 // gets the correct default security descriptor in the new path. |
480 bool RenameFileAndResetSecurityDescriptor( | 484 bool RenameFileAndResetSecurityDescriptor( |
481 const FilePath& source_file_path, | 485 const FilePath& source_file_path, |
482 const FilePath& target_file_path); | 486 const FilePath& target_file_path); |
483 | 487 |
484 } // namespace file_util | 488 } // namespace file_util |
485 | 489 |
486 #endif // BASE_FILE_UTIL_H_ | 490 #endif // BASE_FILE_UTIL_H_ |
OLD | NEW |