summaryrefslogtreecommitdiffstats
path: root/base/string_util.h
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-26 18:51:00 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-26 18:51:00 +0000
commitd9d709e0f019bfb0e65936ff98a696848830713a (patch)
tree4a3f85490afe2b445ca58105d9cfc682847d1eda /base/string_util.h
parentf255c7fcfda1c1b883ba9088224cae71954e1f9f (diff)
downloadchromium_src-d9d709e0f019bfb0e65936ff98a696848830713a.zip
chromium_src-d9d709e0f019bfb0e65936ff98a696848830713a.tar.gz
chromium_src-d9d709e0f019bfb0e65936ff98a696848830713a.tar.bz2
ASCII <-> UTF16 conversion functions. These are just copies of WideToASCII and
ASCIIToWide but they work with string16 instead of wstring. R=brettw Review URL: http://codereview.chromium.org/28189 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10493 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/string_util.h')
-rw-r--r--base/string_util.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/base/string_util.h b/base/string_util.h
index 500a114..93b4898 100644
--- a/base/string_util.h
+++ b/base/string_util.h
@@ -156,9 +156,11 @@ TrimPositions TrimWhitespace(const std::string& input,
std::wstring CollapseWhitespace(const std::wstring& text,
bool trim_sequences_with_line_breaks);
-// These convert between ASCII (7-bit) and UTF16 strings.
+// These convert between ASCII (7-bit) and Wide/UTF16 strings.
std::string WideToASCII(const std::wstring& wide);
std::wstring ASCIIToWide(const std::string& ascii);
+std::string UTF16ToASCII(const string16& utf16);
+string16 ASCIIToUTF16(const std::string& ascii);
// These convert between UTF-8, -16, and -32 strings. They are potentially slow,
// so avoid unnecessary conversions. The low-level versions return a boolean
@@ -235,6 +237,7 @@ bool IsStringUTF8(const std::string& str);
bool IsStringWideUTF8(const std::wstring& str);
bool IsStringASCII(const std::wstring& str);
bool IsStringASCII(const std::string& str);
+bool IsStringASCII(const string16& str);
// ASCII-specific tolower. The standard library's tolower is locale sensitive,
// so we don't want to use it here.