Home | History | Annotate | Download | only in strings

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) {
24 STR tmp(str, last, i - last);
36 void SplitString(const string16& str,
40 SplitStringT(str, c, true, r);
43 void SplitString(const std::string& str,
50 SplitStringT(str, c, true, r);
115 template <typename STR>
116 static void SplitStringUsingSubstrT(const STR& str,
117 const STR& s,
118 std::vector<STR>* r) {
120 typename STR::size_type begin_index = 0;
122 const typename STR::size_type end_index = str.find(s, begin_index);
123 if (end_index == STR::npos) {
124 const STR term = str.substr(begin_index);
125 STR tmp;
130 const STR term = str.substr(begin_index, end_index - begin_index);
131 STR tmp;
138 void SplitStringUsingSubstr(const string16& str,
141 SplitStringUsingSubstrT(str, s, r);
144 void SplitStringUsingSubstr(const std::string& str,
147 SplitStringUsingSubstrT(str, s, r);
150 void SplitStringDontTrim(const string16& str,
154 SplitStringT(str, c, false, r);
157 void SplitStringDontTrim(const std::string& str,
160 DCHECK(IsStringUTF8(str));
165 SplitStringT(str, c, false, r);
168 template<typename STR>
169 void SplitStringAlongWhitespaceT(const STR& str, std::vector<STR>* result) {
171 const size_t length = str.length();
178 switch (str[i]) {
189 str.substr(last_non_ws_start, i - last_non_ws_start));
205 str.substr(last_non_ws_start, length - last_non_ws_start));
209 void SplitStringAlongWhitespace(const string16& str,
211 SplitStringAlongWhitespaceT(str, result);
214 void SplitStringAlongWhitespace(const std::string& str,
216 SplitStringAlongWhitespaceT(str, result);