?? class_xml_element.html
字號(hào):
<html><head><title>CppUnit - The Unit Testing Library</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body bgcolor="#ffffff"> <table width="100%"> <tr> <td width="40%" align="left" valign="center"> <a href="http://sourceforge.net/projects/cppunit"> CppUnit project page </a> </td> <td> <a href="FAQ">FAQ</a> </td> <td width="40%" align="right" valign="center"> <a href="http://cppunit.sourceforge.net">CppUnit home page</a> </td> </tr></table><hr><!-- Generated by Doxygen 1.3.7 --><div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div><h1>XmlElement Class Reference</h1>A XML Element. <a href="#_details">More...</a><p><code>#include <<a class="el" href="_xml_element_8h-source.html">XmlElement.h</a>></code><p><a href="class_xml_element-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 Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#a0">XmlElement</a> (std::string elementName, std::string content="")</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Constructs an element with the specified name and string content. <a href="#a0"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#a1">XmlElement</a> (std::string elementName, int numericContent)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Constructs an element with the specified name and numeric content. <a href="#a1"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#a2">~XmlElement</a> ()</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Destructs the element and its child elements. <a href="#a2"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#a3">name</a> () const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the name of the element. <a href="#a3"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#a4">content</a> () const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the content of the element. <a href="#a4"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#a5">setName</a> (const std::string &name)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the name of the element. <a href="#a5"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#a6">setContent</a> (const std::string &content)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the content of the element. <a href="#a6"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#a7">setContent</a> (int numericContent)</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#a8">addAttribute</a> (std::string attributeName, std::string value)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Adds an attribute with the specified string value. <a href="#a8"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#a9">addAttribute</a> (std::string attributeName, int numericValue)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Adds an attribute with the specified numeric value. <a href="#a9"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#a10">addElement</a> (<a class="el" href="class_xml_element.html">XmlElement</a> *element)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a child element to the element. <a href="#a10"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#a11">elementCount</a> () const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of child elements. <a href="#a11"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="class_xml_element.html">XmlElement</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#a12">elementAt</a> (int index) const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the child element at the specified index. <a href="#a12"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="class_xml_element.html">XmlElement</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#a13">elementFor</a> (const std::string &name) const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the first child element with the specified name. <a href="#a13"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#a14">toString</a> (const std::string &indent="") const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a XML string that represents the element. <a href="#a14"></a><br><br></td></tr><tr><td colspan=2><br><h2>Private Types</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>typedef std::pair< std::string,<br> std::string > </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#y0">Attribute</a></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>typedef CppUnitDeque< <a class="el" href="class_xml_element.html#y0">Attribute</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#y1">Attributes</a></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>typedef CppUnitDeque< <a class="el" href="class_xml_element.html">XmlElement</a> * > </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#y2">Elements</a></td></tr><tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#d0">attributesAsString</a> () const</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#d1">escape</a> (std::string value) const</td></tr><tr><td colspan=2><br><h2>Private Attributes</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#r0">m_name</a></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#r1">m_content</a></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="class_xml_element.html#y1">Attributes</a> </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#r2">m_attributes</a></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="class_xml_element.html#y2">Elements</a> </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_element.html#r3">m_elements</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>A XML Element. <p>A XML element has:<ul><li>a name, specified on construction,</li><li>a content, specified on construction (may be empty),</li><li>zero or more attributes, added with addAttribute(),</li><li>zero or more child elements, added with addElement(). </li></ul><p><hr><h2>Member Typedef Documentation</h2><a class="anchor" name="y0" doxytag="XmlElement::Attribute" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> typedef std::pair<std::string,std::string> <a class="el" href="class_xml_element.html#y0">XmlElement::Attribute</a><code> [private]</code> </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a class="anchor" name="y1" doxytag="XmlElement::Attributes" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> typedef CppUnitDeque<<a class="el" href="class_xml_element.html#y0">Attribute</a>> <a class="el" href="class_xml_element.html#y1">XmlElement::Attributes</a><code> [private]</code> </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><a class="anchor" name="y2" doxytag="XmlElement::Elements" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> typedef CppUnitDeque<<a class="el" href="class_xml_element.html">XmlElement</a> *> <a class="el" href="class_xml_element.html#y2">XmlElement::Elements</a><code> [private]</code> </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><hr><h2>Constructor & Destructor Documentation</h2><a class="anchor" name="a0" doxytag="XmlElement::XmlElement" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> CPPUNIT_NS_BEGIN XmlElement::XmlElement </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">std::string </td> <td class="mdname" nowrap> <em>elementName</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap>std::string </td> <td class="mdname" nowrap> <em>content</em> = <code>""</code></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Constructs an element with the specified name and string content. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>elementName</em> </td><td>Name of the element. Must not be empty. </td></tr> <tr><td></td><td valign=top><em>content</em> </td><td>Content of the element. </td></tr> </table></dl> </td> </tr></table><a class="anchor" name="a1" doxytag="XmlElement::XmlElement" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> XmlElement::XmlElement </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">std::string </td> <td class="mdname" nowrap> <em>elementName</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>numericContent</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Constructs an element with the specified name and numeric content. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>elementName</em> </td><td>Name of the element. Must not be empty. </td></tr> <tr><td></td><td valign=top><em>numericContent</em> </td><td>Content of the element. </td></tr> </table></dl> </td> </tr></table><a class="anchor" name="a2" doxytag="XmlElement::~XmlElement" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> XmlElement::~<a class="el" href="class_xml_element.html">XmlElement</a> </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Destructs the element and its child elements. <p> </td> </tr></table><hr><h2>Member Function Documentation</h2>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -