Lines Matching refs:str
14 template<typename STR>
15 static void SplitStringT(const STR& str,
16 const typename STR::value_type s,
18 std::vector<STR>* r) {
21 size_t c = str.size();
23 if (i == c || str[i] == s) {
25 STR tmp = str.substr(last, len);
27 STR t_tmp;
38 void SplitString(const std::wstring& str,
41 SplitStringT(str, c, true, r);
45 void SplitString(const string16& str,
49 SplitStringT(str, c, true, r);
53 void SplitString(const std::string& str,
57 SplitStringT(str, c, true, r);
122 template <typename STR>
123 static void SplitStringUsingSubstrT(const STR& str,
124 const STR& s,
125 std::vector<STR>* r) {
126 typename STR::size_type begin_index = 0;
128 const typename STR::size_type end_index = str.find(s, begin_index);
129 if (end_index == STR::npos) {
130 const STR term = str.substr(begin_index);
131 STR tmp;
136 const STR term = str.substr(begin_index, end_index - begin_index);
137 STR tmp;
144 void SplitStringUsingSubstr(const string16& str,
147 SplitStringUsingSubstrT(str, s, r);
150 void SplitStringUsingSubstr(const std::string& str,
153 SplitStringUsingSubstrT(str, s, r);
156 void SplitStringDontTrim(const string16& str,
160 SplitStringT(str, c, false, r);
163 void SplitStringDontTrim(const std::string& str,
166 DCHECK(IsStringUTF8(str));
168 SplitStringT(str, c, false, r);
171 template<typename STR>
172 void SplitStringAlongWhitespaceT(const STR& str, std::vector<STR>* result) {
173 const size_t length = str.length();
180 switch (str[i]) {
191 str.substr(last_non_ws_start, i - last_non_ws_start));
207 str.substr(last_non_ws_start, length - last_non_ws_start));
211 void SplitStringAlongWhitespace(const std::wstring& str,
213 SplitStringAlongWhitespaceT(str, result);
217 void SplitStringAlongWhitespace(const string16& str,
219 SplitStringAlongWhitespaceT(str, result);
223 void SplitStringAlongWhitespace(const std::string& str,
225 SplitStringAlongWhitespaceT(str, result);