| 330 | } |
| 331 | |
| 332 | void parse_comma_separated_string(std::string const& in, std::vector<std::string>& out) |
| 333 | { |
| 334 | out.clear(); |
| 335 | |
| 336 | std::string::size_type start = 0; |
| 337 | std::string::size_type end = 0; |
| 338 | |
| 339 | while (start < in.size()) |
| 340 | { |
| 341 | // skip leading spaces |
| 342 | while (start < in.size() |
| 343 | && is_space(in[start])) |
| 344 | ++start; |
| 345 | |
| 346 | end = in.find_first_of(',', start); |
| 347 | if (end == std::string::npos) end = in.size(); |
| 348 | |
| 349 | // skip trailing spaces |
| 350 | std::string::size_type soft_end = end; |
| 351 | while (soft_end > start |
| 352 | && is_space(in[soft_end - 1])) |
| 353 | --soft_end; |
| 354 | |
| 355 | out.push_back(in.substr(start, soft_end - start)); |
| 356 | start = end + 1; |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | std::pair<string_view, string_view> split_string(string_view last, char const sep) |
| 361 | { |