MCPcopy Create free account
hub / github.com/Kitware/VTK / asInt64

Method asInt64

ThirdParty/jsoncpp/vtkjsoncpp/jsoncpp.cpp:3138–3157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3136#if defined(JSON_HAS_INT64)
3137
3138Value::Int64 Value::asInt64() const {
3139 switch (type()) {
3140 case intValue:
3141 return Int64(value_.int_);
3142 case uintValue:
3143 JSON_ASSERT_MESSAGE(isInt64(), "LargestUInt out of Int64 range");
3144 return Int64(value_.uint_);
3145 case realValue:
3146 JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt64, maxInt64),
3147 "double out of Int64 range");
3148 return Int64(value_.real_);
3149 case nullValue:
3150 return 0;
3151 case booleanValue:
3152 return value_.bool_ ? 1 : 0;
3153 default:
3154 break;
3155 }
3156 JSON_FAIL_MESSAGE("Value is not convertible to Int64.");
3157}
3158
3159Value::UInt64 Value::asUInt64() const {
3160 switch (type()) {

Callers

nothing calls this directly

Calls 2

InRangeFunction · 0.85
typeEnum · 0.50

Tested by

no test coverage detected