Loading...
Searching...
No Matches
StringFactoryKeySerialization.hpp
1#pragma once
2#include <score/plugins/StringFactoryKey.hpp>
4#include <score/serialization/JSONValueVisitor.hpp>
5
6//SCORE_SERALIZE_DATASTREAM_DEFINE_T(template<typename T>, StringKey<T>)
7
8template <typename U>
10{
11 static void readFrom(DataStream::Serializer& s, const StringKey<U>& key)
12 {
13 s.stream() << key.toString();
14 }
15
16 static void writeTo(DataStream::Deserializer& s, StringKey<U>& key)
17 {
18 s.stream() >> key.toString();
19 }
20};
21
22/*
23template <typename U>
24struct TSerializer<JSONValue, StringKey<U>>
25{
26 static void readFrom(JSONObject::Serializer& s, const StringKey<U>& key)
27 {
28 s.val = QString::fromStdString(key.toString());
29 }
30
31 static void writeTo(JSONValue::Serializer& s, StringKey<U>& key)
32 {
33 key.toString() = s.val.toString().toStdString();
34 }
35};
36*/
Definition VisitorInterface.hpp:53
Definition DataStreamVisitor.hpp:27
Definition DataStreamVisitor.hpp:202
Definition StringFactoryKey.hpp:8
Definition VisitorInterface.hpp:13