[#BloombergLP-baljsn-Formatter-2constructor-02] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::xref:BloombergLP/baljsn/Formatter.adoc[Formatter]::Formatter :relfileprefix: ../../../ :mrdocs: Constructors == Synopses Declared in `<baljsn_formatter.h>` Create a `Formatter` that writes JSON text to the specified `stream`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/baljsn/Formatter/2constructor-08.adoc[Formatter]( std::ostream& stream, bool usePrettyStyle = false, int initialIndentLevel = 0, int spacesPerLevel = 0, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/baljsn/Formatter/2constructor-08.adoc[_» more..._]# Create a `Formatter` object having the specified `stream`, `usePrettyStyle`, `initialIndentLevel`, `spacesPerLevel`, `escapeForwardSlash`, and `basicAllocator` attributes. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/baljsn/Formatter/2constructor-0a.adoc[Formatter]( std::ostream& stream, bool usePrettyStyle, int initialIndentLevel, int spacesPerLevel, bool escapeForwardSlash, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/baljsn/Formatter/2constructor-0a.adoc[_» more..._]# == Parameters [cols="1,4"] |=== | Name| Description | *stream* | output stream for formatted JSON | *usePrettyStyle* | whether to use pretty encoding style | *initialIndentLevel* | starting indentation level for pretty style | *spacesPerLevel* | spaces per indentation level for pretty style | *basicAllocator* | memory allocator; null uses the default | *escapeForwardSlash* | whether to escape `/` as `/` |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#