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

Function parse_float_value

src/framework/runtime/options.cpp:25–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25float 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
34uint32_t parse_u32_value(const std::string & value, std::string_view key) {
35 if (!value.empty() && value.front() == '-') {

Callers 2

parse_float_optionFunction · 0.85

Calls 2

stringFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected