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

Side by Side Diff: base/file_path.cc

Issue 10984028: PrintTo for FilePath -- Pretty-print when comparing FilePaths in gtest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « base/file_path.h ('k') | no next file » | 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 #include "base/file_path.h" 5 #include "base/file_path.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 #include <algorithm> 8 #include <algorithm>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1225 #if defined(FILE_PATH_USES_WIN_SEPARATORS) 1225 #if defined(FILE_PATH_USES_WIN_SEPARATORS)
1226 StringType copy = path_; 1226 StringType copy = path_;
1227 for (size_t i = 1; i < arraysize(kSeparators); ++i) { 1227 for (size_t i = 1; i < arraysize(kSeparators); ++i) {
1228 std::replace(copy.begin(), copy.end(), kSeparators[i], kSeparators[0]); 1228 std::replace(copy.begin(), copy.end(), kSeparators[i], kSeparators[0]);
1229 } 1229 }
1230 return FilePath(copy); 1230 return FilePath(copy);
1231 #else 1231 #else
1232 return *this; 1232 return *this;
1233 #endif 1233 #endif
1234 } 1234 }
1235
1236 void PrintTo(const FilePath& path, std::ostream* out) {
1237 *out << path.value();
1238 }
OLDNEW
« no previous file with comments | « base/file_path.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698