|
cereal
A C++11 library for serialization
|
An output archive designed to save data to JSON. More...
#include <cereal/archives/json.hpp>
Public Member Functions | |
| JSONOutputArchive (std::ostream &stream) | |
| Construct, outputting to the provided stream. More... | |
| ~JSONOutputArchive () | |
| Destructor, flushes the JSON. | |
| void | saveValue (bool b) |
| void | saveValue (int i) |
| void | saveValue (unsigned u) |
| void | saveValue (int64_t i64) |
| void | saveValue (uint64_t u64) |
| void | saveValue (double d) |
| void | saveValue (std::string const &s) |
| void | saveValue (char const *s) |
| void | saveNull () |
| void | writeName () |
| void | rawString (std::string const &s) |
| void | startNode () |
| Creates a new node that is a child of the node at the top of the stack. More... | |
| void | finishNode () |
| Designates the most recently added node as finished. | |
| void | setNextName (const char *name) |
| Sets the name for the next node created with startNode. | |
| void | saveBinaryValue (const void *data, size_t size, const char *name=nullptr) |
| Saves some binary data, encoded as a base64 string, with an optional name. More... | |
| void | setOutputType (bool outputType) |
Public Member Functions inherited from cereal::OutputArchive< JSONOutputArchive > | |
| OutputArchive (JSONOutputArchive *const self) | |
| Construct the output archive. More... | |
| JSONOutputArchive & | operator() (Types &&...args) |
| Serializes all passed in data. | |
| std::uint32_t | registerSharedPointer (void const *addr) |
| Registers a shared pointer with the archive. More... | |
| std::uint32_t | registerPolymorphicType (char const *name) |
| Registers a polymorphic type name with the archive. More... | |
An output archive designed to save data to JSON.
|
inline |
Construct, outputting to the provided stream.
| stream | The stream to output to. Can be a stringstream, a file stream, or even cout! |
|
inline |
Saves some binary data, encoded as a base64 string, with an optional name.
This will create a new node, optionally named, and insert a value that consists of the data encoded as a base64 string
|
inline |
Creates a new node that is a child of the node at the top of the stack.
Nodes will be given a name that has either been pre-set by a name value pair, or generated based upon a counter unique to the parent node.
The node will then be pushed onto the node stack.
1.8.3.1