diff --git a/AK/JsonValue.cpp b/AK/JsonValue.cpp index b56780bd87..27e06637ed 100644 --- a/AK/JsonValue.cpp +++ b/AK/JsonValue.cpp @@ -127,6 +127,18 @@ JsonValue::JsonValue(const JsonArray& value) m_value.as_array = new JsonArray(value); } +JsonValue::JsonValue(JsonObject&& value) + : m_type(Type::Object) +{ + m_value.as_object = new JsonObject(move(value)); +} + +JsonValue::JsonValue(JsonArray&& value) + : m_type(Type::Array) +{ + m_value.as_array = new JsonArray(move(value)); +} + void JsonValue::clear() { switch (m_type) { diff --git a/AK/JsonValue.h b/AK/JsonValue.h index c0118b6f36..19d95cce3a 100644 --- a/AK/JsonValue.h +++ b/AK/JsonValue.h @@ -50,6 +50,13 @@ public: JsonValue(const JsonArray&); JsonValue(const JsonObject&); + JsonValue(JsonArray&&); + JsonValue(JsonObject&&); + + // FIXME: Implement these + JsonValue& operator=(JsonArray&&) = delete; + JsonValue& operator=(JsonObject&&) = delete; + String serialized() const; void serialize(StringBuilder&) const;