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

Method clear

external/jsoncpp/jsoncpp.cpp:2366–2389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2364bool Value::operator!() const { return isNull(); }
2365
2366void Value::clear() {
2367 JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue ||
2368 type_ == objectValue,
2369 "in Json::Value::clear(): requires complex value");
2370 start_ = 0;
2371 limit_ = 0;
2372 switch (type_) {
2373#ifndef JSON_VALUE_USE_INTERNAL_MAP
2374 case arrayValue:
2375 case objectValue:
2376 value_.map_->clear();
2377 break;
2378#else
2379 case arrayValue:
2380 value_.array_->clear();
2381 break;
2382 case objectValue:
2383 value_.map_->clear();
2384 break;
2385#endif
2386 default:
2387 break;
2388 }
2389}
2390
2391void Value::resize(ArrayIndex newSize) {
2392 JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue,

Callers 15

operator()Method · 0.80
advanceMethod · 0.80
reset_rtypesMethod · 0.80
getExtraCountNamesMethod · 0.80
addMethod · 0.80
flushMethod · 0.80
advanceMethod · 0.80
flushMethod · 0.80
addMethod · 0.80
flushMethod · 0.80
rewindMethod · 0.80
advanceMethod · 0.80

Calls

no outgoing calls

Tested by 3

BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64