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

Method asBool

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

Source from the content-addressed store, hash-verified

3291}
3292
3293bool Value::asBool() const {
3294 switch (type_) {
3295 case booleanValue:
3296 return value_.bool_;
3297 case nullValue:
3298 return false;
3299 case intValue:
3300 return value_.int_ ? true : false;
3301 case uintValue:
3302 return value_.uint_ ? true : false;
3303 case realValue:
3304 // This is kind of strange. Not recommended.
3305 return (value_.real_ != 0.0) ? true : false;
3306 default:
3307 break;
3308 }
3309 JSON_FAIL_MESSAGE("Value is not convertible to bool.");
3310}
3311
3312bool Value::isConvertibleTo(ValueType other) const {
3313 switch (other) {

Callers 4

read_jsonMethod · 0.45
newCharReaderMethod · 0.45
writeValueMethod · 0.45
newStreamWriterMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected