MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / Explode

Function Explode

extern/re2/re2/testing/regexp_generator.cc:241–252  ·  view source on GitHub ↗

Split s into an vector of strings, one for each UTF-8 character.

Source from the content-addressed store, hash-verified

239
240// Split s into an vector of strings, one for each UTF-8 character.
241std::vector<std::string> Explode(const StringPiece& s) {
242 std::vector<std::string> v;
243
244 for (const char *q = s.data(); q < s.data() + s.size(); ) {
245 const char* p = q;
246 Rune r;
247 q += chartorune(&r, q);
248 v.push_back(std::string(p, q - p));
249 }
250
251 return v;
252}
253
254// Split string everywhere a substring is found, returning
255// vector of pieces.

Callers 7

TESTFunction · 0.85
SplitFunction · 0.85
TESTFunction · 0.85
TESTFunction · 0.85
RunTestFunction · 0.85
TESTFunction · 0.85
TESTFunction · 0.85

Calls 4

chartoruneFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by 6

TESTFunction · 0.68
TESTFunction · 0.68
TESTFunction · 0.68
RunTestFunction · 0.68
TESTFunction · 0.68
TESTFunction · 0.68