BloombergLP::balxml::Formatter_PrettyImplUtil::openElement

Open an element of the specified name.

Synopsis

Declared in <balxml_formatter_prettyimpl.h>

static
std::ostream&
openElement(
    std::ostream& stream,
    State* state,
    std::string_view const& name,
    WhitespaceType::Enum whitespaceMode = WhitespaceType::e_PRESERVE_WHITESPACE);

Description

Open an element of the specified name at current indent level with the optionally specified whitespace constraint whitespaceMode for its textual data to the specified stream, with formatting depending on the specified state, and update state accordingly, incrementing the indent level. Return the stream. whitespaceMode constrains how textual data is written with addListData for the current element, but not its nested elements. The behavior is undefined if openElement is called after the root element is closed and there is no subsequent call to reset.

Return Value

a reference to the modifiable stream

Parameters

NameDescription
streamoutput stream to write to
stateformatter state to update
namename of the element to open
whitespaceModewhitespace constraint for the element's data