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. | |
82 std::wstring GetFileExtensionFromPath(const std::wstring& path); | 80 std::wstring GetFileExtensionFromPath(const std::wstring& path); |
83 | 81 |
84 // Returns 'jojo' for path "C:\pics\jojo.jpg". | 82 // Returns 'jojo' for path "C:\pics\jojo.jpg". |
85 std::wstring GetFilenameWithoutExtensionFromPath(const std::wstring& path); | 83 std::wstring GetFilenameWithoutExtensionFromPath(const std::wstring& path); |
86 | 84 |
87 // Returns the directory component of a path, without the trailing | 85 // Returns the directory component of a path, without the trailing |
88 // path separator, or an empty string on error. The function does not | 86 // path separator, or an empty string on error. The function does not |
89 // check for the existence of the path, so if it is passed a directory | 87 // check for the existence of the path, so if it is passed a directory |
90 // without the trailing \, it will interpret the last component of the | 88 // without the trailing \, it will interpret the last component of the |
91 // path as a file and chomp it. This does not support relative paths. | 89 // path as a file and chomp it. This does not support relative paths. |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 | 463 |
466 // Renames a file using the SHFileOperation API to ensure that the target file | 464 // Renames a file using the SHFileOperation API to ensure that the target file |
467 // gets the correct default security descriptor in the new path. | 465 // gets the correct default security descriptor in the new path. |
468 bool RenameFileAndResetSecurityDescriptor( | 466 bool RenameFileAndResetSecurityDescriptor( |
469 const std::wstring& source_file_path, | 467 const std::wstring& source_file_path, |
470 const std::wstring& target_file_path); | 468 const std::wstring& target_file_path); |
471 | 469 |
472 } // namespace file_util | 470 } // namespace file_util |
473 | 471 |
474 #endif // BASE_FILE_UTIL_H_ | 472 #endif // BASE_FILE_UTIL_H_ |
OLD | NEW |