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

Unified Diff: base/string_util.cc

Issue 3447008: base: Finish moving the SplitString functions from string_util.h to string_split.h (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: chromeos fixes Created 10 years, 3 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.h ('k') | base/string_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/string_util.cc
diff --git a/base/string_util.cc b/base/string_util.cc
index ba9108bb8cbb2035d4db43fef87d476620914ccc..c30db96a32ef7c9ab2fe123ae542b3ea134a1dda 100644
--- a/base/string_util.cc
+++ b/base/string_util.cc
@@ -757,51 +757,6 @@ void ReplaceSubstringsAfterOffset(std::string* str,
true); // replace all instances
}
-// TODO(tfarina): Remove this when finish moving SplitString functions to
-// string_split.[cc/h].
-template<typename STR>
-static void SplitStringT(const STR& str,
- const typename STR::value_type s,
- bool trim_whitespace,
- std::vector<STR>* r) {
- size_t last = 0;
- size_t i;
- size_t c = str.size();
- for (i = 0; i <= c; ++i) {
- if (i == c || str[i] == s) {
- size_t len = i - last;
- STR tmp = str.substr(last, len);
- if (trim_whitespace) {
- STR t_tmp;
- TrimWhitespace(tmp, TRIM_ALL, &t_tmp);
- r->push_back(t_tmp);
- } else {
- r->push_back(tmp);
- }
- last = i + 1;
- }
- }
-}
-
-void SplitString(const std::wstring& str,
- wchar_t s,
- std::vector<std::wstring>* r) {
- SplitStringT(str, s, true, r);
-}
-
-#if !defined(WCHAR_T_IS_UTF16)
-void SplitString(const string16& str,
- char16 s,
- std::vector<string16>* r) {
- SplitStringT(str, s, true, r);
-}
-#endif
-
-void SplitString(const std::string& str,
- char s,
- std::vector<std::string>* r) {
- SplitStringT(str, s, true, r);
-}
template<typename STR>
static size_t TokenizeT(const STR& str,
« no previous file with comments | « base/string_util.h ('k') | base/string_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698