[#BloombergLP-balxml-Formatter_PrettyImplUtil]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balxml.adoc[balxml]::Formatter&lowbar;PrettyImplUtil
:relfileprefix: ../../
:mrdocs:

This utility `struct` provides a namespace for pretty&hyphen;printing XML&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct Formatter&lowbar;PrettyImplUtil;
----

== Description

It provides a suite of operations used to pretty&hyphen;print XML documents given a sequence of tokens to emit&period; Together with `Formatter&lowbar;PrettyImplState`, this `struct` provides an implementation of a state machine for such pretty&hyphen;printing&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balxml/Formatter_PrettyImplUtil/State.adoc[`State`] 
| State type used by pretty&hyphen;formatter utilities&period;
| xref:BloombergLP/balxml/Formatter_PrettyImplUtil/StateId.adoc[`StateId`] 
| State&hyphen;id type used by pretty&hyphen;formatter utilities&period;
| xref:BloombergLP/balxml/Formatter_PrettyImplUtil/WhitespaceType.adoc[`WhitespaceType`] 
| Alias for `FormatterWhitespaceType`&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balxml/Formatter_PrettyImplUtil/addAttribute.adoc[`addAttribute`] 
| Add an attribute of the specified `name` and `value` to the currently open element&period;
| xref:BloombergLP/balxml/Formatter_PrettyImplUtil/addBlankLine.adoc[`addBlankLine`] 
| Insert one or two newlines so that a blank line results&period;
| xref:BloombergLP/balxml/Formatter_PrettyImplUtil/addComment.adoc[`addComment`] 
| Write the specified `comment` into the specified `stream`&period;
| xref:BloombergLP/balxml/Formatter_PrettyImplUtil/addData.adoc[`addData`] 
| Add the specified `value` as data content to the specified `stream`&period;
| xref:BloombergLP/balxml/Formatter_PrettyImplUtil/addElementAndData.adoc[`addElementAndData`] 
| Add an element of the specified `name` with the specified `value` as its data content&period;
| xref:BloombergLP/balxml/Formatter_PrettyImplUtil/addHeader.adoc[`addHeader`] 
| Add an XML declaration header with the optionally specified `encoding`&period;
| xref:BloombergLP/balxml/Formatter_PrettyImplUtil/addListData.adoc[`addListData`] 
| Add the specified `value` as list&hyphen;item data content to the specified `stream`&period;
| xref:BloombergLP/balxml/Formatter_PrettyImplUtil/addNewline.adoc[`addNewline`] 
| Insert a literal newline into the XML output&period;
| xref:BloombergLP/balxml/Formatter_PrettyImplUtil/addValidComment.adoc[`addValidComment`] 
| Write the specified `comment` into the specified `stream`&period;
| xref:BloombergLP/balxml/Formatter_PrettyImplUtil/closeElement.adoc[`closeElement`] 
| Close the most recently opened element of the specified `name`&period;
| xref:BloombergLP/balxml/Formatter_PrettyImplUtil/flush.adoc[`flush`] 
| Insert the closing `&gt;` if there is an incomplete tag, and flush the output stream&period;
| xref:BloombergLP/balxml/Formatter_PrettyImplUtil/openElement.adoc[`openElement`] 
| Open an element of the specified `name`&period;
| xref:BloombergLP/balxml/Formatter_PrettyImplUtil/reset.adoc[`reset`] 
| Reset the specified formatter `state` such that it can be used to format a new XML document as if the formatter were just constructed&period;
|===



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