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

Method insertAfter

source/core/StarFormattedJson.cpp:271–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269}
270
271FormattedJson FormattedJson::insertAfter(String const& key, FormattedJson const& value, String const& afterKey) const {
272 if (!m_objectEntryLocations.contains(afterKey))
273 throw JsonException::format("Cannot insert after key \"{}\", which does not exist", afterKey);
274 ElementLocation loc = m_objectEntryLocations.get(afterKey).second;
275 return objectInsert(key, value, loc + 1);
276}
277
278FormattedJson FormattedJson::append(String const& key, FormattedJson const& value) const {
279 return objectInsert(key, value, m_elements.size());

Callers

nothing calls this directly

Calls 3

formatFunction · 0.70
containsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected