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.

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

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

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

Created with MrDocs