| 262 | } |
| 263 | |
| 264 | FormattedJson 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 | |
| 271 | FormattedJson FormattedJson::insertAfter(String const& key, FormattedJson const& value, String const& afterKey) const { |
| 272 | if (!m_objectEntryLocations.contains(afterKey)) |