blob: 6eaca6be363208b3cfad954733a0eab35b3e99e4 [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: TiXmlAttribute 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>TiXmlAttribute Class Reference</h1><!-- doxytag: class="TiXmlAttribute" --><!-- doxytag: inherits="TiXmlBase" -->
30<p>An attribute is a name-value pair.
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 TiXmlAttribute:</div>
36<div class="dynsection">
37 <div class="center">
38 <img src="classTiXmlAttribute.png" usemap="#TiXmlAttribute_map" alt=""/>
39 <map id="TiXmlAttribute_map" name="TiXmlAttribute_map">
40<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="0,0,90,24"/>
The Android Open Source Project562be062009-03-03 19:30:48 -080041</map>
Dan Albertc3bbea32014-08-21 15:48:37 -070042 </div>
43</div>
The Android Open Source Project562be062009-03-03 19:30:48 -080044
Dan Albertc3bbea32014-08-21 15:48:37 -070045<p><a href="classTiXmlAttribute-members.html">List of all members.</a></p>
46<table border="0" cellpadding="0" cellspacing="0">
47<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
48<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9cfa3c8179873fd485d83003b114f8e1"></a><!-- doxytag: member="TiXmlAttribute::TiXmlAttribute" ref="a9cfa3c8179873fd485d83003b114f8e1" args="()" -->
49&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a9cfa3c8179873fd485d83003b114f8e1">TiXmlAttribute</a> ()</td></tr>
50<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Construct an empty attribute. <br/></td></tr>
51<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a052213522caac3979960e0714063861d"></a><!-- doxytag: member="TiXmlAttribute::TiXmlAttribute" ref="a052213522caac3979960e0714063861d" args="(const std::string &amp;_name, const std::string &amp;_value)" -->
52&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a052213522caac3979960e0714063861d">TiXmlAttribute</a> (const std::string &amp;_name, const std::string &amp;_value)</td></tr>
53<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">std::string constructor. <br/></td></tr>
54<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a759d0b76fb8fcf765ecab243bc14f05e"></a><!-- doxytag: member="TiXmlAttribute::TiXmlAttribute" ref="a759d0b76fb8fcf765ecab243bc14f05e" args="(const char *_name, const char *_value)" -->
55&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a759d0b76fb8fcf765ecab243bc14f05e">TiXmlAttribute</a> (const char *_name, const char *_value)</td></tr>
56<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Construct an attribute with a name and value. <br/></td></tr>
57<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a298a57287d305904ba6bd96ae6f78d3d"></a><!-- doxytag: member="TiXmlAttribute::Name" ref="a298a57287d305904ba6bd96ae6f78d3d" args="() const " -->
58const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a298a57287d305904ba6bd96ae6f78d3d">Name</a> () const </td></tr>
59<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the name of this attribute. <br/></td></tr>
60<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0f874490eac8ca00ee0070765d0e97e3"></a><!-- doxytag: member="TiXmlAttribute::Value" ref="a0f874490eac8ca00ee0070765d0e97e3" args="() const " -->
61const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a0f874490eac8ca00ee0070765d0e97e3">Value</a> () const </td></tr>
62<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the value of this attribute. <br/></td></tr>
63<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a87705c3ccf9ee9417beb4f7cbacd4d33"></a><!-- doxytag: member="TiXmlAttribute::ValueStr" ref="a87705c3ccf9ee9417beb4f7cbacd4d33" args="() const " -->
64const std::string &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a87705c3ccf9ee9417beb4f7cbacd4d33">ValueStr</a> () const </td></tr>
65<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the value of this attribute. <br/></td></tr>
66<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa1a20ad59dc7e89a0ab265396360d50f"></a><!-- doxytag: member="TiXmlAttribute::IntValue" ref="aa1a20ad59dc7e89a0ab265396360d50f" args="() const " -->
67int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#aa1a20ad59dc7e89a0ab265396360d50f">IntValue</a> () const </td></tr>
68<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the value of this attribute, converted to an integer. <br/></td></tr>
69<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2880ddef53fc7522c99535273954d230"></a><!-- doxytag: member="TiXmlAttribute::DoubleValue" ref="a2880ddef53fc7522c99535273954d230" args="() const " -->
70double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a2880ddef53fc7522c99535273954d230">DoubleValue</a> () const </td></tr>
71<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the value of this attribute, converted to a double. <br/></td></tr>
72<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#ad6c93088ee21af41a107931223339344">QueryIntValue</a> (int *_value) const </td></tr>
73<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">QueryIntValue examines the value string. <a href="#ad6c93088ee21af41a107931223339344"></a><br/></td></tr>
74<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac87b2a8489906a5d7aa2875f20be3513"></a><!-- doxytag: member="TiXmlAttribute::QueryDoubleValue" ref="ac87b2a8489906a5d7aa2875f20be3513" args="(double *_value) const " -->
75int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#ac87b2a8489906a5d7aa2875f20be3513">QueryDoubleValue</a> (double *_value) const </td></tr>
76<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">QueryDoubleValue examines the value string. See <a class="el" href="classTiXmlAttribute.html#ad6c93088ee21af41a107931223339344" title="QueryIntValue examines the value string.">QueryIntValue()</a>. <br/></td></tr>
77<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab7fa3d21ff8d7c5764cf9af15b667a99"></a><!-- doxytag: member="TiXmlAttribute::SetName" ref="ab7fa3d21ff8d7c5764cf9af15b667a99" args="(const char *_name)" -->
78void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#ab7fa3d21ff8d7c5764cf9af15b667a99">SetName</a> (const char *_name)</td></tr>
79<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the name of this attribute. <br/></td></tr>
80<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2dae44178f668b3cb48101be4f2236a0"></a><!-- doxytag: member="TiXmlAttribute::SetValue" ref="a2dae44178f668b3cb48101be4f2236a0" args="(const char *_value)" -->
81void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a2dae44178f668b3cb48101be4f2236a0">SetValue</a> (const char *_value)</td></tr>
82<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the value. <br/></td></tr>
83<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7e065df640116a62ea4f4b7da5449cc8"></a><!-- doxytag: member="TiXmlAttribute::SetIntValue" ref="a7e065df640116a62ea4f4b7da5449cc8" args="(int _value)" -->
84void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a7e065df640116a62ea4f4b7da5449cc8">SetIntValue</a> (int _value)</td></tr>
85<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the value from an integer. <br/></td></tr>
86<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0316da31373496c4368ad549bf711394"></a><!-- doxytag: member="TiXmlAttribute::SetDoubleValue" ref="a0316da31373496c4368ad549bf711394" args="(double _value)" -->
87void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a0316da31373496c4368ad549bf711394">SetDoubleValue</a> (double _value)</td></tr>
88<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the value from a double. <br/></td></tr>
89<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab296ff0c9a8c701055cd257a8a976e57"></a><!-- doxytag: member="TiXmlAttribute::SetName" ref="ab296ff0c9a8c701055cd257a8a976e57" args="(const std::string &amp;_name)" -->
90void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#ab296ff0c9a8c701055cd257a8a976e57">SetName</a> (const std::string &amp;_name)</td></tr>
91<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">STL std::string form. <br/></td></tr>
92<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab43f67a0cc3ec1d80e62606500f0925f"></a><!-- doxytag: member="TiXmlAttribute::SetValue" ref="ab43f67a0cc3ec1d80e62606500f0925f" args="(const std::string &amp;_value)" -->
93void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#ab43f67a0cc3ec1d80e62606500f0925f">SetValue</a> (const std::string &amp;_value)</td></tr>
94<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">STL std::string form. <br/></td></tr>
95<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1c78e92e223a40843f644ba48ef69f67"></a><!-- doxytag: member="TiXmlAttribute::Next" ref="a1c78e92e223a40843f644ba48ef69f67" args="() const " -->
96const <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a1c78e92e223a40843f644ba48ef69f67">Next</a> () const </td></tr>
97<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the next sibling attribute in the DOM. Returns null at end. <br/></td></tr>
98<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6ebbfe333fe76cd834bd6cbcca3130cf"></a><!-- doxytag: member="TiXmlAttribute::Previous" ref="a6ebbfe333fe76cd834bd6cbcca3130cf" args="() const " -->
99const <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a6ebbfe333fe76cd834bd6cbcca3130cf">Previous</a> () const </td></tr>
100<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the previous sibling attribute in the DOM. Returns null at beginning. <br/></td></tr>
101<tr><td class="memItemLeft" align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#acc04956c1d5c4c31fe74f7a7528d109a">Print</a> (FILE *cfile, int depth) const </td></tr>
102<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="#acc04956c1d5c4c31fe74f7a7528d109a"></a><br/></td></tr>
The Android Open Source Project562be062009-03-03 19:30:48 -0800103</table>
Dan Albertc3bbea32014-08-21 15:48:37 -0700104<hr/><a name="_details"></a><h2>Detailed Description</h2>
105<p>An attribute is a name-value pair. </p>
106<p>Elements have an arbitrary number of attributes, each with a unique name.</p>
107<dl class="note"><dt><b>Note:</b></dt><dd>The attributes are not TiXmlNodes, since they are not part of the tinyXML document object model. There are other suggested ways to look at this problem. </dd></dl>
108<hr/><h2>Member Function Documentation</h2>
109<a class="anchor" id="acc04956c1d5c4c31fe74f7a7528d109a"></a><!-- doxytag: member="TiXmlAttribute::Print" ref="acc04956c1d5c4c31fe74f7a7528d109a" args="(FILE *cfile, int depth) const " -->
110<div class="memitem">
111<div class="memproto">
112 <table class="memname">
The Android Open Source Project562be062009-03-03 19:30:48 -0800113 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700114 <td class="memname">virtual void TiXmlAttribute::Print </td>
115 <td>(</td>
116 <td class="paramtype">FILE *&nbsp;</td>
117 <td class="paramname"> <em>cfile</em>, </td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800118 </tr>
119 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700120 <td class="paramkey"></td>
121 <td></td>
122 <td class="paramtype">int&nbsp;</td>
123 <td class="paramname"> <em>depth</em></td><td>&nbsp;</td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800124 </tr>
125 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700126 <td></td>
127 <td>)</td>
128 <td></td><td></td><td> const<code> [inline, virtual]</code></td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800129 </tr>
130 </table>
Dan Albertc3bbea32014-08-21 15:48:37 -0700131</div>
132<div class="memdoc">
The Android Open Source Project562be062009-03-03 19:30:48 -0800133
Dan Albertc3bbea32014-08-21 15:48:37 -0700134<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>
135<p>) Either or both cfile and str can be null.</p>
136<p>This is a formatted print, and will insert tabs and newlines.</p>
137<p>(For an unformatted stream, use the &lt;&lt; operator.) </p>
138
139<p>Implements <a class="el" href="classTiXmlBase.html#a0de56b3f2ef14c65091a3b916437b512">TiXmlBase</a>.</p>
140
141</div>
142</div>
143<a class="anchor" id="ad6c93088ee21af41a107931223339344"></a><!-- doxytag: member="TiXmlAttribute::QueryIntValue" ref="ad6c93088ee21af41a107931223339344" args="(int *_value) const " -->
144<div class="memitem">
145<div class="memproto">
146 <table class="memname">
The Android Open Source Project562be062009-03-03 19:30:48 -0800147 <tr>
Dan Albertc3bbea32014-08-21 15:48:37 -0700148 <td class="memname">int TiXmlAttribute::QueryIntValue </td>
149 <td>(</td>
150 <td class="paramtype">int *&nbsp;</td>
151 <td class="paramname"> <em>_value</em></td>
152 <td>&nbsp;)&nbsp;</td>
153 <td> const</td>
The Android Open Source Project562be062009-03-03 19:30:48 -0800154 </tr>
155 </table>
Dan Albertc3bbea32014-08-21 15:48:37 -0700156</div>
157<div class="memdoc">
The Android Open Source Project562be062009-03-03 19:30:48 -0800158
Dan Albertc3bbea32014-08-21 15:48:37 -0700159<p>QueryIntValue examines the value string. </p>
160<p>It is an alternative to the <a class="el" href="classTiXmlAttribute.html#aa1a20ad59dc7e89a0ab265396360d50f" title="Return the value of this attribute, converted to an integer.">IntValue()</a> method with richer error checking. If the value 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.</p>
161<p>A specialized but useful call. Note that for success it returns 0, which is the opposite of almost all other TinyXml calls. </p>
162
163</div>
164</div>
165<hr/>The documentation for this class was generated from the following file:<ul>
166<li><a class="el" href="tinyxml_8h_source.html">tinyxml.h</a></li>
167</ul>
168</div>
169<hr size="1"/><address style="text-align: right;"><small>Generated by&nbsp;
The Android Open Source Project562be062009-03-03 19:30:48 -0800170<a href="http://www.doxygen.org/index.html">
Dan Albertc3bbea32014-08-21 15:48:37 -0700171<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
The Android Open Source Project562be062009-03-03 19:30:48 -0800172</body>
173</html>