MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / asUInt

Method asUInt

json/jsoncpp.cpp:3180–3200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

newStreamWriterMethod · 0.80

Calls 2

UIntFunction · 0.85
InRangeFunction · 0.85

Tested by

no test coverage detected