summaryrefslogtreecommitdiffhomepage
path: root/serialize/string.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-05 19:29:40 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-05 19:29:40 +0100
commit12eca108a07cde1606fca3e472aed58749407699 (patch)
tree44ac90dffca8cde0fc06800c5546cd12f5cd9249 /serialize/string.hpp
parent28f5a46ba0058752d4e92cc66e0260f4ed2b8cf3 (diff)
replace std::string with Corrade's String
Diffstat (limited to 'serialize/string.hpp')
-rw-r--r--serialize/string.hpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/serialize/string.hpp b/serialize/string.hpp
new file mode 100644
index 00000000..a3923527
--- /dev/null
+++ b/serialize/string.hpp
@@ -0,0 +1,31 @@
+#pragma once
+
+#include <nlohmann/json_fwd.hpp>
+
+namespace Corrade::Containers {
+
+template<typename T> class BasicStringView;
+class String;
+using StringView = BasicStringView<const char>;
+
+} // namespace Corrade::Containers
+
+namespace floormat {
+
+} // namespace floormat
+
+namespace nlohmann {
+
+template<>
+struct adl_serializer<Corrade::Containers::String> {
+ static void to_json(json& j, const Corrade::Containers::String& val);
+ static void from_json(const json& j, Corrade::Containers::String& val);
+};
+
+template<>
+struct adl_serializer<Corrade::Containers::StringView> {
+ static void to_json(json& j, const Corrade::Containers::StringView& val);
+ static void from_json(const json& j, Corrade::Containers::StringView& val);
+};
+
+} // namespace nlohmann