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

Function json_optional_string

app/cli/request.cpp:71–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69 };
70}
71
72std::string json_option_string(const engine::io::json::Value & value) {
73 if (value.is_string()) {
74 return value.as_string();
75 }
76 if (value.is_bool()) {
77 return value.as_bool() ? "true" : "false";
78 }
79 if (value.is_number()) {
80 const double number = value.as_number();
81 constexpr double kMaxExactJsonInteger = 9007199254740992.0; // 2^53
82 if (std::isfinite(number) && std::trunc(number) == number && std::fabs(number) < kMaxExactJsonInteger) {

Callers 2

build_request_from_jsonFunction · 0.85

Calls 2

is_nullMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected