BloombergLP::balxml::Formatter_PrettyImplUtil::addElementAndData

Add an element of the specified name with the specified value as its data content.

Synopsis

Declared in <balxml_formatter_prettyimpl.h>

template<class TYPE>
static
std::ostream&
addElementAndData(
    std::ostream& stream,
    State* state,
    std::string_view const& name,
    TYPE const& value,
    int formattingMode = 0,
    EncoderOptions const& encoderOptions = EncoderOptions());

Description

Write to the specified stream, with formatting depending on the specified state and the optionally specified encoderOptions, and update state accordingly. Return the stream. This has the same effect as calling the following sequence: 'openElement(name); addData(value), closeElement(name);'. Optionally specify the formattingMode.

Return Value

a reference to the modifiable stream

Parameters

NameDescription
streamoutput stream to write to
stateformatter state to update
namename of the element
valuedata content of the element
formattingModemode used to format value
encoderOptionsoptions controlling encoding of value