This class implements a formatter for rendering JSON text elements.

Synopsis

Declared in <baljsn_formatter.h>

class Formatter;

Description

This class provides operations for rendering JSON text elements to an output stream (supplied at construction) according to a set of formatting options (also supplied at construction).

Member Functions

Name

Description

Formatter [constructor]

Constructors

addArrayElementSeparator

Print a JSON array element separator onto the output stream.

closeArray

Print the characters that end a JSON array onto the output stream.

closeMember

Print the characters that end a JSON member onto the output stream.

closeObject

Print the characters that end a JSON object onto the output stream.

nestingDepth

Return the number of currently open nested objects or arrays.

openArray

Print the characters that start a JSON array onto the output stream.

openMember

Print the start of a JSON member with the specified name.

openObject

Print onto the stream supplied at construction the sequence of characters designating the start of an object (referred to as an "object" in JSON).

putNullValue

Print onto the stream supplied at construction the value corresponding to a null element. Return 0 on success and a non‐zero value otherwise.

putValue

Print onto the stream supplied at construction the specified value.

Created with MrDocs