📄 classtixmlelement.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>TiXmlElement class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </center><hr><h1>TiXmlElement Class Reference</h1>The element is a container class. <a href="#_details">More...</a><p><code>#include <<a class="el" href="tinyxml_8h-source.html">tinyxml.h</a>></code><p><p>Inheritance diagram for TiXmlElement:<p><center><img src="classTiXmlElement.png" usemap="#TiXmlElement_map" border="0" alt=""></center><map name="TiXmlElement_map"><area href="classTiXmlNode.html" alt="TiXmlNode" shape="rect" coords="0,56,87,80"><area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="0,0,87,24"></map><a href="classTiXmlElement-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Public Methods</h2></td></tr><tr><td nowrap align=right valign=top><a name="a0" doxytag="TiXmlElement::TiXmlElement"></a> </td><td valign=bottom><a class="el" href="classTiXmlElement.html#a0">TiXmlElement</a> (const char *in_value)</td></tr><tr><td> </td><td><font size=-1><em>Construct an element.</em></font><br><br></td></tr><tr><td nowrap align=right valign=top><a name="a1" doxytag="TiXmlElement::TiXmlElement"></a> </td><td valign=bottom><a class="el" href="classTiXmlElement.html#a1">TiXmlElement</a> (const std::string &_value)</td></tr><tr><td> </td><td><font size=-1><em>std::string constructor.</em></font><br><br></td></tr><tr><td nowrap align=right valign=top><a name="a5" doxytag="TiXmlElement::Attribute"></a>const char * </td><td valign=bottom><a class="el" href="classTiXmlElement.html#a5">Attribute</a> (const char *name) const</td></tr><tr><td> </td><td><font size=-1><em>Given an attribute name, <a class="el" href="classTiXmlElement.html#a5">Attribute()</a> returns the value for the attribute of that name, or null if none exists.</em></font><br><br></td></tr><tr><td nowrap align=right valign=top>const char * </td><td valign=bottom><a class="el" href="classTiXmlElement.html#a6">Attribute</a> (const char *name, int *i) const</td></tr><tr><td> </td><td><font size=-1><em>Given an attribute name, <a class="el" href="classTiXmlElement.html#a5">Attribute()</a> returns the value for the attribute of that name, or null if none exists.</em> <a href="#a6"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>const char * </td><td valign=bottom><a class="el" href="classTiXmlElement.html#a7">Attribute</a> (const char *name, double *d) const</td></tr><tr><td> </td><td><font size=-1><em>Given an attribute name, <a class="el" href="classTiXmlElement.html#a5">Attribute()</a> returns the value for the attribute of that name, or null if none exists.</em> <a href="#a7"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="classTiXmlElement.html#a8">QueryIntAttribute</a> (const char *name, int *value) const</td></tr><tr><td> </td><td><font size=-1><em>QueryIntAttribute examines the attribute - it is an alternative to the <a class="el" href="classTiXmlElement.html#a5">Attribute()</a> method with richer error checking.</em> <a href="#a8"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top><a name="a9" doxytag="TiXmlElement::QueryDoubleAttribute"></a>int </td><td valign=bottom><a class="el" href="classTiXmlElement.html#a9">QueryDoubleAttribute</a> (const char *name, double *value) const</td></tr><tr><td> </td><td><font size=-1><em>QueryDoubleAttribute examines the attribute - see <a class="el" href="classTiXmlElement.html#a8">QueryIntAttribute()</a>.</em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classTiXmlElement.html#a10">SetAttribute</a> (const char *name, const char *value)</td></tr><tr><td> </td><td><font size=-1><em>Sets an attribute of name to a given value.</em> <a href="#a10"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top><a name="a16" doxytag="TiXmlElement::SetAttribute"></a>void </td><td valign=bottom><a class="el" href="classTiXmlElement.html#a16">SetAttribute</a> (const std::string &name, const std::string &_value)</td></tr><tr><td> </td><td><font size=-1><em>STL std::string form.</em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classTiXmlElement.html#a18">SetAttribute</a> (const char *name, int value)</td></tr><tr><td> </td><td><font size=-1><em>Sets an attribute of name to a given value.</em> <a href="#a18"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classTiXmlElement.html#a19">SetDoubleAttribute</a> (const char *name, double value)</td></tr><tr><td> </td><td><font size=-1><em>Sets an attribute of name to a given value.</em> <a href="#a19"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top><a name="a20" doxytag="TiXmlElement::RemoveAttribute"></a>void </td><td valign=bottom><a class="el" href="classTiXmlElement.html#a20">RemoveAttribute</a> (const char *name)</td></tr><tr><td> </td><td><font size=-1><em>Deletes an attribute with the given name.</em></font><br><br></td></tr><tr><td nowrap align=right valign=top><a name="a21" doxytag="TiXmlElement::RemoveAttribute"></a>void </td><td valign=bottom><a class="el" href="classTiXmlElement.html#a21">RemoveAttribute</a> (const std::string &name)</td></tr><tr><td> </td><td><font size=-1><em>STL std::string form.</em></font><br><br></td></tr><tr><td nowrap align=right valign=top><a name="a22" doxytag="TiXmlElement::FirstAttribute"></a><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> * </td><td valign=bottom><a class="el" href="classTiXmlElement.html#a22">FirstAttribute</a> () const</td></tr><tr><td> </td><td><font size=-1><em>Access the first attribute in this element.</em></font><br><br></td></tr><tr><td nowrap align=right valign=top><a name="a23" doxytag="TiXmlElement::LastAttribute"></a><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> * </td><td valign=bottom><a class="el" href="classTiXmlElement.html#a23">LastAttribute</a> () const</td></tr><tr><td> </td><td><font size=-1><em>Access the last attribute in this element.</em></font><br><br></td></tr><tr><td nowrap align=right valign=top><a name="a24" doxytag="TiXmlElement::Clone"></a>virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td valign=bottom><a class="el" href="classTiXmlElement.html#a24">Clone</a> () const</td></tr><tr><td> </td><td><font size=-1><em>Creates a new Element and returns it - the returned element is a copy.</em></font><br><br></td></tr><tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classTiXmlElement.html#a25">Print</a> (FILE *cfile, int depth) const</td></tr><tr><td> </td><td><font size=-1><em>All TinyXml classes can print themselves to a filestream.</em> <a href="#a25"></a><em></em></font><br><br></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>The element is a container class.<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><hr><h2>Member Function Documentation</h2><a name="a7" doxytag="TiXmlElement::Attribute"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> const char* TiXmlElement::Attribute </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const char * </td> <td class="mdname" nowrap> <em>name</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>double * </td> <td class="mdname" nowrap> <em>d</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"> const</td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Given an attribute name, <a class="el" href="classTiXmlElement.html#a5">Attribute()</a> returns the value for the attribute of that name, or null if none exists.<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. </td> </tr></table><a name="a6" doxytag="TiXmlElement::Attribute"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> const char* TiXmlElement::Attribute </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const char * </td> <td class="mdname" nowrap> <em>name</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>int * </td> <td class="mdname" nowrap> <em>i</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"> const</td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Given an attribute name, <a class="el" href="classTiXmlElement.html#a5">Attribute()</a> returns the value for the attribute of that name, or null if none exists.<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. </td> </tr></table><a name="a25" doxytag="TiXmlElement::Print"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual void TiXmlElement::Print </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">FILE * </td> <td class="mdname" nowrap> <em>cfile</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>depth</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"> const<code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -