Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/json/Saver.h>
Public Member Functions | |
Saver (io::OutStream &out=io::out) | |
Saver (StringBuffer &buf) | |
Saver (sys::Path &path) | |
~Saver (void) | |
void | close (void) |
bool | isReadable (void) const |
void | setReadable (bool read) |
string | getIndent (void) const |
void | setIndent (string i) |
void | beginObject (void) |
void | endObject (void) |
void | beginArray (void) |
void | endArray (void) |
void | addField (string id) |
void | put (void) |
void | put (const char *val) |
void | put (cstring val) |
void | put (string val) |
void | put (t::uint64 val) |
void | put (t::int64 val) |
void | put (int val) |
void | put (double val) |
void | put (bool val) |
virtual void | write (bool x) override |
virtual void | write (char c) override |
virtual void | write (signed char x) override |
virtual void | write (unsigned char x) override |
virtual void | write (short x) override |
virtual void | write (unsigned short x) override |
virtual void | write (int x) override |
virtual void | write (unsigned int x) override |
virtual void | write (long x) override |
virtual void | write (unsigned long x) override |
virtual void | write (long long int x) override |
virtual void | write (long long unsigned int x) override |
virtual void | write (float x) override |
virtual void | write (double x) override |
virtual void | write (long double x) override |
virtual void | write (const char *s) override |
virtual void | write (cstring x) override |
virtual void | write (const string &x) override |
virtual void | key (cstring x) override |
virtual void | key (const string &x) override |
virtual void | beginMap () override |
virtual void | endMap () override |
virtual void | beginList () override |
virtual void | endList () override |
Public Member Functions inherited from StructuredOutput | |
virtual | ~StructuredOutput () |
void | key (const char *x) |
Object dedicated to write a JSON file. When this object is created, a first level object must be created where the user can add pairs of (key, value) with addField() and put methods. A value may be null, a boolean, an integer, a float, a string, an array or a new object. An object is started with beginObject() and anded by endObject(). An array is made of several values (possibly of different types), is started by beginArray() and ended by endArray().
Saver | ( | io::OutStream & | out = io::out | ) |
References Output::setStream().
Saver | ( | StringBuffer & | buf | ) |
References Output::setStream(), and StringBuffer::stream().
References System::createFile(), and Output::setStream().
References Saver::close().
References Saver::key().
References Saver::beginList().
|
overridevirtual |
Begin an array. Only allowed inside an array or in a field.
Implements StructuredOutput.
References Vector< T, E, A >::push().
Referenced by Saver::beginArray().
|
overridevirtual |
Begin an object. Only allowed at the beginning of the output, after adding an object or inside an array.
Implements StructuredOutput.
References Vector< T, E, A >::push().
Referenced by Saver::beginObject().
References Saver::beginMap().
References Saver::endList().
|
overridevirtual |
End an array. Only allowed inside an array.
Implements StructuredOutput.
References Vector< T, E, A >::pop().
Referenced by Saver::endArray().
|
overridevirtual |
End an object. Only allowed inside an object.
Implements StructuredOutput.
References Vector< T, E, A >::pop().
Referenced by Saver::endObject().
References Saver::endMap().
Test if the saver will generate human readable JSON output.
Referenced by Saver::key().
Add a field. Only allowed inside an object.
Implements StructuredOutput.
References elm::_, Saver::isReadable(), and Vector< T, E, A >::push().
Add a field. Only allowed inside an object.
Implements StructuredOutput.
References elm::_, Saver::isReadable(), and Vector< T, E, A >::push().
Referenced by Saver::addField().
References Saver::write().
|
inline |
References Saver::put().
Referenced by Saver::put().
References Saver::write().
|
inline |
References Saver::write().
|
inline |
References Saver::put().
Referenced by Saver::put().
References Saver::write().
References Saver::write().
References Saver::write().
Put a null value.
References Vector< T, E, A >::pop().
Set the indentation string.
i | Identation string (must be only composed of JSON blank characters). |
Set the human readable output option.
read | True for human readable output, false else. |
References elm::io::read().
Put a boolean value.
val | Value to put. |
Implements StructuredOutput.
References Vector< T, E, A >::pop().
Referenced by Saver::put(), and Saver::write().
|
overridevirtual |
Put a character value.
chr | Character to put. |
Implements StructuredOutput.
References Vector< T, E, A >::pop().
|
overridevirtual |
Put a string value.
str | String to put. |
Implements StructuredOutput.
References elm::str(), and Saver::write().
Put a string value.
val | String to put. |
Implements StructuredOutput.
References Vector< T, E, A >::pop().
Put a string value.
str | String to put. |
Implements StructuredOutput.
References Vector< T, E, A >::pop(), and elm::str().
|
overridevirtual |
Implements StructuredOutput.
|
overridevirtual |
Implements StructuredOutput.
|
overridevirtual |
Implements StructuredOutput.
|
overridevirtual |
Implements StructuredOutput.
|
overridevirtual |
Implements StructuredOutput.
|
overridevirtual |
Implements StructuredOutput.
|
overridevirtual |
Implements StructuredOutput.
|
overridevirtual |
Implements StructuredOutput.
|
overridevirtual |
Implements StructuredOutput.
|
overridevirtual |
Implements StructuredOutput.
|
overridevirtual |
Implements StructuredOutput.
|
overridevirtual |
Implements StructuredOutput.
|
overridevirtual |
Implements StructuredOutput.