MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / asInt64

Method asInt64

Source/JSON/jsoncpp.cpp:2840–2859  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2838#if defined(JSON_HAS_INT64)
2839
2840Value::Int64 Value::asInt64() const {
2841 switch (type_) {
2842 case intValue:
2843 return Int64(value_.int_);
2844 case uintValue:
2845 JSON_ASSERT_MESSAGE(isInt64(), "LargestUInt out of Int64 range");
2846 return Int64(value_.uint_);
2847 case realValue:
2848 JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt64, maxInt64),
2849 "double out of Int64 range");
2850 return Int64(value_.real_);
2851 case nullValue:
2852 return 0;
2853 case booleanValue:
2854 return value_.bool_ ? 1 : 0;
2855 default:
2856 break;
2857 }
2858 JSON_FAIL_MESSAGE("Value is not convertible to Int64.");
2859}
2860
2861Value::UInt64 Value::asUInt64() const {
2862 switch (type_) {

Callers

nothing calls this directly

Calls 1

InRangeFunction · 0.70

Tested by

no test coverage detected