MCPcopy Index your code
hub / github.com/Kitware/CMake / size

Method size

Utilities/cmjsoncpp/src/lib_json/json_value.cpp:859–880  ·  view source on GitHub ↗

Number of values in array or object

Source from the content-addressed store, hash-verified

857
858/// Number of values in array or object
859ArrayIndex Value::size() const {
860 switch (type()) {
861 case nullValue:
862 case intValue:
863 case uintValue:
864 case realValue:
865 case booleanValue:
866 case stringValue:
867 return 0;
868 case arrayValue: // size of the array is highest index + 1
869 if (!value_.map_->empty()) {
870 ObjectValues::const_iterator itLast = value_.map_->end();
871 --itLast;
872 return (*itLast).first.index() + 1;
873 }
874 return 0;
875 case objectValue:
876 return ArrayIndex(value_.map_->size());
877 }
878 JSON_ASSERT_UNREACHABLE;
879 return 0; // unreachable;
880}
881
882bool Value::empty() const {
883 if (isNull() || isArray() || isObject())

Callers 15

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

Calls 4

typeClass · 0.50
emptyMethod · 0.45
endMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected