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

Unified Diff: base/file_path.cc

Issue 6597075: FilePath: add a convertor to ASCII (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: base/file_path.cc
diff --git a/base/file_path.cc b/base/file_path.cc
index 5f1375adb5b8e9c98942bc69a474a8761d7682bb..907a4124b6a428845565a5f51aa687506c3b7bb3 100644
--- a/base/file_path.cc
+++ b/base/file_path.cc
@@ -520,6 +520,12 @@ string16 FilePath::LossyDisplayName() const {
return WideToUTF16(base::SysNativeMBToWide(path_));
}
+std::string FilePath::MaybeAsASCII() const {
+ if (IsStringASCII(path_))
+ return path_;
+ return "";
+}
+
// The *Hack functions are temporary while we fix the remainder of the code.
// Remember to remove the #includes at the top when you remove these.
@@ -535,6 +541,12 @@ string16 FilePath::LossyDisplayName() const {
return path_;
}
+std::string FilePath::MaybeAsASCII() const {
+ if (IsStringASCII(path_))
+ return WideToASCII(path_);
+ return "";
+}
+
// static
FilePath FilePath::FromWStringHack(const std::wstring& wstring) {
return FilePath(wstring);
« base/file_path.h ('K') | « base/file_path.h ('k') | chrome/browser/spellcheck_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698