Automatic Documentation 
Automatically self documenting code – the programmer’s dream!

This is almost possible with a painless three step process using two free tools: doxygen and fossil.

Step 1: Edit code to describe what it does


/**

Conversion between UTF-8 and UTF-16 strings.

UTF-8 is used by web pages. It is a variable byte length encoding
of UNICODE characters which is independant of the byte order in a computer word.

UTF-16 is the native Windows UNICODE encoding.

The class stores two copies of the string, one in each encoding,
so should only exist briefly while conversion is done.

This is a wrapper for the WideCharToMultiByte and MultiByteToWideChar
*/
class cUTF
{
public:
/// Construct from UTF-16
cUTF( const wchar_t * ws );
/// Construct from UTF8
cUTF( const char * s );
/// get UTF16 version
const wchar_t * get16() { return myString16; }
/// get UTF8 version
const char * get8() { return myString8; }
/// free buffers
~cUTF() { free(myString8); free(myString16); }
};



Step 2: Run doxygen to generate HTML documentation form the code. Doxygen hunts down all your code and works out the relationships, all in a flash.

Step 3: Do a fossil check in. Fossil finds all the code you have modified, and the new HTML documentation files generated by doxygen, and stores then into an online repository, so that they are immediately available to anyone with a browser. You can see the result here




[ add comment ] ( 40 views )   |  permalink  |   ( 2.9 / 1677 )

<Back | 1 | 2 | Next> Last>>