[#BloombergLP-balxml-Formatter-addData]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balxml.adoc[balxml]::xref:BloombergLP/balxml/Formatter.adoc[Formatter]::addData
:relfileprefix: ../../../
:mrdocs:

Add the specified `value` as the data content, where `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; Perform no line&hyphen;wrapping or indentation as if the whitespace constraint were always `BAEXML&lowbar;PRESERVE&lowbar;WHITESPACE` in `openElement`, with the only exception that an initial newline and an initial indent is added when `openElement` specifies `BAEXML&lowbar;NEWLINE&lowbar;INDENT` option&period; If `value` is of type `bsl&colon;&colon;string` or convertible to `bsl&colon;&colon;string&lowbar;view`, the presence of invalid input stops the transfer of data to the output specified on construction (see &lcub;Valid Strings&rcub;)&period; If `value` is of type `bsl&colon;&colon;string` or convertible to `bsl&colon;&colon;string&lowbar;view`, characters in `value` are escaped (see &lcub;Special Characters&rcub;)&period; If `value` is of type `char`, it is cast to a signed byte value with a range of `&lsqb; &hyphen;128 &period;&period; 127 &rsqb;`&period; Optionally specify the `formattingMode` 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;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
void
addData(
    TYPE const& value,
    int formattingMode = 0);
----


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