BloombergLP::baljsn::Formatter::Formatter

Create a Formatter object having the specified stream, usePrettyStyle, initialIndentLevel, spacesPerLevel, escapeForwardSlash, and basicAllocator attributes.

Synopsis

Declared in <baljsn_formatter.h>

Formatter(
    std::ostream& stream,
    bool usePrettyStyle,
    int initialIndentLevel,
    int spacesPerLevel,
    bool escapeForwardSlash,
    bslma::Allocator* basicAllocator = 0);

Parameters

NameDescription
streamoutput stream for formatted JSON
usePrettyStylewhether to use pretty encoding style
initialIndentLevelstarting indentation level for pretty style
spacesPerLevelspaces per indentation level for pretty style
escapeForwardSlashwhether to escape / as /
basicAllocatormemory allocator; null uses the default