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

Method asInt64

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

Source from the content-addressed store, hash-verified

698#if defined(JSON_HAS_INT64)
699
700Value::Int64 Value::asInt64() const {
701 switch (type()) {
702 case intValue:
703 return Int64(value_.int_);
704 case uintValue:
705 JSON_ASSERT_MESSAGE(isInt64(), "LargestUInt out of Int64 range");
706 return Int64(value_.uint_);
707 case realValue:
708 JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt64, maxInt64),
709 "double out of Int64 range");
710 return Int64(value_.real_);
711 case nullValue:
712 return 0;
713 case booleanValue:
714 return value_.bool_ ? 1 : 0;
715 default:
716 break;
717 }
718 JSON_FAIL_MESSAGE("Value is not convertible to Int64.");
719}
720
721Value::UInt64 Value::asUInt64() const {
722 switch (type()) {

Callers 3

TraverseValueFunction · 0.80
deserializeMethod · 0.80

Calls 2

InRangeFunction · 0.85
typeClass · 0.50

Tested by

no test coverage detected