Commit c26fe349 authored by Davis King's avatar Davis King

added an example

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403728
parent ff545421
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="stylesheet.xsl"?>
<doc>
<title>Documented Code</title>
<body from_file="output.xml"/>
</doc>
<!-- This XML file was generated by the htmlify program created by Davis E. King. See http://dlib.net for updates. -->
<code>
<classes>
<class>
<name>test</name>
<scope></scope>
<declaration>class test</declaration>
<file>test.cpp</file>
<comment>WHAT THIS OBJECT REPRESENTS
This is a simple test class that doesn't do anything</comment>
<public_typedefs>
<typedef>typedef int type</typedef>
</public_typedefs>
<public_methods>
<method>
<name>test</name>
<declaration>test()</declaration>
<comment>ensures
- constructs a test object</comment>
</method>
<method>
<name>print</name>
<declaration>void
print() const</declaration>
<comment>ensures
- prints a message to the screen</comment>
</method>
</public_methods>
</class>
</classes>
<global_functions>
<function>
<name>add_numbers</name>
<scope></scope>
<declaration>int
add_numbers (
int a,
int b
)</declaration>
<file>test.cpp</file>
<comment>ensures
- returns a + b</comment>
</function>
</global_functions>
</code>
This diff is collapsed.
#include <iostream>
// ----------------------------------------------------------------------------------------
using namespace std;
// ----------------------------------------------------------------------------------------
class test
{
/*!
WHAT THIS OBJECT REPRESENTS
This is a simple test class that doesn't do anything
!*/
public:
typedef int type;
test ();
/*!
ensures
- constructs a test object
!*/
void print () const;
/*!
ensures
- prints a message to the screen
!*/
};
// ----------------------------------------------------------------------------------------
test::test() {}
void test::print() const
{
cout << "A message!" << endl;
}
// ----------------------------------------------------------------------------------------
int add_numbers (
int a,
int b
)
/*!
ensures
- returns a + b
!*/
{
return a + b;
}
// ----------------------------------------------------------------------------------------
void a_function (
)
/*!P
This is a function which won't show up in the output of htmlify --to-xml
because of the presence of the P in the above /*!P above.
!*/
{
}
// ----------------------------------------------------------------------------------------
int main()
{
test a;
a.print();
}
// ----------------------------------------------------------------------------------------
...@@ -1233,6 +1233,7 @@ void save_to_xml_file ( ...@@ -1233,6 +1233,7 @@ void save_to_xml_file (
{ {
ofstream fout("output.xml"); ofstream fout("output.xml");
fout << "<!-- This XML file was generated by the htmlify program created by Davis E. King. See http://dlib.net for updates. -->" << endl;
fout << "<code>" << endl; fout << "<code>" << endl;
fout << " <classes>" << endl; fout << " <classes>" << endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment