MCPcopy Create free account
hub / github.com/ComodoSecurity/openedr / asInt

Method asInt

edrav2/eprj/jsoncpp/src/lib_json/json_value.cpp:717–737  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

715#endif
716
717Value::Int Value::asInt() const {
718 switch (type_) {
719 case intValue:
720 JSON_ASSERT_MESSAGE(isInt(), "LargestInt out of Int range");
721 return Int(value_.int_);
722 case uintValue:
723 JSON_ASSERT_MESSAGE(isInt(), "LargestUInt out of Int range");
724 return Int(value_.uint_);
725 case realValue:
726 JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt, maxInt),
727 "double out of Int range");
728 return Int(value_.real_);
729 case nullValue:
730 return 0;
731 case booleanValue:
732 return value_.bool_ ? 1 : 0;
733 default:
734 break;
735 }
736 JSON_FAIL_MESSAGE("Value is not convertible to Int.");
737}
738
739Value::UInt Value::asUInt() const {
740 switch (type_) {

Callers 12

JSONTEST_FIXTUREFunction · 0.45
test_server.cppFile · 0.45
test_client.cppFile · 0.45
test_common.cppFile · 0.45
addMethod · 0.45
subMethod · 0.45
initCounterMethod · 0.45
incrementCounterMethod · 0.45
getErrorCodeMethod · 0.45
throwErrorExceptionMethod · 0.45
addCallMethod · 0.45

Calls 2

InRangeFunction · 0.85
IntClass · 0.50

Tested by 4

addMethod · 0.36
subMethod · 0.36
initCounterMethod · 0.36
incrementCounterMethod · 0.36