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

Utility operations for compact (minimal&hyphen;whitespace) XML formatting&period;

== Synopsis

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

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

== Description

This utility `struct` provides a namespace for a suite of operations used to pretty&hyphen;print XML documents given a sequence of tokens to emit&period; Together with `Formatter&lowbar;CompactImplState`, 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_CompactImplUtil/State.adoc[`State`] 
| State type used by compact&hyphen;formatter utilities&period;
| xref:BloombergLP/balxml/Formatter_CompactImplUtil/StateId.adoc[`StateId`] 
| State&hyphen;id type used by compact&hyphen;formatter utilities&period;
| xref:BloombergLP/balxml/Formatter_CompactImplUtil/WhitespaceType.adoc[`WhitespaceType`] 
| Alias for `FormatterWhitespaceType`&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balxml/Formatter_CompactImplUtil/addAttribute.adoc[`addAttribute`] 
| Add an attribute of the specified `name` and `value` to the open element in the specified `stream`&period;
| xref:BloombergLP/balxml/Formatter_CompactImplUtil/addBlankLine.adoc[`addBlankLine`] 
| Insert one or two newlines so that a blank line results&period;
| xref:BloombergLP/balxml/Formatter_CompactImplUtil/addComment.adoc[`addComment`] 
| Write the specified `comment` into the specified `stream`&period;
| xref:BloombergLP/balxml/Formatter_CompactImplUtil/addData.adoc[`addData`] 
| Add the specified `value` as the data content to the specified `stream`&period;
| xref:BloombergLP/balxml/Formatter_CompactImplUtil/addElementAndData.adoc[`addElementAndData`] 
| Add an element of the specified `name` with the specified `value` as its data content to the specified `stream`&period;
| xref:BloombergLP/balxml/Formatter_CompactImplUtil/addHeader.adoc[`addHeader`] 
| Add an XML header with optionally specified `encoding`&period;
| xref:BloombergLP/balxml/Formatter_CompactImplUtil/addListData.adoc[`addListData`] 
| Add the specified `value` as list data content to the specified `stream`&period;
| xref:BloombergLP/balxml/Formatter_CompactImplUtil/addNewline.adoc[`addNewline`] 
| Insert a literal newline into the XML output&period;
| xref:BloombergLP/balxml/Formatter_CompactImplUtil/addValidComment.adoc[`addValidComment`] 
| Write a valid XML comment into the specified `stream`&period;
| xref:BloombergLP/balxml/Formatter_CompactImplUtil/closeElement.adoc[`closeElement`] 
| Close the most recently opened element of the specified `name`&period;
| xref:BloombergLP/balxml/Formatter_CompactImplUtil/flush.adoc[`flush`] 
| Flush the output stream, completing any open start tag first&period;
| xref:BloombergLP/balxml/Formatter_CompactImplUtil/openElement.adoc[`openElement`] 
| Open an element of the specified `name`&period;
| xref:BloombergLP/balxml/Formatter_CompactImplUtil/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]#
