MCPcopy Create free account
hub / github.com/Illumina/paragraph / asInt64

Method asInt64

external/jsoncpp/jsoncpp.cpp:3247–3266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3245#if defined(JSON_HAS_INT64)
3246
3247Value::Int64 Value::asInt64() const {
3248 switch (type_) {
3249 case intValue:
3250 return Int64(value_.int_);
3251 case uintValue:
3252 JSON_ASSERT_MESSAGE(isInt64(), "LargestUInt out of Int64 range");
3253 return Int64(value_.uint_);
3254 case realValue:
3255 JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt64, maxInt64),
3256 "double out of Int64 range");
3257 return Int64(value_.real_);
3258 case nullValue:
3259 return 0;
3260 case booleanValue:
3261 return value_.bool_ ? 1 : 0;
3262 default:
3263 break;
3264 }
3265 JSON_FAIL_MESSAGE("Value is not convertible to Int64.");
3266}
3267
3268Value::UInt64 Value::asUInt64() const {
3269 switch (type_) {

Callers

nothing calls this directly

Calls 1

InRangeFunction · 0.85

Tested by

no test coverage detected