MCPcopy Create free account
hub / github.com/Samsung/ONE / asUInt

Method asUInt

runtime/3rdparty/jsoncpp/jsoncpp.cpp:3348–3369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3346}
3347
3348Value::UInt Value::asUInt() const
3349{
3350 switch (type())
3351 {
3352 case intValue:
3353 JSON_ASSERT_MESSAGE(isUInt(), "LargestInt out of UInt range");
3354 return UInt(value_.int_);
3355 case uintValue:
3356 JSON_ASSERT_MESSAGE(isUInt(), "LargestUInt out of UInt range");
3357 return UInt(value_.uint_);
3358 case realValue:
3359 JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt), "double out of UInt range");
3360 return UInt(value_.real_);
3361 case nullValue:
3362 return 0;
3363 case booleanValue:
3364 return value_.bool_ ? 1 : 0;
3365 default:
3366 break;
3367 }
3368 JSON_FAIL_MESSAGE("Value is not convertible to UInt.");
3369}
3370
3371#if defined(JSON_HAS_INT64)
3372

Callers 7

writeMethod · 0.80
argArrayToMapFunction · 0.80
ParseMethod · 0.80
argArrayToMapFunction · 0.80
ParseMethod · 0.80
newCharReaderMethod · 0.80
newStreamWriterMethod · 0.80

Calls 3

UIntFunction · 0.85
InRangeFunction · 0.85
typeFunction · 0.50

Tested by

no test coverage detected