SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 - 2018 SEGS Team (see Authors.txt)
5  * This software is licensed! (See License.txt 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 epilogue(BinaryOutputArchive &, QString const &)
Definition: serialization_common.h:110
void prologue(JSONOutputArchive &, QString const &)
Definition: serialization_common.h:115
void CEREAL_SAVE_FUNCTION_NAME(Archive &ar,::QString const &str)
Definition: serialization_common.h:120
void CEREAL_LOAD_FUNCTION_NAME(Archive &ar,::QString &str)
Serialization for basic_string types, if binary data is supported.
Definition: serialization_common.h:126