mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-21 08:48:57 +00:00
AK: Provide a few mutable JSON object/array accessors
We have mutable accessors on the JsonValue class already. This will be needed for interaction with Firefox's DevTools, where we will want to mutate the serialized DOM tree we receive from WebContent.
This commit is contained in:
parent
705001483a
commit
0fc1d4cd69
Notes:
github-actions[bot]
2025-02-19 13:47:48 +00:00
Author: https://github.com/trflynn89
Commit: 0fc1d4cd69
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3589
Reviewed-by: https://github.com/ADKaster
3 changed files with 44 additions and 0 deletions
|
@ -52,6 +52,7 @@ public:
|
|||
[[nodiscard]] bool has_array(StringView key) const;
|
||||
[[nodiscard]] bool has_object(StringView key) const;
|
||||
|
||||
Optional<JsonValue&> get(StringView key);
|
||||
Optional<JsonValue const&> get(StringView key) const;
|
||||
|
||||
template<Integral T>
|
||||
|
@ -76,7 +77,10 @@ public:
|
|||
|
||||
Optional<ByteString> get_byte_string(StringView key) const;
|
||||
|
||||
Optional<JsonObject&> get_object(StringView key);
|
||||
Optional<JsonObject const&> get_object(StringView key) const;
|
||||
|
||||
Optional<JsonArray&> get_array(StringView key);
|
||||
Optional<JsonArray const&> get_array(StringView key) const;
|
||||
|
||||
Optional<double> get_double_with_precision_loss(StringView key) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue