Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Documenting functions in C++ with Doxygen [closed]

I've got a project that I'm using Doxygen to generate documentation for. The documentation of the classes is fine, but I've also got some non-member functions that I use to create objects etc. I'd also like to have these documented, but no matter what I try, Doxygen will not generate documentation from the comments that I have placed above the functions. Why won't Doxygen generate documentation for functions in the global namespace, and what do I need to do to get this to work?

like image 678
Paul Avatar asked May 08 '10 12:05

Paul


People also ask

How exclude code from doxygen?

How can I make doxygen ignore some code fragment? The new and easiest way is to add one comment block with a \cond command at the start and one comment block with a \endcond command at the end of the piece of code that should be ignored. This should be within the same file of course.

What is @brief in C?

Putting the command @brief will generate a short description of the function when you generate the doxygen documentation. That short description can be extended if you want.


2 Answers

Entities that are members of classes are only documented if their class is documented. Entities declared at namespace scope are only documented if their namespace is documented. Entities declared at file scope are only documented if their file is documented.

So to document a free function in the global namespace you also need a line like this somewhere in the header file in which it is declared:

/** @file */ 

Or like this:

/*! \file */ 
like image 96
Oktalist Avatar answered Sep 23 '22 23:09

Oktalist


Use \fn where you otherwise use \class in your \\*! *\ block

http://www.doxygen.nl/manual/docblocks.html look for "Documentation at other places"

http://www.doxygen.nl/manual/commands.html#cmdfn
It works similar as documenting member functions

like image 43
Pieter Avatar answered Sep 24 '22 23:09

Pieter