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

Unified Diff: base/strings/string_util.cc

Issue 270183002: Move IsStringUTF8/ASCII to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more minor nit Created 6 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
« no previous file with comments | « base/strings/string_util.h ('k') | chrome/app/chrome_main_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/strings/string_util.cc
diff --git a/base/strings/string_util.cc b/base/strings/string_util.cc
index e514ac1a6327416925969dd78ad5a730663ab2ea..0adb98959fc0ea335e4bcb2bd408709455441627 100644
--- a/base/strings/string_util.cc
+++ b/base/strings/string_util.cc
@@ -324,8 +324,6 @@ bool ContainsOnlyChars(const StringPiece16& input,
return input.find_first_not_of(characters) == StringPiece16::npos;
}
-} // namespace base
-
template<class STR>
static bool DoIsStringASCII(const STR& str) {
for (size_t i = 0; i < str.length(); i++) {
@@ -336,11 +334,11 @@ static bool DoIsStringASCII(const STR& str) {
return true;
}
-bool IsStringASCII(const base::StringPiece& str) {
+bool IsStringASCII(const StringPiece& str) {
return DoIsStringASCII(str);
}
-bool IsStringASCII(const base::string16& str) {
+bool IsStringASCII(const string16& str) {
return DoIsStringASCII(str);
}
@@ -352,12 +350,14 @@ bool IsStringUTF8(const std::string& str) {
while (char_index < src_len) {
int32 code_point;
CBU8_NEXT(src, char_index, src_len, code_point);
- if (!base::IsValidCharacter(code_point))
+ if (!IsValidCharacter(code_point))
return false;
}
return true;
}
+} // namespace base
+
template<typename Iter>
static inline bool DoLowerCaseEqualsASCII(Iter a_begin,
Iter a_end,
« no previous file with comments | « base/strings/string_util.h ('k') | chrome/app/chrome_main_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698