MCPcopy Create free account
hub / github.com/Kitware/VTK / size

Method size

ThirdParty/jsoncpp/vtkjsoncpp/jsoncpp.cpp:3297–3318  ·  view source on GitHub ↗

Number of values in array or object

Source from the content-addressed store, hash-verified

3295
3296/// Number of values in array or object
3297ArrayIndex Value::size() const {
3298 switch (type()) {
3299 case nullValue:
3300 case intValue:
3301 case uintValue:
3302 case realValue:
3303 case booleanValue:
3304 case stringValue:
3305 return 0;
3306 case arrayValue: // size of the array is highest index + 1
3307 if (!value_.map_->empty()) {
3308 ObjectValues::const_iterator itLast = value_.map_->end();
3309 --itLast;
3310 return (*itLast).first.index() + 1;
3311 }
3312 return 0;
3313 case objectValue:
3314 return ArrayIndex(value_.map_->size());
3315 }
3316 JSON_ASSERT_UNREACHABLE;
3317 return 0; // unreachable;
3318}
3319
3320bool Value::empty() const {
3321 if (isNull() || isArray() || isObject())

Callers 12

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
unindentMethod · 0.45

Calls 4

typeEnum · 0.50
emptyMethod · 0.45
endMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected