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

Unified Diff: base/strings/string_util.cc

Issue 102843002: Move RemoveChars, ReplaceChars, TrimString, and TruncateUTF8ToByteSize to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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/strings/string_util.cc
diff --git a/base/strings/string_util.cc b/base/strings/string_util.cc
index 1d85de8ebbd70c1cfff02e5e60e2770d8bb4ca05..cee124b0c1a43e61b00fe94aa9676e84f72fc483 100644
--- a/base/strings/string_util.cc
+++ b/base/strings/string_util.cc
@@ -116,8 +116,6 @@ const string16& EmptyString16() {
return EmptyStrings::GetInstance()->s16;
}
-} // namespace base
-
template<typename STR>
bool ReplaceCharsT(const STR& input,
const typename STR::value_type replace_chars[],
@@ -230,8 +228,8 @@ void TruncateUTF8ToByteSize(const std::string& input,
int32 prev = char_index;
uint32 code_point = 0;
CBU8_NEXT(data, char_index, truncation_length, code_point);
- if (!base::IsValidCharacter(code_point) ||
- !base::IsValidCodepoint(code_point)) {
+ if (!IsValidCharacter(code_point) ||
+ !IsValidCodepoint(code_point)) {
char_index = prev - 1;
} else {
break;
@@ -244,16 +242,18 @@ void TruncateUTF8ToByteSize(const std::string& input,
output->clear();
}
+} // namespace base
+
TrimPositions TrimWhitespace(const base::string16& input,
TrimPositions positions,
base::string16* output) {
- return TrimStringT(input, base::kWhitespaceUTF16, positions, output);
+ return base::TrimStringT(input, base::kWhitespaceUTF16, positions, output);
}
TrimPositions TrimWhitespaceASCII(const std::string& input,
TrimPositions positions,
std::string* output) {
- return TrimStringT(input, base::kWhitespaceASCII, positions, output);
+ return base::TrimStringT(input, base::kWhitespaceASCII, positions, output);
}
// This function is only for backward-compatibility.

Powered by Google App Engine
This is Rietveld 408576698