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.
| 8136 | // vector with the fields. GTEST_HAS_DEATH_TEST implies that we have |
| 8137 | // ::std::string, so we can use it here. |
| 8138 | static void SplitString(const ::std::string& str, char delimiter, |
| 8139 | ::std::vector< ::std::string>* dest) { |
| 8140 | ::std::vector< ::std::string> parsed; |
| 8141 | ::std::string::size_type pos = 0; |
| 8142 | while (::testing::internal::AlwaysTrue()) { |
| 8143 | const ::std::string::size_type colon = str.find(delimiter, pos); |
| 8144 | if (colon == ::std::string::npos) { |
| 8145 | parsed.push_back(str.substr(pos)); |
| 8146 | break; |
| 8147 | } else { |
| 8148 | parsed.push_back(str.substr(pos, colon - pos)); |
| 8149 | pos = colon + 1; |
| 8150 | } |
| 8151 | } |
| 8152 | dest->swap(parsed); |
| 8153 | } |
| 8154 | |
| 8155 | # if GTEST_OS_WINDOWS |
| 8156 | // Recreates the pipe and event handles from the provided parameters, |
no test coverage detected