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

Method asInt64

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

Source from the content-addressed store, hash-verified

761#if defined(JSON_HAS_INT64)
762
763Value::Int64 Value::asInt64() const {
764 switch (type_) {
765 case intValue:
766 return Int64(value_.int_);
767 case uintValue:
768 JSON_ASSERT_MESSAGE(isInt64(), "LargestUInt out of Int64 range");
769 return Int64(value_.uint_);
770 case realValue:
771 JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt64, maxInt64),
772 "double out of Int64 range");
773 return Int64(value_.real_);
774 case nullValue:
775 return 0;
776 case booleanValue:
777 return value_.bool_ ? 1 : 0;
778 default:
779 break;
780 }
781 JSON_FAIL_MESSAGE("Value is not convertible to Int64.");
782}
783
784Value::UInt64 Value::asUInt64() const {
785 switch (type_) {

Callers 1

JSONTEST_FIXTUREFunction · 0.80

Calls 1

InRangeFunction · 0.85

Tested by

no test coverage detected