[#BloombergLP-baljsn-SimpleFormatter]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::SimpleFormatter
:relfileprefix: ../../
:mrdocs:

This class implements a formatter for rendering JSON text elements&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class SimpleFormatter;
----

== 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; This class has an interface that&apos;s easier to use than that of `baljsn&colon;&colon;Formatter`, and generates more correctly&hyphen;formatted `pretty` output&period;

== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/baljsn/SimpleFormatter/ArrayFormattingStyle.adoc[`ArrayFormattingStyle`] 
| This `enum` lists all possible array formatting styles&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/baljsn/SimpleFormatter/2constructor-069.adoc[`SimpleFormatter`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/baljsn/SimpleFormatter/2destructor.adoc[`&#126;SimpleFormatter`] [.small]#[destructor]#
| Destroy this object&period; Note that correct JSON has been generated if the `isCompleteJSON()` call returns `true`&period;
| xref:BloombergLP/baljsn/SimpleFormatter/addMemberName.adoc[`addMemberName`] 
| Print `name` in double&hyphen;quotes onto the stream supplied at construction&period;
| xref:BloombergLP/baljsn/SimpleFormatter/addNullValue-0e8.adoc[`addNullValue`] 
| `addNullValue` overloads
| xref:BloombergLP/baljsn/SimpleFormatter/addValue-05.adoc[`addValue`] 
| `addValue` overloads
| xref:BloombergLP/baljsn/SimpleFormatter/allocator.adoc[`allocator`] 
| Return the allocator used by this object to supply memory&period;
| xref:BloombergLP/baljsn/SimpleFormatter/closeArray.adoc[`closeArray`] 
| Print the characters that end a JSON array onto the output stream&period;
| xref:BloombergLP/baljsn/SimpleFormatter/closeObject.adoc[`closeObject`] 
| Print the characters that end a JSON object onto the output stream&period;
| xref:BloombergLP/baljsn/SimpleFormatter/isCompleteJSON.adoc[`isCompleteJSON`] 
| Return whether this formatter has produced complete JSON&period;
| xref:BloombergLP/baljsn/SimpleFormatter/isFormattingArray.adoc[`isFormattingArray`] 
| Return whether this formatter is currently formatting an array&period;
| xref:BloombergLP/baljsn/SimpleFormatter/isFormattingObject.adoc[`isFormattingObject`] 
| Return whether this formatter is currently formatting an object&period;
| xref:BloombergLP/baljsn/SimpleFormatter/isNameNeeded.adoc[`isNameNeeded`] 
| Return whether a subsequent value must supply a name&period;
| xref:BloombergLP/baljsn/SimpleFormatter/openArray-00.adoc[`openArray`] 
| `openArray` overloads
| xref:BloombergLP/baljsn/SimpleFormatter/openObject-0a.adoc[`openObject`] 
| `openObject` overloads
| xref:BloombergLP/baljsn/SimpleFormatter/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;SimpleFormatter, UsesBslmaAllocator&gt;`] 
| Declare that `SimpleFormatter` uses a `bslma` allocator&period;
|===



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