1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 16:35:06 +00:00

AK: Add JsonObjectSerializer::add(key, bool) overload

Without this, bools will get implicitly converted to integers, which is
usually not what we want.
This commit is contained in:
Andreas Kling 2020-02-08 02:48:27 +01:00
parent f91b3aab47
commit 745ea2a0ef

View file

@ -79,6 +79,12 @@ public:
m_builder.append('"'); m_builder.append('"');
} }
void add(const StringView& key, bool value)
{
begin_item(key);
m_builder.append(value ? "true" : "false");
}
void add(const StringView& key, i32 value) void add(const StringView& key, i32 value)
{ {
begin_item(key); begin_item(key);