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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // separator, then just drop the separator. | 70 // separator, then just drop the separator. |
71 // Deprecated. Use FilePath::DirName instead. | 71 // Deprecated. Use FilePath::DirName instead. |
72 void TrimFilename(std::wstring* path); | 72 void TrimFilename(std::wstring* path); |
73 | 73 |
74 // Returns the filename portion of 'path', without any leading \'s or /'s. | 74 // Returns the filename portion of 'path', without any leading \'s or /'s. |
75 // Deprecated. Use FilePath::BaseName instead. | 75 // Deprecated. Use FilePath::BaseName instead. |
76 std::wstring GetFilenameFromPath(const std::wstring& path); | 76 std::wstring GetFilenameFromPath(const std::wstring& path); |
77 | 77 |
78 // Returns "jpg" for path "C:\pics\jojo.jpg", or an empty string if | 78 // Returns "jpg" for path "C:\pics\jojo.jpg", or an empty string if |
79 // the file has no extension. | 79 // the file has no extension. |
| 80 FilePath::StringType GetFileExtensionFromPath(const FilePath& path); |
| 81 // Deprecated temporary compatibility function. |
80 std::wstring GetFileExtensionFromPath(const std::wstring& path); | 82 std::wstring GetFileExtensionFromPath(const std::wstring& path); |
81 | 83 |
82 // Returns 'jojo' for path "C:\pics\jojo.jpg". | 84 // Returns 'jojo' for path "C:\pics\jojo.jpg". |
83 std::wstring GetFilenameWithoutExtensionFromPath(const std::wstring& path); | 85 std::wstring GetFilenameWithoutExtensionFromPath(const std::wstring& path); |
84 | 86 |
85 // Returns the directory component of a path, without the trailing | 87 // Returns the directory component of a path, without the trailing |
86 // path separator, or an empty string on error. The function does not | 88 // path separator, or an empty string on error. The function does not |
87 // check for the existence of the path, so if it is passed a directory | 89 // check for the existence of the path, so if it is passed a directory |
88 // without the trailing \, it will interpret the last component of the | 90 // without the trailing \, it will interpret the last component of the |
89 // path as a file and chomp it. This does not support relative paths. | 91 // path as a file and chomp it. This does not support relative paths. |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 #endif | 459 #endif |
458 uint8* data_; | 460 uint8* data_; |
459 size_t length_; | 461 size_t length_; |
460 | 462 |
461 DISALLOW_COPY_AND_ASSIGN(MemoryMappedFile); | 463 DISALLOW_COPY_AND_ASSIGN(MemoryMappedFile); |
462 }; | 464 }; |
463 | 465 |
464 // Renames a file using the SHFileOperation API to ensure that the target file | 466 // Renames a file using the SHFileOperation API to ensure that the target file |
465 // gets the correct default security descriptor in the new path. | 467 // gets the correct default security descriptor in the new path. |
466 bool RenameFileAndResetSecurityDescriptor( | 468 bool RenameFileAndResetSecurityDescriptor( |
467 const std::wstring& source_file_path, | 469 const FilePath& source_file_path, |
468 const std::wstring& target_file_path); | 470 const FilePath& target_file_path); |
469 | 471 |
470 } // namespace file_util | 472 } // namespace file_util |
471 | 473 |
472 #endif // BASE_FILE_UTIL_H_ | 474 #endif // BASE_FILE_UTIL_H_ |
OLD | NEW |