From 4147394dcb607303eb6702bc40b6f9019575b1c3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 18 Jun 2019 09:11:31 +0200 Subject: [PATCH] AK: Add JsonValue(const char*). This should obviously become a string, but if we don't have it, constructing from a string literal ends up creating a boolean value. --- AK/JsonValue.cpp | 5 +++++ AK/JsonValue.h | 1 + 2 files changed, 6 insertions(+) diff --git a/AK/JsonValue.cpp b/AK/JsonValue.cpp index 1f8aee9afb..216160f10d 100644 --- a/AK/JsonValue.cpp +++ b/AK/JsonValue.cpp @@ -76,6 +76,11 @@ JsonValue::JsonValue(unsigned value) } } +JsonValue::JsonValue(const char* cstring) + : JsonValue(String(cstring)) +{ +} + JsonValue::JsonValue(double value) : m_type(Type::Double) { diff --git a/AK/JsonValue.h b/AK/JsonValue.h index d738906189..2d37614513 100644 --- a/AK/JsonValue.h +++ b/AK/JsonValue.h @@ -34,6 +34,7 @@ public: JsonValue(unsigned); JsonValue(double); JsonValue(bool); + JsonValue(const char*); JsonValue(const String&); JsonValue(const JsonArray&); JsonValue(const JsonObject&);