MCPcopy Create free account
hub / github.com/PlayFab/gsdk / asInt64

Method asInt64

cpp/cppsdk/jsoncpp.cpp:3201–3220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3199#if defined(JSON_HAS_INT64)
3200
3201Value::Int64 Value::asInt64() const {
3202 switch (type_) {
3203 case intValue:
3204 return Int64(value_.int_);
3205 case uintValue:
3206 JSON_ASSERT_MESSAGE(isInt64(), "LargestUInt out of Int64 range");
3207 return Int64(value_.uint_);
3208 case realValue:
3209 JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt64, maxInt64),
3210 "double out of Int64 range");
3211 return Int64(value_.real_);
3212 case nullValue:
3213 return 0;
3214 case booleanValue:
3215 return value_.bool_ ? 1 : 0;
3216 default:
3217 break;
3218 }
3219 JSON_FAIL_MESSAGE("Value is not convertible to Int64.");
3220}
3221
3222Value::UInt64 Value::asUInt64() const {
3223 switch (type_) {

Callers 1

FromJsonUtilPFunction · 0.80

Calls 1

InRangeFunction · 0.85

Tested by

no test coverage detected