[#BloombergLP-balxml-Formatter_CompactImplUtil-addListData]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balxml.adoc[balxml]::xref:BloombergLP/balxml/Formatter_CompactImplUtil.adoc[Formatter&lowbar;CompactImplUtil]::addListData
:relfileprefix: ../../../
:mrdocs:

Add the specified `value` as list data content to the specified `stream`&period;

== Synopsis

Declared in `&lt;balxml&lowbar;formatter&lowbar;compactimpl&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class VALUE&lowbar;TYPE&gt;
static
std::ostream&
addListData(
    std::ostream& stream,
    xref:BloombergLP/balxml/Formatter_CompactImplUtil/State.adoc[State]* state,
    VALUE&lowbar;TYPE const& value,
    int formattingMode = 0,
    xref:BloombergLP/balxml/EncoderOptions.adoc[EncoderOptions] const& encoderOptions = EncoderOptions());
----

== Description

Formatting depends on the specified `state`, which is updated accordingly&period; Return the `stream`&period; `value` can be of the following types&colon; `char`, `short`, `int`, `bsls&colon;&colon;Types&colon;&colon;Int64`, `float`, `double`, `bsl&colon;&colon;string`, `bdlt&colon;&colon;Datetime`, `bdlt&colon;&colon;Date`, and `bdlt&colon;&colon;Time`&period; Prefix the `value` with a space(`0x20`) unless the data being added is the first data on a line&period; When adding the data makes the line too long, perform line&hyphen;wrapping and indentation as determined by the whitespace constraint used when the current element is opened with `openElement`&period; If `value` is of type `bsl&colon;&colon;string`, it is truncated at any invalid UTF&hyphen;8 byte&hyphen;sequence or any control character&period; The list of invalid control characters includes characters in the range `&lsqb;0x00, 0x20)&rsqb;` and `0x7F` (DEL) but does not include `0x9`, `0xA`, and `0x0D`&period; The five special characters&colon; apostrophe, double quote, ampersand, less than, and greater than are escaped in the output XML&period; If `value` is of type `char`, it is cast to a signed byte value with a range of &apos;&lsqb; &hyphen;128 &period;&period;&rsqb; 127 &rsqb;`&period; Optionally specify the `formattingMode&apos; and `encoderOptions` to specify the format used to encode `value`&period; The behavior is undefined if the call is made when there are no opened elements&period;

== Return Value

a reference to the modifiable `stream`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *stream*
| output stream
| *state*
| formatter state to consult and update
| *value*
| list&hyphen;item data value to write
| *formattingMode*
| optional formatting mode for `value`
| *encoderOptions*
| optional encoder options for `value`
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
