MCPcopy Create free account
hub / github.com/ComodoSecurity/openedr / asUInt

Method asUInt

edrav2/eprj/jsoncpp/src/lib_json/json_value.cpp:739–759  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

737}
738
739Value::UInt Value::asUInt() const {
740 switch (type_) {
741 case intValue:
742 JSON_ASSERT_MESSAGE(isUInt(), "LargestInt out of UInt range");
743 return UInt(value_.int_);
744 case uintValue:
745 JSON_ASSERT_MESSAGE(isUInt(), "LargestUInt out of UInt range");
746 return UInt(value_.uint_);
747 case realValue:
748 JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt),
749 "double out of UInt range");
750 return UInt(value_.real_);
751 case nullValue:
752 return 0;
753 case booleanValue:
754 return value_.bool_ ? 1 : 0;
755 default:
756 break;
757 }
758 JSON_FAIL_MESSAGE("Value is not convertible to UInt.");
759}
760
761#if defined(JSON_HAS_INT64)
762

Callers 3

newCharReaderMethod · 0.80
newStreamWriterMethod · 0.80
JSONTEST_FIXTUREFunction · 0.80

Calls 1

InRangeFunction · 0.85

Tested by

no test coverage detected