Awkward Array: ToJsonString Class Reference

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

Produces a JSON-formatted string. More...

`#include <json.h>`

Inheritance diagram for ToJsonString:

## Public Member Functions
| ToJsonString (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 ToJsonString with a full set of parameters. More...
| ~ToJsonString ()
| 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...
const std::string | tostring ()
| Return the accumulated data as a string. More...
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. More...
virtual void | null ()=0
| Append a `null` value. More...
virtual void | boolean (bool x)=0
| Append a boolean value `x`. More...
virtual void | integer (int64_t x)=0
| Append an integer value `x`. More...
virtual void | real (double x)=0
| Append a real value `x`. More...
virtual void | complex (std::complex< double > x)=0
| Append a complex value `x`. More...
virtual void | string (const char *x, int64_t length)=0
| Append a string value `x`. More...
virtual void | beginlist ()=0
| Begin a list. More...
virtual void | endlist ()=0
| End the current list. More...
virtual void | beginrecord ()=0
| Begin a record. More...
virtual void | field (const char *x)=0
| Insert a key for a key-value pair. More...
virtual void | endrecord ()=0
| End the current record. More...
virtual void | json (const char *data)=0
| Write raw JSON as a string. 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...

## Detailed Description

Produces a JSON-formatted string.

## Constructor & Destructor Documentation

## ◆ ToJsonString()

ToJsonString | ( | 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 ToJsonString 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

## ◆ ~ToJsonString()

~ToJsonString | ( |  | ) |

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