![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
Print to memory functionality. More...
#include <tinyxml.h>
Public Member Functions | |
| TiXmlPrinter () | |
| virtual bool | VisitEnter (const TiXmlDocument &doc) |
| Visit a document. | |
| virtual bool | VisitExit (const TiXmlDocument &doc) |
| Visit a document. | |
| virtual bool | VisitEnter (const TiXmlElement &element, const TiXmlAttribute *firstAttribute) |
| Visit an element. | |
| virtual bool | VisitExit (const TiXmlElement &element) |
| Visit an element. | |
| virtual bool | Visit (const TiXmlDeclaration &declaration) |
| Visit a declaration. | |
| virtual bool | Visit (const TiXmlText &text) |
| Visit a text node. | |
| virtual bool | Visit (const TiXmlComment &comment) |
| Visit a comment node. | |
| virtual bool | Visit (const TiXmlUnknown &unknown) |
| Visit an unknow node. | |
| virtual bool | Visit (const TiXmlStylesheetReference &stylesheet) |
| Visit a stylesheet reference. | |
| void | SetIndent (const char *_indent) |
| Set the indent characters for printing. | |
| const char * | Indent () |
| Query the indention string. | |
| void | SetLineBreak (const char *_lineBreak) |
| Set the line breaking string. | |
| const char * | LineBreak () |
| Query the current line breaking string. | |
| void | SetStreamPrinting () |
| Switch over to "stream printing" which is the most dense formatting without linebreaks. | |
| const char * | CStr () |
| Return the result. | |
| size_t | Size () |
| Return the length of the result string. | |
| const std::string & | Str () |
| Return the result. | |
Private Member Functions | |
| void | DoIndent () |
| void | DoLineBreak () |
Private Attributes | |
| int | depth |
| bool | simpleTextPrint |
| TIXML_STRING | buffer |
| TIXML_STRING | indent |
| TIXML_STRING | lineBreak |
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() );
|
inline |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inline |
|
inline |
|
inline |
|
inline |
|
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 2112 of file tinyxml.h.
References indent, and lineBreak.
Referenced by TiXmlNode::operator<<, and TiXmlNode::operator<<.
|
inline |
|
inline |
Return the result.
Definition at line 2123 of file tinyxml.h.
References buffer.
Referenced by TiXmlNode::operator<<, and TiXmlNode::operator<<.
|
virtual |
Visit a comment node.
Reimplemented from TiXmlVisitor.
Definition at line 1722 of file tinyxml.cpp.
References buffer, DoIndent(), DoLineBreak(), and TiXmlNode::Value().
|
virtual |
Visit a declaration.
Reimplemented from TiXmlVisitor.
Definition at line 1715 of file tinyxml.cpp.
References buffer, DoIndent(), DoLineBreak(), and TiXmlDeclaration::Print().
|
virtual |
Visit a stylesheet reference.
Reimplemented from TiXmlVisitor.
Definition at line 1740 of file tinyxml.cpp.
References buffer, DoIndent(), DoLineBreak(), and TiXmlStylesheetReference::Print().
Visit a text node.
Reimplemented from TiXmlVisitor.
Definition at line 1693 of file tinyxml.cpp.
References buffer, TiXmlText::CDATA(), DoIndent(), DoLineBreak(), TiXmlBase::EncodeString(), simpleTextPrint, TIXML_STRING, TiXmlNode::Value(), and TiXmlNode::ValueTStr().
|
virtual |
Visit an unknow node.
Reimplemented from TiXmlVisitor.
Definition at line 1731 of file tinyxml.cpp.
References buffer, DoIndent(), DoLineBreak(), and TiXmlNode::Value().
|
virtual |
Visit a document.
Reimplemented from TiXmlVisitor.
Definition at line 1636 of file tinyxml.cpp.
|
virtual |
Visit an element.
Reimplemented from TiXmlVisitor.
Definition at line 1640 of file tinyxml.cpp.
References buffer, TiXmlText::CDATA(), depth, DoIndent(), DoLineBreak(), TiXmlNode::FirstChild(), TiXmlNode::LastChild(), TiXmlAttribute::Next(), simpleTextPrint, TiXmlNode::ToText(), and TiXmlNode::Value().
|
virtual |
Visit a document.
Reimplemented from TiXmlVisitor.
Definition at line 1638 of file tinyxml.cpp.
|
virtual |
Visit an element.
Reimplemented from TiXmlVisitor.
Definition at line 1672 of file tinyxml.cpp.
References buffer, depth, DoIndent(), DoLineBreak(), TiXmlNode::FirstChild(), simpleTextPrint, and TiXmlNode::Value().
|
private |
Definition at line 2135 of file tinyxml.h.
Referenced by TiXmlPrinter(), CStr(), DoIndent(), DoLineBreak(), Size(), Str(), Visit(), Visit(), Visit(), Visit(), Visit(), VisitEnter(), and VisitExit().
|
private |
Definition at line 2133 of file tinyxml.h.
Referenced by TiXmlPrinter(), DoIndent(), VisitEnter(), and VisitExit().
|
private |
Definition at line 2136 of file tinyxml.h.
Referenced by TiXmlPrinter(), DoIndent(), Indent(), SetIndent(), and SetStreamPrinting().
|
private |
Definition at line 2137 of file tinyxml.h.
Referenced by TiXmlPrinter(), DoLineBreak(), LineBreak(), SetLineBreak(), and SetStreamPrinting().
|
private |
Definition at line 2134 of file tinyxml.h.
Referenced by TiXmlPrinter(), Visit(), VisitEnter(), and VisitExit().