MCPcopy Create free account
hub / github.com/ValveSoftware/openvr / asInt64

Method asInt64

src/jsoncpp.cpp:3150–3171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3148#if defined(JSON_HAS_INT64)
3149
3150Value::Int64 Value::asInt64() const {
3151 switch (type_) {
3152 case intValue:
3153 return Int64(value_.int_);
3154 case uintValue:
3155 JSON_ASSERT_MESSAGE(isInt64(), "LargestUInt out of Int64 range");
3156 return Int64(value_.uint_);
3157 case realValue:
3158 JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt64, maxInt64),
3159 "double out of Int64 range");
3160 return Int64(value_.real_);
3161 case nullValue:
3162 return 0;
3163 case booleanValue:
3164 return value_.bool_ ? 1 : 0;
3165 default:
3166 if ( default_value_ )
3167 return default_value_->asInt64();
3168 else
3169 return 0l;
3170 }
3171}
3172
3173Value::UInt64 Value::asUInt64() const {
3174 switch (type_) {

Callers

nothing calls this directly

Calls 1

InRangeFunction · 0.85

Tested by

no test coverage detected