#include <balxml_formatter_prettyimpl.h>
This struct
provides a namespace for enumerating the set of labels for distinct states of Formatter_PrettyImplState
.
◆ Enum
Enumerator |
---|
e_AT_START | This state indicates that the current write position of the formatter is at the start of the document. The formatter is only allowed to add an XML header when in this state.
|
e_AFTER_START_NO_TAG | This state indicates that the current write position of the formatter is after some tokens have been emitted, such as an XML header and/or some comments, but before any XML tags have been emitted. The formatter is not allowed to emit an XML header when in this state.
|
e_IN_TAG | This state indicates that the current write position of the formatter is immediately after the name of an opening tag, or otherwise immediately after the value of an attribute of an opening tag. In this state, most token printing operations, other than adding attributes, need to emit a ">" character to close the currently open tag before emitting their content. For example: 1| <someTag
`---------^
* Note that there is no '>' character yet
or: 1| <someTag attr="value" otherAttr="42"
`-------------------------------------^
|
e_FIRST_DATA_BETWEEN_TAGS | This state indicates that the current write position of the formatter is after a complete opening tag, before any data for the tag, and that there are tokens already emitted on the current line (i.e., that the current write position is not at the start of the line). In this state, whether or not token printing operations need to emit a new line and indentation generally depends on the whitespace mode set for the currently-open tag. Note that comments are not considered data. For example: 1| <someTag>
`----------^
or: 1| <someTag> <!-- comment -->
`---------------------------^
or: 1| <someTag attr="value">
2| <!-- comment -->
`-------------------^
|
e_FIRST_DATA_AT_LINE_BETWEEN_TAGS | This state indicates that the current write position of the formatter is at column 0 (i.e., that it is at the start of a new line) and either 1) after a closing tag, or 2) after a complete opening tag and optional data. In this state, most token printing operations need to emit indentation before their content. For example: or: 1| <someTag>
2| </someTag>
3|
`^
* Note that the 'closeElement' operation, which is used to
print closing tags, e.g., "</example>", *always* writes a
newline character after the closing tag.
or: 1| <someTag>
2| some list data
3| some more list data
4|
`^
|
e_TRAILING_DATA_BETWEEN_TAGS | This state indicates that the current write position of the formatter is after one or more data tokens for the currently-open tag, and that there are tokens already emitted on the current line (i.e., that the current write position is not at the start of a new line). In this state, data printing operations must put delimiting whitespace before their data. What whitespace they emit may depend on the whitespace mode of the currently-open tag. For example: 1| <someTag> someData
`-------------------^
or 1| <someTag>
2| some list data
3| some more list data
`----------------------^
|
e_AT_END | This state indicates that the current write position of the formatter is immediately after the top-level closing tag of the document.
|
The documentation for this struct was generated from the following file: