[#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. == Synopsis Declared in `<baljsn_simpleformatter.h>` [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). This class has an interface that's easier to use than that of `baljsn::Formatter`, and generates more correctly‐formatted `pretty` output. == Enums [cols="1,4"] |=== | Name| Description | xref:BloombergLP/baljsn/SimpleFormatter/ArrayFormattingStyle.adoc[`ArrayFormattingStyle`] | This `enum` lists all possible array formatting styles. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/baljsn/SimpleFormatter/2constructor-069.adoc[`SimpleFormatter`] [.small]#[constructor]# | Constructors | xref:BloombergLP/baljsn/SimpleFormatter/2destructor.adoc[`~SimpleFormatter`] [.small]#[destructor]# | Destroy this object. Note that correct JSON has been generated if the `isCompleteJSON()` call returns `true`. | xref:BloombergLP/baljsn/SimpleFormatter/addMemberName.adoc[`addMemberName`] | Print `name` in double‐quotes onto the stream supplied at construction. | 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. | xref:BloombergLP/baljsn/SimpleFormatter/closeArray.adoc[`closeArray`] | Print the characters that end a JSON array onto the output stream. | xref:BloombergLP/baljsn/SimpleFormatter/closeObject.adoc[`closeObject`] | Print the characters that end a JSON object onto the output stream. | xref:BloombergLP/baljsn/SimpleFormatter/isCompleteJSON.adoc[`isCompleteJSON`] | Return whether this formatter has produced complete JSON. | xref:BloombergLP/baljsn/SimpleFormatter/isFormattingArray.adoc[`isFormattingArray`] | Return whether this formatter is currently formatting an array. | xref:BloombergLP/baljsn/SimpleFormatter/isFormattingObject.adoc[`isFormattingObject`] | Return whether this formatter is currently formatting an object. | xref:BloombergLP/baljsn/SimpleFormatter/isNameNeeded.adoc[`isNameNeeded`] | Return whether a subsequent value must supply a name. | 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<SimpleFormatter, UsesBslmaAllocator>`] | Declare that `SimpleFormatter` uses a `bslma` allocator. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#