MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / get_arithmetic_value

Function get_arithmetic_value

dependencies/json/json.hpp:3507–3530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3505 !std::is_same<ArithmeticType, typename BasicJsonType::boolean_t>::value,
3506 int > = 0 >
3507void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val)
3508{
3509 switch (static_cast<value_t>(j))
3510 {
3511 case value_t::number_unsigned:
3512 {
3513 val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_unsigned_t*>());
3514 break;
3515 }
3516 case value_t::number_integer:
3517 {
3518 val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_integer_t*>());
3519 break;
3520 }
3521 case value_t::number_float:
3522 {
3523 val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_float_t*>());
3524 break;
3525 }
3526
3527 default:
3528 JSON_THROW(type_error::create(302, "type must be number, but is " + std::string(j.type_name())));
3529 }
3530}
3531
3532template<typename BasicJsonType>
3533void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b)

Callers 1

from_jsonFunction · 0.70

Calls 1

createFunction · 0.70

Tested by

no test coverage detected