BloombergLP::balxml::Formatter_CompactImplUtil::addElementAndData

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

Synopsis

Declared in <balxml_formatter_compactimpl.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

Formatting depends on the specified state and the optionally specified encoderOptions, and state is updated 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
stateformatter state to consult and update
nameelement name
valueelement data content
formattingModeoptional formatting mode for value
encoderOptionsoptional encoder options for value