[#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` object using the specified `stream`. Optionally specify `usePrettyStyle` to inform the formatter whether the pretty encoding style should be used when writing data. If `usePrettyStyle` is not specified then the data is written in a compact style. If `usePrettyStyle` is specified, additionally specify `initialIndentLevel` and `spacesPerLevel` to provide the initial indentation level and spaces per level at which the data should be formatted. If `initialIndentLevel` or `spacesPerLevel` is not specified then an initial value of `0` is used for both parameters. If `usePrettyStyle` is `false` then `initialIndentLevel` and `spacesPerLevel` are both ignored. Optionally specify `escapeForwardSlash`. If `escapeForwardSlash` is specified as `false`, `/` characters will be formatted as‐is, otherwise, they will be rendered with a leading backslash, as "\/". Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is 0, the currently installed default allocator is used. [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..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#