mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00: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
1 changed files with 12 additions and 0 deletions
|
@ -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 a new issue