MCPcopy Create free account
hub / github.com/ComodoSecurity/openedr / size

Method size

edrav2/eprj/jsoncpp/src/lib_json/json_value.cpp:920–941  ·  view source on GitHub ↗

Number of values in array or object

Source from the content-addressed store, hash-verified

918
919/// Number of values in array or object
920ArrayIndex Value::size() const {
921 switch (type_) {
922 case nullValue:
923 case intValue:
924 case uintValue:
925 case realValue:
926 case booleanValue:
927 case stringValue:
928 return 0;
929 case arrayValue: // size of the array is highest index + 1
930 if (!value_.map_->empty()) {
931 ObjectValues::const_iterator itLast = value_.map_->end();
932 --itLast;
933 return (*itLast).first.index() + 1;
934 }
935 return 0;
936 case objectValue:
937 return ArrayIndex(value_.map_->size());
938 }
939 JSON_ASSERT_UNREACHABLE;
940 return 0; // unreachable;
941}
942
943bool Value::empty() const {
944 if (isNull() || isArray() || isObject())

Callers 15

parseMethod · 0.45
readValueMethod · 0.45
recoverFromErrorMethod · 0.45
validateMethod · 0.45
parseFromStreamFunction · 0.45
valueToStringFunction · 0.45
writeValueMethod · 0.45
writeArrayValueMethod · 0.45
isMultilineArrayMethod · 0.45
unindentMethod · 0.45
validateMethod · 0.45
operator<Method · 0.45

Calls 3

emptyMethod · 0.45
endMethod · 0.45
indexMethod · 0.45

Tested by 9

indentTextMethod · 0.36
testCountMethod · 0.36
runAllTestMethod · 0.36
check_exception3Function · 0.36
callbackMethod · 0.36
GetNamedParametersMethod · 0.36
toJsonValueMethod · 0.36