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

Method asUInt64

cpp/cppsdk/jsoncpp.cpp:3222–3241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3220}
3221
3222Value::UInt64 Value::asUInt64() const {
3223 switch (type_) {
3224 case intValue:
3225 JSON_ASSERT_MESSAGE(isUInt64(), "LargestInt out of UInt64 range");
3226 return UInt64(value_.int_);
3227 case uintValue:
3228 return UInt64(value_.uint_);
3229 case realValue:
3230 JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt64),
3231 "double out of UInt64 range");
3232 return UInt64(value_.real_);
3233 case nullValue:
3234 return 0;
3235 case booleanValue:
3236 return value_.bool_ ? 1 : 0;
3237 default:
3238 break;
3239 }
3240 JSON_FAIL_MESSAGE("Value is not convertible to UInt64.");
3241}
3242#endif // if defined(JSON_HAS_INT64)
3243
3244LargestInt Value::asLargestInt() const {

Callers 1

FromJsonUtilPFunction · 0.80

Calls 1

InRangeFunction · 0.85

Tested by

no test coverage detected