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

Method asInt

json/jsoncpp.cpp:3158–3178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3156#endif
3157
3158Value::Int Value::asInt() const {
3159 switch (type_) {
3160 case intValue:
3161 JSON_ASSERT_MESSAGE(isInt(), "LargestInt out of Int range");
3162 return Int(value_.int_);
3163 case uintValue:
3164 JSON_ASSERT_MESSAGE(isInt(), "LargestUInt out of Int range");
3165 return Int(value_.uint_);
3166 case realValue:
3167 JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt, maxInt),
3168 "double out of Int range");
3169 return Int(value_.real_);
3170 case nullValue:
3171 return 0;
3172 case booleanValue:
3173 return value_.bool_ ? 1 : 0;
3174 default:
3175 break;
3176 }
3177 JSON_FAIL_MESSAGE("Value is not convertible to Int.");
3178}
3179
3180Value::UInt Value::asUInt() const {
3181 switch (type_) {

Callers 1

newCharReaderMethod · 0.80

Calls 1

InRangeFunction · 0.85

Tested by

no test coverage detected