MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / eraseIndex

Method eraseIndex

source/core/StarFormattedJson.cpp:358–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356}
357
358FormattedJson FormattedJson::eraseIndex(size_t index) const {
359 if (type() != Json::Type::Array)
360 throw JsonException::format("Cannot call set with index on FormattedJson type {}, must be Array type", typeName());
361
362 if (index >= m_arrayElementLocations.size())
363 throw JsonException::format("FormattedJson::eraseIndex({}) out of range", index);
364
365 ElementLocation loc = m_arrayElementLocations.at(index);
366 ElementList elements = m_elements;
367 removeValueFromArray(elements, loc);
368 return array(elements);
369}
370
371size_t FormattedJson::size() const {
372 return m_jsonValue.size();

Callers

nothing calls this directly

Calls 5

removeValueFromArrayFunction · 0.85
formatFunction · 0.70
typeFunction · 0.50
sizeMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected