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

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

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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_util_unittest.cc ('k') | base/i18n/char_iterator_unittest.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 #include "base/files/file_path.h" 5 #include "base/files/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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 // See file_path.h for a discussion of the encoding of paths on POSIX 545 // See file_path.h for a discussion of the encoding of paths on POSIX
546 // platforms. These encoding conversion functions are not quite correct. 546 // platforms. These encoding conversion functions are not quite correct.
547 547
548 string16 FilePath::LossyDisplayName() const { 548 string16 FilePath::LossyDisplayName() const {
549 return WideToUTF16(SysNativeMBToWide(path_)); 549 return WideToUTF16(SysNativeMBToWide(path_));
550 } 550 }
551 551
552 std::string FilePath::MaybeAsASCII() const { 552 std::string FilePath::MaybeAsASCII() const {
553 if (IsStringASCII(path_)) 553 if (IsStringASCII(path_))
554 return path_; 554 return path_;
555 return ""; 555 return std::string();
556 } 556 }
557 557
558 std::string FilePath::AsUTF8Unsafe() const { 558 std::string FilePath::AsUTF8Unsafe() const {
559 #if defined(OS_MACOSX) || defined(OS_CHROMEOS) 559 #if defined(OS_MACOSX) || defined(OS_CHROMEOS)
560 return value(); 560 return value();
561 #else 561 #else
562 return WideToUTF8(SysNativeMBToWide(value())); 562 return WideToUTF8(SysNativeMBToWide(value()));
563 #endif 563 #endif
564 } 564 }
565 565
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
1251 #else 1251 #else
1252 return *this; 1252 return *this;
1253 #endif 1253 #endif
1254 } 1254 }
1255 1255
1256 } // namespace base 1256 } // namespace base
1257 1257
1258 void PrintTo(const base::FilePath& path, std::ostream* out) { 1258 void PrintTo(const base::FilePath& path, std::ostream* out) {
1259 *out << path.value(); 1259 *out << path.value();
1260 } 1260 }
OLDNEW
« no previous file with comments | « base/file_util_unittest.cc ('k') | base/i18n/char_iterator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698