MCPcopy Create free account
hub / github.com/PlayFab/gsdk / size

Method size

cpp/cppsdk/jsoncpp.cpp:3358–3379  ·  view source on GitHub ↗

Number of values in array or object

Source from the content-addressed store, hash-verified

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

Callers 15

parseMethod · 0.80
readValueMethod · 0.80
recoverFromErrorMethod · 0.80
goodMethod · 0.80
validateMethod · 0.80
parseFromStreamFunction · 0.80
operator<Method · 0.80
operator==Method · 0.80
isConvertibleToMethod · 0.80
getMemberNamesMethod · 0.80
valueToStringFunction · 0.80

Calls 3

emptyMethod · 0.80
endMethod · 0.80
indexMethod · 0.80