MCPcopy Create free account
hub / github.com/SICKAG/sick_scan_xd / asUInt

Method asUInt

test/docker/jsoncpp/src/lib_json/json_value.cpp:676–696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

674}
675
676Value::UInt Value::asUInt() const {
677 switch (type()) {
678 case intValue:
679 JSON_ASSERT_MESSAGE(isUInt(), "LargestInt out of UInt range");
680 return UInt(value_.int_);
681 case uintValue:
682 JSON_ASSERT_MESSAGE(isUInt(), "LargestUInt out of UInt range");
683 return UInt(value_.uint_);
684 case realValue:
685 JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt),
686 "double out of UInt range");
687 return UInt(value_.real_);
688 case nullValue:
689 return 0;
690 case booleanValue:
691 return value_.bool_ ? 1 : 0;
692 default:
693 break;
694 }
695 JSON_FAIL_MESSAGE("Value is not convertible to UInt.");
696}
697
698#if defined(JSON_HAS_INT64)
699

Callers 2

newCharReaderMethod · 0.80
newStreamWriterMethod · 0.80

Calls 1

InRangeFunction · 0.85

Tested by

no test coverage detected