<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>edelib: TiXmlPrinter Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">edelib  <span id="projectnumber">2.0.0</span> </div> </td> </tr> </tbody> </table> </div> <!-- Generated by Doxygen 1.7.6.1 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> </div> <div class="headertitle"> <div class="title">TiXmlPrinter Class Reference</div> </div> </div><!--header--> <div class="contents"> <!-- doxytag: class="TiXmlPrinter" --><!-- doxytag: inherits="TiXmlVisitor" --> <p>Print to memory. <a href="classTiXmlPrinter.html#details">More...</a></p> <p><code>#include <<a class="el" href="TiXml_8h_source.html">edelib/TiXml.h</a>></code></p> <div class="dynheader"> Inheritance diagram for TiXmlPrinter:</div> <div class="dyncontent"> <div class="center"> <img src="classTiXmlPrinter.png" usemap="#TiXmlPrinter_map" alt=""/> <map id="TiXmlPrinter_map" name="TiXmlPrinter_map"> <area href="classTiXmlVisitor.html" title="SAX emulation." alt="TiXmlVisitor" shape="rect" coords="0,0,81,24"/> </map> </div></div> <p><a href="classTiXmlPrinter-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a4f8a69ed237be9a69dcaf7e10988c7e2">TiXmlPrinter</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a5c35b47d196df5059f7ca7a90d31d5b2">SetIndent</a> (const char *_indent)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a35793ea09a1f98e6005741507f7e3980">Indent</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a6e83bf85282be30473185d1f4b00bbdf">SetLineBreak</a> (const char *_lineBreak)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#ab48af389e9a758e844f628c5497f33ab">LineBreak</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a6cf4cf5bc8e01dff0cb75d1bdfbf7e6d">SetStreamPrinting</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a91b713da0032c680dfa529354ecf1d0d">CStr</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#a7b470b21b5807f0a9162bef72aebfef9">Size</a> ()</td></tr> </table> <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><p>Print to memory. </p> <p>Print to memory functionality. The <a class="el" href="classTiXmlPrinter.html" title="Print to memory.">TiXmlPrinter</a> is useful when you need to:</p> <ol type="1"> <li>Print to memory (especially in non-STL mode)</li> <li>Control formatting (line endings, etc.)</li> </ol> <p>When constructed, the <a class="el" href="classTiXmlPrinter.html" title="Print to memory.">TiXmlPrinter</a> is in its default "pretty printing" mode. Before calling Accept() you can call methods to control the printing of the XML document. After <a class="el" href="classTiXmlNode.html#a3da2314556d60c86be93bcef3bcf8893">TiXmlNode::Accept()</a> is called, the printed document can be accessed via the <a class="el" href="classTiXmlPrinter.html#a91b713da0032c680dfa529354ecf1d0d">CStr()</a>, Str(), and <a class="el" href="classTiXmlPrinter.html#a7b470b21b5807f0a9162bef72aebfef9">Size()</a> methods.</p> <p><a class="el" href="classTiXmlPrinter.html" title="Print to memory.">TiXmlPrinter</a> uses the Visitor API. </p> <div class="fragment"><pre class="fragment"> * TiXmlPrinter printer; * printer.SetIndent( "\t" ); * * doc.Accept( &printer ); * fprintf( stdout, "%s", printer.CStr() ); * </pre></div> </div><hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a4f8a69ed237be9a69dcaf7e10988c7e2"></a><!-- doxytag: member="TiXmlPrinter::TiXmlPrinter" ref="a4f8a69ed237be9a69dcaf7e10988c7e2" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Empty constructor </p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a91b713da0032c680dfa529354ecf1d0d"></a><!-- doxytag: member="TiXmlPrinter::CStr" ref="a91b713da0032c680dfa529354ecf1d0d" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const char* <a class="el" href="classTiXmlPrinter.html#a91b713da0032c680dfa529354ecf1d0d">CStr</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Return the result. </p> <p>References <a class="el" href="classedelib_1_1String.html#afaee44f7b89e348000f3af4a76308d7b">String::c_str()</a>.</p> </div> </div> <a class="anchor" id="a35793ea09a1f98e6005741507f7e3980"></a><!-- doxytag: member="TiXmlPrinter::Indent" ref="a35793ea09a1f98e6005741507f7e3980" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const char* <a class="el" href="classTiXmlPrinter.html#a35793ea09a1f98e6005741507f7e3980">Indent</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Query the indention string. </p> <p>References <a class="el" href="classedelib_1_1String.html#afaee44f7b89e348000f3af4a76308d7b">String::c_str()</a>.</p> </div> </div> <a class="anchor" id="ab48af389e9a758e844f628c5497f33ab"></a><!-- doxytag: member="TiXmlPrinter::LineBreak" ref="ab48af389e9a758e844f628c5497f33ab" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const char* <a class="el" href="classTiXmlPrinter.html#ab48af389e9a758e844f628c5497f33ab">LineBreak</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Query the current line breaking string. </p> <p>References <a class="el" href="classedelib_1_1String.html#afaee44f7b89e348000f3af4a76308d7b">String::c_str()</a>.</p> </div> </div> <a class="anchor" id="a5c35b47d196df5059f7ca7a90d31d5b2"></a><!-- doxytag: member="TiXmlPrinter::SetIndent" ref="a5c35b47d196df5059f7ca7a90d31d5b2" args="(const char *_indent)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classTiXmlPrinter.html#a5c35b47d196df5059f7ca7a90d31d5b2">SetIndent</a> </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"><em>_indent</em></td><td>)</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Set the indent characters for printing. By default 4 spaces but tab (\t) is also useful, or null/empty string for no indentation. </p> </div> </div> <a class="anchor" id="a6e83bf85282be30473185d1f4b00bbdf"></a><!-- doxytag: member="TiXmlPrinter::SetLineBreak" ref="a6e83bf85282be30473185d1f4b00bbdf" args="(const char *_lineBreak)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classTiXmlPrinter.html#a6e83bf85282be30473185d1f4b00bbdf">SetLineBreak</a> </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"><em>_lineBreak</em></td><td>)</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Set the line breaking string. By default set to newline (<br/> ). Some operating systems prefer other characters, or can be set to the null/empty string for no indenation. </p> </div> </div> <a class="anchor" id="a6cf4cf5bc8e01dff0cb75d1bdfbf7e6d"></a><!-- doxytag: member="TiXmlPrinter::SetStreamPrinting" ref="a6cf4cf5bc8e01dff0cb75d1bdfbf7e6d" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classTiXmlPrinter.html#a6cf4cf5bc8e01dff0cb75d1bdfbf7e6d">SetStreamPrinting</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Switch over to "stream printing" which is the most dense formatting without linebreaks. Common when the XML is needed for network transmission. </p> </div> </div> <a class="anchor" id="a7b470b21b5807f0a9162bef72aebfef9"></a><!-- doxytag: member="TiXmlPrinter::Size" ref="a7b470b21b5807f0a9162bef72aebfef9" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">size_t <a class="el" href="classTiXmlPrinter.html#a7b470b21b5807f0a9162bef72aebfef9">Size</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Return the length of the result string. </p> <p>References <a class="el" href="classedelib_1_1String.html#af82978762f57d4553b0f2c1331c60e65">String::length()</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li>edelib/<a class="el" href="TiXml_8h_source.html">TiXml.h</a></li> </ul> </div><!-- contents --> <hr class="footer"/><address class="footer"><small> Generated on Tue Jun 5 2012 17:49:02 for edelib by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.7.6.1 </small></address> </body> </html>