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

Method asInt64

vrclient_x64/jsoncpp.cpp:3149–3170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

InRangeFunction · 0.85

Tested by

no test coverage detected