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

Unified Diff: base/utf_string_conversions.h

Issue 3076013: Move ASCIIToWide and ASCIIToUTF16 to utf_string_conversions.h. I've found it... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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 | « base/string_util.cc ('k') | base/utf_string_conversions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/utf_string_conversions.h
===================================================================
--- base/utf_string_conversions.h (revision 54020)
+++ base/utf_string_conversions.h (working copy)
@@ -48,4 +48,18 @@
# define UTF16ToWideHack UTF16ToWide
#endif
+// These convert an ASCII string, typically a hardcoded constant, to a
+// UTF16/Wide string.
+//
+// Note that this doesn't use StringPiece because it's very common to need
+// ASCIIToUTF16("foo"), and either we have to include it in this file, or
+// forward declare it and force all callers to include string_piece.h. Given
+// that string_piece brings in complicated stuff like <algorithm>, it's
+// easier to just duplicate these very simple definitions for the two calling
+// cases we actually use.
+std::wstring ASCIIToWide(const char* ascii);
+std::wstring ASCIIToWide(const std::string& ascii);
+string16 ASCIIToUTF16(const char* ascii);
+string16 ASCIIToUTF16(const std::string& ascii);
+
#endif // BASE_UTF_STRING_CONVERSIONS_H_
« no previous file with comments | « base/string_util.cc ('k') | base/utf_string_conversions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698