diff options
Diffstat (limited to 'AK')
-rw-r--r-- | AK/JsonValue.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/AK/JsonValue.h b/AK/JsonValue.h index 1c31a46dd9..59415fdac8 100644 --- a/AK/JsonValue.h +++ b/AK/JsonValue.h @@ -63,6 +63,13 @@ public: template<typename Builder> void serialize(Builder&) const; + String as_string_or(const String& alternative) + { + if (is_string()) + return as_string(); + return alternative; + } + String to_string() const { if (is_string()) |