• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5<meta http-equiv="X-UA-Compatible" content="IE=9"/>
6<meta name="generator" content="Doxygen 1.8.13"/>
7<meta name="viewport" content="width=device-width, initial-scale=1"/>
8<title>TinyXML-2: tinyxml2::XMLPrinter Class Reference</title>
9<link href="tabs.css" rel="stylesheet" type="text/css"/>
10<script type="text/javascript" src="jquery.js"></script>
11<script type="text/javascript" src="dynsections.js"></script>
12<link href="search/search.css" rel="stylesheet" type="text/css"/>
13<script type="text/javascript" src="search/searchdata.js"></script>
14<script type="text/javascript" src="search/search.js"></script>
15<link href="doxygen.css" rel="stylesheet" type="text/css" />
16</head>
17<body>
18<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
19<div id="titlearea">
20<table cellspacing="0" cellpadding="0">
21 <tbody>
22 <tr style="height: 56px;">
23  <td id="projectalign" style="padding-left: 0.5em;">
24   <div id="projectname">TinyXML-2
25   &#160;<span id="projectnumber">7.0.0</span>
26   </div>
27  </td>
28 </tr>
29 </tbody>
30</table>
31</div>
32<!-- end header part -->
33<!-- Generated by Doxygen 1.8.13 -->
34<script type="text/javascript">
35var searchBox = new SearchBox("searchBox", "search",false,'Search');
36</script>
37<script type="text/javascript" src="menudata.js"></script>
38<script type="text/javascript" src="menu.js"></script>
39<script type="text/javascript">
40$(function() {
41  initMenu('',true,false,'search.php','Search');
42  $(document).ready(function() { init_search(); });
43});
44</script>
45<div id="main-nav"></div>
46<!-- window showing the filter options -->
47<div id="MSearchSelectWindow"
48     onmouseover="return searchBox.OnSearchSelectShow()"
49     onmouseout="return searchBox.OnSearchSelectHide()"
50     onkeydown="return searchBox.OnSearchSelectKey(event)">
51</div>
52
53<!-- iframe showing the search results (closed by default) -->
54<div id="MSearchResultsWindow">
55<iframe src="javascript:void(0)" frameborder="0"
56        name="MSearchResults" id="MSearchResults">
57</iframe>
58</div>
59
60<div id="nav-path" class="navpath">
61  <ul>
62<li class="navelem"><b>tinyxml2</b></li><li class="navelem"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html">XMLPrinter</a></li>  </ul>
63</div>
64</div><!-- top -->
65<div class="header">
66  <div class="summary">
67<a href="#pub-methods">Public Member Functions</a> &#124;
68<a href="#pro-methods">Protected Member Functions</a> &#124;
69<a href="classtinyxml2_1_1_x_m_l_printer-members.html">List of all members</a>  </div>
70  <div class="headertitle">
71<div class="title">tinyxml2::XMLPrinter Class Reference</div>  </div>
72</div><!--header-->
73<div class="contents">
74
75<p><code>#include &lt;<a class="el" href="tinyxml2_8h_source.html">tinyxml2.h</a>&gt;</code></p>
76<div class="dynheader">
77Inheritance diagram for tinyxml2::XMLPrinter:</div>
78<div class="dyncontent">
79 <div class="center">
80  <img src="classtinyxml2_1_1_x_m_l_printer.png" usemap="#tinyxml2::XMLPrinter_map" alt=""/>
81  <map id="tinyxml2::XMLPrinter_map" name="tinyxml2::XMLPrinter_map">
82<area href="classtinyxml2_1_1_x_m_l_visitor.html" alt="tinyxml2::XMLVisitor" shape="rect" coords="0,0,128,24"/>
83</map>
84 </div></div>
85<table class="memberdecls">
86<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
87Public Member Functions</h2></td></tr>
88<tr class="memitem:aa6d3841c069085f5b8a27bc7103c04f7"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#aa6d3841c069085f5b8a27bc7103c04f7">XMLPrinter</a> (FILE *file=0, bool compact=false, int depth=0)</td></tr>
89<tr class="separator:aa6d3841c069085f5b8a27bc7103c04f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
90<tr class="memitem:a178c608ce8476043d5d6513819cde903"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#a178c608ce8476043d5d6513819cde903">PushHeader</a> (bool writeBOM, bool writeDeclaration)</td></tr>
91<tr class="separator:a178c608ce8476043d5d6513819cde903"><td class="memSeparator" colspan="2">&#160;</td></tr>
92<tr class="memitem:a20fb06c83bd13e5140d7dd13af06c010"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#a20fb06c83bd13e5140d7dd13af06c010">OpenElement</a> (const char *name, bool compactMode=false)</td></tr>
93<tr class="separator:a20fb06c83bd13e5140d7dd13af06c010"><td class="memSeparator" colspan="2">&#160;</td></tr>
94<tr class="memitem:a9a4e2c9348b42e147629d5a99f4af3f0"><td class="memItemLeft" align="right" valign="top"><a id="a9a4e2c9348b42e147629d5a99f4af3f0"></a>
95void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#a9a4e2c9348b42e147629d5a99f4af3f0">PushAttribute</a> (const char *name, const char *value)</td></tr>
96<tr class="memdesc:a9a4e2c9348b42e147629d5a99f4af3f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">If streaming, add an attribute to an open element. <br /></td></tr>
97<tr class="separator:a9a4e2c9348b42e147629d5a99f4af3f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
98<tr class="memitem:ad04d29562b46fcdb23ab320f8b664240"><td class="memItemLeft" align="right" valign="top"><a id="ad04d29562b46fcdb23ab320f8b664240"></a>
99virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#ad04d29562b46fcdb23ab320f8b664240">CloseElement</a> (bool compactMode=false)</td></tr>
100<tr class="memdesc:ad04d29562b46fcdb23ab320f8b664240"><td class="mdescLeft">&#160;</td><td class="mdescRight">If streaming, close the Element. <br /></td></tr>
101<tr class="separator:ad04d29562b46fcdb23ab320f8b664240"><td class="memSeparator" colspan="2">&#160;</td></tr>
102<tr class="memitem:a1cc16a9362df4332012cb13cff6441b3"><td class="memItemLeft" align="right" valign="top"><a id="a1cc16a9362df4332012cb13cff6441b3"></a>
103void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#a1cc16a9362df4332012cb13cff6441b3">PushText</a> (const char *text, bool cdata=false)</td></tr>
104<tr class="memdesc:a1cc16a9362df4332012cb13cff6441b3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a text node. <br /></td></tr>
105<tr class="separator:a1cc16a9362df4332012cb13cff6441b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
106<tr class="memitem:a3e0d4d78de25d4cf081009e1431cea7e"><td class="memItemLeft" align="right" valign="top"><a id="a3e0d4d78de25d4cf081009e1431cea7e"></a>
107void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#a3e0d4d78de25d4cf081009e1431cea7e">PushText</a> (int value)</td></tr>
108<tr class="memdesc:a3e0d4d78de25d4cf081009e1431cea7e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a text node from an integer. <br /></td></tr>
109<tr class="separator:a3e0d4d78de25d4cf081009e1431cea7e"><td class="memSeparator" colspan="2">&#160;</td></tr>
110<tr class="memitem:a661fb50e7e0a4918d2d259cb0fae647e"><td class="memItemLeft" align="right" valign="top"><a id="a661fb50e7e0a4918d2d259cb0fae647e"></a>
111void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#a661fb50e7e0a4918d2d259cb0fae647e">PushText</a> (unsigned value)</td></tr>
112<tr class="memdesc:a661fb50e7e0a4918d2d259cb0fae647e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a text node from an unsigned. <br /></td></tr>
113<tr class="separator:a661fb50e7e0a4918d2d259cb0fae647e"><td class="memSeparator" colspan="2">&#160;</td></tr>
114<tr class="memitem:a96b0a0bfe105154a0a6c37d725258f0a"><td class="memItemLeft" align="right" valign="top"><a id="a96b0a0bfe105154a0a6c37d725258f0a"></a>
115void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#a96b0a0bfe105154a0a6c37d725258f0a">PushText</a> (int64_t value)</td></tr>
116<tr class="memdesc:a96b0a0bfe105154a0a6c37d725258f0a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a text node from an unsigned. <br /></td></tr>
117<tr class="separator:a96b0a0bfe105154a0a6c37d725258f0a"><td class="memSeparator" colspan="2">&#160;</td></tr>
118<tr class="memitem:a4390e5fa1ed05189a8686647345ab29f"><td class="memItemLeft" align="right" valign="top"><a id="a4390e5fa1ed05189a8686647345ab29f"></a>
119void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#a4390e5fa1ed05189a8686647345ab29f">PushText</a> (bool value)</td></tr>
120<tr class="memdesc:a4390e5fa1ed05189a8686647345ab29f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a text node from a bool. <br /></td></tr>
121<tr class="separator:a4390e5fa1ed05189a8686647345ab29f"><td class="memSeparator" colspan="2">&#160;</td></tr>
122<tr class="memitem:a1dbb1390e829d0673af66b9cd1928bd7"><td class="memItemLeft" align="right" valign="top"><a id="a1dbb1390e829d0673af66b9cd1928bd7"></a>
123void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#a1dbb1390e829d0673af66b9cd1928bd7">PushText</a> (float value)</td></tr>
124<tr class="memdesc:a1dbb1390e829d0673af66b9cd1928bd7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a text node from a float. <br /></td></tr>
125<tr class="separator:a1dbb1390e829d0673af66b9cd1928bd7"><td class="memSeparator" colspan="2">&#160;</td></tr>
126<tr class="memitem:aa715302dfc09473c77c853cbd5431965"><td class="memItemLeft" align="right" valign="top"><a id="aa715302dfc09473c77c853cbd5431965"></a>
127void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#aa715302dfc09473c77c853cbd5431965">PushText</a> (double value)</td></tr>
128<tr class="memdesc:aa715302dfc09473c77c853cbd5431965"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a text node from a double. <br /></td></tr>
129<tr class="separator:aa715302dfc09473c77c853cbd5431965"><td class="memSeparator" colspan="2">&#160;</td></tr>
130<tr class="memitem:afc8416814219591c2fd5656e0c233140"><td class="memItemLeft" align="right" valign="top"><a id="afc8416814219591c2fd5656e0c233140"></a>
131void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#afc8416814219591c2fd5656e0c233140">PushComment</a> (const char *comment)</td></tr>
132<tr class="memdesc:afc8416814219591c2fd5656e0c233140"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a comment. <br /></td></tr>
133<tr class="separator:afc8416814219591c2fd5656e0c233140"><td class="memSeparator" colspan="2">&#160;</td></tr>
134<tr class="memitem:ae966b988a7a28c41e91c5ca17fb2054b"><td class="memItemLeft" align="right" valign="top"><a id="ae966b988a7a28c41e91c5ca17fb2054b"></a>
135virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#ae966b988a7a28c41e91c5ca17fb2054b">VisitEnter</a> (const <a class="el" href="classtinyxml2_1_1_x_m_l_document.html">XMLDocument</a> &amp;)</td></tr>
136<tr class="memdesc:ae966b988a7a28c41e91c5ca17fb2054b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Visit a document. <br /></td></tr>
137<tr class="separator:ae966b988a7a28c41e91c5ca17fb2054b"><td class="memSeparator" colspan="2">&#160;</td></tr>
138<tr class="memitem:a15fc1f2b922f540917dcf52808737b29"><td class="memItemLeft" align="right" valign="top"><a id="a15fc1f2b922f540917dcf52808737b29"></a>
139virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#a15fc1f2b922f540917dcf52808737b29">VisitExit</a> (const <a class="el" href="classtinyxml2_1_1_x_m_l_document.html">XMLDocument</a> &amp;)</td></tr>
140<tr class="memdesc:a15fc1f2b922f540917dcf52808737b29"><td class="mdescLeft">&#160;</td><td class="mdescRight">Visit a document. <br /></td></tr>
141<tr class="separator:a15fc1f2b922f540917dcf52808737b29"><td class="memSeparator" colspan="2">&#160;</td></tr>
142<tr class="memitem:a2ce2aa508c21ac91615093ddb9c282c5"><td class="memItemLeft" align="right" valign="top"><a id="a2ce2aa508c21ac91615093ddb9c282c5"></a>
143virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#a2ce2aa508c21ac91615093ddb9c282c5">VisitEnter</a> (const <a class="el" href="classtinyxml2_1_1_x_m_l_element.html">XMLElement</a> &amp;element, const <a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html">XMLAttribute</a> *attribute)</td></tr>
144<tr class="memdesc:a2ce2aa508c21ac91615093ddb9c282c5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Visit an element. <br /></td></tr>
145<tr class="separator:a2ce2aa508c21ac91615093ddb9c282c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
146<tr class="memitem:ae99e0a7086543591edfb565f24689098"><td class="memItemLeft" align="right" valign="top"><a id="ae99e0a7086543591edfb565f24689098"></a>
147virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#ae99e0a7086543591edfb565f24689098">VisitExit</a> (const <a class="el" href="classtinyxml2_1_1_x_m_l_element.html">XMLElement</a> &amp;element)</td></tr>
148<tr class="memdesc:ae99e0a7086543591edfb565f24689098"><td class="mdescLeft">&#160;</td><td class="mdescRight">Visit an element. <br /></td></tr>
149<tr class="separator:ae99e0a7086543591edfb565f24689098"><td class="memSeparator" colspan="2">&#160;</td></tr>
150<tr class="memitem:a275ae25544a12199ae40b6994ca6e4de"><td class="memItemLeft" align="right" valign="top"><a id="a275ae25544a12199ae40b6994ca6e4de"></a>
151virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#a275ae25544a12199ae40b6994ca6e4de">Visit</a> (const <a class="el" href="classtinyxml2_1_1_x_m_l_text.html">XMLText</a> &amp;text)</td></tr>
152<tr class="memdesc:a275ae25544a12199ae40b6994ca6e4de"><td class="mdescLeft">&#160;</td><td class="mdescRight">Visit a text node. <br /></td></tr>
153<tr class="separator:a275ae25544a12199ae40b6994ca6e4de"><td class="memSeparator" colspan="2">&#160;</td></tr>
154<tr class="memitem:a3f16a30be1537ac141d9bd2db824ba9e"><td class="memItemLeft" align="right" valign="top"><a id="a3f16a30be1537ac141d9bd2db824ba9e"></a>
155virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#a3f16a30be1537ac141d9bd2db824ba9e">Visit</a> (const <a class="el" href="classtinyxml2_1_1_x_m_l_comment.html">XMLComment</a> &amp;comment)</td></tr>
156<tr class="memdesc:a3f16a30be1537ac141d9bd2db824ba9e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Visit a comment node. <br /></td></tr>
157<tr class="separator:a3f16a30be1537ac141d9bd2db824ba9e"><td class="memSeparator" colspan="2">&#160;</td></tr>
158<tr class="memitem:a9ceff5cd85e5db65838962174fcdcc46"><td class="memItemLeft" align="right" valign="top"><a id="a9ceff5cd85e5db65838962174fcdcc46"></a>
159virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#a9ceff5cd85e5db65838962174fcdcc46">Visit</a> (const <a class="el" href="classtinyxml2_1_1_x_m_l_declaration.html">XMLDeclaration</a> &amp;declaration)</td></tr>
160<tr class="memdesc:a9ceff5cd85e5db65838962174fcdcc46"><td class="mdescLeft">&#160;</td><td class="mdescRight">Visit a declaration. <br /></td></tr>
161<tr class="separator:a9ceff5cd85e5db65838962174fcdcc46"><td class="memSeparator" colspan="2">&#160;</td></tr>
162<tr class="memitem:aa15e1da81e17dea5da6499ac5b08d9d8"><td class="memItemLeft" align="right" valign="top"><a id="aa15e1da81e17dea5da6499ac5b08d9d8"></a>
163virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#aa15e1da81e17dea5da6499ac5b08d9d8">Visit</a> (const <a class="el" href="classtinyxml2_1_1_x_m_l_unknown.html">XMLUnknown</a> &amp;unknown)</td></tr>
164<tr class="memdesc:aa15e1da81e17dea5da6499ac5b08d9d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Visit an unknown node. <br /></td></tr>
165<tr class="separator:aa15e1da81e17dea5da6499ac5b08d9d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
166<tr class="memitem:a180671d73844f159f2d4aafbc11d106e"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#a180671d73844f159f2d4aafbc11d106e">CStr</a> () const</td></tr>
167<tr class="separator:a180671d73844f159f2d4aafbc11d106e"><td class="memSeparator" colspan="2">&#160;</td></tr>
168<tr class="memitem:a3256cf3523d4898b91abb18b924be04c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#a3256cf3523d4898b91abb18b924be04c">CStrSize</a> () const</td></tr>
169<tr class="separator:a3256cf3523d4898b91abb18b924be04c"><td class="memSeparator" colspan="2">&#160;</td></tr>
170<tr class="memitem:a216157765b7267bf389975b1cbf9a909"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#a216157765b7267bf389975b1cbf9a909">ClearBuffer</a> ()</td></tr>
171<tr class="separator:a216157765b7267bf389975b1cbf9a909"><td class="memSeparator" colspan="2">&#160;</td></tr>
172</table><table class="memberdecls">
173<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
174Protected Member Functions</h2></td></tr>
175<tr class="memitem:a01148e2ebe6776e38c5a3e41bc5feb74"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#a01148e2ebe6776e38c5a3e41bc5feb74">PrintSpace</a> (int depth)</td></tr>
176<tr class="separator:a01148e2ebe6776e38c5a3e41bc5feb74"><td class="memSeparator" colspan="2">&#160;</td></tr>
177</table>
178<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
179<div class="textblock"><p>Printing functionality. The <a class="el" href="classtinyxml2_1_1_x_m_l_printer.html">XMLPrinter</a> gives you more options than the <a class="el" href="classtinyxml2_1_1_x_m_l_document.html#a867cf5fa3e3ff6ae4847a8b7ee8ec083">XMLDocument::Print()</a> method.</p>
180<p>It can:</p><ol type="1">
181<li>Print to memory.</li>
182<li>Print to a file you provide.</li>
183<li>Print XML without a <a class="el" href="classtinyxml2_1_1_x_m_l_document.html">XMLDocument</a>.</li>
184</ol>
185<p>Print to Memory</p>
186<pre class="fragment">XMLPrinter printer;
187doc.Print( &amp;printer );
188SomeFunction( printer.CStr() );
189</pre><p>Print to a File</p>
190<p>You provide the file pointer. </p><pre class="fragment">XMLPrinter printer( fp );
191doc.Print( &amp;printer );
192</pre><p>Print without a <a class="el" href="classtinyxml2_1_1_x_m_l_document.html">XMLDocument</a></p>
193<p>When loading, an XML parser is very useful. However, sometimes when saving, it just gets in the way. The code is often set up for streaming, and constructing the DOM is just overhead.</p>
194<p>The Printer supports the streaming case. The following code prints out a trivially simple XML file without ever creating an XML document.</p>
195<pre class="fragment">XMLPrinter printer( fp );
196printer.OpenElement( "foo" );
197printer.PushAttribute( "foo", "bar" );
198printer.CloseElement();
199</pre> </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
200<a id="aa6d3841c069085f5b8a27bc7103c04f7"></a>
201<h2 class="memtitle"><span class="permalink"><a href="#aa6d3841c069085f5b8a27bc7103c04f7">&#9670;&nbsp;</a></span>XMLPrinter()</h2>
202
203<div class="memitem">
204<div class="memproto">
205      <table class="memname">
206        <tr>
207          <td class="memname">tinyxml2::XMLPrinter::XMLPrinter </td>
208          <td>(</td>
209          <td class="paramtype">FILE *&#160;</td>
210          <td class="paramname"><em>file</em> = <code>0</code>, </td>
211        </tr>
212        <tr>
213          <td class="paramkey"></td>
214          <td></td>
215          <td class="paramtype">bool&#160;</td>
216          <td class="paramname"><em>compact</em> = <code>false</code>, </td>
217        </tr>
218        <tr>
219          <td class="paramkey"></td>
220          <td></td>
221          <td class="paramtype">int&#160;</td>
222          <td class="paramname"><em>depth</em> = <code>0</code>&#160;</td>
223        </tr>
224        <tr>
225          <td></td>
226          <td>)</td>
227          <td></td><td></td>
228        </tr>
229      </table>
230</div><div class="memdoc">
231<p>Construct the printer. If the FILE* is specified, this will print to the FILE. Else it will print to memory, and the result is available in <a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#a180671d73844f159f2d4aafbc11d106e">CStr()</a>. If 'compact' is set to true, then output is created with only required whitespace and newlines. </p>
232
233</div>
234</div>
235<h2 class="groupheader">Member Function Documentation</h2>
236<a id="a216157765b7267bf389975b1cbf9a909"></a>
237<h2 class="memtitle"><span class="permalink"><a href="#a216157765b7267bf389975b1cbf9a909">&#9670;&nbsp;</a></span>ClearBuffer()</h2>
238
239<div class="memitem">
240<div class="memproto">
241<table class="mlabels">
242  <tr>
243  <td class="mlabels-left">
244      <table class="memname">
245        <tr>
246          <td class="memname">void tinyxml2::XMLPrinter::ClearBuffer </td>
247          <td>(</td>
248          <td class="paramname"></td><td>)</td>
249          <td></td>
250        </tr>
251      </table>
252  </td>
253  <td class="mlabels-right">
254<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
255  </tr>
256</table>
257</div><div class="memdoc">
258<p>If in print to memory mode, reset the buffer to the beginning. </p>
259
260</div>
261</div>
262<a id="a180671d73844f159f2d4aafbc11d106e"></a>
263<h2 class="memtitle"><span class="permalink"><a href="#a180671d73844f159f2d4aafbc11d106e">&#9670;&nbsp;</a></span>CStr()</h2>
264
265<div class="memitem">
266<div class="memproto">
267<table class="mlabels">
268  <tr>
269  <td class="mlabels-left">
270      <table class="memname">
271        <tr>
272          <td class="memname">const char* tinyxml2::XMLPrinter::CStr </td>
273          <td>(</td>
274          <td class="paramname"></td><td>)</td>
275          <td> const</td>
276        </tr>
277      </table>
278  </td>
279  <td class="mlabels-right">
280<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
281  </tr>
282</table>
283</div><div class="memdoc">
284<p>If in print to memory mode, return a pointer to the XML file in memory. </p>
285
286</div>
287</div>
288<a id="a3256cf3523d4898b91abb18b924be04c"></a>
289<h2 class="memtitle"><span class="permalink"><a href="#a3256cf3523d4898b91abb18b924be04c">&#9670;&nbsp;</a></span>CStrSize()</h2>
290
291<div class="memitem">
292<div class="memproto">
293<table class="mlabels">
294  <tr>
295  <td class="mlabels-left">
296      <table class="memname">
297        <tr>
298          <td class="memname">int tinyxml2::XMLPrinter::CStrSize </td>
299          <td>(</td>
300          <td class="paramname"></td><td>)</td>
301          <td> const</td>
302        </tr>
303      </table>
304  </td>
305  <td class="mlabels-right">
306<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
307  </tr>
308</table>
309</div><div class="memdoc">
310<p>If in print to memory mode, return the size of the XML file in memory. (Note the size returned includes the terminating null.) </p>
311
312</div>
313</div>
314<a id="a20fb06c83bd13e5140d7dd13af06c010"></a>
315<h2 class="memtitle"><span class="permalink"><a href="#a20fb06c83bd13e5140d7dd13af06c010">&#9670;&nbsp;</a></span>OpenElement()</h2>
316
317<div class="memitem">
318<div class="memproto">
319      <table class="memname">
320        <tr>
321          <td class="memname">void tinyxml2::XMLPrinter::OpenElement </td>
322          <td>(</td>
323          <td class="paramtype">const char *&#160;</td>
324          <td class="paramname"><em>name</em>, </td>
325        </tr>
326        <tr>
327          <td class="paramkey"></td>
328          <td></td>
329          <td class="paramtype">bool&#160;</td>
330          <td class="paramname"><em>compactMode</em> = <code>false</code>&#160;</td>
331        </tr>
332        <tr>
333          <td></td>
334          <td>)</td>
335          <td></td><td></td>
336        </tr>
337      </table>
338</div><div class="memdoc">
339<p>If streaming, start writing an element. The element must be closed with <a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#ad04d29562b46fcdb23ab320f8b664240" title="If streaming, close the Element. ">CloseElement()</a> </p>
340
341</div>
342</div>
343<a id="a01148e2ebe6776e38c5a3e41bc5feb74"></a>
344<h2 class="memtitle"><span class="permalink"><a href="#a01148e2ebe6776e38c5a3e41bc5feb74">&#9670;&nbsp;</a></span>PrintSpace()</h2>
345
346<div class="memitem">
347<div class="memproto">
348<table class="mlabels">
349  <tr>
350  <td class="mlabels-left">
351      <table class="memname">
352        <tr>
353          <td class="memname">virtual void tinyxml2::XMLPrinter::PrintSpace </td>
354          <td>(</td>
355          <td class="paramtype">int&#160;</td>
356          <td class="paramname"><em>depth</em></td><td>)</td>
357          <td></td>
358        </tr>
359      </table>
360  </td>
361  <td class="mlabels-right">
362<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span>  </td>
363  </tr>
364</table>
365</div><div class="memdoc">
366<p>Prints out the space before an element. You may override to change the space and tabs used. A <a class="el" href="classtinyxml2_1_1_x_m_l_printer.html#a01148e2ebe6776e38c5a3e41bc5feb74">PrintSpace()</a> override should call Print(). </p>
367
368</div>
369</div>
370<a id="a178c608ce8476043d5d6513819cde903"></a>
371<h2 class="memtitle"><span class="permalink"><a href="#a178c608ce8476043d5d6513819cde903">&#9670;&nbsp;</a></span>PushHeader()</h2>
372
373<div class="memitem">
374<div class="memproto">
375      <table class="memname">
376        <tr>
377          <td class="memname">void tinyxml2::XMLPrinter::PushHeader </td>
378          <td>(</td>
379          <td class="paramtype">bool&#160;</td>
380          <td class="paramname"><em>writeBOM</em>, </td>
381        </tr>
382        <tr>
383          <td class="paramkey"></td>
384          <td></td>
385          <td class="paramtype">bool&#160;</td>
386          <td class="paramname"><em>writeDeclaration</em>&#160;</td>
387        </tr>
388        <tr>
389          <td></td>
390          <td>)</td>
391          <td></td><td></td>
392        </tr>
393      </table>
394</div><div class="memdoc">
395<p>If streaming, write the BOM and declaration. </p>
396
397</div>
398</div>
399<hr/>The documentation for this class was generated from the following file:<ul>
400<li><a class="el" href="tinyxml2_8h_source.html">tinyxml2.h</a></li>
401</ul>
402</div><!-- contents -->
403<!-- start footer part -->
404<hr class="footer"/><address class="footer"><small>
405Generated on Tue Nov 6 2018 09:38:26 for TinyXML-2 by &#160;<a href="http://www.doxygen.org/index.html">
406<img class="footer" src="doxygen.png" alt="doxygen"/>
407</a> 1.8.13
408</small></address>
409</body>
410</html>
411