| 44 | } |
| 45 | |
| 46 | int64_t parse_int64(const std::string & text, size_t & pos) { |
| 47 | skip_ws(text, pos); |
| 48 | size_t end = pos; |
| 49 | while (end < text.size() && (std::isdigit(static_cast<unsigned char>(text[end])) != 0 || text[end] == '-')) { |
| 50 | ++end; |
| 51 | } |
| 52 | if (end == pos) { |
| 53 | throw std::runtime_error("expected integer"); |
| 54 | } |
| 55 | const auto value = std::stoll(text.substr(pos, end - pos)); |
| 56 | pos = end; |
| 57 | return value; |
| 58 | } |
| 59 | |
| 60 | std::vector<int64_t> parse_int_array(const std::string & text, size_t & pos) { |
| 61 | skip_ws(text, pos); |
no test coverage detected