From d2fcaad5425acb4a50138e793e3dcecc6600e4d3 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 27 Nov 2022 15:28:05 +0100 Subject: wip scenery list --- serialize/corrade-string.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'serialize/corrade-string.cpp') diff --git a/serialize/corrade-string.cpp b/serialize/corrade-string.cpp index 16ae23e1..7b772d4c 100644 --- a/serialize/corrade-string.cpp +++ b/serialize/corrade-string.cpp @@ -28,4 +28,12 @@ void adl_serializer::to_json(json& j, StringView val) to_json(j, s); } +void adl_serializer::from_json(const json& j, StringView& val) +{ + using nlohmann::from_json; + std::string_view s; + from_json(j, s); + val = StringView{s.data(), s.size()}; +} + } // namespace nlohmann -- cgit v1.2.3