|
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
21 #ifndef ELM_JSON_SAVER_H_
22 #define ELM_JSON_SAVER_H_
24 #include <elm/data/Vector.h>
26 #include <elm/io/BufferedOutStream.h>
27 #include <elm/io/StructuredOutput.h>
28 #include <elm/string/utf8.h>
29 #include <elm/sys/Path.h>
32 namespace elm {
namespace json {
44 inline string getIndent(
void)
const {
return indent; }
66 virtual void write(
bool x)
override;
67 virtual void write(
char c)
override;
68 virtual void write(
signed char x)
override;
69 virtual void write(
unsigned char x)
override;
70 virtual void write(
short x)
override;
71 virtual void write(
unsigned short x)
override;
72 virtual void write(
int x)
override;
73 virtual void write(
unsigned int x)
override;
74 virtual void write(
long x)
override;
75 virtual void write(
unsigned long x)
override;
76 virtual void write(
long long int x)
override;
77 virtual void write(
long long unsigned int x)
override;
78 virtual void write(
float x)
override;
79 virtual void write(
double x)
override;
80 virtual void write(
long double x)
override;
81 virtual void write(
const char *s)
override;
83 virtual void write(
const string& x)
override;
85 virtual void key(
const string& x)
override;
87 virtual void endMap()
override;
89 virtual void endList()
override;
102 void doIndent(
bool close =
false);
103 static state_t next(state_t s);
104 static bool isObject(state_t s);
105 static bool isArray(state_t s);
107 inline void nextByValue(
void);
typename type_info< T >::out_t out
Definition: type_info.h:284
void beginObject(void)
Definition: Saver.h:48
void endObject(void)
Definition: Saver.h:49
void put(void)
Definition: json.cpp:307
virtual void write(bool x) override
Definition: json.cpp:320
void endArray(void)
Definition: Saver.h:51
Definition: StringBuffer.h:18
sys::SystemOutStream & out
Definition: system_SystemIO.cpp:122
void put(const char *val)
Definition: Saver.h:56
virtual void beginList() override
Definition: json.cpp:213
long int64
Definition: arch.h:32
void put(double val)
Definition: Saver.h:62
CString cstring
Definition: CString.h:62
virtual void endList() override
Definition: json.cpp:226
void setReadable(bool read)
Definition: Saver.h:43
string getIndent(void) const
Definition: Saver.h:44
void put(t::uint64 val)
Definition: Saver.h:59
virtual void endMap() override
Definition: json.cpp:200
FileInput read(sys::Path path)
Definition: io.h:26
void put(bool val)
Definition: Saver.h:63
void put(cstring val)
Definition: Saver.h:57
~Saver(void)
Definition: json.cpp:71
bool isReadable(void) const
Definition: Saver.h:42
void put(int val)
Definition: Saver.h:61
void addField(string id)
Definition: Saver.h:52
unsigned long uint64
Definition: arch.h:33
Definition: BufferedOutStream.h:31
void setIndent(string i)
Definition: Saver.h:45
Definition: OutStream.h:30
Definition: StructuredOutput.h:28
void put(string val)
Definition: Saver.h:58
virtual void key(cstring x) override
Definition: json.cpp:261
virtual void beginMap() override
Definition: json.cpp:187
void close(void)
Definition: json.cpp:108
void put(t::int64 val)
Definition: Saver.h:60
void beginArray(void)
Definition: Saver.h:50
t::uint32 char_t
Definition: utf8.h:31
Saver(io::OutStream &out=io::out)
Definition: json.cpp:47