Format XML tags, attributes, and data with indentation and wrapping.
Synopsis
Declared in <balxml_formatter.h>
class Formatter;
Description
This class provides a set of XML‐style formatting utilities that enable transparent indentation and wrapping for users attempting to format data with XML tags and attributes. A formatter object is instantiated with a pointer to an output stream or streambuf. Users can then use the provided utilities to write element tags, attributes, data in a valid XML sequence into the underlying stream.
This class has no features that would impair thread safety. However, it does not mediate between two threads attempting to access the same stream.
Type Aliases
Name |
Description |
|
Member Functions
Name |
Description |
|
Constructors |
Add an attribute of the specified |
|
Insert newline characters into the output stream such that a blank line results. |
|
Write the specified |
|
Add the specified |
|
Add an element of the specified |
|
Add an XML declaration header with the optionally specified |
|
Add the specified |
|
Insert a literal newline into the XML output. If following a call to |
|
Write the specified |
|
Close the most recently opened element of the specified |
|
Return the encoder options being used. |
|
Insert the closing |
|
Return the current level of indentation. |
|
Open an element of the specified |
|
Return the current column position where the next output starts. |
|
Return a reference to the underlying output stream. |
|
Reset the formatter such that it can be used to format a new XML document as if the formatter were just constructed |
|
Return the number of spaces per indentation level. |
|
Return 0 if no errors have been detected since construction or since the last call to |
|
Return the line width where line‐wrapping takes place. |
Static Data Members
Name |
Description |
Deprecated alias for |
|
In addition to wrapping and indentation, place tags and data on separate lines. |
|
Preserve whitespace in element text; data is output as‐is. |
|
Wrap long lines when output would otherwise exceed the wrap column. |
|
Wrap long lines and indent continuation lines after wrapping. |
Created with MrDocs