Chromium Code Reviews| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 | 96 |
| 97 // Appends new_ending to path, adding a separator between the two if necessary. | 97 // Appends new_ending to path, adding a separator between the two if necessary. |
| 98 void AppendToPath(std::wstring* path, const std::wstring& new_ending); | 98 void AppendToPath(std::wstring* path, const std::wstring& new_ending); |
| 99 | 99 |
| 100 // Convert provided relative path into an absolute path. Returns false on | 100 // Convert provided relative path into an absolute path. Returns false on |
| 101 // error. | 101 // error. |
| 102 bool AbsolutePath(FilePath* path); | 102 bool AbsolutePath(FilePath* path); |
| 103 // Deprecated temporary compatibility function. | 103 // Deprecated temporary compatibility function. |
| 104 bool AbsolutePath(std::wstring* path); | 104 bool AbsolutePath(std::wstring* path); |
| 105 | 105 |
| 106 // Returns true if this FilePath represents a parent dir of |other|. Both | 106 // Returns true if |parent| contains |child|. Both paths are converted to |
| 107 // paths are normalized before doing the comparison, but neither |this| nor | 107 // absolute paths before doing the comparison. |
|
Erik does not do reviews
2009/01/12 17:14:05
If we're not going to handle MacOSX case-sensitivi
| |
| 108 // |other| are modified. | 108 bool ContainsPath(const FilePath& parent, const FilePath& child); |
| 109 bool PathContains(const FilePath& path, const FilePath& other); | |
| 110 | 109 |
| 111 // Deprecated compatibility function. Use FilePath::InsertBeforeExtension. | 110 // Deprecated compatibility function. Use FilePath::InsertBeforeExtension. |
| 112 void InsertBeforeExtension(FilePath* path, const FilePath::StringType& suffix); | 111 void InsertBeforeExtension(FilePath* path, const FilePath::StringType& suffix); |
| 113 | 112 |
| 114 // Deprecated compatibility function. Use FilePath::ReplaceExtension. | 113 // Deprecated compatibility function. Use FilePath::ReplaceExtension. |
| 115 void ReplaceExtension(FilePath* file_name, | 114 void ReplaceExtension(FilePath* file_name, |
| 116 const FilePath::StringType& extension); | 115 const FilePath::StringType& extension); |
| 117 | 116 |
| 118 #if defined(OS_WIN) | 117 #if defined(OS_WIN) |
| 119 // Deprecated temporary compatibility functions. | 118 // Deprecated temporary compatibility functions. |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 461 | 460 |
| 462 // Renames a file using the SHFileOperation API to ensure that the target file | 461 // Renames a file using the SHFileOperation API to ensure that the target file |
| 463 // gets the correct default security descriptor in the new path. | 462 // gets the correct default security descriptor in the new path. |
| 464 bool RenameFileAndResetSecurityDescriptor( | 463 bool RenameFileAndResetSecurityDescriptor( |
| 465 const FilePath& source_file_path, | 464 const FilePath& source_file_path, |
| 466 const FilePath& target_file_path); | 465 const FilePath& target_file_path); |
| 467 | 466 |
| 468 } // namespace file_util | 467 } // namespace file_util |
| 469 | 468 |
| 470 #endif // BASE_FILE_UTIL_H_ | 469 #endif // BASE_FILE_UTIL_H_ |
| OLD | NEW |