MCPcopy Create free account
hub / github.com/THUDM/AgentTuning / asInt64

Method asInt64

AgentBench.old/src/tasks/card_game/logic/src/jsoncpp/jsoncpp.cpp:3189–3208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3187#if defined(JSON_HAS_INT64)
3188
3189Value::Int64 Value::asInt64() const {
3190 switch (type_) {
3191 case intValue:
3192 return Int64(value_.int_);
3193 case uintValue:
3194 JSON_ASSERT_MESSAGE(isInt64(), "LargestUInt out of Int64 range");
3195 return Int64(value_.uint_);
3196 case realValue:
3197 JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt64, maxInt64),
3198 "double out of Int64 range");
3199 return Int64(value_.real_);
3200 case nullValue:
3201 return 0;
3202 case booleanValue:
3203 return value_.bool_ ? 1 : 0;
3204 default:
3205 break;
3206 }
3207 JSON_FAIL_MESSAGE("Value is not convertible to Int64.");
3208}
3209
3210Value::UInt64 Value::asUInt64() const {
3211 switch (type_) {

Callers

nothing calls this directly

Calls 1

InRangeFunction · 0.70

Tested by

no test coverage detected