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

Method asUInt64

ThirdParty/jsoncpp/vtkjsoncpp/jsoncpp.cpp:3159–3178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3157}
3158
3159Value::UInt64 Value::asUInt64() const {
3160 switch (type()) {
3161 case intValue:
3162 JSON_ASSERT_MESSAGE(isUInt64(), "LargestInt out of UInt64 range");
3163 return UInt64(value_.int_);
3164 case uintValue:
3165 return UInt64(value_.uint_);
3166 case realValue:
3167 JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt64),
3168 "double out of UInt64 range");
3169 return UInt64(value_.real_);
3170 case nullValue:
3171 return 0;
3172 case booleanValue:
3173 return value_.bool_ ? 1 : 0;
3174 default:
3175 break;
3176 }
3177 JSON_FAIL_MESSAGE("Value is not convertible to UInt64.");
3178}
3179#endif // if defined(JSON_HAS_INT64)
3180
3181LargestInt Value::asLargestInt() const {

Callers

nothing calls this directly

Calls 2

InRangeFunction · 0.85
typeEnum · 0.50

Tested by

no test coverage detected