From 745ea2a0efdae71130de0f52ce8ec5b137b6d73c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 8 Feb 2020 02:48:27 +0100 Subject: [PATCH] AK: Add JsonObjectSerializer::add(key, bool) overload Without this, bools will get implicitly converted to integers, which is usually not what we want. --- AK/JsonObjectSerializer.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/AK/JsonObjectSerializer.h b/AK/JsonObjectSerializer.h index 07122e662d..0c6b1eda97 100644 --- a/AK/JsonObjectSerializer.h +++ b/AK/JsonObjectSerializer.h @@ -79,6 +79,12 @@ public: 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) { begin_item(key);