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

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

Issue 176843022: Move UTF16ToASCII, remove WideToASCII. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/command_line.cc ('k') | base/strings/string_util.h » ('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 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 #endif 626 #endif
627 } 627 }
628 628
629 #elif defined(OS_WIN) 629 #elif defined(OS_WIN)
630 string16 FilePath::LossyDisplayName() const { 630 string16 FilePath::LossyDisplayName() const {
631 return path_; 631 return path_;
632 } 632 }
633 633
634 std::string FilePath::MaybeAsASCII() const { 634 std::string FilePath::MaybeAsASCII() const {
635 if (IsStringASCII(path_)) 635 if (IsStringASCII(path_))
636 return WideToASCII(path_); 636 return UTF16ToASCII(path_);
637 return ""; 637 return std::string();
638 } 638 }
639 639
640 std::string FilePath::AsUTF8Unsafe() const { 640 std::string FilePath::AsUTF8Unsafe() const {
641 return WideToUTF8(value()); 641 return WideToUTF8(value());
642 } 642 }
643 643
644 string16 FilePath::AsUTF16Unsafe() const { 644 string16 FilePath::AsUTF16Unsafe() const {
645 return value(); 645 return value();
646 } 646 }
647 647
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 bool FilePath::IsContentUri() const { 1307 bool FilePath::IsContentUri() const {
1308 return StartsWithASCII(path_, "content://", false /*case_sensitive*/); 1308 return StartsWithASCII(path_, "content://", false /*case_sensitive*/);
1309 } 1309 }
1310 #endif 1310 #endif
1311 1311
1312 } // namespace base 1312 } // namespace base
1313 1313
1314 void PrintTo(const base::FilePath& path, std::ostream* out) { 1314 void PrintTo(const base::FilePath& path, std::ostream* out) {
1315 *out << path.value(); 1315 *out << path.value();
1316 } 1316 }
OLDNEW
« no previous file with comments | « base/command_line.cc ('k') | base/strings/string_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698