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

Method asUInt

external/jsoncpp/jsoncpp.cpp:3083–3103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3081}
3082
3083Value::UInt Value::asUInt() const {
3084 switch (type()) {
3085 case intValue:
3086 JSON_ASSERT_MESSAGE(isUInt(), "LargestInt out of UInt range");
3087 return UInt(value_.int_);
3088 case uintValue:
3089 JSON_ASSERT_MESSAGE(isUInt(), "LargestUInt out of UInt range");
3090 return UInt(value_.uint_);
3091 case realValue:
3092 JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt),
3093 "double out of UInt range");
3094 return UInt(value_.real_);
3095 case nullValue:
3096 return 0;
3097 case booleanValue:
3098 return value_.bool_ ? 1 : 0;
3099 default:
3100 break;
3101 }
3102 JSON_FAIL_MESSAGE("Value is not convertible to UInt.");
3103}
3104
3105#if defined(JSON_HAS_INT64)
3106

Callers 12

LocationMethod · 0.80
setLocationMethod · 0.80
fromJsonMethod · 0.80
fromJsonMethod · 0.80
APICallMethod · 0.80
fromJsonMethod · 0.80
fromJsonMethod · 0.80
fromJsonMethod · 0.80
fromJsonMethod · 0.80
fromJsonMethod · 0.80
newCharReaderMethod · 0.80
newStreamWriterMethod · 0.80

Calls 1

InRangeFunction · 0.85

Tested by

no test coverage detected