MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / size

Method size

src/share/jsoncpp/jsoncpp.cpp:3359–3380  ·  view source on GitHub ↗

Number of values in array or object

Source from the content-addressed store, hash-verified

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

Callers 15

formatOptionFunction · 0.80
foreachFunction · 0.80
shutdownMethod · 0.80
loadQueueMethod · 0.80
getPlatformNameFunction · 0.80
adjustPositionMethod · 0.80
isCursorInsideMethod · 0.80
addHistoryMethod · 0.80
canForwardMethod · 0.80
backMethod · 0.80
forwardMethod · 0.80
readUdpPendingDataMethod · 0.80

Calls 3

endMethod · 0.80
indexMethod · 0.80
emptyMethod · 0.45

Tested by 1

drawControlMethod · 0.64