| 163 | using Matrix = Eigen::Matrix<double, Dynamic, Dynamic, RowMajor>; |
| 164 | |
| 165 | void SplitStringUsingChar(const std::string& full, |
| 166 | const char delim, |
| 167 | std::vector<std::string>* result) { |
| 168 | std::back_insert_iterator<std::vector<std::string>> it(*result); |
| 169 | |
| 170 | const char* p = full.data(); |
| 171 | const char* end = p + full.size(); |
| 172 | while (p != end) { |
| 173 | if (*p == delim) { |
| 174 | ++p; |
| 175 | } else { |
| 176 | const char* start = p; |
| 177 | while (++p != end && *p != delim) { |
| 178 | // Skip to the next occurrence of the delimiter. |
| 179 | } |
| 180 | *it++ = std::string(start, p - start); |
| 181 | } |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | bool GetAndSplitLine(std::ifstream& ifs, std::vector<std::string>* pieces) { |
| 186 | pieces->clear(); |
no test coverage detected