MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / SplitString

Function SplitString

rtpose_wrapper/src/gtest/gtest-all.cpp:7294–7309  ·  view source on GitHub ↗

Splits a given string on a given delimiter, populating a given vector with the fields. GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we can use it here.

Source from the content-addressed store, hash-verified

7292// vector with the fields. GTEST_HAS_DEATH_TEST implies that we have
7293// ::std::string, so we can use it here.
7294static void SplitString(const ::std::string& str, char delimiter,
7295 ::std::vector< ::std::string>* dest) {
7296 ::std::vector< ::std::string> parsed;
7297 ::std::string::size_type pos = 0;
7298 while (::testing::internal::AlwaysTrue()) {
7299 const ::std::string::size_type colon = str.find(delimiter, pos);
7300 if (colon == ::std::string::npos) {
7301 parsed.push_back(str.substr(pos));
7302 break;
7303 } else {
7304 parsed.push_back(str.substr(pos, colon - pos));
7305 pos = colon + 1;
7306 }
7307 }
7308 dest->swap(parsed);
7309}
7310
7311# if GTEST_OS_WINDOWS
7312// Recreates the pipe and event handles from the provided parameters,

Callers 1

Calls 1

AlwaysTrueFunction · 0.85

Tested by

no test coverage detected