\section{Ti\-Xml\-Element Class Reference}
\label{classTiXmlElement}\index{Ti\-Xml\-Element@{Ti\-Xml\-Element}}


The element is a container class.  




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

Inheritance diagram for Ti\-Xml\-Element\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{classTiXmlElement}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\bf Ti\-Xml\-Element} (const char $\ast$in\-\_\-value)\label{classTiXmlElement_a01bc3ab372d35da08efcbbe65ad90c60}

\begin{DoxyCompactList}\small\item\em Construct an element. \end{DoxyCompactList}\item 
{\bf Ti\-Xml\-Element} (const std\-::string \&\-\_\-value)\label{classTiXmlElement_a40fc2e3c1a955e2f78e1a32350d180e7}

\begin{DoxyCompactList}\small\item\em std\-::string constructor. \end{DoxyCompactList}\item 
{\bfseries Ti\-Xml\-Element} (const {\bf Ti\-Xml\-Element} \&)\label{classTiXmlElement_a1ca4465f3c2eac6a60e641cd7f1d9f7e}

\item 
void {\bfseries operator=} (const {\bf Ti\-Xml\-Element} \&base)\label{classTiXmlElement_af5cd4156e082ef3bf23adfe0ed173340}

\item 
const char $\ast$ {\bf Attribute} (const char $\ast$name) const \label{classTiXmlElement_ac1e4691e9375ba4e665dce7e46a50a9c}

\begin{DoxyCompactList}\small\item\em Given an attribute name, \doxyref{Attribute()}{p.}{classTiXmlElement_ac1e4691e9375ba4e665dce7e46a50a9c} returns the value for the attribute of that name, or null if none exists. \end{DoxyCompactList}\item 
const char $\ast$ {\bf Attribute} (const char $\ast$name, int $\ast$i) const 
\begin{DoxyCompactList}\small\item\em Given an attribute name, \doxyref{Attribute()}{p.}{classTiXmlElement_ac1e4691e9375ba4e665dce7e46a50a9c} returns the value for the attribute of that name, or null if none exists. \end{DoxyCompactList}\item 
const char $\ast$ {\bf Attribute} (const char $\ast$name, double $\ast$d) const 
\begin{DoxyCompactList}\small\item\em Given an attribute name, \doxyref{Attribute()}{p.}{classTiXmlElement_ac1e4691e9375ba4e665dce7e46a50a9c} returns the value for the attribute of that name, or null if none exists. \end{DoxyCompactList}\item 
int {\bf Query\-Int\-Attribute} (const char $\ast$name, int $\ast$\-\_\-value) const 
\begin{DoxyCompactList}\small\item\em Query\-Int\-Attribute examines the attribute -\/ it is an alternative to the \doxyref{Attribute()}{p.}{classTiXmlElement_ac1e4691e9375ba4e665dce7e46a50a9c} method with richer error checking. \end{DoxyCompactList}\item 
int {\bf Query\-Double\-Attribute} (const char $\ast$name, double $\ast$\-\_\-value) const \label{classTiXmlElement_a898d7730ecc341f0bffc7a9dadbf1ce7}

\begin{DoxyCompactList}\small\item\em Query\-Double\-Attribute examines the attribute -\/ see \doxyref{Query\-Int\-Attribute()}{p.}{classTiXmlElement_aea0bfe471380f281c5945770ddbf52b9}. \end{DoxyCompactList}\item 
int {\bf Query\-Float\-Attribute} (const char $\ast$name, float $\ast$\-\_\-value) const \label{classTiXmlElement_aa04d3af11601ef5a5f88295203a843be}

\begin{DoxyCompactList}\small\item\em Query\-Float\-Attribute examines the attribute -\/ see \doxyref{Query\-Int\-Attribute()}{p.}{classTiXmlElement_aea0bfe471380f281c5945770ddbf52b9}. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T $>$ }\\int {\bf Query\-Value\-Attribute} (const std\-::string \&name, T $\ast$out\-Value) const 
\begin{DoxyCompactList}\small\item\em Template form of the attribute query which will try to read the attribute into the specified type. \end{DoxyCompactList}\item 
void {\bf Set\-Attribute} (const char $\ast$name, const char $\ast$\-\_\-value)
\begin{DoxyCompactList}\small\item\em Sets an attribute of name to a given value. \end{DoxyCompactList}\item 
const std\-::string $\ast$ {\bfseries Attribute} (const std\-::string \&name) const \label{classTiXmlElement_a0397ccf40f95e01bfcc46728170df135}

\item 
const std\-::string $\ast$ {\bfseries Attribute} (const std\-::string \&name, int $\ast$i) const \label{classTiXmlElement_aa0be00b00ed249cbedc2723a5b888ef5}

\item 
const std\-::string $\ast$ {\bfseries Attribute} (const std\-::string \&name, double $\ast$d) const \label{classTiXmlElement_a22833b0b61d8c7f6b81e15a6da345a95}

\item 
int {\bfseries Query\-Int\-Attribute} (const std\-::string \&name, int $\ast$\-\_\-value) const \label{classTiXmlElement_ad79cb2416a5b94784f9a517add7e2d6d}

\item 
int {\bfseries Query\-Double\-Attribute} (const std\-::string \&name, double $\ast$\-\_\-value) const \label{classTiXmlElement_a157250e0c0303657d911f6991106ba73}

\item 
void {\bf Set\-Attribute} (const std\-::string \&name, const std\-::string \&\-\_\-value)
\begin{DoxyCompactList}\small\item\em S\-T\-L std\-::string form. \end{DoxyCompactList}\item 
void {\bfseries Set\-Attribute} (const std\-::string \&name, int \-\_\-value)\label{classTiXmlElement_a6f18d54fbe25bbc527936ee65363b3c5}

\item 
void {\bf Set\-Attribute} (const char $\ast$name, int value)
\begin{DoxyCompactList}\small\item\em Sets an attribute of name to a given value. \end{DoxyCompactList}\item 
void {\bf Set\-Double\-Attribute} (const char $\ast$name, double value)
\begin{DoxyCompactList}\small\item\em Sets an attribute of name to a given value. \end{DoxyCompactList}\item 
void {\bf Remove\-Attribute} (const char $\ast$name)\label{classTiXmlElement_a56979767deca794376b1dfa69a525b2a}

\begin{DoxyCompactList}\small\item\em Deletes an attribute with the given name. \end{DoxyCompactList}\item 
void {\bf Remove\-Attribute} (const std\-::string \&name)\label{classTiXmlElement_a1afa6aea716511326a608e4c05df4f3a}

\begin{DoxyCompactList}\small\item\em S\-T\-L std\-::string form. \end{DoxyCompactList}\item 
const {\bf Ti\-Xml\-Attribute} $\ast$ {\bf First\-Attribute} () const \label{classTiXmlElement_a516054c9073647d6cb29b6abe9fa0592}

\begin{DoxyCompactList}\small\item\em Access the first attribute in this element. \end{DoxyCompactList}\item 
{\bf Ti\-Xml\-Attribute} $\ast$ {\bfseries First\-Attribute} ()\label{classTiXmlElement_a4b33780fc565d38d6b54f640e0cf1737}

\item 
const {\bf Ti\-Xml\-Attribute} $\ast$ {\bf Last\-Attribute} () const \label{classTiXmlElement_a86191b49f9177be132b85b14655f1381}

\begin{DoxyCompactList}\small\item\em Access the last attribute in this element. \end{DoxyCompactList}\item 
{\bf Ti\-Xml\-Attribute} $\ast$ {\bfseries Last\-Attribute} ()\label{classTiXmlElement_a222f81cf06155cd108f2a68d4d176004}

\item 
const char $\ast$ {\bf Get\-Text} () const 
\begin{DoxyCompactList}\small\item\em Convenience function for easy access to the text inside an element. \end{DoxyCompactList}\item 
virtual {\bf Ti\-Xml\-Node} $\ast$ {\bf Clone} () const \label{classTiXmlElement_a13f6df105ebb1e8dc636e75cc883be32}

\begin{DoxyCompactList}\small\item\em Creates a new Element and returns it -\/ the returned element is a copy. \end{DoxyCompactList}\item 
virtual void {\bf Print} (F\-I\-L\-E $\ast$cfile, int depth) const 
\begin{DoxyCompactList}\small\item\em All Tiny\-Xml classes can print themselves to a filestream or the string class (\doxyref{Ti\-Xml\-String}{p.}{classTiXmlString} in non-\/\-S\-T\-L mode, std\-::string in S\-T\-L mode.) Either or both cfile and str can be null. \end{DoxyCompactList}\item 
virtual const char $\ast$ {\bfseries Parse} (const char $\ast$p, {\bf Ti\-Xml\-Parsing\-Data} $\ast$data, Ti\-Xml\-Encoding encoding)\label{classTiXmlElement_af95c9165159fd9dfdcc5b894a3fcf85b}

\item 
virtual const {\bf Ti\-Xml\-Element} $\ast$ {\bf To\-Element} () const \label{classTiXmlElement_ac5b8d0e25fa23fd9acbb6d146082901c}

\begin{DoxyCompactList}\small\item\em Cast to a more defined type. Will return null not of the requested type. \end{DoxyCompactList}\item 
virtual {\bf Ti\-Xml\-Element} $\ast$ {\bf To\-Element} ()\label{classTiXmlElement_a9def86337ea7a755eb41cac980f60c7a}

\begin{DoxyCompactList}\small\item\em Cast to a more defined type. Will return null not of the requested type. \end{DoxyCompactList}\item 
virtual bool {\bf Accept} ({\bf Ti\-Xml\-Visitor} $\ast$visitor) const \label{classTiXmlElement_a31ab28cc3b892a69254391d6bbe08df3}

\begin{DoxyCompactList}\small\item\em Walk the X\-M\-L tree visiting this node and all of its children. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
void {\bfseries Copy\-To} ({\bf Ti\-Xml\-Element} $\ast$target) const \label{classTiXmlElement_a9e0c1983b840de4134f1f6bf7af00b0f}

\item 
void {\bfseries Clear\-This} ()\label{classTiXmlElement_a5670933ec2d7d9763b9891acc05d7f7d}

\item 
virtual void {\bfseries Stream\-In} (std\-::istream $\ast$in, T\-I\-X\-M\-L\-\_\-\-S\-T\-R\-I\-N\-G $\ast$tag)\label{classTiXmlElement_acc42052299e0bcf04871f3c2d229fe93}

\item 
const char $\ast$ {\bfseries Read\-Value} (const char $\ast$in, {\bf Ti\-Xml\-Parsing\-Data} $\ast$prev\-Data, Ti\-Xml\-Encoding encoding)\label{classTiXmlElement_ac786bce103042d3837c4cc2ff6967d41}

\end{DoxyCompactItemize}
\subsection*{Additional Inherited Members}


\subsection{Detailed Description}
The element is a container class. 

It has a value, the element name, and can contain other elements, text, comments, and unknowns. Elements also contain an arbitrary number of attributes. 

\subsection{Member Function Documentation}
\index{Ti\-Xml\-Element@{Ti\-Xml\-Element}!Attribute@{Attribute}}
\index{Attribute@{Attribute}!TiXmlElement@{Ti\-Xml\-Element}}
\subsubsection[{Attribute}]{\setlength{\rightskip}{0pt plus 5cm}const char $\ast$ Ti\-Xml\-Element\-::\-Attribute (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{name, }
\item[{int $\ast$}]{i}
\end{DoxyParamCaption}
) const}\label{classTiXmlElement_aa9192e80567b5042dbded80b78c44339}


Given an attribute name, \doxyref{Attribute()}{p.}{classTiXmlElement_ac1e4691e9375ba4e665dce7e46a50a9c} returns the value for the attribute of that name, or null if none exists. 

If the attribute exists and can be converted to an integer, the integer value will be put in the return 'i', if 'i' is non-\/null. 

References Attribute().

\index{Ti\-Xml\-Element@{Ti\-Xml\-Element}!Attribute@{Attribute}}
\index{Attribute@{Attribute}!TiXmlElement@{Ti\-Xml\-Element}}
\subsubsection[{Attribute}]{\setlength{\rightskip}{0pt plus 5cm}const char $\ast$ Ti\-Xml\-Element\-::\-Attribute (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{name, }
\item[{double $\ast$}]{d}
\end{DoxyParamCaption}
) const}\label{classTiXmlElement_aec4f727f8aa49b51248d80125d173136}


Given an attribute name, \doxyref{Attribute()}{p.}{classTiXmlElement_ac1e4691e9375ba4e665dce7e46a50a9c} returns the value for the attribute of that name, or null if none exists. 

If the attribute exists and can be converted to an double, the double value will be put in the return 'd', if 'd' is non-\/null. 

References Attribute().

\index{Ti\-Xml\-Element@{Ti\-Xml\-Element}!Get\-Text@{Get\-Text}}
\index{Get\-Text@{Get\-Text}!TiXmlElement@{Ti\-Xml\-Element}}
\subsubsection[{Get\-Text}]{\setlength{\rightskip}{0pt plus 5cm}const char $\ast$ Ti\-Xml\-Element\-::\-Get\-Text (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}\label{classTiXmlElement_aa6dedd8a146acf3b1bc0903deb2d411a}


Convenience function for easy access to the text inside an element. 

Although easy and concise, \doxyref{Get\-Text()}{p.}{classTiXmlElement_aa6dedd8a146acf3b1bc0903deb2d411a} is limited compared to getting the \doxyref{Ti\-Xml\-Text}{p.}{classTiXmlText} child and accessing it directly.

If the first child of 'this' is a \doxyref{Ti\-Xml\-Text}{p.}{classTiXmlText}, the \doxyref{Get\-Text()}{p.}{classTiXmlElement_aa6dedd8a146acf3b1bc0903deb2d411a} returns the character string of the Text node, else null is returned.

This is a convenient method for getting the text of simple contained text\-: \begin{DoxyVerb}    <foo>This is text</foo>
    const char* str = fooElement->GetText();\end{DoxyVerb}


'str' will be a pointer to \char`\"{}\-This is text\char`\"{}.

Note that this function can be misleading. If the element foo was created from this X\-M\-L\-: \begin{DoxyVerb}    <foo><b>This is text</b></foo> \end{DoxyVerb}


then the value of str would be null. The first child node isn't a text node, it is another element. From this X\-M\-L\-: \begin{DoxyVerb}    <foo>This is <b>text</b></foo> \end{DoxyVerb}
 \doxyref{Get\-Text()}{p.}{classTiXmlElement_aa6dedd8a146acf3b1bc0903deb2d411a} will return \char`\"{}\-This is \char`\"{}.

W\-A\-R\-N\-I\-N\-G\-: \doxyref{Get\-Text()}{p.}{classTiXmlElement_aa6dedd8a146acf3b1bc0903deb2d411a} accesses a child node -\/ don't become confused with the similarly named \doxyref{Ti\-Xml\-Handle\-::\-Text()}{p.}{classTiXmlHandle_a9fc739c8a18d160006f82572fc143d13} and \doxyref{Ti\-Xml\-Node\-::\-To\-Text()}{p.}{classTiXmlNode_a3ddfbcac78fbea041fad57e5c6d60a03} which are safe type casts on the referenced node. 

References Ti\-Xml\-Node\-::\-First\-Child(), Ti\-Xml\-Node\-::\-To\-Text(), and Ti\-Xml\-Node\-::\-Value().

\index{Ti\-Xml\-Element@{Ti\-Xml\-Element}!Print@{Print}}
\index{Print@{Print}!TiXmlElement@{Ti\-Xml\-Element}}
\subsubsection[{Print}]{\setlength{\rightskip}{0pt plus 5cm}void Ti\-Xml\-Element\-::\-Print (
\begin{DoxyParamCaption}
\item[{F\-I\-L\-E $\ast$}]{cfile, }
\item[{int}]{depth}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [virtual]}}\label{classTiXmlElement_ad9d0c008866982ab8d9aafae7e14d692}


All Tiny\-Xml classes can print themselves to a filestream or the string class (\doxyref{Ti\-Xml\-String}{p.}{classTiXmlString} in non-\/\-S\-T\-L mode, std\-::string in S\-T\-L mode.) Either or both cfile and str can be null. 

This is a formatted print, and will insert tabs and newlines.

(For an unformatted stream, use the $<$$<$ operator.) 

Implements {\bf Ti\-Xml\-Base} \doxyref{}{p.}{classTiXmlBase_a0de56b3f2ef14c65091a3b916437b512}.



References Ti\-Xml\-Attribute\-::\-Next(), Ti\-Xml\-Node\-::\-Next\-Sibling(), Ti\-Xml\-Base\-::\-Print(), and Ti\-Xml\-Node\-::\-To\-Text().

\index{Ti\-Xml\-Element@{Ti\-Xml\-Element}!Query\-Int\-Attribute@{Query\-Int\-Attribute}}
\index{Query\-Int\-Attribute@{Query\-Int\-Attribute}!TiXmlElement@{Ti\-Xml\-Element}}
\subsubsection[{Query\-Int\-Attribute}]{\setlength{\rightskip}{0pt plus 5cm}int Ti\-Xml\-Element\-::\-Query\-Int\-Attribute (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{name, }
\item[{int $\ast$}]{\-\_\-value}
\end{DoxyParamCaption}
) const}\label{classTiXmlElement_aea0bfe471380f281c5945770ddbf52b9}


Query\-Int\-Attribute examines the attribute -\/ it is an alternative to the \doxyref{Attribute()}{p.}{classTiXmlElement_ac1e4691e9375ba4e665dce7e46a50a9c} method with richer error checking. 

If the attribute is an integer, it is stored in 'value' and the call returns T\-I\-X\-M\-L\-\_\-\-S\-U\-C\-C\-E\-S\-S. If it is not an integer, it returns T\-I\-X\-M\-L\-\_\-\-W\-R\-O\-N\-G\-\_\-\-T\-Y\-P\-E. If the attribute does not exist, then T\-I\-X\-M\-L\-\_\-\-N\-O\-\_\-\-A\-T\-T\-R\-I\-B\-U\-T\-E is returned. 

References Ti\-Xml\-Attribute\-::\-Query\-Int\-Value().

\index{Ti\-Xml\-Element@{Ti\-Xml\-Element}!Query\-Value\-Attribute@{Query\-Value\-Attribute}}
\index{Query\-Value\-Attribute@{Query\-Value\-Attribute}!TiXmlElement@{Ti\-Xml\-Element}}
\subsubsection[{Query\-Value\-Attribute}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ int Ti\-Xml\-Element\-::\-Query\-Value\-Attribute (
\begin{DoxyParamCaption}
\item[{const std\-::string \&}]{name, }
\item[{T $\ast$}]{out\-Value}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}\label{classTiXmlElement_a676f888438f8eb8d69a695ead195edb8}


Template form of the attribute query which will try to read the attribute into the specified type. 

Very easy, very powerful, but be careful to make sure to call this with the correct type.

\begin{DoxyReturn}{Returns}
T\-I\-X\-M\-L\-\_\-\-S\-U\-C\-C\-E\-S\-S, T\-I\-X\-M\-L\-\_\-\-W\-R\-O\-N\-G\-\_\-\-T\-Y\-P\-E, or T\-I\-X\-M\-L\-\_\-\-N\-O\-\_\-\-A\-T\-T\-R\-I\-B\-U\-T\-E 
\end{DoxyReturn}


References Ti\-Xml\-Attribute\-::\-Value\-Str().

\index{Ti\-Xml\-Element@{Ti\-Xml\-Element}!Set\-Attribute@{Set\-Attribute}}
\index{Set\-Attribute@{Set\-Attribute}!TiXmlElement@{Ti\-Xml\-Element}}
\subsubsection[{Set\-Attribute}]{\setlength{\rightskip}{0pt plus 5cm}void Ti\-Xml\-Element\-::\-Set\-Attribute (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{name, }
\item[{const char $\ast$}]{\-\_\-value}
\end{DoxyParamCaption}
)}\label{classTiXmlElement_abf0b3bd7f0e4c746a89ec6e7f101fc32}


Sets an attribute of name to a given value. 

The attribute will be created if it does not exist, or changed if it does. 

References Ti\-Xml\-Node\-::\-Get\-Document(), and Ti\-Xml\-Attribute\-::\-Set\-Value().



Referenced by marlin\-::\-X\-M\-L\-Fix\-Coll\-Types\-::parse(), marlin\-::\-X\-M\-L\-Parser\-::processconditions(), marlin\-::\-X\-M\-L\-Parser\-::replacegroups(), Set\-Attribute(), and Set\-Double\-Attribute().

\index{Ti\-Xml\-Element@{Ti\-Xml\-Element}!Set\-Attribute@{Set\-Attribute}}
\index{Set\-Attribute@{Set\-Attribute}!TiXmlElement@{Ti\-Xml\-Element}}
\subsubsection[{Set\-Attribute}]{\setlength{\rightskip}{0pt plus 5cm}void Ti\-Xml\-Element\-::\-Set\-Attribute (
\begin{DoxyParamCaption}
\item[{const std\-::string \&}]{name, }
\item[{const std\-::string \&}]{\-\_\-value}
\end{DoxyParamCaption}
)}\label{classTiXmlElement_a80ed65b1d194c71c6c9986ae42337d7d}


S\-T\-L std\-::string form. 

S\-T\-L std\-::string form. \index{Ti\-Xml\-Element@{Ti\-Xml\-Element}!Set\-Attribute@{Set\-Attribute}}
\index{Set\-Attribute@{Set\-Attribute}!TiXmlElement@{Ti\-Xml\-Element}}
\subsubsection[{Set\-Attribute}]{\setlength{\rightskip}{0pt plus 5cm}void Ti\-Xml\-Element\-::\-Set\-Attribute (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{name, }
\item[{int}]{value}
\end{DoxyParamCaption}
)}\label{classTiXmlElement_ace6f4be75e373726d4774073d666d1a7}


Sets an attribute of name to a given value. 

The attribute will be created if it does not exist, or changed if it does. 

References Set\-Attribute().

\index{Ti\-Xml\-Element@{Ti\-Xml\-Element}!Set\-Double\-Attribute@{Set\-Double\-Attribute}}
\index{Set\-Double\-Attribute@{Set\-Double\-Attribute}!TiXmlElement@{Ti\-Xml\-Element}}
\subsubsection[{Set\-Double\-Attribute}]{\setlength{\rightskip}{0pt plus 5cm}void Ti\-Xml\-Element\-::\-Set\-Double\-Attribute (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{name, }
\item[{double}]{value}
\end{DoxyParamCaption}
)}\label{classTiXmlElement_a0d1dd975d75496778177e35abfe0ec0b}


Sets an attribute of name to a given value. 

The attribute will be created if it does not exist, or changed if it does. 

References Set\-Attribute().



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