1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3<title>TinyXml: TiXmlAttribute Class Reference</title>
4<link href="doxygen.css" rel="stylesheet" type="text/css">
5</head><body>
6<!-- Generated by Doxygen 1.4.4 -->
7<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a></div>
8<h1>TiXmlAttribute Class Reference</h1><!-- doxytag: class="TiXmlAttribute" --><!-- doxytag: inherits="TiXmlBase" -->An attribute is a name-value pair.
9<a href="#_details">More...</a>
10<p>
11<code>#include &lt;<a class="el" href="tinyxml_8h-source.html">tinyxml.h</a>&gt;</code>
12<p>
13<p>Inheritance diagram for TiXmlAttribute:
14<p><center><img src="classTiXmlAttribute.png" usemap="#TiXmlAttribute_map" border="0" alt=""></center>
15<map name="TiXmlAttribute_map">
16<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="0,0,90,24">
17</map>
18<a href="classTiXmlAttribute-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
19<tr><td></td></tr>
20<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
21<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a0"></a><!-- doxytag: member="TiXmlAttribute::TiXmlAttribute" ref="a0" args="()" -->
22&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a0">TiXmlAttribute</a> ()</td></tr>
23
24<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Construct an empty attribute. <br></td></tr>
25<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a1"></a><!-- doxytag: member="TiXmlAttribute::TiXmlAttribute" ref="a1" args="(const std::string &amp;_name, const std::string &amp;_value)" -->
26&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a1">TiXmlAttribute</a> (const std::string &amp;_name, const std::string &amp;_value)</td></tr>
27
28<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">std::string constructor. <br></td></tr>
29<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a2"></a><!-- doxytag: member="TiXmlAttribute::TiXmlAttribute" ref="a2" args="(const char *_name, const char *_value)" -->
30&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a2">TiXmlAttribute</a> (const char *_name, const char *_value)</td></tr>
31
32<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Construct an attribute with a name and value. <br></td></tr>
33<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a3"></a><!-- doxytag: member="TiXmlAttribute::Name" ref="a3" args="() const " -->
34const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a3">Name</a> () const </td></tr>
35
36<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the name of this attribute. <br></td></tr>
37<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a4"></a><!-- doxytag: member="TiXmlAttribute::Value" ref="a4" args="() const " -->
38const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a4">Value</a> () const </td></tr>
39
40<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the value of this attribute. <br></td></tr>
41<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a5"></a><!-- doxytag: member="TiXmlAttribute::IntValue" ref="a5" args="() const " -->
42int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a5">IntValue</a> () const </td></tr>
43
44<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the value of this attribute, converted to an integer. <br></td></tr>
45<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a6"></a><!-- doxytag: member="TiXmlAttribute::DoubleValue" ref="a6" args="() const " -->
46double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a6">DoubleValue</a> () const </td></tr>
47
48<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the value of this attribute, converted to a double. <br></td></tr>
49<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a7">QueryIntValue</a> (int *_value) const </td></tr>
50
51<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">QueryIntValue examines the value string.  <a href="#a7"></a><br></td></tr>
52<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a8"></a><!-- doxytag: member="TiXmlAttribute::QueryDoubleValue" ref="a8" args="(double *_value) const " -->
53int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a8">QueryDoubleValue</a> (double *_value) const </td></tr>
54
55<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">QueryDoubleValue examines the value string. See <a class="el" href="classTiXmlAttribute.html#a7">QueryIntValue()</a>. <br></td></tr>
56<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a9"></a><!-- doxytag: member="TiXmlAttribute::SetName" ref="a9" args="(const char *_name)" -->
57void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a9">SetName</a> (const char *_name)</td></tr>
58
59<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the name of this attribute. <br></td></tr>
60<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a10"></a><!-- doxytag: member="TiXmlAttribute::SetValue" ref="a10" args="(const char *_value)" -->
61void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a10">SetValue</a> (const char *_value)</td></tr>
62
63<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the value. <br></td></tr>
64<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a11"></a><!-- doxytag: member="TiXmlAttribute::SetIntValue" ref="a11" args="(int _value)" -->
65void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a11">SetIntValue</a> (int _value)</td></tr>
66
67<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the value from an integer. <br></td></tr>
68<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a12"></a><!-- doxytag: member="TiXmlAttribute::SetDoubleValue" ref="a12" args="(double _value)" -->
69void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a12">SetDoubleValue</a> (double _value)</td></tr>
70
71<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the value from a double. <br></td></tr>
72<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a13"></a><!-- doxytag: member="TiXmlAttribute::SetName" ref="a13" args="(const std::string &amp;_name)" -->
73void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a13">SetName</a> (const std::string &amp;_name)</td></tr>
74
75<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">STL std::string form. <br></td></tr>
76<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a14"></a><!-- doxytag: member="TiXmlAttribute::SetValue" ref="a14" args="(const std::string &amp;_value)" -->
77void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a14">SetValue</a> (const std::string &amp;_value)</td></tr>
78
79<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">STL std::string form. <br></td></tr>
80<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a15"></a><!-- doxytag: member="TiXmlAttribute::Next" ref="a15" args="() const " -->
81const <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a15">Next</a> () const </td></tr>
82
83<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the next sibling attribute in the DOM. Returns null at end. <br></td></tr>
84<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a17"></a><!-- doxytag: member="TiXmlAttribute::Previous" ref="a17" args="() const " -->
85const <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a17">Previous</a> () const </td></tr>
86
87<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the previous sibling attribute in the DOM. Returns null at beginning. <br></td></tr>
88<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a23">Print</a> (FILE *cfile, int depth) const </td></tr>
89
90<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">All TinyXml classes can print themselves to a filestream.  <a href="#a23"></a><br></td></tr>
91</table>
92<hr><a name="_details"></a><h2>Detailed Description</h2>
93An attribute is a name-value pair.
94<p>
95Elements have an arbitrary number of attributes, each with a unique name.<p>
96<dl compact><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>
97
98<p>
99<hr><h2>Member Function Documentation</h2>
100<a class="anchor" name="a23"></a><!-- doxytag: member="TiXmlAttribute::Print" ref="a23" args="(FILE *cfile, int depth) const " --><p>
101<table class="mdTable" cellpadding="2" cellspacing="0">
102  <tr>
103    <td class="mdRow">
104      <table cellpadding="0" cellspacing="0" border="0">
105        <tr>
106          <td class="md" nowrap valign="top">virtual void TiXmlAttribute::Print           </td>
107          <td class="md" valign="top">(&nbsp;</td>
108          <td class="md" nowrap valign="top">FILE *&nbsp;</td>
109          <td class="mdname" nowrap> <em>cfile</em>, </td>
110        </tr>
111        <tr>
112          <td class="md" nowrap align="right"></td>
113          <td class="md"></td>
114          <td class="md" nowrap>int&nbsp;</td>
115          <td class="mdname" nowrap> <em>depth</em></td>
116        </tr>
117        <tr>
118          <td class="md"></td>
119          <td class="md">)&nbsp;</td>
120          <td class="md" colspan="2"> const<code> [virtual]</code></td>
121        </tr>
122      </table>
123    </td>
124  </tr>
125</table>
126<table cellspacing="5" cellpadding="0" border="0">
127  <tr>
128    <td>
129      &nbsp;
130    </td>
131    <td>
132
133<p>
134All TinyXml classes can print themselves to a filestream.
135<p>
136This is a formatted print, and will insert tabs and newlines.<p>
137(For an unformatted stream, use the &lt;&lt; operator.)
138<p>
139Implements <a class="el" href="classTiXmlBase.html#a2">TiXmlBase</a>.    </td>
140  </tr>
141</table>
142<a class="anchor" name="a7"></a><!-- doxytag: member="TiXmlAttribute::QueryIntValue" ref="a7" args="(int *_value) const " --><p>
143<table class="mdTable" cellpadding="2" cellspacing="0">
144  <tr>
145    <td class="mdRow">
146      <table cellpadding="0" cellspacing="0" border="0">
147        <tr>
148          <td class="md" nowrap valign="top">int TiXmlAttribute::QueryIntValue           </td>
149          <td class="md" valign="top">(&nbsp;</td>
150          <td class="md" nowrap valign="top">int *&nbsp;</td>
151          <td class="mdname1" valign="top" nowrap> <em>_value</em>          </td>
152          <td class="md" valign="top">&nbsp;)&nbsp;</td>
153          <td class="md" nowrap> const</td>
154        </tr>
155      </table>
156    </td>
157  </tr>
158</table>
159<table cellspacing="5" cellpadding="0" border="0">
160  <tr>
161    <td>
162      &nbsp;
163    </td>
164    <td>
165
166<p>
167QueryIntValue examines the value string.
168<p>
169It is an alternative to the <a class="el" href="classTiXmlAttribute.html#a5">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>
170A specialized but useful call. Note that for success it returns 0, which is the opposite of almost all other TinyXml calls.    </td>
171  </tr>
172</table>
173<hr>The documentation for this class was generated from the following file:<ul>
174<li><a class="el" href="tinyxml_8h-source.html">tinyxml.h</a></ul>
175<hr size="1"><address style="align: right;"><small>Generated on Sat Oct 8 14:15:30 2005 for TinyXml by&nbsp;
176<a href="http://www.doxygen.org/index.html">
177<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.4 </small></address>
178</body>
179</html>
180