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 29 matching lines...) Expand all Loading... |
40 // Returns true if the given path ends with a path separator character. | 40 // Returns true if the given path ends with a path separator character. |
41 bool EndsWithSeparator(const FilePath& path); | 41 bool EndsWithSeparator(const FilePath& path); |
42 // These two versions are both deprecated. TODO(estade): remove them. | 42 // These two versions are both deprecated. TODO(estade): remove them. |
43 bool EndsWithSeparator(std::wstring* path); | 43 bool EndsWithSeparator(std::wstring* path); |
44 bool EndsWithSeparator(const std::wstring& path); | 44 bool EndsWithSeparator(const std::wstring& path); |
45 | 45 |
46 // Makes sure that |path| ends with a separator IFF path is a directory that | 46 // Makes sure that |path| ends with a separator IFF path is a directory that |
47 // exists. Returns true if |path| is an existing directory, false otherwise. | 47 // exists. Returns true if |path| is an existing directory, false otherwise. |
48 bool EnsureEndsWithSeparator(FilePath* path); | 48 bool EnsureEndsWithSeparator(FilePath* path); |
49 | 49 |
50 // Modifies a string by trimming all trailing separators from the end. | |
51 // Deprecated. FilePath does this automatically, and if it's constructed from a | |
52 // path with a trailing separator, StripTrailingSeparators() may be used. | |
53 void TrimTrailingSeparator(std::wstring* dir); | |
54 | |
55 // Strips the topmost directory from the end of 'dir'. Assumes 'dir' does not | 50 // Strips the topmost directory from the end of 'dir'. Assumes 'dir' does not |
56 // refer to a file. | 51 // refer to a file. |
57 // If 'dir' is a root directory, return without change. | 52 // If 'dir' is a root directory, return without change. |
58 // Deprecated. Use FilePath::DirName instead. | 53 // Deprecated. Use FilePath::DirName instead. |
59 void UpOneDirectory(std::wstring* dir); | 54 void UpOneDirectory(std::wstring* dir); |
60 // Strips the topmost directory from the end of 'dir'. Assumes 'dir' does not | 55 // Strips the topmost directory from the end of 'dir'. Assumes 'dir' does not |
61 // refer to a file. | 56 // refer to a file. |
62 // If 'dir' is a root directory, the result becomes empty string. | 57 // If 'dir' is a root directory, the result becomes empty string. |
63 // Deprecated. Use FilePath::DirName instead. | 58 // Deprecated. Use FilePath::DirName instead. |
64 void UpOneDirectoryOrEmpty(std::wstring* dir); | 59 void UpOneDirectoryOrEmpty(std::wstring* dir); |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 | 524 |
530 // Renames a file using the SHFileOperation API to ensure that the target file | 525 // Renames a file using the SHFileOperation API to ensure that the target file |
531 // gets the correct default security descriptor in the new path. | 526 // gets the correct default security descriptor in the new path. |
532 bool RenameFileAndResetSecurityDescriptor( | 527 bool RenameFileAndResetSecurityDescriptor( |
533 const FilePath& source_file_path, | 528 const FilePath& source_file_path, |
534 const FilePath& target_file_path); | 529 const FilePath& target_file_path); |
535 | 530 |
536 } // namespace file_util | 531 } // namespace file_util |
537 | 532 |
538 #endif // BASE_FILE_UTIL_H_ | 533 #endif // BASE_FILE_UTIL_H_ |
OLD | NEW |