views:

222

answers:

1

All classes of my library are defined within a namespace. When I create a mainpage for Doxygen I have to explicitly use this namespace within comments to make Doxygen generate links. I would like to use something like "using namespace" for the whole comment block.

An example:

/**
* \mainpage My Library
*
* Use MyLibraryNamespace::MyClass to ...
*/

Here Doxygen automatically generates a link to the documentation of MyLibraryNamespace::MyClass.

/**
* \mainpage My Library
*
* Use MyClass to ...
*/

Here Doxygen does not generate a link to the documentation of MyLibraryNamespace::MyClass (as there might be multiple MyClass definitions in different namespaces I suppose). To ease the reading I would like to omit the namespace prefix in the comment. Is that possible without having to type \ref MyLibraryNamespace::MyClass "MyClass" every time?

+1  A: 

You can make this work for one namespace by putting your comment inside the namespace. This bugs me considerably as we have multiple nested namespaces and I hate having to use them in Doxygen comments.

namespace MyLibraryNamespace {
/**
* \mainpage My Library
*
* Use MyClass to ...
*/
};
Andy Dent