MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / size

Method size

Source/JSON/jsoncpp.cpp:2996–3017  ·  view source on GitHub ↗

Number of values in array or object

Source from the content-addressed store, hash-verified

2994
2995/// Number of values in array or object
2996ArrayIndex Value::size() const {
2997 switch (type_) {
2998 case nullValue:
2999 case intValue:
3000 case uintValue:
3001 case realValue:
3002 case booleanValue:
3003 case stringValue:
3004 return 0;
3005 case arrayValue: // size of the array is highest index + 1
3006 if (!value_.map_->empty()) {
3007 ObjectValues::const_iterator itLast = value_.map_->end();
3008 --itLast;
3009 return (*itLast).first.index() + 1;
3010 }
3011 return 0;
3012 case objectValue:
3013 return ArrayIndex(value_.map_->size());
3014 }
3015 JSON_ASSERT_UNREACHABLE;
3016 return 0; // unreachable;
3017}
3018
3019bool Value::empty() const {
3020 if (isNull() || isArray() || isObject())

Callers 15

InitMethod · 0.45
PerfGPUBeginMethod · 0.45
PostFrameSwapMethod · 0.45
initVisualizationMethod · 0.45
drawVisualizationMethod · 0.45
AddMeshMethod · 0.45
WriteObjFunction · 0.45
Convex2DCollideFunction · 0.45
ClipPolygonFunction · 0.45
AddVoxelDrawFunction · 0.45
VoxellizeMeshFunction · 0.45
NumPointsMethod · 0.45

Calls 3

emptyMethod · 0.45
endMethod · 0.45
indexMethod · 0.45

Tested by 1

TestMainFunction · 0.36