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

Unified Diff: base/file_path.h

Issue 8402008: Add FilePath::FromUTF8Unsafe() and FilePath::AsUTF8Unsafe(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/file_path.cc » ('j') | base/file_path_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_path.h
diff --git a/base/file_path.h b/base/file_path.h
index 639683356eea970980cdc65cd1438b944289795b..a6708e6a22afbe9737d0089e052e0e0345e1e384 100644
--- a/base/file_path.h
+++ b/base/file_path.h
@@ -294,6 +294,9 @@ class BASE_EXPORT FilePath {
// known-ASCII filename.
std::string MaybeAsASCII() const;
+ // Return the path as UTF-8.
+ std::string AsUTF8() const;
+
// Older Chromium code assumes that paths are always wstrings.
// This function converts wstrings to FilePaths, and is
// useful to smooth porting that old code to the FilePath API.
@@ -312,6 +315,9 @@ class BASE_EXPORT FilePath {
// ever use the result of that again as a path.
static FilePath FromWStringHack(const std::wstring& wstring);
+ // Returns a FilePath object from a path name in UTF-8.
+ static FilePath FromUTF8(const std::string& utf8);
+
void WriteToPickle(Pickle* pickle);
bool ReadFromPickle(Pickle* pickle, void** iter);
« no previous file with comments | « no previous file | base/file_path.cc » ('j') | base/file_path_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698