MCPcopy Create free account
hub / github.com/SOUI2/soui / size

Method size

third-part/jsoncpp/src/lib_json/json_value.cpp:935–956  ·  view source on GitHub ↗

Number of values in array or object

Source from the content-addressed store, hash-verified

933
934/// Number of values in array or object
935ArrayIndex Value::size() const {
936 switch (type_) {
937 case nullValue:
938 case intValue:
939 case uintValue:
940 case realValue:
941 case booleanValue:
942 case stringValue:
943 return 0;
944 case arrayValue: // size of the array is highest index + 1
945 if (!value_.map_->empty()) {
946 ObjectValues::const_iterator itLast = value_.map_->end();
947 --itLast;
948 return (*itLast).first.index() + 1;
949 }
950 return 0;
951 case objectValue:
952 return ArrayIndex(value_.map_->size());
953 }
954 JSON_ASSERT_UNREACHABLE;
955 return 0; // unreachable;
956}
957
958bool Value::empty() const {
959 if (isNull() || isArray() || isObject())

Callers 15

parseMethod · 0.45
readValueMethod · 0.45
recoverFromErrorMethod · 0.45
goodMethod · 0.45
validateMethod · 0.45
parseFromStreamFunction · 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 3

indentTextMethod · 0.36
testCountMethod · 0.36
runAllTestMethod · 0.36