MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / asUInt

Method asUInt

src/share/jsoncpp/jsoncpp.cpp:3178–3198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

newStreamWriterMethod · 0.80

Calls 1

InRangeFunction · 0.85

Tested by

no test coverage detected