Awkward Array: ToJsonPrettyString Class Reference

Loading...
Searching...
No Matches
Public Member Functions | List of all members
ToJsonPrettyString Class Reference

Produces a pretty JSON-formatted string. More...

`#include <json.h>`

Inheritance diagram for ToJsonPrettyString:

## Public Member Functions
| ToJsonPrettyString (int64_t maxdecimals, 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 ToJsonPrettyString with a full set of parameters.
| ~ToJsonPrettyString ()
| 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.
const std::string | tostring ()
| Return the accumulated data 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.

## Detailed Description

Produces a pretty JSON-formatted string.

## Constructor & Destructor Documentation

## ◆ ToJsonPrettyString()

ToJsonPrettyString | ( | int64_t | maxdecimals,
|  | 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 ToJsonPrettyString with a full set of parameters.

Parameters

  maxdecimals | Maximum number of decimals for floating-point numbers or `-1` for full precision.
  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

## ◆ ~ToJsonPrettyString()

~ToJsonPrettyString | ( |  | ) |

Empty destructor; required for some C++ reason.

## Member Function Documentation

## ◆ beginlist()

void beginlist | ( |  | ) |
| overridevirtual

Begin a list.

Implements ToJson.

## ◆ beginrecord()

void beginrecord | ( |  | ) |
| overridevirtual

Begin a record.

Implements ToJson.

## ◆ boolean()

void boolean | ( | bool | x | ) |
| overridevirtual

Append a boolean value `x`.

Implements ToJson.

## ◆ complex()

void complex | ( | std::complex< double > | x | ) |
| overridevirtual

Append a complex value `x`.

Implements ToJson.

## ◆ endlist()

void endlist | ( |  | ) |
| overridevirtual

End the current list.

Implements ToJson.

## ◆ endrecord()

void endrecord | ( |  | ) |
| overridevirtual

End the current record.

Implements ToJson.

## ◆ field()

void field | ( | const char * | x | ) |
| overridevirtual

Insert a key for a key-value pair.

Implements ToJson.

## ◆ integer()

void integer | ( | int64_t | x | ) |
| overridevirtual

Append an integer value `x`.

Implements ToJson.

## ◆ json()

void json | ( | const char * | data | ) |
| overridevirtual

Write raw JSON as a string.

Implements ToJson.

## ◆ null()

void null | ( |  | ) |
| overridevirtual

Append a `null` value.

Implements ToJson.

## ◆ real()

void real | ( | double | x | ) |
| overridevirtual

Append a real value `x`.

Implements ToJson.

## ◆ string()

void string | ( | const char * | x,
|  | int64_t | length
| ) |  |
| overridevirtual

Append a string value `x`.

Implements ToJson.

## ◆ tostring()

const std::string tostring | ( |  | ) |

Return the accumulated data as a string.

The documentation for this class was generated from the following file:

- include/awkward/io/json.h