MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / SplitString

Function SplitString

source/test/gtest/src/gtest.cc:1233–1248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1231#endif // GTEST_HAS_STD_WSTRING
1232
1233void SplitString(const ::std::string& str, char delimiter,
1234 ::std::vector< ::std::string>* dest) {
1235 ::std::vector< ::std::string> parsed;
1236 ::std::string::size_type pos = 0;
1237 while (::testing::internal::AlwaysTrue()) {
1238 const ::std::string::size_type colon = str.find(delimiter, pos);
1239 if (colon == ::std::string::npos) {
1240 parsed.push_back(str.substr(pos));
1241 break;
1242 } else {
1243 parsed.push_back(str.substr(pos, colon - pos));
1244 pos = colon + 1;
1245 }
1246 }
1247 dest->swap(parsed);
1248}
1249
1250} // namespace internal
1251

Callers 4

UnitTestFilterMethod · 0.85
LoadFlagsFromFileFunction · 0.85

Calls 5

AlwaysTrueFunction · 0.85
findMethod · 0.45
push_backMethod · 0.45
substrMethod · 0.45
swapMethod · 0.45

Tested by

no test coverage detected