User Tools

Site Tools


Using Doxygen in C/C++

In general, simply running Doxgen on the directory containing the sources will generate useful output.

You can add to this with specific commenting using their /** … */ notation - in general, before the definition of the object you are documenting. See slao: doxygen/html/commands.html

Doxygen Manual

A main Overview page separate from the source documentation.

Start another source file called something like docs.h or mainpage.h In here, write your essay describing your program.

Other commands you might usefully use on this page

the \mainpage <title> command are the title for the main page.

the \section <alias> <Title (if different)> command, whose syntax you should be able to deduce

Including Images

\image html mypicture.gif You may need, under Doxywizard:Expert:IMAGE_PATH - to specify where your images are.

Including file contents

\include <filename> does this and as with images you will have to inform EXAMPLE_PATH.

This combination

\dontinclude main.cpp
\skip #include "grade.h"
\until << endl;

only includes the portion of the file defined by skip <pattern> … until <pattern>. It's a means of commenting your way through a sourcefile bit by bit. i.e. Only one dontinclude required for multiple skip..untils on a sourcefile. The above snippet will display the source fragment:

#include "grade.h"
#include "Student_info.h"
#include "progConfig.h"  

using namespace std;

int main() 
        // Just prove the CMake vars came through
        cout << "\n" << PROJECT_NAME << " - Version " << GoIterate_VERSION_MAJOR << "." << GoIterate_VERSION_MINOR 
        << endl;

So when I run it the resulting output is..

$ GoIterate.exe

GoIterate - Version 0.1
/ etc.

Oops, that last bit is irrelevant - it pertains to CMake, and is the output of the above source code fragment.

programming/doxygen.txt · Last modified: 2020/04/08 00:24 (external edit)