mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 05:35:52 +03:00
AK: Add mutable accessors for JsonValue's as_array and as_object
This commit is contained in:
parent
13b18a182a
commit
5d61053276
Notes:
sideshowbarker
2024-07-17 04:23:26 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/5d61053276 Pull-request: https://github.com/SerenityOS/serenity/pull/16099 Reviewed-by: https://github.com/linusg
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user