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

Method asUInt64

src/share/jsoncpp/jsoncpp.cpp:3223–3242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

InRangeFunction · 0.85

Tested by

no test coverage detected