Produces a pretty JSON-formatted file. More...
#include <json.h>
Public Member Functions | |
ToJsonPrettyFile (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 ToJsonPrettyFile with a full set of parameters. More... | |
~ToJsonPrettyFile () | |
Empty destructor; required for some C++ reason. More... | |
void | null () override |
Append a null value. More... | |
void | boolean (bool x) override |
Append a boolean value x . More... | |
void | integer (int64_t x) override |
Append an integer value x . More... | |
void | real (double x) override |
Append a real value x . More... | |
void | complex (std::complex< double > x) override |
Append a complex value x . More... | |
void | string (const char *x, int64_t length) override |
Append a string value x . More... | |
void | beginlist () override |
Begin a list. More... | |
void | endlist () override |
End the current list. More... | |
void | beginrecord () override |
Begin a record. More... | |
void | field (const char *x) override |
Insert a key for a key-value pair. More... | |
void | endrecord () override |
End the current record. More... | |
void | json (const char *data) override |
Write raw JSON as a string. More... | |
![]() | |
virtual | ~ToJson () |
Virtual destructor acts as a first non-inline virtual function that determines a specific translation unit in which vtable shall be emitted. More... | |
void | string (const std::string &x) |
Append a string value x . More... | |
void | field (const std::string &x) |
Insert a key for a key-value pair. More... | |
Produces a pretty JSON-formatted file.
ToJsonPrettyFile | ( | 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 ToJsonPrettyFile 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 |
~ToJsonPrettyFile | ( | ) |
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.