GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
Serializer.h
1 /*
2  * GDevelop Core
3  * Copyright 2008-2016 Florian Rival ([email protected]). All rights
4  * reserved. This project is released under the MIT License.
5  */
6 
7 #ifndef GDCORE_SERIALIZER_H
8 #define GDCORE_SERIALIZER_H
9 #include <string>
10 #include "GDCore/Serialization/SerializerElement.h"
11 
12 namespace gd {
13 
18 class GD_CORE_API Serializer {
19  public:
24 
28  static gd::String ToEscapedXMLString(const gd::String& str);
30 
37 
40  static gd::String ToJSON(const SerializerElement& element);
41 
45  static SerializerElement FromJSON(const char* json);
46 
50  static SerializerElement FromJSON(const gd::String& json) {
51  return FromJSON(json.c_str());
52  }
54 
55  virtual ~Serializer(){};
56 
57  private:
58  Serializer(){};
59 };
60 
61 } // namespace gd
62 
63 #endif
A generic container that can represent a value ( containing a string, double, bool or int),...
Definition: SerializerElement.h:37
The class used to save/load projects and GDCore classes from/to XML or JSON.
Definition: Serializer.h:18
static SerializerElement FromJSON(const gd::String &json)
Construct a gd::SerializerElement from a JSON string.
Definition: Serializer.h:50
String represents an UTF8 encoded string.
Definition: String.h:33
const char * c_str() const
Get the C-string.
Definition: String.h:359
Definition: CommonTools.h:24