MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / resize

Method resize

src/share/jsoncpp/jsoncpp.cpp:3407–3423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3405}
3406
3407void Value::resize(ArrayIndex newSize) {
3408 JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue,
3409 "in Json::Value::resize(): requires arrayValue");
3410 if (type_ == nullValue)
3411 *this = Value(arrayValue);
3412 ArrayIndex oldSize = size();
3413 if (newSize == 0)
3414 clear();
3415 else if (newSize > oldSize)
3416 (*this)[newSize - 1];
3417 else {
3418 for (ArrayIndex index = newSize; index < oldSize; ++index) {
3419 value_.map_->erase(index);
3420 }
3421 JSON_ASSERT(size() == newSize);
3422 }
3423}
3424
3425Value& Value::operator[](ArrayIndex index) {
3426 JSON_ASSERT_MESSAGE(

Callers 15

addHistoryMethod · 0.80
readUdpPendingDataMethod · 0.80
openDetailsMethod · 0.80
openErrorDetailsMethod · 0.80
resizeEventMethod · 0.80
searchDocumentByTitleMethod · 0.80
searchDocumentByWhereMethod · 0.80
readUdpPendingDataMethod · 0.80
receiveConnectionMethod · 0.80
codePointToUTF8Function · 0.80
recoverFromErrorMethod · 0.80
unindentMethod · 0.80

Calls 1

ValueClass · 0.50

Tested by

no test coverage detected