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

Side by Side Diff: base/file_path.h

Issue 16252: Reverting 7423. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/file_path.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) 2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 // FilePath is a container for pathnames stored in a platform's native string 5 // FilePath is a container for pathnames stored in a platform's native string
6 // type, providing containers for manipulation in according with the 6 // type, providing containers for manipulation in according with the
7 // platform's conventions for pathnames. It supports the following path 7 // platform's conventions for pathnames. It supports the following path
8 // types: 8 // types:
9 // 9 //
10 // POSIX Windows 10 // POSIX Windows
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 return path_ == that.path_; 125 return path_ == that.path_;
126 } 126 }
127 127
128 // Required for some STL containers and operations 128 // Required for some STL containers and operations
129 bool operator<(const FilePath& that) const { 129 bool operator<(const FilePath& that) const {
130 return path_ < that.path_; 130 return path_ < that.path_;
131 } 131 }
132 132
133 const StringType& value() const { return path_; } 133 const StringType& value() const { return path_; }
134 134
135 // Returns value() encoded as a UTF8 std::string. Be careful to not use this
136 // in places that use filesystem APIs as it won't be portable.
137 const std::string UTF8Value() const;
138
139 // Returns true if |character| is in kSeparators. 135 // Returns true if |character| is in kSeparators.
140 static bool IsSeparator(CharType character); 136 static bool IsSeparator(CharType character);
141 137
142 // Returns a FilePath corresponding to the directory containing the path 138 // Returns a FilePath corresponding to the directory containing the path
143 // named by this object, stripping away the file component. If this object 139 // named by this object, stripping away the file component. If this object
144 // only contains one component, returns a FilePath identifying 140 // only contains one component, returns a FilePath identifying
145 // kCurrentDirectory. If this object already refers to the root directory, 141 // kCurrentDirectory. If this object already refers to the root directory,
146 // returns a FilePath identifying the root directory. 142 // returns a FilePath identifying the root directory.
147 FilePath DirName() const; 143 FilePath DirName() const;
148 144
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 struct hash<FilePath> { 212 struct hash<FilePath> {
217 size_t operator()(const FilePath& f) const { 213 size_t operator()(const FilePath& f) const {
218 return std::tr1::hash<FilePath::StringType>()(f.value()); 214 return std::tr1::hash<FilePath::StringType>()(f.value());
219 } 215 }
220 }; 216 };
221 217
222 } // namespace __gnu_cxx 218 } // namespace __gnu_cxx
223 #endif // defined(COMPILER_GCC) 219 #endif // defined(COMPILER_GCC)
224 220
225 #endif // BASE_FILE_PATH_H_ 221 #endif // BASE_FILE_PATH_H_
OLDNEW
« no previous file with comments | « no previous file | base/file_path.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698