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

Unified Diff: base/string_util.h

Issue 113996: Move a few functions commonly called with char* to StringPiece. (Closed)
Patch Set: Created 11 years, 7 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/string_util.h
diff --git a/base/string_util.h b/base/string_util.h
index f40cc8dc0056a6c07424442dc24434855aba4a93..b082078117ee126ae1a20d4231b74d933426bbc5 100644
--- a/base/string_util.h
+++ b/base/string_util.h
@@ -174,9 +174,9 @@ std::wstring CollapseWhitespace(const std::wstring& text,
// 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::wstring ASCIIToWide(const StringPiece& ascii);
std::string UTF16ToASCII(const string16& utf16);
-string16 ASCIIToUTF16(const std::string& ascii);
+string16 ASCIIToUTF16(const StringPiece& 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
@@ -252,7 +252,7 @@ bool IsString8Bit(const std::wstring& str);
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 StringPiece& str);
bool IsStringASCII(const string16& str);
// ASCII-specific tolower. The standard library's tolower is locale sensitive,
« base/file_path.h ('K') | « base/file_path.cc ('k') | base/string_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698