summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-06-18 09:11:31 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-06-18 09:11:31 +0200
commit4147394dcb607303eb6702bc40b6f9019575b1c3 (patch)
tree796a8b030d279cadc50ba0050240dca270f38b29
parent1a761ea4fdd722309613fcd80a6160c113cc4b2a (diff)
downloadserenity-4147394dcb607303eb6702bc40b6f9019575b1c3.zip
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.
-rw-r--r--AK/JsonValue.cpp5
-rw-r--r--AK/JsonValue.h1
2 files changed, 6 insertions, 0 deletions
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&);