[#BloombergLP-balxml-Formatter_PrettyImplUtil-addData] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balxml.adoc[balxml]::xref:BloombergLP/balxml/Formatter_PrettyImplUtil.adoc[Formatter_PrettyImplUtil]::addData :relfileprefix: ../../../ :mrdocs: Add the specified `value` as data content to the specified `stream`. == Synopsis Declared in `<balxml_formatter_prettyimpl.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class VALUE_TYPE> static std::ostream& addData( std::ostream& stream, xref:BloombergLP/balxml/Formatter_PrettyImplUtil/State.adoc[State]* state, VALUE_TYPE const& value, int formattingMode = 0, xref:BloombergLP/balxml/EncoderOptions.adoc[EncoderOptions] const& encoderOptions = EncoderOptions()); ---- == Description Format depending on the specified `state`, and update `state` accordingly. Return the `stream`. `value` can be of the following types: `char`, `short`, `int`, `bsls::Types::Int64`, `float`, `double`, `bsl::string`, `bdlt::Datetime`, `bdlt::Date`, and `bdlt::Time`. Perform no line‐wrapping or indentation as if the whitespace constraint were always `BAEXML_PRESERVE_WHITESPACE` in `openElement`, with the only exception that an initial newline and an initial indent is added when `openElement` specifies `BAEXML_NEWLINE_INDENT` option. If `value` is of type `bsl::string`, it is truncated at any invalid UTF‐8 byte‐sequence or any control character. The list of invalid control characters includes characters in the range `[0x00, 0x20)]` and `0x7F` (DEL) but does not include `0x9`, `0xA`, and `0x0D`. The five special characters: apostrophe, double quote, ampersand, less than, and greater than are escaped in the output XML. If `value` is of type `char`, it is cast to a signed byte value with a range of '[ ‐128 .. 127 ]`. Optionally specify the `formattingMode' and `encoderOptions` to specify the format used to encode `value`. The behavior is undefined if the call is made when there are no opened elements. == Return Value a reference to the modifiable `stream` == Parameters [cols="1,4"] |=== | Name| Description | *stream* | output stream to write to | *state* | formatter state to update | *value* | data content to add | *formattingMode* | mode used to format `value` | *encoderOptions* | options controlling encoding of `value` |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#