MCPcopy Create free account
hub / github.com/PlayFab/gsdk / resize

Method resize

cpp/cppsdk/jsoncpp.cpp:3406–3422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 4

codePointToUTF8Function · 0.80
recoverFromErrorMethod · 0.80
valueToStringFunction · 0.80
unindentMethod · 0.80

Calls 1

ValueClass · 0.50

Tested by

no test coverage detected