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

Side by Side Diff: base/files/file_path.h

Issue 1372153002: Detecting and fixing stringprintf.h format bugs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing one more bug Created 5 years, 2 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/memory/shared_memory_win.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 // An abstraction to isolate users from the differences between native 132 // An abstraction to isolate users from the differences between native
133 // pathnames on different platforms. 133 // pathnames on different platforms.
134 class BASE_EXPORT FilePath { 134 class BASE_EXPORT FilePath {
135 public: 135 public:
136 #if defined(OS_POSIX) 136 #if defined(OS_POSIX)
137 // On most platforms, native pathnames are char arrays, and the encoding 137 // On most platforms, native pathnames are char arrays, and the encoding
138 // may or may not be specified. On Mac OS X, native pathnames are encoded 138 // may or may not be specified. On Mac OS X, native pathnames are encoded
139 // in UTF-8. 139 // in UTF-8.
140 typedef std::string StringType; 140 typedef std::string StringType;
141 #define PRIsFP "s"
Lei Zhang 2015/09/30 18:35:01 You should move these into their own section with
141 #elif defined(OS_WIN) 142 #elif defined(OS_WIN)
142 // On Windows, for Unicode-aware applications, native pathnames are wchar_t 143 // On Windows, for Unicode-aware applications, native pathnames are wchar_t
143 // arrays encoded in UTF-16. 144 // arrays encoded in UTF-16.
144 typedef std::wstring StringType; 145 typedef std::wstring StringType;
146 #define PRIsFP "ls"
145 #endif // OS_WIN 147 #endif // OS_WIN
146 148
147 typedef BasicStringPiece<StringType> StringPieceType; 149 typedef BasicStringPiece<StringType> StringPieceType;
148 typedef StringType::value_type CharType; 150 typedef StringType::value_type CharType;
149 151
150 // Null-terminated array of separators used to separate components in 152 // Null-terminated array of separators used to separate components in
151 // hierarchical paths. Each character in this array is a valid separator, 153 // hierarchical paths. Each character in this array is a valid separator,
152 // but kSeparators[0] is treated as the canonical separator and will be used 154 // but kSeparators[0] is treated as the canonical separator and will be used
153 // when composing pathnames. 155 // when composing pathnames.
154 static const CharType kSeparators[]; 156 static const CharType kSeparators[];
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 template<> 460 template<>
459 struct hash<base::FilePath> { 461 struct hash<base::FilePath> {
460 size_t operator()(const base::FilePath& f) const { 462 size_t operator()(const base::FilePath& f) const {
461 return hash<base::FilePath::StringType>()(f.value()); 463 return hash<base::FilePath::StringType>()(f.value());
462 } 464 }
463 }; 465 };
464 466
465 } // namespace BASE_HASH_NAMESPACE 467 } // namespace BASE_HASH_NAMESPACE
466 468
467 #endif // BASE_FILES_FILE_PATH_H_ 469 #endif // BASE_FILES_FILE_PATH_H_
OLDNEW
« no previous file with comments | « no previous file | base/memory/shared_memory_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698