MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / asUInt64

Method asUInt64

Sources/Dependencies/jsoncpp/value.cpp:773–791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

771 }
772
773 Value::UInt64 Value::asUInt64() const {
774 switch (type()) {
775 case intValue:
776 JSON_ASSERT_MESSAGE(isUInt64(), "LargestInt out of UInt64 range");
777 return UInt64(value_.int_);
778 case uintValue:
779 return UInt64(value_.uint_);
780 case realValue:
781 JSON_ASSERT_MESSAGE(InRange(value_.real_, 0u, maxUInt64), "double out of UInt64 range");
782 return UInt64(value_.real_);
783 case nullValue:
784 return 0;
785 case booleanValue:
786 return value_.bool_ ? 1 : 0;
787 default:
788 break;
789 }
790 JSON_FAIL_MESSAGE("Value is not convertible to UInt64.");
791 }
792#endif // if defined(JSON_HAS_INT64)
793
794 LargestInt Value::asLargestInt() const {

Callers

nothing calls this directly

Calls 2

typeClass · 0.85
InRangeFunction · 0.85

Tested by

no test coverage detected