| 9 | using ordered_json = nlohmann::ordered_json; |
| 10 | |
| 11 | static std::string_view trim_trailing_space(std::string_view sv, int max = -1) { |
| 12 | int count = 0; |
| 13 | while (!sv.empty() && std::isspace(static_cast<unsigned char>(sv.back()))) { |
| 14 | if (max != -1 && count >= max) { |
| 15 | break; |
| 16 | } |
| 17 | sv.remove_suffix(1); |
| 18 | count++; |
| 19 | } |
| 20 | return sv; |
| 21 | } |
| 22 | |
| 23 | static std::string_view trim_leading_space(std::string_view sv, int max = -1) { |
| 24 | int count = 0; |