| 136 | } |
| 137 | |
| 138 | std::optional<float> parse_finite_float_option( |
| 139 | const std::unordered_map<std::string, std::string> & options, |
| 140 | std::initializer_list<std::string_view> keys) { |
| 141 | if (const auto match = find_option_match(options, keys)) { |
| 142 | const float value = parse_float_value(match->value, match->key); |
| 143 | if (!std::isfinite(value)) { |
| 144 | throw std::runtime_error(match->key + " must be a finite float"); |
| 145 | } |
| 146 | return value; |
| 147 | } |
| 148 | return std::nullopt; |
| 149 | } |
| 150 | |
| 151 | std::optional<uint32_t> parse_u32_option( |
| 152 | const std::unordered_map<std::string, std::string> & options, |
no test coverage detected