1 <!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"/> 5 <meta http-equiv="X-UA-Compatible" content="IE=9"/> 6 <meta name="generator" content="Doxygen 1.8.13"/> 7 <meta name="viewport" content="width=device-width, initial-scale=1"/> 8 <title>TinyXML-2: tinyxml2::XMLAttribute Class Reference</title> 9 <link href="tabs.css" rel="stylesheet" type="text/css"/> 10 <script type="text/javascript" src="jquery.js"></script> 11 <script type="text/javascript" src="dynsections.js"></script> 12 <link href="search/search.css" rel="stylesheet" type="text/css"/> 13 <script type="text/javascript" src="search/searchdata.js"></script> 14 <script type="text/javascript" src="search/search.js"></script> 15 <link href="doxygen.css" rel="stylesheet" type="text/css" /> 16 </head> 17 <body> 18 <div id="top"><!-- do not remove this div, it is closed by doxygen! --> 19 <div id="titlearea"> 20 <table cellspacing="0" cellpadding="0"> 21 <tbody> 22 <tr style="height: 56px;"> 23 <td id="projectalign" style="padding-left: 0.5em;"> 24 <div id="projectname">TinyXML-2 25  <span id="projectnumber">7.0.0</span> 26 </div> 27 </td> 28 </tr> 29 </tbody> 30 </table> 31 </div> 32 <!-- end header part --> 33 <!-- Generated by Doxygen 1.8.13 --> 34 <script type="text/javascript"> 35 var searchBox = new SearchBox("searchBox", "search",false,'Search'); 36 </script> 37 <script type="text/javascript" src="menudata.js"></script> 38 <script type="text/javascript" src="menu.js"></script> 39 <script type="text/javascript"> 40 $(function() { 41 initMenu('',true,false,'search.php','Search'); 42 $(document).ready(function() { init_search(); }); 43 }); 44 </script> 45 <div id="main-nav"></div> 46 <!-- window showing the filter options --> 47 <div id="MSearchSelectWindow" 48 onmouseover="return searchBox.OnSearchSelectShow()" 49 onmouseout="return searchBox.OnSearchSelectHide()" 50 onkeydown="return searchBox.OnSearchSelectKey(event)"> 51 </div> 52 53 <!-- iframe showing the search results (closed by default) --> 54 <div id="MSearchResultsWindow"> 55 <iframe src="javascript:void(0)" frameborder="0" 56 name="MSearchResults" id="MSearchResults"> 57 </iframe> 58 </div> 59 60 <div id="nav-path" class="navpath"> 61 <ul> 62 <li class="navelem"><b>tinyxml2</b></li><li class="navelem"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html">XMLAttribute</a></li> </ul> 63 </div> 64 </div><!-- top --> 65 <div class="header"> 66 <div class="summary"> 67 <a href="#pub-methods">Public Member Functions</a> | 68 <a href="classtinyxml2_1_1_x_m_l_attribute-members.html">List of all members</a> </div> 69 <div class="headertitle"> 70 <div class="title">tinyxml2::XMLAttribute Class Reference</div> </div> 71 </div><!--header--> 72 <div class="contents"> 73 74 <p><code>#include <<a class="el" href="tinyxml2_8h_source.html">tinyxml2.h</a>></code></p> 75 <table class="memberdecls"> 76 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> 77 Public Member Functions</h2></td></tr> 78 <tr class="memitem:ab886c486ec19f02ed826f8dc129e5ad8"><td class="memItemLeft" align="right" valign="top"><a id="ab886c486ec19f02ed826f8dc129e5ad8"></a> 79 const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#ab886c486ec19f02ed826f8dc129e5ad8">Name</a> () const</td></tr> 80 <tr class="memdesc:ab886c486ec19f02ed826f8dc129e5ad8"><td class="mdescLeft"> </td><td class="mdescRight">The name of the attribute. <br /></td></tr> 81 <tr class="separator:ab886c486ec19f02ed826f8dc129e5ad8"><td class="memSeparator" colspan="2"> </td></tr> 82 <tr class="memitem:a1aab1dd0e43ecbcfa306adbcf3a3d853"><td class="memItemLeft" align="right" valign="top"><a id="a1aab1dd0e43ecbcfa306adbcf3a3d853"></a> 83 const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#a1aab1dd0e43ecbcfa306adbcf3a3d853">Value</a> () const</td></tr> 84 <tr class="memdesc:a1aab1dd0e43ecbcfa306adbcf3a3d853"><td class="mdescLeft"> </td><td class="mdescRight">The value of the attribute. <br /></td></tr> 85 <tr class="separator:a1aab1dd0e43ecbcfa306adbcf3a3d853"><td class="memSeparator" colspan="2"> </td></tr> 86 <tr class="memitem:a02d5ea924586e35f9c13857d1671b765"><td class="memItemLeft" align="right" valign="top"><a id="a02d5ea924586e35f9c13857d1671b765"></a> 87 int </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#a02d5ea924586e35f9c13857d1671b765">GetLineNum</a> () const</td></tr> 88 <tr class="memdesc:a02d5ea924586e35f9c13857d1671b765"><td class="mdescLeft"> </td><td class="mdescRight">Gets the line number the attribute is in, if the document was parsed from a file. <br /></td></tr> 89 <tr class="separator:a02d5ea924586e35f9c13857d1671b765"><td class="memSeparator" colspan="2"> </td></tr> 90 <tr class="memitem:aee53571b21e7ce5421eb929523a8bbe6"><td class="memItemLeft" align="right" valign="top"><a id="aee53571b21e7ce5421eb929523a8bbe6"></a> 91 const <a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html">XMLAttribute</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#aee53571b21e7ce5421eb929523a8bbe6">Next</a> () const</td></tr> 92 <tr class="memdesc:aee53571b21e7ce5421eb929523a8bbe6"><td class="mdescLeft"> </td><td class="mdescRight">The next attribute in the list. <br /></td></tr> 93 <tr class="separator:aee53571b21e7ce5421eb929523a8bbe6"><td class="memSeparator" colspan="2"> </td></tr> 94 <tr class="memitem:adfa2433f0fdafd5c3880936de9affa80"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#adfa2433f0fdafd5c3880936de9affa80">IntValue</a> () const</td></tr> 95 <tr class="separator:adfa2433f0fdafd5c3880936de9affa80"><td class="memSeparator" colspan="2"> </td></tr> 96 <tr class="memitem:a0be5343b08a957c42c02c5d32c35d338"><td class="memItemLeft" align="right" valign="top"><a id="a0be5343b08a957c42c02c5d32c35d338"></a> 97 unsigned </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#a0be5343b08a957c42c02c5d32c35d338">UnsignedValue</a> () const</td></tr> 98 <tr class="memdesc:a0be5343b08a957c42c02c5d32c35d338"><td class="mdescLeft"> </td><td class="mdescRight">Query as an unsigned integer. See <a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#adfa2433f0fdafd5c3880936de9affa80">IntValue()</a> <br /></td></tr> 99 <tr class="separator:a0be5343b08a957c42c02c5d32c35d338"><td class="memSeparator" colspan="2"> </td></tr> 100 <tr class="memitem:a98ce5207344ad33a265b0422addae1ff"><td class="memItemLeft" align="right" valign="top"><a id="a98ce5207344ad33a265b0422addae1ff"></a> 101 bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#a98ce5207344ad33a265b0422addae1ff">BoolValue</a> () const</td></tr> 102 <tr class="memdesc:a98ce5207344ad33a265b0422addae1ff"><td class="mdescLeft"> </td><td class="mdescRight">Query as a boolean. See <a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#adfa2433f0fdafd5c3880936de9affa80">IntValue()</a> <br /></td></tr> 103 <tr class="separator:a98ce5207344ad33a265b0422addae1ff"><td class="memSeparator" colspan="2"> </td></tr> 104 <tr class="memitem:a4aa73513f54ff0087d3e804f0f54e30f"><td class="memItemLeft" align="right" valign="top"><a id="a4aa73513f54ff0087d3e804f0f54e30f"></a> 105 double </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#a4aa73513f54ff0087d3e804f0f54e30f">DoubleValue</a> () const</td></tr> 106 <tr class="memdesc:a4aa73513f54ff0087d3e804f0f54e30f"><td class="mdescLeft"> </td><td class="mdescRight">Query as a double. See <a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#adfa2433f0fdafd5c3880936de9affa80">IntValue()</a> <br /></td></tr> 107 <tr class="separator:a4aa73513f54ff0087d3e804f0f54e30f"><td class="memSeparator" colspan="2"> </td></tr> 108 <tr class="memitem:a27797b45d21c981257720db94f5f8801"><td class="memItemLeft" align="right" valign="top"><a id="a27797b45d21c981257720db94f5f8801"></a> 109 float </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#a27797b45d21c981257720db94f5f8801">FloatValue</a> () const</td></tr> 110 <tr class="memdesc:a27797b45d21c981257720db94f5f8801"><td class="mdescLeft"> </td><td class="mdescRight">Query as a float. See <a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#adfa2433f0fdafd5c3880936de9affa80">IntValue()</a> <br /></td></tr> 111 <tr class="separator:a27797b45d21c981257720db94f5f8801"><td class="memSeparator" colspan="2"> </td></tr> 112 <tr class="memitem:a6d5176260db00ea301c01af8457cd993"><td class="memItemLeft" align="right" valign="top">XMLError </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#a6d5176260db00ea301c01af8457cd993">QueryIntValue</a> (int *value) const</td></tr> 113 <tr class="separator:a6d5176260db00ea301c01af8457cd993"><td class="memSeparator" colspan="2"> </td></tr> 114 <tr class="memitem:a48a7f3496f1415832e451bd8d09c9cb9"><td class="memItemLeft" align="right" valign="top"><a id="a48a7f3496f1415832e451bd8d09c9cb9"></a> 115 XMLError </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#a48a7f3496f1415832e451bd8d09c9cb9">QueryUnsignedValue</a> (unsigned int *value) const</td></tr> 116 <tr class="memdesc:a48a7f3496f1415832e451bd8d09c9cb9"><td class="mdescLeft"> </td><td class="mdescRight">See QueryIntValue. <br /></td></tr> 117 <tr class="separator:a48a7f3496f1415832e451bd8d09c9cb9"><td class="memSeparator" colspan="2"> </td></tr> 118 <tr class="memitem:a4e25344d6e4159026be34dbddf1dcac2"><td class="memItemLeft" align="right" valign="top"><a id="a4e25344d6e4159026be34dbddf1dcac2"></a> 119 XMLError </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#a4e25344d6e4159026be34dbddf1dcac2">QueryInt64Value</a> (int64_t *value) const</td></tr> 120 <tr class="memdesc:a4e25344d6e4159026be34dbddf1dcac2"><td class="mdescLeft"> </td><td class="mdescRight">See QueryIntValue. <br /></td></tr> 121 <tr class="separator:a4e25344d6e4159026be34dbddf1dcac2"><td class="memSeparator" colspan="2"> </td></tr> 122 <tr class="memitem:a5f32e038954256f61c21ff20fd13a09c"><td class="memItemLeft" align="right" valign="top"><a id="a5f32e038954256f61c21ff20fd13a09c"></a> 123 XMLError </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#a5f32e038954256f61c21ff20fd13a09c">QueryBoolValue</a> (bool *value) const</td></tr> 124 <tr class="memdesc:a5f32e038954256f61c21ff20fd13a09c"><td class="mdescLeft"> </td><td class="mdescRight">See QueryIntValue. <br /></td></tr> 125 <tr class="separator:a5f32e038954256f61c21ff20fd13a09c"><td class="memSeparator" colspan="2"> </td></tr> 126 <tr class="memitem:a2aa6e55e8ea03af0609cf6690bff79b9"><td class="memItemLeft" align="right" valign="top"><a id="a2aa6e55e8ea03af0609cf6690bff79b9"></a> 127 XMLError </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#a2aa6e55e8ea03af0609cf6690bff79b9">QueryDoubleValue</a> (double *value) const</td></tr> 128 <tr class="memdesc:a2aa6e55e8ea03af0609cf6690bff79b9"><td class="mdescLeft"> </td><td class="mdescRight">See QueryIntValue. <br /></td></tr> 129 <tr class="separator:a2aa6e55e8ea03af0609cf6690bff79b9"><td class="memSeparator" colspan="2"> </td></tr> 130 <tr class="memitem:a049dea6449a6259b6cfed44a9427b607"><td class="memItemLeft" align="right" valign="top"><a id="a049dea6449a6259b6cfed44a9427b607"></a> 131 XMLError </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#a049dea6449a6259b6cfed44a9427b607">QueryFloatValue</a> (float *value) const</td></tr> 132 <tr class="memdesc:a049dea6449a6259b6cfed44a9427b607"><td class="mdescLeft"> </td><td class="mdescRight">See QueryIntValue. <br /></td></tr> 133 <tr class="separator:a049dea6449a6259b6cfed44a9427b607"><td class="memSeparator" colspan="2"> </td></tr> 134 <tr class="memitem:a406d2c4a13c7af99a65edb59dd9f7581"><td class="memItemLeft" align="right" valign="top"><a id="a406d2c4a13c7af99a65edb59dd9f7581"></a> 135 void </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#a406d2c4a13c7af99a65edb59dd9f7581">SetAttribute</a> (const char *value)</td></tr> 136 <tr class="memdesc:a406d2c4a13c7af99a65edb59dd9f7581"><td class="mdescLeft"> </td><td class="mdescRight">Set the attribute to a string value. <br /></td></tr> 137 <tr class="separator:a406d2c4a13c7af99a65edb59dd9f7581"><td class="memSeparator" colspan="2"> </td></tr> 138 <tr class="memitem:ad86d7d7058d76761c3a80662566a57e5"><td class="memItemLeft" align="right" valign="top"><a id="ad86d7d7058d76761c3a80662566a57e5"></a> 139 void </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#ad86d7d7058d76761c3a80662566a57e5">SetAttribute</a> (int value)</td></tr> 140 <tr class="memdesc:ad86d7d7058d76761c3a80662566a57e5"><td class="mdescLeft"> </td><td class="mdescRight">Set the attribute to value. <br /></td></tr> 141 <tr class="separator:ad86d7d7058d76761c3a80662566a57e5"><td class="memSeparator" colspan="2"> </td></tr> 142 <tr class="memitem:ae70468c0f6df2748ba3529c716999fae"><td class="memItemLeft" align="right" valign="top"><a id="ae70468c0f6df2748ba3529c716999fae"></a> 143 void </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#ae70468c0f6df2748ba3529c716999fae">SetAttribute</a> (unsigned value)</td></tr> 144 <tr class="memdesc:ae70468c0f6df2748ba3529c716999fae"><td class="mdescLeft"> </td><td class="mdescRight">Set the attribute to value. <br /></td></tr> 145 <tr class="separator:ae70468c0f6df2748ba3529c716999fae"><td class="memSeparator" colspan="2"> </td></tr> 146 <tr class="memitem:a7c1240f479722b9aa29b6c030aa116c2"><td class="memItemLeft" align="right" valign="top"><a id="a7c1240f479722b9aa29b6c030aa116c2"></a> 147 void </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#a7c1240f479722b9aa29b6c030aa116c2">SetAttribute</a> (int64_t value)</td></tr> 148 <tr class="memdesc:a7c1240f479722b9aa29b6c030aa116c2"><td class="mdescLeft"> </td><td class="mdescRight">Set the attribute to value. <br /></td></tr> 149 <tr class="separator:a7c1240f479722b9aa29b6c030aa116c2"><td class="memSeparator" colspan="2"> </td></tr> 150 <tr class="memitem:ab3516def4fe058fe328f2b89fc2d77da"><td class="memItemLeft" align="right" valign="top"><a id="ab3516def4fe058fe328f2b89fc2d77da"></a> 151 void </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#ab3516def4fe058fe328f2b89fc2d77da">SetAttribute</a> (bool value)</td></tr> 152 <tr class="memdesc:ab3516def4fe058fe328f2b89fc2d77da"><td class="mdescLeft"> </td><td class="mdescRight">Set the attribute to value. <br /></td></tr> 153 <tr class="separator:ab3516def4fe058fe328f2b89fc2d77da"><td class="memSeparator" colspan="2"> </td></tr> 154 <tr class="memitem:a9a65ab3147abe8ccbbd373ce8791e818"><td class="memItemLeft" align="right" valign="top"><a id="a9a65ab3147abe8ccbbd373ce8791e818"></a> 155 void </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#a9a65ab3147abe8ccbbd373ce8791e818">SetAttribute</a> (double value)</td></tr> 156 <tr class="memdesc:a9a65ab3147abe8ccbbd373ce8791e818"><td class="mdescLeft"> </td><td class="mdescRight">Set the attribute to value. <br /></td></tr> 157 <tr class="separator:a9a65ab3147abe8ccbbd373ce8791e818"><td class="memSeparator" colspan="2"> </td></tr> 158 <tr class="memitem:ae95e843313aaf5d56c32530b6456df02"><td class="memItemLeft" align="right" valign="top"><a id="ae95e843313aaf5d56c32530b6456df02"></a> 159 void </td><td class="memItemRight" valign="bottom"><a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#ae95e843313aaf5d56c32530b6456df02">SetAttribute</a> (float value)</td></tr> 160 <tr class="memdesc:ae95e843313aaf5d56c32530b6456df02"><td class="mdescLeft"> </td><td class="mdescRight">Set the attribute to value. <br /></td></tr> 161 <tr class="separator:ae95e843313aaf5d56c32530b6456df02"><td class="memSeparator" colspan="2"> </td></tr> 162 </table> 163 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> 164 <div class="textblock"><p>An attribute is a name-value pair. Elements have an arbitrary number of attributes, each with a unique name.</p> 165 <dl class="section note"><dt>Note</dt><dd>The attributes are not XMLNodes. You may only query the <a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#aee53571b21e7ce5421eb929523a8bbe6" title="The next attribute in the list. ">Next()</a> attribute in a list. </dd></dl> 166 </div><h2 class="groupheader">Member Function Documentation</h2> 167 <a id="adfa2433f0fdafd5c3880936de9affa80"></a> 168 <h2 class="memtitle"><span class="permalink"><a href="#adfa2433f0fdafd5c3880936de9affa80">◆ </a></span>IntValue()</h2> 169 170 <div class="memitem"> 171 <div class="memproto"> 172 <table class="mlabels"> 173 <tr> 174 <td class="mlabels-left"> 175 <table class="memname"> 176 <tr> 177 <td class="memname">int tinyxml2::XMLAttribute::IntValue </td> 178 <td>(</td> 179 <td class="paramname"></td><td>)</td> 180 <td> const</td> 181 </tr> 182 </table> 183 </td> 184 <td class="mlabels-right"> 185 <span class="mlabels"><span class="mlabel">inline</span></span> </td> 186 </tr> 187 </table> 188 </div><div class="memdoc"> 189 <p>IntValue interprets the attribute as an integer, and returns the value. If the value isn't an integer, 0 will be returned. There is no error checking; use <a class="el" href="classtinyxml2_1_1_x_m_l_attribute.html#a6d5176260db00ea301c01af8457cd993">QueryIntValue()</a> if you need error checking. </p> 190 191 </div> 192 </div> 193 <a id="a6d5176260db00ea301c01af8457cd993"></a> 194 <h2 class="memtitle"><span class="permalink"><a href="#a6d5176260db00ea301c01af8457cd993">◆ </a></span>QueryIntValue()</h2> 195 196 <div class="memitem"> 197 <div class="memproto"> 198 <table class="memname"> 199 <tr> 200 <td class="memname">XMLError tinyxml2::XMLAttribute::QueryIntValue </td> 201 <td>(</td> 202 <td class="paramtype">int * </td> 203 <td class="paramname"><em>value</em></td><td>)</td> 204 <td> const</td> 205 </tr> 206 </table> 207 </div><div class="memdoc"> 208 <p>QueryIntValue interprets the attribute as an integer, and returns the value in the provided parameter. The function will return XML_SUCCESS on success, and XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful. </p> 209 210 </div> 211 </div> 212 <hr/>The documentation for this class was generated from the following file:<ul> 213 <li><a class="el" href="tinyxml2_8h_source.html">tinyxml2.h</a></li> 214 </ul> 215 </div><!-- contents --> 216 <!-- start footer part --> 217 <hr class="footer"/><address class="footer"><small> 218 Generated on Tue Nov 6 2018 09:38:26 for TinyXML-2 by  <a href="http://www.doxygen.org/index.html"> 219 <img class="footer" src="doxygen.png" alt="doxygen"/> 220 </a> 1.8.13 221 </small></address> 222 </body> 223 </html> 224