MCPcopy Create free account
hub / github.com/Illumina/hap.py / size

Method size

external/jsoncpp/jsoncpp.cpp:2327–2355  ·  view source on GitHub ↗

Number of values in array or object

Source from the content-addressed store, hash-verified

2325
2326/// Number of values in array or object
2327ArrayIndex Value::size() const {
2328 switch (type_) {
2329 case nullValue:
2330 case intValue:
2331 case uintValue:
2332 case realValue:
2333 case booleanValue:
2334 case stringValue:
2335 return 0;
2336#ifndef JSON_VALUE_USE_INTERNAL_MAP
2337 case arrayValue: // size of the array is highest index + 1
2338 if (!value_.map_->empty()) {
2339 ObjectValues::const_iterator itLast = value_.map_->end();
2340 --itLast;
2341 return (*itLast).first.index() + 1;
2342 }
2343 return 0;
2344 case objectValue:
2345 return ArrayIndex(value_.map_->size());
2346#else
2347 case arrayValue:
2348 return Int(value_.array_->size());
2349 case objectValue:
2350 return Int(value_.map_->size());
2351#endif
2352 }
2353 JSON_ASSERT_UNREACHABLE;
2354 return 0; // unreachable;
2355}
2356
2357bool Value::empty() const {
2358 if (isNull() || isArray() || isObject())

Callers 15

getGQFunction · 0.80
getADFunction · 0.80
getDPFunction · 0.80
getFormatIntFunction · 0.80
getFormatFloatFunction · 0.80
setFormatStringsFunction · 0.80
setFormatFloatsFunction · 0.80
setFormatIntsFunction · 0.80
classifyAlleleStringFunction · 0.80
MMappedFastaFileMethod · 0.80
addIntervalMethod · 0.80
advanceMethod · 0.80

Calls 3

emptyMethod · 0.80
indexMethod · 0.80
endMethod · 0.45

Tested by 8

BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64
listcmpFunction · 0.64