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

Function bool_arg

tests/chatterbox/chatterbox_warm_bench.cpp:52–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52bool bool_arg(int argc, char ** argv, const std::string & name, bool fallback) {
53 const std::string value = arg_value(argc, argv, name, fallback ? "true" : "false");
54 if (value == "1" || value == "true" || value == "yes") {
55 return true;
56 }
57 if (value == "0" || value == "false" || value == "no") {
58 return false;
59 }
60 throw std::runtime_error("invalid boolean value for " + name + ": " + value);
61}
62
63engine::core::BackendType parse_backend(const std::string & value) {
64 if (value == "cpu") {

Callers 1

mainFunction · 0.70

Calls 1

arg_valueFunction · 0.70

Tested by

no test coverage detected