[#BloombergLP-baljsn-Formatter] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::Formatter :relfileprefix: ../../ :mrdocs: This class implements a formatter for rendering JSON text elements. == Synopsis Declared in `<baljsn_formatter.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- 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 [cols="1,4"] |=== | Name| Description | xref:BloombergLP/baljsn/Formatter/2constructor-02.adoc[`Formatter`] [.small]#[constructor]# | Constructors | xref:BloombergLP/baljsn/Formatter/addArrayElementSeparator.adoc[`addArrayElementSeparator`] | Print a JSON array element separator onto the output stream. | xref:BloombergLP/baljsn/Formatter/closeArray.adoc[`closeArray`] | Print the characters that end a JSON array onto the output stream. | xref:BloombergLP/baljsn/Formatter/closeMember.adoc[`closeMember`] | Print the characters that end a JSON member onto the output stream. | xref:BloombergLP/baljsn/Formatter/closeObject.adoc[`closeObject`] | Print the characters that end a JSON object onto the output stream. | xref:BloombergLP/baljsn/Formatter/nestingDepth.adoc[`nestingDepth`] | Return the number of currently open nested objects or arrays. | xref:BloombergLP/baljsn/Formatter/openArray.adoc[`openArray`] | Print the characters that start a JSON array onto the output stream. | xref:BloombergLP/baljsn/Formatter/openMember.adoc[`openMember`] | Print the start of a JSON member with the specified `name`. | xref:BloombergLP/baljsn/Formatter/openObject.adoc[`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). | xref:BloombergLP/baljsn/Formatter/putNullValue.adoc[`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. | xref:BloombergLP/baljsn/Formatter/putValue.adoc[`putValue`] | Print onto the stream supplied at construction the specified `value`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#