?? class_xml_outputter.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>XmlOutputter Class Reference<br><small>[<a class="el" href="group___writing_test_result.html">Writing test result</a>]</small></h1>Outputs a <a class="el" href="class_test_result_collector.html">TestResultCollector</a> in XML format. <a href="#_details">More...</a><p><code>#include <<a class="el" href="_xml_outputter_8h-source.html">XmlOutputter.h</a>></code><p><p>Inheritance diagram for XmlOutputter:<p><center><img src="class_xml_outputter.png" usemap="#XmlOutputter_map" border="0" alt=""></center><map name="XmlOutputter_map"><area href="class_outputter.html" alt="Outputter" shape="rect" coords="0,0,85,24"></map><a href="class_xml_outputter-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 Types</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>typedef CppUnitMap< <a class="el" href="class_test.html">Test</a> *,<br> <a class="el" href="class_test_failure.html">TestFailure</a> *, std::less<<br> <a class="el" href="class_test.html">Test</a> * > > </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_outputter.html#w0">FailedTests</a></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_outputter.html#a0">XmlOutputter</a> (<a class="el" href="class_test_result_collector.html">TestResultCollector</a> *result, std::ostream &stream, std::string encoding=std::string("ISO-8859-1"))</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Constructs a XmlOutputter object. <a href="#a0"></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_outputter.html#a1">~XmlOutputter</a> ()</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#a1"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_outputter.html#a2">addHook</a> (<a class="el" href="class_xml_outputter_hook.html">XmlOutputterHook</a> *hook)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Adds the specified hook to the outputter. <a href="#a2"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_outputter.html#a3">removeHook</a> (<a class="el" href="class_xml_outputter_hook.html">XmlOutputterHook</a> *hook)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Removes the specified hook from the outputter. <a href="#a3"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_outputter.html#a4">write</a> ()</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Writes the specified result as an XML document to the stream. <a href="#a4"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_outputter.html#a5">setStyleSheet</a> (const std::string &styleSheet)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the XSL style sheet used. <a href="#a5"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_outputter.html#a6">setRootNode</a> ()</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the root element and adds its children. <a href="#a6"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_outputter.html#a7">addFailedTests</a> (<a class="el" href="class_xml_outputter.html#w0">FailedTests</a> &failedTests, <a class="el" href="class_xml_element.html">XmlElement</a> *rootNode)</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_outputter.html#a8">addSuccessfulTests</a> (<a class="el" href="class_xml_outputter.html#w0">FailedTests</a> &failedTests, <a class="el" href="class_xml_element.html">XmlElement</a> *rootNode)</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_outputter.html#a9">addStatistics</a> (<a class="el" href="class_xml_element.html">XmlElement</a> *rootNode)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Adds the statics element to the root node. <a href="#a9"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_outputter.html#a10">addFailedTest</a> (<a class="el" href="class_test.html">Test</a> *test, <a class="el" href="class_test_failure.html">TestFailure</a> *failure, int testNumber, <a class="el" href="class_xml_element.html">XmlElement</a> *testsNode)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a failed test to the failed tests node. Creates a new element containing datas about the failed test, and adds it to the failed tests element. Then, for all hooks, call failTestAdded(). <a href="#a10"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_outputter.html#a11">addFailureLocation</a> (<a class="el" href="class_test_failure.html">TestFailure</a> *failure, <a class="el" href="class_xml_element.html">XmlElement</a> *testElement)</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_outputter.html#a12">addSuccessfulTest</a> (<a class="el" href="class_test.html">Test</a> *test, int testNumber, <a class="el" href="class_xml_element.html">XmlElement</a> *testsNode)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a successful test to the successful tests node. Creates a new element containing datas about the successful test, and adds it to the successful tests element. Then, for all hooks, call successfulTestAdded(). <a href="#a12"></a><br><br></td></tr><tr><td colspan=2><br><h2>Protected Types</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>typedef CppUnitDeque< <a class="el" href="class_xml_outputter_hook.html">XmlOutputterHook</a> * > </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_outputter.html#x0">Hooks</a></td></tr><tr><td colspan=2><br><h2>Protected Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_outputter.html#b0">fillFailedTestsMap</a> (<a class="el" href="class_xml_outputter.html#w0">FailedTests</a> &failedTests)</td></tr><tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="class_test_result_collector.html">TestResultCollector</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_outputter.html#p0">m_result</a></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>std::ostream & </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_outputter.html#p1">m_stream</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_outputter.html#p2">m_encoding</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_outputter.html#p3">m_styleSheet</a></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="class_xml_document.html">XmlDocument</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_outputter.html#p4">m_xml</a></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="class_xml_outputter.html#x0">Hooks</a> </td><td class="memItemRight" valign=bottom><a class="el" href="class_xml_outputter.html#p5">m_hooks</a></td></tr><tr><td colspan=2><br><h2>Private 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_outputter.html#d0">XmlOutputter</a> (const <a class="el" href="class_xml_outputter.html">XmlOutputter</a> &copy)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Prevents the use of the copy constructor. <a href="#d0"></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_outputter.html#d1">operator=</a> (const <a class="el" href="class_xml_outputter.html">XmlOutputter</a> &copy)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Prevents the use of the copy operator. <a href="#d1"></a><br><br></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Outputs a <a class="el" href="class_test_result_collector.html">TestResultCollector</a> in XML format. <p>Save the test result as a XML stream.<p>Additional datas can be added to the XML document using <a class="el" href="class_xml_outputter_hook.html">XmlOutputterHook</a>. Hook are not owned by the XmlOutputter. They should be valid until destruction of the XmlOutputter. They can be removed with removeHook().<p><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="class_xml_document.html">XmlDocument</a>, <a class="el" href="class_xml_element.html">XmlElement</a>, <a class="el" href="class_xml_outputter_hook.html">XmlOutputterHook</a>. </dd></dl><p><hr><h2>Member Typedef Documentation</h2><a class="anchor" name="w0" doxytag="XmlOutputter::FailedTests" ></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 CppUnitMap<<a class="el" href="class_test.html">Test</a> *,<a class="el" href="class_test_failure.html">TestFailure</a>*, std::less<<a class="el" href="class_test.html">Test</a>*> > <a class="el" href="class_xml_outputter.html#w0">XmlOutputter::FailedTests</a> </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="x0" doxytag="XmlOutputter::Hooks" ></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_outputter_hook.html">XmlOutputterHook</a> *> <a class="el" href="class_xml_outputter.html#x0">XmlOutputter::Hooks</a><code> [protected]</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="XmlOutputter::XmlOutputter" ></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 XmlOutputter::XmlOutputter </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="class_test_result_collector.html">TestResultCollector</a> * </td> <td class="mdname" nowrap> <em>result</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap>std::ostream & </td> <td class="mdname" nowrap> <em>stream</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>encoding</em> = <code>std::string("ISO-8859-1")</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 a XmlOutputter object. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>result</em> </td><td>Result of the test run. </td></tr> <tr><td></td><td valign=top><em>stream</em> </td><td>Stream used to output the XML output. </td></tr> <tr><td></td><td valign=top><em>encoding</em> </td><td>Encoding used in the XML file (default is Latin-1). </td></tr> </table></dl> </td> </tr></table><a class="anchor" name="a1" doxytag="XmlOutputter::~XmlOutputter" ></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"> XmlOutputter::~<a class="el" href="class_xml_outputter.html">XmlOutputter</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>Destructor. <p> </td> </tr></table><a class="anchor" name="d0" doxytag="XmlOutputter::XmlOutputter" ></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"> XmlOutputter::XmlOutputter </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="class_xml_outputter.html">XmlOutputter</a> & </td> <td class="mdname1" valign="top" nowrap> <em>copy</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [private]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Prevents the use of the copy constructor. <p> </td> </tr></table><hr><h2>Member Function Documentation</h2><a class="anchor" name="a10" doxytag="XmlOutputter::addFailedTest" ></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"> void XmlOutputter::addFailedTest </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="class_test.html">Test</a> * </td> <td class="mdname" nowrap> <em>test</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap><a class="el" href="class_test_failure.html">TestFailure</a> * </td> <td class="mdname" nowrap> <em>failure</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>testNumber</em>, </td> </tr> <tr>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -