\section{Ti\-Xml\-Printer Class Reference}
\label{classTiXmlPrinter}\index{Ti\-Xml\-Printer@{Ti\-Xml\-Printer}}


Print to memory functionality.  




{\ttfamily \#include $<$tinyxml.\-h$>$}

Inheritance diagram for Ti\-Xml\-Printer\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classTiXmlPrinter}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual bool {\bf Visit\-Enter} (const {\bf Ti\-Xml\-Document} \&doc)\label{classTiXmlPrinter_a2ec73087db26ff4d2c4316c56f861db7}

\begin{DoxyCompactList}\small\item\em Visit a document. \end{DoxyCompactList}\item 
virtual bool {\bf Visit\-Exit} (const {\bf Ti\-Xml\-Document} \&doc)\label{classTiXmlPrinter_a0a636046fa589b6d7f3e5bd025b3f33e}

\begin{DoxyCompactList}\small\item\em Visit a document. \end{DoxyCompactList}\item 
virtual bool {\bf Visit\-Enter} (const {\bf Ti\-Xml\-Element} \&element, const {\bf Ti\-Xml\-Attribute} $\ast$first\-Attribute)\label{classTiXmlPrinter_a6dccaf5ee4979f13877690afe28721e8}

\begin{DoxyCompactList}\small\item\em Visit an element. \end{DoxyCompactList}\item 
virtual bool {\bf Visit\-Exit} (const {\bf Ti\-Xml\-Element} \&element)\label{classTiXmlPrinter_ae6a1df8271df4bf62d7873c38e34aa69}

\begin{DoxyCompactList}\small\item\em Visit an element. \end{DoxyCompactList}\item 
virtual bool {\bf Visit} (const {\bf Ti\-Xml\-Declaration} \&declaration)\label{classTiXmlPrinter_adaf7eec4dc43ad071ff52b60361574f5}

\begin{DoxyCompactList}\small\item\em Visit a declaration. \end{DoxyCompactList}\item 
virtual bool {\bf Visit} (const {\bf Ti\-Xml\-Text} \&text)\label{classTiXmlPrinter_a0857c5d32c59b9a257f9a49cb9411df5}

\begin{DoxyCompactList}\small\item\em Visit a text node. \end{DoxyCompactList}\item 
virtual bool {\bf Visit} (const {\bf Ti\-Xml\-Comment} \&comment)\label{classTiXmlPrinter_a9870423f5603630e6142f6bdb66dfb57}

\begin{DoxyCompactList}\small\item\em Visit a comment node. \end{DoxyCompactList}\item 
virtual bool {\bf Visit} (const {\bf Ti\-Xml\-Unknown} \&unknown)\label{classTiXmlPrinter_a08591a15c9a07afa83c24e08b03d6358}

\begin{DoxyCompactList}\small\item\em Visit an unknow node. \end{DoxyCompactList}\item 
void {\bf Set\-Indent} (const char $\ast$\-\_\-indent)
\begin{DoxyCompactList}\small\item\em Set the indent characters for printing. \end{DoxyCompactList}\item 
const char $\ast$ {\bf Indent} ()\label{classTiXmlPrinter_abb33ec7d4bad6aaeb57f4304394b133d}

\begin{DoxyCompactList}\small\item\em Query the indention string. \end{DoxyCompactList}\item 
void {\bf Set\-Line\-Break} (const char $\ast$\-\_\-line\-Break)
\begin{DoxyCompactList}\small\item\em Set the line breaking string. \end{DoxyCompactList}\item 
const char $\ast$ {\bf Line\-Break} ()\label{classTiXmlPrinter_a11f1b4804a460b175ec244eb5724d96d}

\begin{DoxyCompactList}\small\item\em Query the current line breaking string. \end{DoxyCompactList}\item 
void {\bf Set\-Stream\-Printing} ()
\begin{DoxyCompactList}\small\item\em Switch over to \char`\"{}stream printing\char`\"{} which is the most dense formatting without linebreaks. \end{DoxyCompactList}\item 
const char $\ast$ {\bf C\-Str} ()\label{classTiXmlPrinter_a859eede9597d3e0355b77757be48735e}

\begin{DoxyCompactList}\small\item\em Return the result. \end{DoxyCompactList}\item 
size\-\_\-t {\bf Size} ()\label{classTiXmlPrinter_ad01375ae9199bd2f48252eaddce3039d}

\begin{DoxyCompactList}\small\item\em Return the length of the result string. \end{DoxyCompactList}\item 
const std\-::string \& {\bf Str} ()\label{classTiXmlPrinter_a3bd4daf44309b41f5813a833caa0d1c9}

\begin{DoxyCompactList}\small\item\em Return the result. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Print to memory functionality. 

The \doxyref{Ti\-Xml\-Printer}{p.}{classTiXmlPrinter} is useful when you need to\-:


\begin{DoxyEnumerate}
\item Print to memory (especially in non-\/\-S\-T\-L mode)
\item Control formatting (line endings, etc.)
\end{DoxyEnumerate}

When constructed, the \doxyref{Ti\-Xml\-Printer}{p.}{classTiXmlPrinter} is in its default \char`\"{}pretty printing\char`\"{} mode. Before calling Accept() you can call methods to control the printing of the X\-M\-L document. After \doxyref{Ti\-Xml\-Node\-::\-Accept()}{p.}{classTiXmlNode_acc0f88b7462c6cb73809d410a4f5bb86} is called, the printed document can be accessed via the \doxyref{C\-Str()}{p.}{classTiXmlPrinter_a859eede9597d3e0355b77757be48735e}, \doxyref{Str()}{p.}{classTiXmlPrinter_a3bd4daf44309b41f5813a833caa0d1c9}, and \doxyref{Size()}{p.}{classTiXmlPrinter_ad01375ae9199bd2f48252eaddce3039d} methods.

\doxyref{Ti\-Xml\-Printer}{p.}{classTiXmlPrinter} uses the Visitor A\-P\-I. \begin{DoxyVerb}    TiXmlPrinter printer;
    printer.SetIndent( "\t" );

    doc.Accept( &printer );
    fprintf( stdout, "%s", printer.CStr() );\end{DoxyVerb}
 

\subsection{Member Function Documentation}
\index{Ti\-Xml\-Printer@{Ti\-Xml\-Printer}!Set\-Indent@{Set\-Indent}}
\index{Set\-Indent@{Set\-Indent}!TiXmlPrinter@{Ti\-Xml\-Printer}}
\subsubsection[{Set\-Indent}]{\setlength{\rightskip}{0pt plus 5cm}void Ti\-Xml\-Printer\-::\-Set\-Indent (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{\-\_\-indent}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classTiXmlPrinter_a213377a4070c7e625bae59716b089e5e}


Set the indent characters for printing. 

By default 4 spaces but tab () is also useful, or null/empty string for no indentation. \index{Ti\-Xml\-Printer@{Ti\-Xml\-Printer}!Set\-Line\-Break@{Set\-Line\-Break}}
\index{Set\-Line\-Break@{Set\-Line\-Break}!TiXmlPrinter@{Ti\-Xml\-Printer}}
\subsubsection[{Set\-Line\-Break}]{\setlength{\rightskip}{0pt plus 5cm}void Ti\-Xml\-Printer\-::\-Set\-Line\-Break (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{\-\_\-line\-Break}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classTiXmlPrinter_a4be1e37e69e3858c59635aa947174fe6}


Set the line breaking string. 

By default set to newline (\par
). Some operating systems prefer other characters, or can be set to the null/empty string for no indenation. \index{Ti\-Xml\-Printer@{Ti\-Xml\-Printer}!Set\-Stream\-Printing@{Set\-Stream\-Printing}}
\index{Set\-Stream\-Printing@{Set\-Stream\-Printing}!TiXmlPrinter@{Ti\-Xml\-Printer}}
\subsubsection[{Set\-Stream\-Printing}]{\setlength{\rightskip}{0pt plus 5cm}void Ti\-Xml\-Printer\-::\-Set\-Stream\-Printing (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{classTiXmlPrinter_ab23a90629e374cb1cadca090468bbd19}


Switch over to \char`\"{}stream printing\char`\"{} which is the most dense formatting without linebreaks. 

Common when the X\-M\-L is needed for network transmission. 

The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
tinyxml.\-h\item 
tinyxml.\-cc\end{DoxyCompactItemize}
