MCPcopy Create free account
hub / github.com/Illumina/hap.py / asInt64

Method asInt64

external/jsoncpp/jsoncpp.cpp:2172–2191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2170#if defined(JSON_HAS_INT64)
2171
2172Value::Int64 Value::asInt64() const {
2173 switch (type_) {
2174 case intValue:
2175 return Int64(value_.int_);
2176 case uintValue:
2177 JSON_ASSERT_MESSAGE(isInt64(), "LargestUInt out of Int64 range");
2178 return Int64(value_.uint_);
2179 case realValue:
2180 JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt64, maxInt64),
2181 "double out of Int64 range");
2182 return Int64(value_.real_);
2183 case nullValue:
2184 return 0;
2185 case booleanValue:
2186 return value_.bool_ ? 1 : 0;
2187 default:
2188 break;
2189 }
2190 JSON_FAIL_MESSAGE("Value is not convertible to Int64.");
2191}
2192
2193Value::UInt64 Value::asUInt64() const {
2194 switch (type_) {

Callers

nothing calls this directly

Calls 1

InRangeFunction · 0.85

Tested by

no test coverage detected