MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / size

Method size

json/jsoncpp.cpp:3361–3382  ·  view source on GitHub ↗

Number of values in array or object

Source from the content-addressed store, hash-verified

3359
3360/// Number of values in array or object
3361ArrayIndex Value::size() const {
3362 switch (type_) {
3363 case nullValue:
3364 case intValue:
3365 case uintValue:
3366 case realValue:
3367 case booleanValue:
3368 case stringValue:
3369 return 0;
3370 case arrayValue: // size of the array is highest index + 1
3371 if (!value_.map_->empty()) {
3372 ObjectValues::const_iterator itLast = value_.map_->end();
3373 --itLast;
3374 return (*itLast).first.index() + 1;
3375 }
3376 return 0;
3377 case objectValue:
3378 return ArrayIndex(value_.map_->size());
3379 }
3380 JSON_ASSERT_UNREACHABLE;
3381 return 0; // unreachable;
3382}
3383
3384bool Value::empty() const {
3385 if (isNull() || isArray() || isObject())

Callers 15

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
valueToStringFunction · 0.45
writeValueMethod · 0.45

Calls 4

ArrayIndexClass · 0.85
emptyMethod · 0.45
endMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected