Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: base/file_util.h

Issue 145026: Move PathComponents from file_util to FilePath, add FilePath::IsParent() (Closed)
Patch Set: noop Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/file_path_unittest.cc ('k') | base/file_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 20 matching lines...) Expand all
31 31
32 namespace base { 32 namespace base {
33 class Time; 33 class Time;
34 } 34 }
35 35
36 namespace file_util { 36 namespace file_util {
37 37
38 //----------------------------------------------------------------------------- 38 //-----------------------------------------------------------------------------
39 // Functions that operate purely on a path string w/o touching the filesystem: 39 // Functions that operate purely on a path string w/o touching the filesystem:
40 40
41 // Returns a vector of all of the components of the provided path.
42 void PathComponents(const FilePath& path,
43 std::vector<FilePath::StringType>* components);
44
45 // Returns true if the given path ends with a path separator character. 41 // Returns true if the given path ends with a path separator character.
46 bool EndsWithSeparator(const FilePath& path); 42 bool EndsWithSeparator(const FilePath& path);
47 // These two versions are both deprecated. TODO(estade): remove them. 43 // These two versions are both deprecated. TODO(estade): remove them.
48 bool EndsWithSeparator(std::wstring* path); 44 bool EndsWithSeparator(std::wstring* path);
49 bool EndsWithSeparator(const std::wstring& path); 45 bool EndsWithSeparator(const std::wstring& path);
50 46
51 // Makes sure that |path| ends with a separator IFF path is a directory that 47 // Makes sure that |path| ends with a separator IFF path is a directory that
52 // exists. Returns true if |path| is an existing directory, false otherwise. 48 // exists. Returns true if |path| is an existing directory, false otherwise.
53 bool EnsureEndsWithSeparator(FilePath* path); 49 bool EnsureEndsWithSeparator(FilePath* path);
54 50
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 521
526 // Renames a file using the SHFileOperation API to ensure that the target file 522 // Renames a file using the SHFileOperation API to ensure that the target file
527 // gets the correct default security descriptor in the new path. 523 // gets the correct default security descriptor in the new path.
528 bool RenameFileAndResetSecurityDescriptor( 524 bool RenameFileAndResetSecurityDescriptor(
529 const FilePath& source_file_path, 525 const FilePath& source_file_path,
530 const FilePath& target_file_path); 526 const FilePath& target_file_path);
531 527
532 } // namespace file_util 528 } // namespace file_util
533 529
534 #endif // BASE_FILE_UTIL_H_ 530 #endif // BASE_FILE_UTIL_H_
OLDNEW
« no previous file with comments | « base/file_path_unittest.cc ('k') | base/file_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698