| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |