MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / parse_finite_float_option

Function parse_finite_float_option

src/framework/runtime/options.cpp:138–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138std::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
151std::optional<uint32_t> parse_u32_option(
152 const std::unordered_map<std::string, std::string> & options,

Calls 2

find_option_matchFunction · 0.85
parse_float_valueFunction · 0.85

Tested by

no test coverage detected