MCPcopy Create free account
hub / github.com/cpputest/cpputest / split

Method split

src/CppUTest/SimpleString.cpp:366–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364}
365
366void SimpleString::split(const SimpleString& delimiter, SimpleStringCollection& col) const
367{
368 size_t num = count(delimiter);
369 size_t extraEndToken = (endsWith(delimiter)) ? 0 : 1U;
370 col.allocate(num + extraEndToken);
371
372 const char* str = getBuffer();
373 const char* prev;
374 for (size_t i = 0; i < num; ++i) {
375 prev = str;
376 str = StrStr(str, delimiter.getBuffer()) + 1;
377 col[i] = SimpleString(prev).subString(0, size_t (str - prev));
378 }
379 if (extraEndToken) {
380 col[num] = str;
381 }
382}
383
384void SimpleString::replace(char to, char with)
385{

Callers 7

addGroupDotNameFilterMethod · 0.80
get_test_groupMethod · 0.80
get_test_groupsMethod · 0.80
TESTFunction · 0.80
lineMethod · 0.80
amountOfLinesMethod · 0.80
TESTFunction · 0.80

Calls 4

SimpleStringClass · 0.85
allocateMethod · 0.80
getBufferMethod · 0.80
subStringMethod · 0.80

Tested by 6

get_test_groupMethod · 0.64
get_test_groupsMethod · 0.64
TESTFunction · 0.64
lineMethod · 0.64
amountOfLinesMethod · 0.64
TESTFunction · 0.64