[#BloombergLP-baljsn-SimpleFormatter-2constructor-06d] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::xref:BloombergLP/baljsn/SimpleFormatter.adoc[SimpleFormatter]::SimpleFormatter :relfileprefix: ../../../ :mrdocs: Create a `SimpleFormatter` that writes JSON to `stream` using `encoderOptions`. == Synopsis Declared in `<baljsn_simpleformatter.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit SimpleFormatter( std::ostream& stream, xref:BloombergLP/baljsn/EncoderOptions.adoc[EncoderOptions] const& encoderOptions, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- == Description Create a `SimpleFormatter` object using the specified `stream`. Optionally specify `encoderOptions` to configure the output options * if `encoderOptions` is not supplied, a default‐constructed `EncoderOptions` object will be used. Note that the `encodeEmptyArrays` attribute in the `encoderOptions` is ignored. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is 0, the currently installed default allocator is used. == Parameters [cols="1,4"] |=== | Name| Description | *stream* | output stream for formatted JSON | *encoderOptions* | options configuring JSON output | *basicAllocator* | memory allocator; null uses the default |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#