AK: Add mutable accessors for JsonValue's as_array and as_object

This commit is contained in:
Timothy Flynn 2022-11-17 16:17:13 -05:00 committed by Linus Groh
parent 13b18a182a
commit 5d61053276
Notes: sideshowbarker 2024-07-17 04:23:26 +09:00

View file

@ -164,12 +164,24 @@ public:
}
#endif
JsonObject& as_object()
{
VERIFY(is_object());
return *m_value.as_object;
}
JsonObject const& as_object() const
{
VERIFY(is_object());
return *m_value.as_object;
}
JsonArray& as_array()
{
VERIFY(is_array());
return *m_value.as_array;
}
JsonArray const& as_array() const
{
VERIFY(is_array());