| 23 | } |
| 24 | |
| 25 | float parse_float_value(const std::string & value, std::string_view key) { |
| 26 | size_t parsed = 0; |
| 27 | const float out = std::stof(value, &parsed); |
| 28 | if (parsed != value.size()) { |
| 29 | throw std::runtime_error(std::string(key) + " must be a float"); |
| 30 | } |
| 31 | return out; |
| 32 | } |
| 33 | |
| 34 | uint32_t parse_u32_value(const std::string & value, std::string_view key) { |
| 35 | if (!value.empty() && value.front() == '-') { |
no test coverage detected