Group PJSUA2_JSON

group PJSUA2_JSON

Provides object serialization and deserialization to/from JSON document.

class JsonDocument : public pj::PersistentDocument
#include <json.hpp>

Persistent document (file) with JSON format.

Public Functions

JsonDocument()

Default constructor

~JsonDocument()

Destructor

virtual void loadFile(const string &filename)

Load this document from a file.

Parameters:

filename – The file name.

virtual void loadString(const string &input)

Load this document from string.

Parameters:

input – The string.

virtual void saveFile(const string &filename)

Write this document to a file.

Parameters:

filename – The file name.

virtual string saveString()

Write this document to string.

virtual ContainerNode &getRootContainer() const

Get the root container node for this document

pj_json_elem *allocElement() const

An internal function to create JSON element.

pj_pool_t *getPool()

An internal function to get the pool.