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.
| 7292 | // vector with the fields. GTEST_HAS_DEATH_TEST implies that we have |
| 7293 | // ::std::string, so we can use it here. |
| 7294 | static 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, |
no test coverage detected