TiXmlPrinter Class Reference
#include <tinyxml.h>
List of all members.
Detailed Description
Print to memory functionality. The TiXmlPrinter is useful when you need to:
- Print to memory (especially in non-STL mode)
- Control formatting (line endings, etc.)
When constructed, the TiXmlPrinter is in its default "pretty printing" mode. Before calling Accept() you can call methods to control the printing of the XML document. After TiXmlNode::Accept() is called, the printed document can be accessed via the CStr(), Str(), and Size() methods.
TiXmlPrinter uses the Visitor API.
TiXmlPrinter printer;
printer.SetIndent( "\t" );
doc.Accept( &printer );
fprintf( stdout, "%s", printer.CStr() );
Definition at line 1745 of file tinyxml.h.
Constructor & Destructor Documentation
TiXmlPrinter::TiXmlPrinter |
( |
|
) |
[inline] |
Member Function Documentation
const char* TiXmlPrinter::CStr |
( |
|
) |
[inline] |
void TiXmlPrinter::DoIndent |
( |
|
) |
[inline, private] |
void TiXmlPrinter::DoLineBreak |
( |
|
) |
[inline, private] |
const char* TiXmlPrinter::Indent |
( |
|
) |
[inline] |
Query the indention string.
Definition at line 1767 of file tinyxml.h.
const char* TiXmlPrinter::LineBreak |
( |
|
) |
[inline] |
Query the current line breaking string.
Definition at line 1774 of file tinyxml.h.
void TiXmlPrinter::SetIndent |
( |
const char * |
_indent |
) |
[inline] |
Set the indent characters for printing. By default 4 spaces but tab () is also useful, or null/empty string for no indentation.
Definition at line 1765 of file tinyxml.h.
void TiXmlPrinter::SetLineBreak |
( |
const char * |
_lineBreak |
) |
[inline] |
Set the line breaking string. By default set to newline (
). Some operating systems prefer other characters, or can be set to the null/empty string for no indenation.
Definition at line 1772 of file tinyxml.h.
void TiXmlPrinter::SetStreamPrinting |
( |
|
) |
[inline] |
Switch over to "stream printing" which is the most dense formatting without linebreaks. Common when the XML is needed for network transmission.
Definition at line 1779 of file tinyxml.h.
size_t TiXmlPrinter::Size |
( |
|
) |
[inline] |
Return the length of the result string.
Definition at line 1785 of file tinyxml.h.
bool TiXmlPrinter::Visit |
( |
const TiXmlText & |
|
) |
[virtual] |
bool TiXmlPrinter::VisitEnter |
( |
const TiXmlDocument & |
|
) |
[virtual] |
bool TiXmlPrinter::VisitExit |
( |
const TiXmlElement & |
|
) |
[virtual] |
Member Data Documentation
The documentation for this class was generated from the following files: