From 39cdafa09930a5255639cd008dd673cb7437451d Mon Sep 17 00:00:00 2001 From: Sainan Date: Sat, 28 Dec 2024 00:20:57 +0100 Subject: [PATCH] Add JsonString::JsonString(const std::string&) --- soup/JsonString.cpp | 5 +++++ soup/JsonString.hpp | 1 + 2 files changed, 6 insertions(+) diff --git a/soup/JsonString.cpp b/soup/JsonString.cpp index a90ef41c..8a20ebe9 100644 --- a/soup/JsonString.cpp +++ b/soup/JsonString.cpp @@ -11,6 +11,11 @@ NAMESPACE_SOUP { } + JsonString::JsonString(const std::string& value) noexcept + : JsonNode(JSON_STRING), value(value) + { + } + JsonString::JsonString(std::string&& value) noexcept : JsonNode(JSON_STRING), value(std::move(value)) { diff --git a/soup/JsonString.hpp b/soup/JsonString.hpp index 3b761fc9..9bc18246 100644 --- a/soup/JsonString.hpp +++ b/soup/JsonString.hpp @@ -11,6 +11,7 @@ NAMESPACE_SOUP std::string value{}; explicit JsonString() noexcept; + explicit JsonString(const std::string& value) noexcept; explicit JsonString(std::string&& value) noexcept; explicit JsonString(const char*& c) SOUP_EXCAL;