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

Method asInt64

external/jsoncpp/jsoncpp.cpp:3107–3126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3105#if defined(JSON_HAS_INT64)
3106
3107Value::Int64 Value::asInt64() const {
3108 switch (type()) {
3109 case intValue:
3110 return Int64(value_.int_);
3111 case uintValue:
3112 JSON_ASSERT_MESSAGE(isInt64(), "LargestUInt out of Int64 range");
3113 return Int64(value_.uint_);
3114 case realValue:
3115 JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt64, maxInt64),
3116 "double out of Int64 range");
3117 return Int64(value_.real_);
3118 case nullValue:
3119 return 0;
3120 case booleanValue:
3121 return value_.bool_ ? 1 : 0;
3122 default:
3123 break;
3124 }
3125 JSON_FAIL_MESSAGE("Value is not convertible to Int64.");
3126}
3127
3128Value::UInt64 Value::asUInt64() const {
3129 switch (type()) {

Callers 1

fromJsonMethod · 0.80

Calls 1

InRangeFunction · 0.85

Tested by

no test coverage detected