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

Method insertBefore

source/core/StarFormattedJson.cpp:264–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264FormattedJson FormattedJson::insertBefore(String const& key, FormattedJson const& value, String const& beforeKey) const {
265 if (!m_objectEntryLocations.contains(beforeKey))
266 throw JsonException::format("Cannot insert before key \"{}\", which does not exist", beforeKey);
267 ElementLocation loc = m_objectEntryLocations.get(beforeKey).first;
268 return objectInsert(key, value, loc);
269}
270
271FormattedJson FormattedJson::insertAfter(String const& key, FormattedJson const& value, String const& afterKey) const {
272 if (!m_objectEntryLocations.contains(afterKey))

Callers 2

addOrSetMethod · 0.80
TESTFunction · 0.80

Calls 3

formatFunction · 0.70
containsMethod · 0.45
getMethod · 0.45

Tested by 1

TESTFunction · 0.64