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

Method asUInt64

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

Source from the content-addressed store, hash-verified

782}
783
784Value::UInt64 Value::asUInt64() const {
785 switch (type_) {
786 case intValue:
787 JSON_ASSERT_MESSAGE(isUInt64(), "LargestInt out of UInt64 range");
788 return UInt64(value_.int_);
789 case uintValue:
790 return UInt64(value_.uint_);
791 case realValue:
792 JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt64),
793 "double out of UInt64 range");
794 return UInt64(value_.real_);
795 case nullValue:
796 return 0;
797 case booleanValue:
798 return value_.bool_ ? 1 : 0;
799 default:
800 break;
801 }
802 JSON_FAIL_MESSAGE("Value is not convertible to UInt64.");
803}
804#endif // if defined(JSON_HAS_INT64)
805
806LargestInt Value::asLargestInt() const {

Callers 2

newCharReaderMethod · 0.80
JSONTEST_FIXTUREFunction · 0.80

Calls 1

InRangeFunction · 0.85

Tested by

no test coverage detected