From 09c59ee7c04efe19cbf8b0c14228474713ee949c Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Sun, 13 Nov 2022 00:49:54 -0500 Subject: [PATCH] AK: Support taking JSON values out of a JSON array --- AK/JsonArray.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AK/JsonArray.h b/AK/JsonArray.h index 57b6308dd1..0a2de05246 100644 --- a/AK/JsonArray.h +++ b/AK/JsonArray.h @@ -55,6 +55,8 @@ public: [[nodiscard]] JsonValue const& at(size_t index) const { return m_values.at(index); } [[nodiscard]] JsonValue const& operator[](size_t index) const { return at(index); } + [[nodiscard]] JsonValue take(size_t index) { return m_values.take(index); } + void clear() { m_values.clear(); } void append(JsonValue value) { m_values.append(move(value)); } void set(size_t index, JsonValue value) { m_values[index] = move(value); }