| 269 | } |
| 270 | |
| 271 | FormattedJson 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 | |
| 278 | FormattedJson FormattedJson::append(String const& key, FormattedJson const& value) const { |
| 279 | return objectInsert(key, value, m_elements.size()); |