SEGS  0.6.1-develop [d2cac982]
Super Entity Game Server
CerealHelpers.h
Go to the documentation of this file.
1 /*
2  * SEGS - Super Entity Game Server
3  * http://www.segs.io/
4  * Copyright (c) 2006 - 2019 SEGS Team (see AUTHORS.md)
5  * This software is licensed under the terms of the 3-clause BSD License. See LICENSE.md for details.
6  */
7 
8 #ifndef CEREALHELPERS_H
9 #define CEREALHELPERS_H
10 #include <QString>
11 #include <cereal/archives/json.hpp>
12 
13 namespace cereal {
14 inline void epilogue(BinaryOutputArchive &, QString const &) { }
15 inline void epilogue(BinaryInputArchive &, QString const &) { }
16 inline void epilogue(JSONOutputArchive &, QString const &) { }
17 inline void epilogue(JSONInputArchive &, QString const &) { }
18 
19 inline void prologue(JSONOutputArchive &, QString const &) { }
20 inline void prologue(JSONInputArchive &, QString const &) { }
21 inline void prologue(BinaryOutputArchive &, QString const &) { }
22 inline void prologue(BinaryInputArchive &, QString const &) { }
23 
24 template<class Archive> inline void CEREAL_SAVE_FUNCTION_NAME(Archive & ar, ::QString const & str)
25 {
26  ar( str.toStdString() );
27 }
29 template<class Archive> inline void CEREAL_LOAD_FUNCTION_NAME(Archive & ar, ::QString & str)
30 {
31  std::string rd;
32  ar( rd );
33  str = QString::fromStdString(rd);
34 }
35 }
36 #endif // CEREALHELPERS_H
void CEREAL_SAVE_FUNCTION_NAME(Archive &ar, ::QString const &str)
Definition: serialization_types.h:80
void epilogue(BinaryOutputArchive &, QString const &)
Definition: serialization_types.h:42
void CEREAL_LOAD_FUNCTION_NAME(Archive &ar, ::QString &str)
Serialization for utf8-like types, if binary data is supported.
Definition: serialization_types.h:95
Definition: serialization_types.h:41
void prologue(JSONOutputArchive &, QString const &)
Definition: serialization_types.h:47