MCPcopy Create free account
hub / github.com/SOUI2/soui / asUInt

Method asUInt

third-part/jsoncpp/src/lib_json/json_value.cpp:754–774  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

752}
753
754Value::UInt Value::asUInt() const {
755 switch (type_) {
756 case intValue:
757 JSON_ASSERT_MESSAGE(isUInt(), "LargestInt out of UInt range");
758 return UInt(value_.int_);
759 case uintValue:
760 JSON_ASSERT_MESSAGE(isUInt(), "LargestUInt out of UInt range");
761 return UInt(value_.uint_);
762 case realValue:
763 JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt),
764 "double out of UInt range");
765 return UInt(value_.real_);
766 case nullValue:
767 return 0;
768 case booleanValue:
769 return value_.bool_ ? 1 : 0;
770 default:
771 break;
772 }
773 JSON_FAIL_MESSAGE("Value is not convertible to UInt.");
774}
775
776#if defined(JSON_HAS_INT64)
777

Callers 2

newStreamWriterMethod · 0.80
JSONTEST_FIXTUREFunction · 0.80

Calls 1

InRangeFunction · 0.85

Tested by

no test coverage detected