“使用命名空间"有关Doxygen的评论 [英] "using namespace" for Doxygen comments
问题描述
我的库的所有类都在名称空间中定义.当我为Doxygen创建主页时,必须在注释中显式使用此命名空间,以使Doxygen生成链接.我想在整个注释块中使用使用命名空间"之类的东西.
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.
一个例子:
/**
* \mainpage My Library
*
* Use MyLibraryNamespace::MyClass to ...
*/
此处Doxygen自动生成指向MyLibraryNamespace :: MyClass文档的链接.
Here Doxygen automatically generates a link to the documentation of MyLibraryNamespace::MyClass.
/**
* \mainpage My Library
*
* Use MyClass to ...
*/
此处Doxygen不会生成指向MyLibraryNamespace :: MyClass文档的链接(因为我想在不同的命名空间中可能有多个MyClass定义).为了简化阅读,我想在注释中省略名称空间前缀.是否可以不必每次都键入\ref MyLibraryNamespace::MyClass "MyClass"
?
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?
推荐答案
您可以通过将注释放入命名空间中来使此功能适用于一个命名空间.这给我带来了极大的麻烦,因为我们有多个嵌套的命名空间,而且我讨厌不得不在Doxygen注释中使用它们.
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 ...
*/
};
从Markdown角度看2016年更新
我正在将Doxygen用于Realm的C#文档(是的,Doxygen也可以处理典型的C#XML注释格式!). Markdown主页使用@ref引用命名空间的类:
I'm using Doxygen for the C# docs for Realm (yes Doxygen handles the typical C# XML comment format too!). The Markdown main page uses the @ref to refer to namespaced classes:
The main classes you will use are:
- [Realm](@ref Realms.Realm)
- [RealmObject](@ref Realms.RealmObject)
- [RealmList](@ref Realms.RealmList)
- [Transaction](@ref Realms.Transaction)
您可以在在此处在线
这篇关于“使用命名空间"有关Doxygen的评论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!