MCPcopy Create free account
hub / github.com/Kitware/CMake / asUInt64

Method asUInt64

Utilities/cmjsoncpp/src/lib_json/json_value.cpp:721–740  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

719}
720
721Value::UInt64 Value::asUInt64() const {
722 switch (type()) {
723 case intValue:
724 JSON_ASSERT_MESSAGE(isUInt64(), "LargestInt out of UInt64 range");
725 return UInt64(value_.int_);
726 case uintValue:
727 return UInt64(value_.uint_);
728 case realValue:
729 JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt64),
730 "double out of UInt64 range");
731 return UInt64(value_.real_);
732 case nullValue:
733 return 0;
734 case booleanValue:
735 return value_.bool_ ? 1 : 0;
736 default:
737 break;
738 }
739 JSON_FAIL_MESSAGE("Value is not convertible to UInt64.");
740}
741#endif // if defined(JSON_HAS_INT64)
742
743LargestInt Value::asLargestInt() const {

Callers 4

TraverseValueFunction · 0.80
InstrumentTestMethod · 0.80
InstrumentCommandMethod · 0.80
BuildTraceEventMethod · 0.80

Calls 2

InRangeFunction · 0.85
typeClass · 0.50

Tested by

no test coverage detected