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

Method asUInt64

vrclient_x64/jsoncpp.cpp:3172–3193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

InRangeFunction · 0.85

Tested by

no test coverage detected