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

Unified Diff: base/files/file_path.h

Issue 17509002: Add FilePath::{As,From}UTF16Unsafe (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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/files/file_path.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_path.h
diff --git a/base/files/file_path.h b/base/files/file_path.h
index 0fb2285b690d4edb2fda412c61a13a89c954dc54..8b69ea493a141672aecfe72afec2486b047dcae4 100644
--- a/base/files/file_path.h
+++ b/base/files/file_path.h
@@ -329,6 +329,9 @@ class BASE_EXPORT FilePath {
// with "Unsafe" in the function name.
std::string AsUTF8Unsafe() const;
+ // Similar to AsUTF8Unsafe, but returns UTF-16 instead.
+ string16 AsUTF16Unsafe() 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.
@@ -357,6 +360,9 @@ class BASE_EXPORT FilePath {
// AsUTF8Unsafe() for details.
static FilePath FromUTF8Unsafe(const std::string& utf8);
+ // Similar to FromUTF8Unsafe, but accepts UTF-16 instead.
+ static FilePath FromUTF16Unsafe(const string16& utf16);
+
void WriteToPickle(Pickle* pickle) const;
bool ReadFromPickle(PickleIterator* iter);
« no previous file with comments | « no previous file | base/files/file_path.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698