| 104 | } |
| 105 | |
| 106 | FormattedJson FormattedJson::get(String const& key) const { |
| 107 | if (type() != Json::Type::Object) |
| 108 | throw JsonException::format("Cannot call get with key on FormattedJson type {}, must be Object type", typeName()); |
| 109 | |
| 110 | Maybe<pair<ElementLocation, ElementLocation>> entry = m_objectEntryLocations.maybe(key); |
| 111 | if (entry.isNothing()) |
| 112 | throw JsonException::format("No such key in FormattedJson::get(\"{}\")", key); |
| 113 | |
| 114 | return getFormattedJson(entry->second); |
| 115 | } |
| 116 | |
| 117 | FormattedJson FormattedJson::get(size_t index) const { |
| 118 | if (type() != Json::Type::Array) |