MCPcopy Create free account
hub / github.com/Illumina/paragraph / size

Method size

external/jsoncpp/jsoncpp.cpp:3404–3425  ·  view source on GitHub ↗

Number of values in array or object

Source from the content-addressed store, hash-verified

3402
3403/// Number of values in array or object
3404ArrayIndex Value::size() const {
3405 switch (type_) {
3406 case nullValue:
3407 case intValue:
3408 case uintValue:
3409 case realValue:
3410 case booleanValue:
3411 case stringValue:
3412 return 0;
3413 case arrayValue: // size of the array is highest index + 1
3414 if (!value_.map_->empty()) {
3415 ObjectValues::const_iterator itLast = value_.map_->end();
3416 --itLast;
3417 return (*itLast).first.index() + 1;
3418 }
3419 return 0;
3420 case objectValue:
3421 return ArrayIndex(value_.map_->size());
3422 }
3423 JSON_ASSERT_UNREACHABLE;
3424 return 0; // unreachable;
3425}
3426
3427bool Value::empty() const {
3428 if (isNull() || isArray() || isObject())

Callers 14

parseMethod · 0.45
readValueMethod · 0.45
recoverFromErrorMethod · 0.45
goodMethod · 0.45
validateMethod · 0.45
parseFromStreamFunction · 0.45
operator<Method · 0.45
operator==Method · 0.45
isConvertibleToMethod · 0.45
getMemberNamesMethod · 0.45
writeValueMethod · 0.45
writeArrayValueMethod · 0.45

Calls 3

emptyMethod · 0.80
indexMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected