MCPcopy Create free account
hub / github.com/ValveSoftware/openvr / size

Method size

src/jsoncpp.cpp:3316–3337  ·  view source on GitHub ↗

Number of values in array or object

Source from the content-addressed store, hash-verified

3314
3315/// Number of values in array or object
3316ArrayIndex Value::size() const {
3317 switch (type_) {
3318 case nullValue:
3319 case intValue:
3320 case uintValue:
3321 case realValue:
3322 case booleanValue:
3323 case stringValue:
3324 return 0;
3325 case arrayValue: // size of the array is highest index + 1
3326 if (!value_.map_->empty()) {
3327 ObjectValues::const_iterator itLast = value_.map_->end();
3328 --itLast;
3329 return (*itLast).first.index() + 1;
3330 }
3331 return 0;
3332 case objectValue:
3333 return ArrayIndex(value_.map_->size());
3334 }
3335 JSON_ASSERT_UNREACHABLE;
3336 return 0; // unreachable;
3337}
3338
3339bool Value::empty() const {
3340 if (isNull() || isArray() || isObject())

Callers 15

OpenCVAppStartMethod · 0.80
BlurDepthsMethod · 0.80
~GeometryObjectMethod · 0.80
RenderMethod · 0.80
SetRenderTypeMethod · 0.80
TackIndexMethod · 0.80
SetIndexArrayMethod · 0.80
SetArrayPropsMethod · 0.80
CheckVertexPropsMethod · 0.80
SetArrayPropsAdvancedMethod · 0.80
CheckMethod · 0.80

Calls 3

emptyMethod · 0.80
endMethod · 0.80
indexMethod · 0.80

Tested by

no test coverage detected