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

Method asUInt64

src/jsoncpp.cpp:3173–3194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3171}
3172
3173Value::UInt64 Value::asUInt64() const {
3174 switch (type_) {
3175 case intValue:
3176 JSON_ASSERT_MESSAGE(isUInt64(), "LargestInt out of UInt64 range");
3177 return UInt64(value_.int_);
3178 case uintValue:
3179 return UInt64(value_.uint_);
3180 case realValue:
3181 JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt64),
3182 "double out of UInt64 range");
3183 return UInt64(value_.real_);
3184 case nullValue:
3185 return 0;
3186 case booleanValue:
3187 return value_.bool_ ? 1 : 0;
3188 default:
3189 if ( default_value_ )
3190 return default_value_->asUInt64();
3191 else
3192 return 0ul;
3193 }
3194}
3195#endif // if defined(JSON_HAS_INT64)
3196
3197LargestInt Value::asLargestInt() const {

Callers

nothing calls this directly

Calls 1

InRangeFunction · 0.85

Tested by

no test coverage detected