?? _xml_element_8h-source.html
字號:
<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.h</h1><a href="_xml_element_8h.html">Go to the documentation of this file.</a><pre class="fragment"><div>00001 <span class="preprocessor">#ifndef CPPUNIT_TOOLS_XMLELEMENT_H</span>00002 <span class="preprocessor"></span><span class="preprocessor">#define CPPUNIT_TOOLS_XMLELEMENT_H</span>00003 <span class="preprocessor"></span>00004 <span class="preprocessor">#include <<a class="code" href="_portability_8h.html">cppunit/Portability.h</a>></span>00005 00006 <span class="preprocessor">#if CPPUNIT_NEED_DLL_DECL</span>00007 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( push )</span>00008 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z</span>00009 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00010 <span class="preprocessor"></span>00011 <span class="preprocessor">#include <<a class="code" href="_cpp_unit_deque_8h.html">cppunit/portability/CppUnitDeque.h</a>></span>00012 <span class="preprocessor">#include <string></span>00013 00014 00015 <a class="code" href="_portability_8h.html#a6">CPPUNIT_NS_BEGIN</a>00016 00017 00018 <span class="keyword">class </span><a class="code" href="class_xml_element.html">XmlElement</a>;00019 00020 <span class="preprocessor">#if CPPUNIT_NEED_DLL_DECL</span>00021 <span class="preprocessor"></span><span class="comment">// template class CPPUNIT_API std::deque<XmlElement *>;</span>00022 <span class="preprocessor">#endif</span>00023 <span class="preprocessor"></span>00024 <a name="l00033"></a><a class="code" href="class_xml_element.html">00033</a> <span class="keyword">class </span>CPPUNIT_API XmlElement00034 {00035 <span class="keyword">public</span>:00040 XmlElement( std::string elementName,00041 std::string content =<span class="stringliteral">""</span> );00042 00047 XmlElement( std::string elementName,00048 <span class="keywordtype">int</span> numericContent );00049 00052 <span class="keyword">virtual</span> ~XmlElement();00053 00057 std::string name() <span class="keyword">const</span>;00058 00062 std::string content() <span class="keyword">const</span>;00063 00067 <span class="keywordtype">void</span> setName( <span class="keyword">const</span> std::string &name );00068 00072 <span class="keywordtype">void</span> setContent( <span class="keyword">const</span> std::string &content );00073 00076 <span class="keywordtype">void</span> setContent( <span class="keywordtype">int</span> numericContent );00077 00082 <span class="keywordtype">void</span> addAttribute( std::string attributeName,00083 std::string value );00084 00089 <span class="keywordtype">void</span> addAttribute( std::string attributeName,00090 <span class="keywordtype">int</span> numericValue );00091 00095 <span class="keywordtype">void</span> addElement( XmlElement *element );00096 00100 <span class="keywordtype">int</span> elementCount() <span class="keyword">const</span>;00101 00107 XmlElement *elementAt( <span class="keywordtype">int</span> index ) <span class="keyword">const</span>;00108 00115 XmlElement *elementFor( <span class="keyword">const</span> std::string &name ) <span class="keyword">const</span>;00116 00122 std::string toString( <span class="keyword">const</span> std::string &indent = <span class="stringliteral">""</span> ) <span class="keyword">const</span>;00123 00124 <span class="keyword">private</span>:<a name="l00125"></a><a class="code" href="class_xml_element.html#y0">00125</a> <span class="keyword">typedef</span> std::pair<std::string,std::string> <a class="code" href="class_xml_element.html#y0">Attribute</a>;00126 00127 std::string attributesAsString() const;00128 std::string escape( std::string value ) const;00129 00130 private:<a name="l00131"></a><a class="code" href="class_xml_element.html#r0">00131</a> std::string m_name;<a name="l00132"></a><a class="code" href="class_xml_element.html#r1">00132</a> std::string m_content;00133 <a name="l00134"></a><a class="code" href="class_xml_element.html#y1">00134</a> typedef CppUnitDeque<Attribute> Attributes;<a name="l00135"></a><a class="code" href="class_xml_element.html#r2">00135</a> Attributes m_attributes;00136 <a name="l00137"></a><a class="code" href="class_xml_element.html#y2">00137</a> typedef CppUnitDeque<XmlElement *> Elements;<a name="l00138"></a><a class="code" href="class_xml_element.html#r3">00138</a> Elements m_elements;00139 };00140 00141 00142 CPPUNIT_NS_END00143 00144 #if CPPUNIT_NEED_DLL_DECL00145 #pragma warning( pop )00146 #endif00147 00148 00149 #endif <span class="comment">// CPPUNIT_TOOLS_XMLELEMENT_H</span></div></pre><hr><table width="100%"> <tr> <td width="10%" align="left" valign="center"> <a href="http://sourceforge.net"> <img src="http://sourceforge.net/sflogo.php?group_id=11795" width="88" height="31" border="0" alt="SourceForge Logo"></a> </td> <td width="20%" align="left" valign="center"> hosts this site. </td> <td> </td> <td align="right" valign="center"> Send comments to:<br> <a href="mailto:cppunit-devel@lists.sourceforge.net">CppUnit Developers</a> </td> </tr></table></body> </html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -