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

Method asUInt

cpp/cppsdk/jsoncpp.cpp:3177–3197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3175}
3176
3177Value::UInt Value::asUInt() const {
3178 switch (type_) {
3179 case intValue:
3180 JSON_ASSERT_MESSAGE(isUInt(), "LargestInt out of UInt range");
3181 return UInt(value_.int_);
3182 case uintValue:
3183 JSON_ASSERT_MESSAGE(isUInt(), "LargestUInt out of UInt range");
3184 return UInt(value_.uint_);
3185 case realValue:
3186 JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt),
3187 "double out of UInt range");
3188 return UInt(value_.real_);
3189 case nullValue:
3190 return 0;
3191 case booleanValue:
3192 return value_.bool_ ? 1 : 0;
3193 default:
3194 break;
3195 }
3196 JSON_FAIL_MESSAGE("Value is not convertible to UInt.");
3197}
3198
3199#if defined(JSON_HAS_INT64)
3200

Callers 2

newStreamWriterMethod · 0.80
FromJsonUtilPFunction · 0.80

Calls 1

InRangeFunction · 0.85

Tested by

no test coverage detected