MCPcopy Create free account
hub / github.com/DeNA/HandlerSocket-Plugin-for-MySQL / split_tmpl_vec

Function split_tmpl_vec

libhsclient/string_util.cpp:149–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149template <typename T, typename V> size_t
150split_tmpl_vec(char delim, const T& buf, V& parts)
151{
152 typedef typename T::value_type value_type;
153 size_t i = 0;
154 value_type *start = buf.begin();
155 value_type *const finish = buf.end();
156 while (true) {
157 value_type *const p = memchr_char(start, delim, finish - start);
158 if (p == 0) {
159 parts.push_back(T(start, finish - start));
160 break;
161 }
162 parts.push_back(T(start, p - start));
163 start = p + 1;
164 }
165 const size_t r = i;
166 return r;
167}
168
169size_t
170split(char delim, const string_ref& buf, std::vector<string_ref>& parts_r)

Callers 1

splitFunction · 0.85

Calls 3

memchr_charFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected