MCPcopy Create free account
hub / github.com/ValveSoftware/openvr / resize

Method resize

src/jsoncpp.cpp:3366–3382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3364}
3365
3366void Value::resize(ArrayIndex newSize) {
3367 JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue,
3368 "in Json::Value::resize(): requires arrayValue");
3369 if (type_ == nullValue)
3370 *this = Value(arrayValue);
3371 ArrayIndex oldSize = size();
3372 if (newSize == 0)
3373 clear();
3374 else if (newSize > oldSize)
3375 (*this)[newSize - 1];
3376 else {
3377 for (ArrayIndex index = newSize; index < oldSize; ++index) {
3378 value_.map_->erase(index);
3379 }
3380 assert(size() == newSize);
3381 }
3382}
3383
3384Value& Value::operator[](ArrayIndex index) {
3385 JSON_ASSERT_MESSAGE(

Callers 15

OpenCVAppStartMethod · 0.80
BInitMethod · 0.80
SetRenderTypeMethod · 0.80
TackIndexMethod · 0.80
SetIndexArrayMethod · 0.80
SetArrayPropsMethod · 0.80
CheckVertexPropsMethod · 0.80
SetArrayPropsAdvancedMethod · 0.80
CheckMethod · 0.80
BInitVulkanSwapchainMethod · 0.80
BufferToStdStringFunction · 0.80

Calls 1

ValueClass · 0.50

Tested by

no test coverage detected