Utility operations for compact (minimal‐whitespace) XML formatting.

Synopsis

Declared in <balxml_formatter_compactimpl.h>

struct Formatter_CompactImplUtil;

Description

This utility struct provides a namespace for a suite of operations used to pretty‐print XML documents given a sequence of tokens to emit. Together with Formatter_CompactImplState, this struct provides an implementation of a state machine for such pretty‐printing.

Type Aliases

Name

Description

State

State type used by compact‐formatter utilities.

StateId

State‐id type used by compact‐formatter utilities.

WhitespaceType

Alias for FormatterWhitespaceType.

Static Member Functions

Name

Description

addAttribute

Add an attribute of the specified name and value to the open element in the specified stream.

addBlankLine

Insert one or two newlines so that a blank line results.

addComment

Write the specified comment into the specified stream.

addData

Add the specified value as the data content to the specified stream.

addElementAndData

Add an element of the specified name with the specified value as its data content to the specified stream.

addHeader

Add an XML header with optionally specified encoding.

addListData

Add the specified value as list data content to the specified stream.

addNewline

Insert a literal newline into the XML output.

addValidComment

Write a valid XML comment into the specified stream.

closeElement

Close the most recently opened element of the specified name.

flush

Flush the output stream, completing any open start tag first.

openElement

Open an element of the specified name.

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.

Created with MrDocs