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

Side by Side Diff: base/file_path.h

Issue 2831029: Add a method for normalizing path separators on Windows. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: a few more Created 10 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 | « 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 297
298 // Static helper method to write a StringType to a pickle. 298 // Static helper method to write a StringType to a pickle.
299 static void WriteStringTypeToPickle(Pickle* pickle, 299 static void WriteStringTypeToPickle(Pickle* pickle,
300 const FilePath::StringType& path); 300 const FilePath::StringType& path);
301 static bool ReadStringTypeFromPickle(Pickle* pickle, void** iter, 301 static bool ReadStringTypeFromPickle(Pickle* pickle, void** iter,
302 FilePath::StringType* path); 302 FilePath::StringType* path);
303 303
304 void WriteToPickle(Pickle* pickle); 304 void WriteToPickle(Pickle* pickle);
305 bool ReadFromPickle(Pickle* pickle, void** iter); 305 bool ReadFromPickle(Pickle* pickle, void** iter);
306 306
307 #if defined(FILE_PATH_USES_WIN_SEPARATORS)
308 // Normalize all path separators to backslash.
309 FilePath NormalizeWindowsPathSeparators() const;
310 #endif
311
307 // Compare two strings in the same way the file system does. 312 // Compare two strings in the same way the file system does.
308 // Note that these always ignore case, even on file systems that are case- 313 // Note that these always ignore case, even on file systems that are case-
309 // sensitive. If case-sensitive comparison is ever needed, add corresponding 314 // sensitive. If case-sensitive comparison is ever needed, add corresponding
310 // methods here. 315 // methods here.
311 // The methods are written as a static method so that they can also be used 316 // The methods are written as a static method so that they can also be used
312 // on parts of a file path, e.g., just the extension. 317 // on parts of a file path, e.g., just the extension.
313 // CompareIgnoreCase() returns -1, 0 or 1 for less-than, equal-to and 318 // CompareIgnoreCase() returns -1, 0 or 1 for less-than, equal-to and
314 // greater-than respectively. 319 // greater-than respectively.
315 static int CompareIgnoreCase(const StringType& string1, 320 static int CompareIgnoreCase(const StringType& string1,
316 const StringType& string2); 321 const StringType& string2);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 namespace stdext { 379 namespace stdext {
375 380
376 inline size_t hash_value(const FilePath& f) { 381 inline size_t hash_value(const FilePath& f) {
377 return hash_value(f.value()); 382 return hash_value(f.value());
378 } 383 }
379 384
380 } // namespace stdext 385 } // namespace stdext
381 #endif // COMPILER 386 #endif // COMPILER
382 387
383 #endif // BASE_FILE_PATH_H_ 388 #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