[#BloombergLP-baljsn-Formatter-2constructor-08] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::xref:BloombergLP/baljsn/Formatter.adoc[Formatter]::Formatter :relfileprefix: ../../../ :mrdocs: 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. == Synopsis Declared in `<baljsn_formatter.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- Formatter( std::ostream& stream, bool usePrettyStyle = false, int initialIndentLevel = 0, int spacesPerLevel = 0, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#