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

Method size

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

Number of values in array or object

Source from the content-addressed store, hash-verified

3344
3345/// Number of values in array or object
3346ArrayIndex Value::size() const {
3347 switch (type_) {
3348 case nullValue:
3349 case intValue:
3350 case uintValue:
3351 case realValue:
3352 case booleanValue:
3353 case stringValue:
3354 return 0;
3355 case arrayValue: // size of the array is highest index + 1
3356 if (!value_.map_->empty()) {
3357 ObjectValues::const_iterator itLast = value_.map_->end();
3358 --itLast;
3359 return (*itLast).first.index() + 1;
3360 }
3361 return 0;
3362 case objectValue:
3363 return ArrayIndex(value_.map_->size());
3364 }
3365 JSON_ASSERT_UNREACHABLE;
3366 return 0; // unreachable;
3367}
3368
3369bool Value::empty() const {
3370 if (isNull() || isArray() || isObject())

Callers 15

receive_player_listMethod · 0.45
action_info_modifierMethod · 0.45
write_jsonMethod · 0.45
pick_msg_checkerMethod · 0.45
action_msg_checkerMethod · 0.45
read_jsonMethod · 0.45
skill_validMethod · 0.45
skillMethod · 0.45
get_sizeMethod · 0.45
parseMethod · 0.45
readValueMethod · 0.45
recoverFromErrorMethod · 0.45

Calls 3

emptyMethod · 0.45
endMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected