ToJson Class Referenceabstract

#include <json.h>

Inheritance diagram for ToJson:
ToJsonFile ToJsonPrettyFile ToJsonPrettyString ToJsonString

Public Member Functions

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

Abstract base class for producing JSON data.

Constructor & Destructor Documentation

◆ ~ToJson()

virtual ~ToJson ( )
virtual

Virtual destructor acts as a first non-inline virtual function that determines a specific translation unit in which vtable shall be emitted.

Member Function Documentation

◆ beginlist()

virtual void beginlist ( )
pure virtual

Begin a list.

Implemented in ToJsonPrettyFile, ToJsonFile, ToJsonPrettyString, and ToJsonString.

◆ beginrecord()

virtual void beginrecord ( )
pure virtual

Begin a record.

Implemented in ToJsonPrettyFile, ToJsonFile, ToJsonPrettyString, and ToJsonString.

◆ boolean()

virtual void boolean ( bool  x)
pure virtual

Append a boolean value x.

Implemented in ToJsonPrettyFile, ToJsonFile, ToJsonPrettyString, and ToJsonString.

◆ complex()

virtual void complex ( std::complex< double >  x)
pure virtual

Append a complex value x.

Implemented in ToJsonPrettyFile, ToJsonFile, ToJsonPrettyString, and ToJsonString.

◆ endlist()

virtual void endlist ( )
pure virtual

End the current list.

Implemented in ToJsonPrettyFile, ToJsonFile, ToJsonPrettyString, and ToJsonString.

◆ endrecord()

virtual void endrecord ( )
pure virtual

End the current record.

Implemented in ToJsonPrettyFile, ToJsonFile, ToJsonPrettyString, and ToJsonString.

◆ field() [1/2]

virtual void field ( const char *  x)
pure virtual

Insert a key for a key-value pair.

Implemented in ToJsonPrettyFile, ToJsonFile, ToJsonPrettyString, and ToJsonString.

◆ field() [2/2]

void field ( const std::string &  x)

Insert a key for a key-value pair.

◆ integer()

virtual void integer ( int64_t  x)
pure virtual

Append an integer value x.

Implemented in ToJsonPrettyFile, ToJsonFile, ToJsonPrettyString, and ToJsonString.

◆ json()

virtual void json ( const char *  data)
pure virtual

Write raw JSON as a string.

Implemented in ToJsonPrettyFile, ToJsonFile, ToJsonPrettyString, and ToJsonString.

◆ null()

virtual void null ( )
pure virtual

Append a null value.

Implemented in ToJsonPrettyFile, ToJsonFile, ToJsonPrettyString, and ToJsonString.

◆ real()

virtual void real ( double  x)
pure virtual

Append a real value x.

Implemented in ToJsonPrettyFile, ToJsonFile, ToJsonPrettyString, and ToJsonString.

◆ string() [1/2]

virtual void string ( const char *  x,
int64_t  length 
)
pure virtual

Append a string value x.

Implemented in ToJsonPrettyFile, ToJsonFile, ToJsonPrettyString, and ToJsonString.

◆ string() [2/2]

void string ( const std::string &  x)

Append a string value x.


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