MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / size

Method size

Sources/Dependencies/jsoncpp/value.cpp:955–976  ·  view source on GitHub ↗

Number of values in array or object

Source from the content-addressed store, hash-verified

953
954 /// Number of values in array or object
955 ArrayIndex Value::size() const {
956 switch (type()) {
957 case nullValue:
958 case intValue:
959 case uintValue:
960 case realValue:
961 case booleanValue:
962 case stringValue:
963 return 0;
964 case arrayValue: // size of the array is highest index + 1
965 if (!value_.map_->empty()) {
966 ObjectValues::const_iterator itLast = value_.map_->end();
967 --itLast;
968 return (*itLast).first.index() + 1;
969 }
970 return 0;
971 case objectValue:
972 return ArrayIndex(value_.map_->size());
973 }
974 JSON_ASSERT_UNREACHABLE;
975 return 0; // unreachable;
976 }
977
978 bool Value::empty() const {
979 if (isNull() || isArray() || isObject())

Callers 11

operator<Method · 0.45
operator==Method · 0.45
getMemberNamesMethod · 0.45
getMemberCountMethod · 0.45
valueToStringFunction · 0.45
writeArrayValueMethod · 0.45
isMultilineArrayMethod · 0.45
unindentMethod · 0.45
readValueMethod · 0.45
recoverFromErrorMethod · 0.45
getifaddrsFunction · 0.45

Calls 4

typeClass · 0.85
emptyMethod · 0.45
endMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected