MCPcopy Create free account
hub / github.com/Samsung/UTopia / size

Method size

external/jsoncpp/jsoncpp.cpp:3264–3285  ·  view source on GitHub ↗

Number of values in array or object

Source from the content-addressed store, hash-verified

3262
3263/// Number of values in array or object
3264ArrayIndex Value::size() const {
3265 switch (type()) {
3266 case nullValue:
3267 case intValue:
3268 case uintValue:
3269 case realValue:
3270 case booleanValue:
3271 case stringValue:
3272 return 0;
3273 case arrayValue: // size of the array is highest index + 1
3274 if (!value_.map_->empty()) {
3275 ObjectValues::const_iterator itLast = value_.map_->end();
3276 --itLast;
3277 return (*itLast).first.index() + 1;
3278 }
3279 return 0;
3280 case objectValue:
3281 return ArrayIndex(value_.map_->size());
3282 }
3283 JSON_ASSERT_UNREACHABLE;
3284 return 0; // unreachable;
3285}
3286
3287bool Value::empty() const {
3288 if (isNull() || isArray() || isObject())

Callers 15

getArgExprsFunction · 0.80
isDefaultArgumentFunction · 0.80
isImplicitArgumentFunction · 0.80
findDefinedFunctionDeclsFunction · 0.80
regexFunction · 0.80
replaceStringFunction · 0.80
getDemangledNameFunction · 0.80
findFilePathsFunction · 0.80
getNormalizedPathFunction · 0.80
buildMethod · 0.80

Calls 3

emptyMethod · 0.80
endMethod · 0.80
indexMethod · 0.80

Tested by 15

findCallExprMethod · 0.64
findAssignOperatorMethod · 0.64
TEST_FFunction · 0.64
TESTFunction · 0.64
TESTFunction · 0.64
TEST_FFunction · 0.64
TEST_FFunction · 0.64
verifyFirstUseFunction · 0.64
TEST_FFunction · 0.64
checkNonFileMethod · 0.64
checkIncludedHeadersMethod · 0.64
createFuzzerMethod · 0.64