| 443 | } |
| 444 | |
| 445 | FormattedJson FormattedJson::array(ElementList const& elements) { |
| 446 | FormattedJson json = ofType(Json::Type::Array); |
| 447 | for (JsonElement const& elem : elements) { |
| 448 | if (elem.is<ColonElement>() || elem.is<ObjectKeyElement>()) |
| 449 | throw JsonException("Invalid FormattedJson element in Json array"); |
| 450 | json.appendElement(elem); |
| 451 | } |
| 452 | return json; |
| 453 | } |
| 454 | |
| 455 | FormattedJson FormattedJson::objectInsert(String const& key, FormattedJson const& value, ElementLocation loc) const { |
| 456 | if (type() != Json::Type::Object) |
no test coverage detected