| 54 | } |
| 55 | |
| 56 | static void strsplit(std::string_view line, std::vector<std::string_view> &tokens, char delim, std::size_t limit = 0) |
| 57 | { |
| 58 | size_t count = 1, pos; |
| 59 | while ((pos = line.find (delim)) != line.npos) |
| 60 | { |
| 61 | count++; |
| 62 | if (limit > 0 && count >= limit) delim = '\n'; // reset delimiter |
| 63 | tokens.push_back (line.substr (0, pos)); |
| 64 | line = line.substr (pos + 1); |
| 65 | } |
| 66 | if (!line.empty ()) tokens.push_back (line); |
| 67 | } |
| 68 | |
| 69 | static std::pair<std::string, std::string> parse_header_line(std::string_view line) |
| 70 | { |
no test coverage detected