Produces a JSON-formatted file. More...
#include <json.h>
Public Member Functions | |
| ToJsonFile (FILE *destination, int64_t maxdecimals, int64_t buffersize, const char *nan_string=nullptr, const char *infinity_string=nullptr, const char *minus_infinity_string=nullptr, const char *complex_real_string=nullptr, const char *complex_imag_string=nullptr) | |
| Creates a ToJsonFile with a full set of parameters. | |
| ~ToJsonFile () | |
| Empty destructor; required for some C++ reason. | |
| void | null () override |
Append a null value. | |
| void | boolean (bool x) override |
Append a boolean value x. | |
| void | integer (int64_t x) override |
Append an integer value x. | |
| void | real (double x) override |
Append a real value x. | |
| void | complex (std::complex< double > x) override |
Append a complex value x. | |
| void | string (const char *x, int64_t length) override |
Append a string value x. | |
| void | beginlist () override |
| Begin a list. | |
| void | endlist () override |
| End the current list. | |
| void | beginrecord () override |
| Begin a record. | |
| void | field (const char *x) override |
| Insert a key for a key-value pair. | |
| void | endrecord () override |
| End the current record. | |
| void | json (const char *data) override |
| Write raw JSON as a string. | |
Public Member Functions inherited from ToJson | |
| virtual | ~ToJson () |
| Virtual destructor acts as a first non-inline virtual function that determines a specific translation unit in which vtable shall be emitted. | |
| virtual void | null ()=0 |
Append a null value. | |
| virtual void | boolean (bool x)=0 |
Append a boolean value x. | |
| virtual void | integer (int64_t x)=0 |
Append an integer value x. | |
| virtual void | real (double x)=0 |
Append a real value x. | |
| virtual void | complex (std::complex< double > x)=0 |
Append a complex value x. | |
| virtual void | string (const char *x, int64_t length)=0 |
Append a string value x. | |
| virtual void | beginlist ()=0 |
| Begin a list. | |
| virtual void | endlist ()=0 |
| End the current list. | |
| virtual void | beginrecord ()=0 |
| Begin a record. | |
| virtual void | field (const char *x)=0 |
| Insert a key for a key-value pair. | |
| virtual void | endrecord ()=0 |
| End the current record. | |
| virtual void | json (const char *data)=0 |
| Write raw JSON as a string. | |
| void | string (const std::string &x) |
Append a string value x. | |
| void | field (const std::string &x) |
| Insert a key for a key-value pair. | |
Produces a JSON-formatted file.
| ToJsonFile | ( | FILE * | destination, |
| int64_t | maxdecimals, | ||
| int64_t | buffersize, | ||
| const char * | nan_string = nullptr, |
||
| const char * | infinity_string = nullptr, |
||
| const char * | minus_infinity_string = nullptr, |
||
| const char * | complex_real_string = nullptr, |
||
| const char * | complex_imag_string = nullptr |
||
| ) |
Creates a ToJsonFile with a full set of parameters.
| destination | C file handle to the file to write. |
| maxdecimals | Maximum number of decimals for floating-point numbers or -1 for full precision. |
| buffersize | Number of bytes for an intermediate buffer. |
| nan_string | user-defined string for a not-a-number (NaN) value representation in JSON format |
| infinity_string | user-defined string for a positive infinity representation in JSON format |
| minus_infinity_string | user-defined string for a negative infinity representation in JSON format |
| complex_real_string | user-defined string for a complex number real part representation in JSON format |
| complex_imag_string | user-defined string for a complex number imaginary part representation in JSON format |
| ~ToJsonFile | ( | ) |
Empty destructor; required for some C++ reason.
|
overridevirtual |
Begin a list.
Implements ToJson.
|
overridevirtual |
Begin a record.
Implements ToJson.
|
overridevirtual |
Append a boolean value x.
Implements ToJson.
|
overridevirtual |
Append a complex value x.
Implements ToJson.
|
overridevirtual |
End the current list.
Implements ToJson.
|
overridevirtual |
End the current record.
Implements ToJson.
|
overridevirtual |
Insert a key for a key-value pair.
Implements ToJson.
|
overridevirtual |
Append an integer value x.
Implements ToJson.
|
overridevirtual |
Write raw JSON as a string.
Implements ToJson.
|
overridevirtual |
Append a null value.
Implements ToJson.
|
overridevirtual |
Append a real value x.
Implements ToJson.
|
overridevirtual |
Append a string value x.
Implements ToJson.