MCPcopy Create free account
hub / github.com/Samsung/ONE / asUInt64

Method asUInt64

runtime/3rdparty/jsoncpp/jsoncpp.cpp:3395–3415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3393}
3394
3395Value::UInt64 Value::asUInt64() const
3396{
3397 switch (type())
3398 {
3399 case intValue:
3400 JSON_ASSERT_MESSAGE(isUInt64(), "LargestInt out of UInt64 range");
3401 return UInt64(value_.int_);
3402 case uintValue:
3403 return UInt64(value_.uint_);
3404 case realValue:
3405 JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt64), "double out of UInt64 range");
3406 return UInt64(value_.real_);
3407 case nullValue:
3408 return 0;
3409 case booleanValue:
3410 return value_.bool_ ? 1 : 0;
3411 default:
3412 break;
3413 }
3414 JSON_FAIL_MESSAGE("Value is not convertible to UInt64.");
3415}
3416#endif // if defined(JSON_HAS_INT64)
3417
3418LargestInt Value::asLargestInt() const

Callers 1

handleShapeJsonParamFunction · 0.80

Calls 2

InRangeFunction · 0.85
typeFunction · 0.50

Tested by

no test coverage detected