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

Method asInt64

runtime/3rdparty/jsoncpp/jsoncpp.cpp:3373–3393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3371#if defined(JSON_HAS_INT64)
3372
3373Value::Int64 Value::asInt64() const
3374{
3375 switch (type())
3376 {
3377 case intValue:
3378 return Int64(value_.int_);
3379 case uintValue:
3380 JSON_ASSERT_MESSAGE(isInt64(), "LargestUInt out of Int64 range");
3381 return Int64(value_.uint_);
3382 case realValue:
3383 JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt64, maxInt64), "double out of Int64 range");
3384 return Int64(value_.real_);
3385 case nullValue:
3386 return 0;
3387 case booleanValue:
3388 return value_.bool_ ? 1 : 0;
3389 default:
3390 break;
3391 }
3392 JSON_FAIL_MESSAGE("Value is not convertible to Int64.");
3393}
3394
3395Value::UInt64 Value::asUInt64() const
3396{

Callers

nothing calls this directly

Calls 2

InRangeFunction · 0.85
typeFunction · 0.50

Tested by

no test coverage detected