MCPcopy Create free account
hub / github.com/Samsung/ONE / size

Method size

runtime/3rdparty/jsoncpp/jsoncpp.cpp:3540–3564  ·  view source on GitHub ↗

Number of values in array or object

Source from the content-addressed store, hash-verified

3538
3539/// Number of values in array or object
3540ArrayIndex Value::size() const
3541{
3542 switch (type())
3543 {
3544 case nullValue:
3545 case intValue:
3546 case uintValue:
3547 case realValue:
3548 case booleanValue:
3549 case stringValue:
3550 return 0;
3551 case arrayValue: // size of the array is highest index + 1
3552 if (!value_.map_->empty())
3553 {
3554 ObjectValues::const_iterator itLast = value_.map_->end();
3555 --itLast;
3556 return (*itLast).first.index() + 1;
3557 }
3558 return 0;
3559 case objectValue:
3560 return ArrayIndex(value_.map_->size());
3561 }
3562 JSON_ASSERT_UNREACHABLE;
3563 return 0; // unreachable;
3564}
3565
3566bool Value::empty() const
3567{

Callers 13

__init__.pyFile · 0.45
parseMethod · 0.45
readValueMethod · 0.45
recoverFromErrorMethod · 0.45
parseFromStreamFunction · 0.45
operator<Method · 0.45
operator==Method · 0.45
getMemberNamesMethod · 0.45
valueToStringFunction · 0.45
writeValueMethod · 0.45
writeArrayValueMethod · 0.45
isMultilineArrayMethod · 0.45

Calls 4

typeFunction · 0.50
emptyMethod · 0.45
endMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected