blob: 4d6a5e9353d3e84130c4fff59afec86522234f4d [file] [log] [blame]
Dan Albertc3bbea32014-08-21 15:48:37 -07001<!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"/>
The Android Open Source Project562be062009-03-03 19:30:48 -08005<title>TinyXml: TiXmlElement Class Reference</title>
Dan Albertc3bbea32014-08-21 15:48:37 -07006<link href="tabs.css" rel="stylesheet" type="text/css"/>
7<link href="doxygen.css" rel="stylesheet" type="text/css"/>
8</head>
9<body>
10<!-- Generated by Doxygen 1.6.2 -->
11<div class="navigation" id="top">
12 <div class="tabs">
13 <ul>
14 <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
15 <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
16 <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
17 <li><a href="files.html"><span>Files</span></a></li>
18 </ul>
19 </div>
20 <div class="tabs">
21 <ul>
22 <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
23 <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
24 <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
25 </ul>
26 </div>
27</div>
28<div class="contents">
29<h1>TiXmlElement Class Reference</h1><!-- doxytag: class="TiXmlElement" --><!-- doxytag: inherits="TiXmlNode" -->
30<p>The element is a container class.
31<a href="#_details">More...</a></p>
32
33<p><code>#include &lt;<a class="el" href="tinyxml_8h_source.html">tinyxml.h</a>&gt;</code></p>
34<div class="dynheader">
35Inheritance diagram for TiXmlElement:</div>
36<div class="dynsection">
37 <div class="center">
38 <img src="classTiXmlElement.png" usemap="#TiXmlElement_map" alt=""/>
39 <map id="TiXmlElement_map" name="TiXmlElement_map">
40<area href="classTiXmlNode.html" alt="TiXmlNode" shape="rect" coords="0,56,87,80"/>
41<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="0,0,87,24"/>
The Android Open Source Project562be062009-03-03 19:30:48 -080042</map>
Dan Albertc3bbea32014-08-21 15:48:37 -070043 </div>
44</div>
The Android Open Source Project562be062009-03-03 19:30:48 -080045
Dan Albertc3bbea32014-08-21 15:48:37 -070046<p><a href="classTiXmlElement-members.html">List of all members.</a></p>
47<table border="0" cellpadding="0" cellspacing="0">
48<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
49<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a01bc3ab372d35da08efcbbe65ad90c60"></a><!-- doxytag: member="TiXmlElement::TiXmlElement" ref="a01bc3ab372d35da08efcbbe65ad90c60" args="(const char *in_value)" -->
50&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a01bc3ab372d35da08efcbbe65ad90c60">TiXmlElement</a> (const char *in_value)</td></tr>
51<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Construct an element. <br/></td></tr>
52<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a40fc2e3c1a955e2f78e1a32350d180e7"></a><!-- doxytag: member="TiXmlElement::TiXmlElement" ref="a40fc2e3c1a955e2f78e1a32350d180e7" args="(const std::string &amp;_value)" -->
53&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a40fc2e3c1a955e2f78e1a32350d180e7">TiXmlElement</a> (const std::string &amp;_value)</td></tr>
54<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">std::string constructor. <br/></td></tr>
55<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae419a442a9701a62b0c3d8fd1cbdd12d"></a><!-- doxytag: member="TiXmlElement::Attribute" ref="ae419a442a9701a62b0c3d8fd1cbdd12d" args="(const char *name) const " -->
56const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d">Attribute</a> (const char *name) const </td></tr>
57<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Given an attribute name, <a class="el" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d" title="Given an attribute name, Attribute() returns the value for the attribute of that...">Attribute()</a> returns the value for the attribute of that name, or null if none exists. <br/></td></tr>
58<tr><td class="memItemLeft" align="right" valign="top">const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a0ed8348fdc56b72a6b4900ce5bac1849">Attribute</a> (const char *name, int *i) const </td></tr>
59<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Given an attribute name, <a class="el" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d" title="Given an attribute name, Attribute() returns the value for the attribute of that...">Attribute()</a> returns the value for the attribute of that name, or null if none exists. <a href="#a0ed8348fdc56b72a6b4900ce5bac1849"></a><br/></td></tr>
60<tr><td class="memItemLeft" align="right" valign="top">const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#aeaff99d4f0ea5b34f7aee202aad457ba">Attribute</a> (const char *name, double *d) const </td></tr>
61<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Given an attribute name, <a class="el" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d" title="Given an attribute name, Attribute() returns the value for the attribute of that...">Attribute()</a> returns the value for the attribute of that name, or null if none exists. <a href="#aeaff99d4f0ea5b34f7aee202aad457ba"></a><br/></td></tr>
62<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#aea0bfe471380f281c5945770ddbf52b9">QueryIntAttribute</a> (const char *name, int *_value) const </td></tr>
63<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">QueryIntAttribute examines the attribute - it is an alternative to the <a class="el" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d" title="Given an attribute name, Attribute() returns the value for the attribute of that...">Attribute()</a> method with richer error checking. <a href="#aea0bfe471380f281c5945770ddbf52b9"></a><br/></td></tr>
64<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae48df644f890ab86fa19839ac401f00d"></a><!-- doxytag: member="TiXmlElement::QueryUnsignedAttribute" ref="ae48df644f890ab86fa19839ac401f00d" args="(const char *name, unsigned *_value) const " -->
65int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#ae48df644f890ab86fa19839ac401f00d">QueryUnsignedAttribute</a> (const char *name, unsigned *_value) const </td></tr>
66<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">QueryUnsignedAttribute examines the attribute - see <a class="el" href="classTiXmlElement.html#aea0bfe471380f281c5945770ddbf52b9" title="QueryIntAttribute examines the attribute - it is an alternative to the Attribute()...">QueryIntAttribute()</a>. <br/></td></tr>
67<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#af4a1d3f88c28eb0f3115dc39ebd83fff">QueryBoolAttribute</a> (const char *name, bool *_value) const </td></tr>
68<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">QueryBoolAttribute examines the attribute - see <a class="el" href="classTiXmlElement.html#aea0bfe471380f281c5945770ddbf52b9" title="QueryIntAttribute examines the attribute - it is an alternative to the Attribute()...">QueryIntAttribute()</a>. <a href="#af4a1d3f88c28eb0f3115dc39ebd83fff"></a><br/></td></tr>
69<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a898d7730ecc341f0bffc7a9dadbf1ce7"></a><!-- doxytag: member="TiXmlElement::QueryDoubleAttribute" ref="a898d7730ecc341f0bffc7a9dadbf1ce7" args="(const char *name, double *_value) const " -->
70int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a898d7730ecc341f0bffc7a9dadbf1ce7">QueryDoubleAttribute</a> (const char *name, double *_value) const </td></tr>
71<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">QueryDoubleAttribute examines the attribute - see <a class="el" href="classTiXmlElement.html#aea0bfe471380f281c5945770ddbf52b9" title="QueryIntAttribute examines the attribute - it is an alternative to the Attribute()...">QueryIntAttribute()</a>. <br/></td></tr>
72<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa04d3af11601ef5a5f88295203a843be"></a><!-- doxytag: member="TiXmlElement::QueryFloatAttribute" ref="aa04d3af11601ef5a5f88295203a843be" args="(const char *name, float *_value) const " -->
73int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#aa04d3af11601ef5a5f88295203a843be">QueryFloatAttribute</a> (const char *name, float *_value) const </td></tr>
74<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">QueryFloatAttribute examines the attribute - see <a class="el" href="classTiXmlElement.html#aea0bfe471380f281c5945770ddbf52b9" title="QueryIntAttribute examines the attribute - it is an alternative to the Attribute()...">QueryIntAttribute()</a>. <br/></td></tr>
75<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a14321ac360efe906ed449d9db3fd9961"></a><!-- doxytag: member="TiXmlElement::QueryStringAttribute" ref="a14321ac360efe906ed449d9db3fd9961" args="(const char *name, std::string *_value) const " -->
76int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a14321ac360efe906ed449d9db3fd9961">QueryStringAttribute</a> (const char *name, std::string *_value) const </td></tr>
77<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">QueryStringAttribute examines the attribute - see <a class="el" href="classTiXmlElement.html#aea0bfe471380f281c5945770ddbf52b9" title="QueryIntAttribute examines the attribute - it is an alternative to the Attribute()...">QueryIntAttribute()</a>. <br/></td></tr>
78<tr><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
79<tr><td class="memTemplItemLeft" align="right" valign="top">int&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#ae3b9a03b0a56663a40801c7256683576">QueryValueAttribute</a> (const std::string &amp;name, T *outValue) const </td></tr>
80<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Template form of the attribute query which will try to read the attribute into the specified type. <a href="#ae3b9a03b0a56663a40801c7256683576"></a><br/></td></tr>
81<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#abf0b3bd7f0e4c746a89ec6e7f101fc32">SetAttribute</a> (const char *name, const char *_value)</td></tr>
82<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets an attribute of name to a given value. <a href="#abf0b3bd7f0e4c746a89ec6e7f101fc32"></a><br/></td></tr>
83<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a80ed65b1d194c71c6c9986ae42337d7d">SetAttribute</a> (const std::string &amp;name, const std::string &amp;_value)</td></tr>
84<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6f18d54fbe25bbc527936ee65363b3c5"></a><!-- doxytag: member="TiXmlElement::SetAttribute" ref="a6f18d54fbe25bbc527936ee65363b3c5" args="(const std::string &amp;name, int _value)" -->
85void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a6f18d54fbe25bbc527936ee65363b3c5">SetAttribute</a> (const std::string &amp;name, int _value)</td></tr>
86<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">STL std::string form. <br/></td></tr>
87<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#ace6f4be75e373726d4774073d666d1a7">SetAttribute</a> (const char *name, int value)</td></tr>
88<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets an attribute of name to a given value. <a href="#ace6f4be75e373726d4774073d666d1a7"></a><br/></td></tr>
89<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a0d1dd975d75496778177e35abfe0ec0b">SetDoubleAttribute</a> (const char *name, double value)</td></tr>
90<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets an attribute of name to a given value. <a href="#a0d1dd975d75496778177e35abfe0ec0b"></a><br/></td></tr>
91<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a56979767deca794376b1dfa69a525b2a"></a><!-- doxytag: member="TiXmlElement::RemoveAttribute" ref="a56979767deca794376b1dfa69a525b2a" args="(const char *name)" -->
92void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a56979767deca794376b1dfa69a525b2a">RemoveAttribute</a> (const char *name)</td></tr>
93<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deletes an attribute with the given name. <br/></td></tr>
94<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1afa6aea716511326a608e4c05df4f3a"></a><!-- doxytag: member="TiXmlElement::RemoveAttribute" ref="a1afa6aea716511326a608e4c05df4f3a" args="(const std::string &amp;name)" -->
95void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a1afa6aea716511326a608e4c05df4f3a">RemoveAttribute</a> (const std::string &amp;name)</td></tr>
96<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">STL std::string form. <br/></td></tr>
97<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a516054c9073647d6cb29b6abe9fa0592"></a><!-- doxytag: member="TiXmlElement::FirstAttribute" ref="a516054c9073647d6cb29b6abe9fa0592" args="() const " -->
98const <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a516054c9073647d6cb29b6abe9fa0592">FirstAttribute</a> () const </td></tr>
99<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Access the first attribute in this element. <br/></td></tr>
100<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a86191b49f9177be132b85b14655f1381"></a><!-- doxytag: member="TiXmlElement::LastAttribute" ref="a86191b49f9177be132b85b14655f1381" args="() const " -->
101const <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a86191b49f9177be132b85b14655f1381">LastAttribute</a> () const </td></tr>
102<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Access the last attribute in this element. <br/></td></tr>
103<tr><td class="memItemLeft" align="right" valign="top">const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#af3282294986cdb216646ea1f67af2c87">GetText</a> () const </td></tr>
104<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Convenience function for easy access to the text inside an element. <a href="#af3282294986cdb216646ea1f67af2c87"></a><br/></td></tr>
105<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa464535ea1994db337cb6a8ce4b588b5"></a><!-- doxytag: member="TiXmlElement::Clone" ref="aa464535ea1994db337cb6a8ce4b588b5" args="() const " -->
106virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#aa464535ea1994db337cb6a8ce4b588b5">Clone</a> () const </td></tr>
107<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates a new Element and returns it - the returned element is a copy. <br/></td></tr>
108<tr><td class="memItemLeft" align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#afbf52736e70fc91ec9d760721d6f4fd2">Print</a> (FILE *cfile, int depth) const </td></tr>
109<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. <a href="#afbf52736e70fc91ec9d760721d6f4fd2"></a><br/></td></tr>
110<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac5b8d0e25fa23fd9acbb6d146082901c"></a><!-- doxytag: member="TiXmlElement::ToElement" ref="ac5b8d0e25fa23fd9acbb6d146082901c" args="() const " -->
111virtual const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#ac5b8d0e25fa23fd9acbb6d146082901c">ToElement</a> () const </td></tr>
112<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br/></td></tr>
113<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9def86337ea7a755eb41cac980f60c7a"></a><!-- doxytag: member="TiXmlElement::ToElement" ref="a9def86337ea7a755eb41cac980f60c7a" args="()" -->
114virtual <a class="el" href="classTiXmlElement.html">TiXmlElement</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a9def86337ea7a755eb41cac980f60c7a">ToElement</a> ()</td></tr>
115<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br/></td></tr>
116<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a71a81b2afb0d42be1543d1c404dee6f5"></a><!-- doxytag: member="TiXmlElement::Accept" ref="a71a81b2afb0d42be1543d1c404dee6f5" args="(TiXmlVisitor *visitor) const " -->
117virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a71a81b2afb0d42be1543d1c404dee6f5">Accept</a> (<a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> *visitor) const </td></tr>
118<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Walk the XML tree visiting this node and all of its children. <br/></td></tr>
The Android Open Source Project562be062009-03-03 19:30:48 -0800119</table>
Dan Albertc3bbea32014-08-21 15:48:37 -0700120<hr/><a name="_details"></a><h2>Detailed Description</h2>
121<p>The element is a container class. </p>
122<p>It has a value, the element name, and can contain other elements, text, comments, and unknowns. Elements also contain an arbitrary number of attributes. </p>
123<hr/><h2>Member Function Documentation</h2>
124<a class="anchor" id="aeaff99d4f0ea5b34f7aee202aad457ba"></a><!-- doxytag: member="TiXmlElement::Attribute" ref="aeaff99d4f0ea5b34f7aee202aad457ba" args="(const char *name, double *d) const " -->
125<div class="memitem">
126<div class="memproto">
127 <table class="memname">
The Android Open Source Project562be062009-03-03 19:30:48 -0800128 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700129 <td class="memname">const char* TiXmlElement::Attribute </td>
130 <td>(</td>
131 <td class="paramtype">const char *&nbsp;</td>
132 <td class="paramname"> <em>name</em>, </td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800133 </tr>
134 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700135 <td class="paramkey"></td>
136 <td></td>
137 <td class="paramtype">double *&nbsp;</td>
138 <td class="paramname"> <em>d</em></td><td>&nbsp;</td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800139 </tr>
140 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700141 <td></td>
142 <td>)</td>
143 <td></td><td></td><td> const</td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800144 </tr>
145 </table>
Dan Albertc3bbea32014-08-21 15:48:37 -0700146</div>
147<div class="memdoc">
The Android Open Source Project562be062009-03-03 19:30:48 -0800148
Dan Albertc3bbea32014-08-21 15:48:37 -0700149<p>Given an attribute name, <a class="el" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d" title="Given an attribute name, Attribute() returns the value for the attribute of that...">Attribute()</a> returns the value for the attribute of that name, or null if none exists. </p>
150<p>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. </p>
151
152</div>
153</div>
154<a class="anchor" id="a0ed8348fdc56b72a6b4900ce5bac1849"></a><!-- doxytag: member="TiXmlElement::Attribute" ref="a0ed8348fdc56b72a6b4900ce5bac1849" args="(const char *name, int *i) const " -->
155<div class="memitem">
156<div class="memproto">
157 <table class="memname">
The Android Open Source Project562be062009-03-03 19:30:48 -0800158 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700159 <td class="memname">const char* TiXmlElement::Attribute </td>
160 <td>(</td>
161 <td class="paramtype">const char *&nbsp;</td>
162 <td class="paramname"> <em>name</em>, </td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800163 </tr>
164 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700165 <td class="paramkey"></td>
166 <td></td>
167 <td class="paramtype">int *&nbsp;</td>
168 <td class="paramname"> <em>i</em></td><td>&nbsp;</td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800169 </tr>
170 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700171 <td></td>
172 <td>)</td>
173 <td></td><td></td><td> const</td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800174 </tr>
175 </table>
Dan Albertc3bbea32014-08-21 15:48:37 -0700176</div>
177<div class="memdoc">
The Android Open Source Project562be062009-03-03 19:30:48 -0800178
Dan Albertc3bbea32014-08-21 15:48:37 -0700179<p>Given an attribute name, <a class="el" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d" title="Given an attribute name, Attribute() returns the value for the attribute of that...">Attribute()</a> returns the value for the attribute of that name, or null if none exists. </p>
180<p>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. </p>
181
182</div>
183</div>
184<a class="anchor" id="af3282294986cdb216646ea1f67af2c87"></a><!-- doxytag: member="TiXmlElement::GetText" ref="af3282294986cdb216646ea1f67af2c87" args="() const " -->
185<div class="memitem">
186<div class="memproto">
187 <table class="memname">
The Android Open Source Project562be062009-03-03 19:30:48 -0800188 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700189 <td class="memname">const char* TiXmlElement::GetText </td>
190 <td>(</td>
191 <td class="paramname"></td>
192 <td>&nbsp;)&nbsp;</td>
193 <td> const</td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800194 </tr>
195 </table>
Dan Albertc3bbea32014-08-21 15:48:37 -0700196</div>
197<div class="memdoc">
The Android Open Source Project562be062009-03-03 19:30:48 -0800198
Dan Albertc3bbea32014-08-21 15:48:37 -0700199<p>Convenience function for easy access to the text inside an element. </p>
200<p>Although easy and concise, <a class="el" href="classTiXmlElement.html#af3282294986cdb216646ea1f67af2c87" title="Convenience function for easy access to the text inside an element.">GetText()</a> is limited compared to getting the <a class="el" href="classTiXmlText.html" title="XML text.">TiXmlText</a> child and accessing it directly.</p>
201<p>If the first child of 'this' is a <a class="el" href="classTiXmlText.html" title="XML text.">TiXmlText</a>, the <a class="el" href="classTiXmlElement.html#af3282294986cdb216646ea1f67af2c87" title="Convenience function for easy access to the text inside an element.">GetText()</a> returns the character string of the Text node, else null is returned.</p>
202<p>This is a convenient method for getting the text of simple contained text: </p>
203<div class="fragment"><pre class="fragment">
204 &lt;foo&gt;This is text&lt;/foo&gt;
The Android Open Source Project562be062009-03-03 19:30:48 -0800205 const char* str = fooElement-&gt;GetText();
Dan Albertc3bbea32014-08-21 15:48:37 -0700206 </pre></div><p>'str' will be a pointer to "This is text".</p>
207<p>Note that this function can be misleading. If the element foo was created from this XML: </p>
208<div class="fragment"><pre class="fragment">
209 &lt;foo&gt;&lt;b&gt;This is text&lt;/b&gt;&lt;/foo&gt;
210 </pre></div><p>then the value of str would be null. The first child node isn't a text node, it is another element. From this XML: </p>
211<div class="fragment"><pre class="fragment">
212 &lt;foo&gt;This is &lt;b&gt;text&lt;/b&gt;&lt;/foo&gt;
213 </pre></div><p> <a class="el" href="classTiXmlElement.html#af3282294986cdb216646ea1f67af2c87" title="Convenience function for easy access to the text inside an element.">GetText()</a> will return "This is ".</p>
214<p>WARNING: <a class="el" href="classTiXmlElement.html#af3282294986cdb216646ea1f67af2c87" title="Convenience function for easy access to the text inside an element.">GetText()</a> accesses a child node - don't become confused with the similarly named <a class="el" href="classTiXmlHandle.html#a9fc739c8a18d160006f82572fc143d13">TiXmlHandle::Text()</a> and <a class="el" href="classTiXmlNode.html#a3ddfbcac78fbea041fad57e5c6d60a03" title="Cast to a more defined type. Will return null if not of the requested type.">TiXmlNode::ToText()</a> which are safe type casts on the referenced node. </p>
215
216</div>
217</div>
218<a class="anchor" id="afbf52736e70fc91ec9d760721d6f4fd2"></a><!-- doxytag: member="TiXmlElement::Print" ref="afbf52736e70fc91ec9d760721d6f4fd2" args="(FILE *cfile, int depth) const " -->
219<div class="memitem">
220<div class="memproto">
221 <table class="memname">
The Android Open Source Project562be062009-03-03 19:30:48 -0800222 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700223 <td class="memname">virtual void TiXmlElement::Print </td>
224 <td>(</td>
225 <td class="paramtype">FILE *&nbsp;</td>
226 <td class="paramname"> <em>cfile</em>, </td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800227 </tr>
228 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700229 <td class="paramkey"></td>
230 <td></td>
231 <td class="paramtype">int&nbsp;</td>
232 <td class="paramname"> <em>depth</em></td><td>&nbsp;</td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800233 </tr>
234 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700235 <td></td>
236 <td>)</td>
237 <td></td><td></td><td> const<code> [virtual]</code></td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800238 </tr>
239 </table>
Dan Albertc3bbea32014-08-21 15:48:37 -0700240</div>
241<div class="memdoc">
The Android Open Source Project562be062009-03-03 19:30:48 -0800242
Dan Albertc3bbea32014-08-21 15:48:37 -0700243<p>All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. </p>
244<p>) Either or both cfile and str can be null.</p>
245<p>This is a formatted print, and will insert tabs and newlines.</p>
246<p>(For an unformatted stream, use the &lt;&lt; operator.) </p>
247
248<p>Implements <a class="el" href="classTiXmlBase.html#a0de56b3f2ef14c65091a3b916437b512">TiXmlBase</a>.</p>
249
250</div>
251</div>
252<a class="anchor" id="af4a1d3f88c28eb0f3115dc39ebd83fff"></a><!-- doxytag: member="TiXmlElement::QueryBoolAttribute" ref="af4a1d3f88c28eb0f3115dc39ebd83fff" args="(const char *name, bool *_value) const " -->
253<div class="memitem">
254<div class="memproto">
255 <table class="memname">
The Android Open Source Project562be062009-03-03 19:30:48 -0800256 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700257 <td class="memname">int TiXmlElement::QueryBoolAttribute </td>
258 <td>(</td>
259 <td class="paramtype">const char *&nbsp;</td>
260 <td class="paramname"> <em>name</em>, </td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800261 </tr>
262 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700263 <td class="paramkey"></td>
264 <td></td>
265 <td class="paramtype">bool *&nbsp;</td>
266 <td class="paramname"> <em>_value</em></td><td>&nbsp;</td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800267 </tr>
268 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700269 <td></td>
270 <td>)</td>
271 <td></td><td></td><td> const</td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800272 </tr>
273 </table>
Dan Albertc3bbea32014-08-21 15:48:37 -0700274</div>
275<div class="memdoc">
The Android Open Source Project562be062009-03-03 19:30:48 -0800276
Dan Albertc3bbea32014-08-21 15:48:37 -0700277<p>QueryBoolAttribute examines the attribute - see <a class="el" href="classTiXmlElement.html#aea0bfe471380f281c5945770ddbf52b9" title="QueryIntAttribute examines the attribute - it is an alternative to the Attribute()...">QueryIntAttribute()</a>. </p>
278<p>Note that '1', 'true', or 'yes' are considered true, while '0', 'false' and 'no' are considered false. </p>
279
280</div>
281</div>
282<a class="anchor" id="aea0bfe471380f281c5945770ddbf52b9"></a><!-- doxytag: member="TiXmlElement::QueryIntAttribute" ref="aea0bfe471380f281c5945770ddbf52b9" args="(const char *name, int *_value) const " -->
283<div class="memitem">
284<div class="memproto">
285 <table class="memname">
The Android Open Source Project562be062009-03-03 19:30:48 -0800286 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700287 <td class="memname">int TiXmlElement::QueryIntAttribute </td>
288 <td>(</td>
289 <td class="paramtype">const char *&nbsp;</td>
290 <td class="paramname"> <em>name</em>, </td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800291 </tr>
292 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700293 <td class="paramkey"></td>
294 <td></td>
295 <td class="paramtype">int *&nbsp;</td>
296 <td class="paramname"> <em>_value</em></td><td>&nbsp;</td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800297 </tr>
298 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700299 <td></td>
300 <td>)</td>
301 <td></td><td></td><td> const</td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800302 </tr>
303 </table>
Dan Albertc3bbea32014-08-21 15:48:37 -0700304</div>
305<div class="memdoc">
The Android Open Source Project562be062009-03-03 19:30:48 -0800306
Dan Albertc3bbea32014-08-21 15:48:37 -0700307<p>QueryIntAttribute examines the attribute - it is an alternative to the <a class="el" href="classTiXmlElement.html#ae419a442a9701a62b0c3d8fd1cbdd12d" title="Given an attribute name, Attribute() returns the value for the attribute of that...">Attribute()</a> method with richer error checking. </p>
308<p>If the attribute is an integer, it is stored in 'value' and the call returns TIXML_SUCCESS. If it is not an integer, it returns TIXML_WRONG_TYPE. If the attribute does not exist, then TIXML_NO_ATTRIBUTE is returned. </p>
309
310</div>
311</div>
312<a class="anchor" id="ae3b9a03b0a56663a40801c7256683576"></a><!-- doxytag: member="TiXmlElement::QueryValueAttribute" ref="ae3b9a03b0a56663a40801c7256683576" args="(const std::string &amp;name, T *outValue) const " -->
313<div class="memitem">
314<div class="memproto">
315<div class="memtemplate">
316template&lt;typename T &gt; </div>
317 <table class="memname">
The Android Open Source Project562be062009-03-03 19:30:48 -0800318 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700319 <td class="memname">int TiXmlElement::QueryValueAttribute </td>
320 <td>(</td>
321 <td class="paramtype">const std::string &amp;&nbsp;</td>
322 <td class="paramname"> <em>name</em>, </td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800323 </tr>
324 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700325 <td class="paramkey"></td>
326 <td></td>
327 <td class="paramtype">T *&nbsp;</td>
328 <td class="paramname"> <em>outValue</em></td><td>&nbsp;</td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800329 </tr>
330 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700331 <td></td>
332 <td>)</td>
333 <td></td><td></td><td> const<code> [inline]</code></td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800334 </tr>
335 </table>
Dan Albertc3bbea32014-08-21 15:48:37 -0700336</div>
337<div class="memdoc">
The Android Open Source Project562be062009-03-03 19:30:48 -0800338
Dan Albertc3bbea32014-08-21 15:48:37 -0700339<p>Template form of the attribute query which will try to read the attribute into the specified type. </p>
340<p>Very easy, very powerful, but be careful to make sure to call this with the correct type.</p>
341<p>NOTE: This method doesn't work correctly for 'string' types that contain spaces.</p>
342<dl class="return"><dt><b>Returns:</b></dt><dd>TIXML_SUCCESS, TIXML_WRONG_TYPE, or TIXML_NO_ATTRIBUTE </dd></dl>
343
344<p>References <a class="el" href="tinyxml_8h_source.html#l00814">TiXmlAttribute::ValueStr()</a>.</p>
345
346</div>
347</div>
348<a class="anchor" id="ace6f4be75e373726d4774073d666d1a7"></a><!-- doxytag: member="TiXmlElement::SetAttribute" ref="ace6f4be75e373726d4774073d666d1a7" args="(const char *name, int value)" -->
349<div class="memitem">
350<div class="memproto">
351 <table class="memname">
The Android Open Source Project562be062009-03-03 19:30:48 -0800352 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700353 <td class="memname">void TiXmlElement::SetAttribute </td>
354 <td>(</td>
355 <td class="paramtype">const char *&nbsp;</td>
356 <td class="paramname"> <em>name</em>, </td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800357 </tr>
358 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700359 <td class="paramkey"></td>
360 <td></td>
361 <td class="paramtype">int&nbsp;</td>
362 <td class="paramname"> <em>value</em></td><td>&nbsp;</td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800363 </tr>
364 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700365 <td></td>
366 <td>)</td>
367 <td></td><td></td><td></td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800368 </tr>
369 </table>
Dan Albertc3bbea32014-08-21 15:48:37 -0700370</div>
371<div class="memdoc">
The Android Open Source Project562be062009-03-03 19:30:48 -0800372
Dan Albertc3bbea32014-08-21 15:48:37 -0700373<p>Sets an attribute of name to a given value. </p>
374<p>The attribute will be created if it does not exist, or changed if it does. </p>
375
376</div>
377</div>
378<a class="anchor" id="a80ed65b1d194c71c6c9986ae42337d7d"></a><!-- doxytag: member="TiXmlElement::SetAttribute" ref="a80ed65b1d194c71c6c9986ae42337d7d" args="(const std::string &amp;name, const std::string &amp;_value)" -->
379<div class="memitem">
380<div class="memproto">
381 <table class="memname">
382 <tr>
383 <td class="memname">void TiXmlElement::SetAttribute </td>
384 <td>(</td>
385 <td class="paramtype">const std::string &amp;&nbsp;</td>
386 <td class="paramname"> <em>name</em>, </td>
387 </tr>
388 <tr>
389 <td class="paramkey"></td>
390 <td></td>
391 <td class="paramtype">const std::string &amp;&nbsp;</td>
392 <td class="paramname"> <em>_value</em></td><td>&nbsp;</td>
393 </tr>
394 <tr>
395 <td></td>
396 <td>)</td>
397 <td></td><td></td><td></td>
398 </tr>
399 </table>
400</div>
401<div class="memdoc">
402<p>STL std::string form. </p>
403
404</div>
405</div>
406<a class="anchor" id="abf0b3bd7f0e4c746a89ec6e7f101fc32"></a><!-- doxytag: member="TiXmlElement::SetAttribute" ref="abf0b3bd7f0e4c746a89ec6e7f101fc32" args="(const char *name, const char *_value)" -->
407<div class="memitem">
408<div class="memproto">
409 <table class="memname">
410 <tr>
411 <td class="memname">void TiXmlElement::SetAttribute </td>
412 <td>(</td>
413 <td class="paramtype">const char *&nbsp;</td>
414 <td class="paramname"> <em>name</em>, </td>
415 </tr>
416 <tr>
417 <td class="paramkey"></td>
418 <td></td>
419 <td class="paramtype">const char *&nbsp;</td>
420 <td class="paramname"> <em>_value</em></td><td>&nbsp;</td>
421 </tr>
422 <tr>
423 <td></td>
424 <td>)</td>
425 <td></td><td></td><td></td>
426 </tr>
427 </table>
428</div>
429<div class="memdoc">
430
431<p>Sets an attribute of name to a given value. </p>
432<p>The attribute will be created if it does not exist, or changed if it does. </p>
433
434</div>
435</div>
436<a class="anchor" id="a0d1dd975d75496778177e35abfe0ec0b"></a><!-- doxytag: member="TiXmlElement::SetDoubleAttribute" ref="a0d1dd975d75496778177e35abfe0ec0b" args="(const char *name, double value)" -->
437<div class="memitem">
438<div class="memproto">
439 <table class="memname">
440 <tr>
441 <td class="memname">void TiXmlElement::SetDoubleAttribute </td>
442 <td>(</td>
443 <td class="paramtype">const char *&nbsp;</td>
444 <td class="paramname"> <em>name</em>, </td>
445 </tr>
446 <tr>
447 <td class="paramkey"></td>
448 <td></td>
449 <td class="paramtype">double&nbsp;</td>
450 <td class="paramname"> <em>value</em></td><td>&nbsp;</td>
451 </tr>
452 <tr>
453 <td></td>
454 <td>)</td>
455 <td></td><td></td><td></td>
456 </tr>
457 </table>
458</div>
459<div class="memdoc">
460
461<p>Sets an attribute of name to a given value. </p>
462<p>The attribute will be created if it does not exist, or changed if it does. </p>
463
464</div>
465</div>
466<hr/>The documentation for this class was generated from the following file:<ul>
467<li><a class="el" href="tinyxml_8h_source.html">tinyxml.h</a></li>
468</ul>
469</div>
470<hr size="1"/><address style="text-align: right;"><small>Generated by&nbsp;
The Android Open Source Project562be062009-03-03 19:30:48 -0800471<a href="http://www.doxygen.org/index.html">
Dan Albertc3bbea32014-08-21 15:48:37 -0700472<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
The Android Open Source Project562be062009-03-03 19:30:48 -0800473</body>
474</html>