Panda3D
|
Print to memory functionality. More...
#include <pandadoc.hpp>
Public Member Functions | |
__init__ () | |
__init__ (const TiXmlPrinter) | |
str | CStr () |
Return the result. | |
str | Indent () |
Query the indention string. | |
str | LineBreak () |
Query the current line breaking string. | |
SetIndent (str _indent) | |
Set the indent characters for printing. | |
SetLineBreak (str _lineBreak) | |
Set the line breaking string. | |
SetStreamPrinting () | |
Switch over to "stream printing" which is the most dense formatting without linebreaks. | |
int | Size () |
Return the length of the result string. | |
str | Str () |
Return the result. | |
![]() | |
__init__ () | |
__init__ (const TiXmlVisitor) | |
bool | Visit (const TiXmlComment) |
bool | Visit (const TiXmlDeclaration) |
bool | Visit (const TiXmlText) |
bool | Visit (const TiXmlUnknown) |
bool | VisitEnter (const TiXmlDocument) |
bool | VisitEnter (const TiXmlElement, const TiXmlAttribute) |
bool | VisitExit (const TiXmlDocument) |
bool | VisitExit (const TiXmlElement) |
Print to memory functionality.
The TiXmlPrinter is useful when you need to:
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() );
__init__ | ( | ) |
__init__ | ( | const TiXmlPrinter | ) |
str CStr | ( | ) |
Return the result.
str Indent | ( | ) |
Query the indention string.
str LineBreak | ( | ) |
Query the current line breaking string.
SetIndent | ( | str | _indent | ) |
Set the indent characters for printing.
By default 4 spaces but tab (\t) is also useful, or null/empty string for no indentation.
SetLineBreak | ( | str | _lineBreak | ) |
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.
SetStreamPrinting | ( | ) |
Switch over to "stream printing" which is the most dense formatting without linebreaks.
Common when the XML is needed for network transmission.
int Size | ( | ) |
Return the length of the result string.
str Str | ( | ) |
Return the result.