[#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&period;

== Synopsis

Declared in `&lt;baljsn&lowbar;formatter&period;h&gt;`

[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)&period;

== 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&period;
| xref:BloombergLP/baljsn/Formatter/closeArray.adoc[`closeArray`] 
| Print the characters that end a JSON array onto the output stream&period;
| xref:BloombergLP/baljsn/Formatter/closeMember.adoc[`closeMember`] 
| Print the characters that end a JSON member onto the output stream&period;
| xref:BloombergLP/baljsn/Formatter/closeObject.adoc[`closeObject`] 
| Print the characters that end a JSON object onto the output stream&period;
| xref:BloombergLP/baljsn/Formatter/nestingDepth.adoc[`nestingDepth`] 
| Return the number of currently open nested objects or arrays&period;
| xref:BloombergLP/baljsn/Formatter/openArray.adoc[`openArray`] 
| Print the characters that start a JSON array onto the output stream&period;
| xref:BloombergLP/baljsn/Formatter/openMember.adoc[`openMember`] 
| Print the start of a JSON member with the specified `name`&period;
| 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 &quot;object&quot; in JSON)&period;
| xref:BloombergLP/baljsn/Formatter/putNullValue.adoc[`putNullValue`] 
| Print onto the stream supplied at construction the value corresponding to a null element&period; Return 0 on success and a non&hyphen;zero value otherwise&period;
| xref:BloombergLP/baljsn/Formatter/putValue.adoc[`putValue`] 
| Print onto the stream supplied at construction the specified `value`&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
