From e8478ae4ef8bd1dbb83cd46e8af060d5331ba2df Mon Sep 17 00:00:00 2001 From: "tfarina@chromium.org" Date: Thu, 2 Sep 2010 02:01:48 +0000 Subject: base: Move SplitStringUsingSubstr functions from string_util.h to string_split.h BUG=None TEST=trybots Review URL: http://codereview.chromium.org/3284005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58300 0039d316-1c4b-4281-b951-d872f2087c98 --- base/string_util.cc | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'base/string_util.cc') diff --git a/base/string_util.cc b/base/string_util.cc index 56aa39d..a7f5258 100644 --- a/base/string_util.cc +++ b/base/string_util.cc @@ -821,40 +821,6 @@ void SplitStringDontTrim(const std::string& str, SplitStringT(str, s, false, r); } -template -static void SplitStringUsingSubstrT(const STR& str, - const STR& s, - std::vector* r) { - typename STR::size_type begin_index = 0; - while (true) { - const typename STR::size_type end_index = str.find(s, begin_index); - if (end_index == STR::npos) { - const STR term = str.substr(begin_index); - STR tmp; - TrimWhitespace(term, TRIM_ALL, &tmp); - r->push_back(tmp); - return; - } - const STR term = str.substr(begin_index, end_index - begin_index); - STR tmp; - TrimWhitespace(term, TRIM_ALL, &tmp); - r->push_back(tmp); - begin_index = end_index + s.size(); - } -} - -void SplitStringUsingSubstr(const string16& str, - const string16& s, - std::vector* r) { - SplitStringUsingSubstrT(str, s, r); -} - -void SplitStringUsingSubstr(const std::string& str, - const std::string& s, - std::vector* r) { - SplitStringUsingSubstrT(str, s, r); -} - template static size_t TokenizeT(const STR& str, const STR& delimiters, -- cgit v1.1