我在 Doxygen 识别命名空间和模块时遇到问题。我认为问题在于是否将\addtogroup
命名空间内或命名空间外。
示例 1,在命名空间之外:
/*!
* \addtogroup Records
* @{
*/
//! Generic record interfaces and implementations
namespace Records
{
//! Describes the record interface
class Interface;
} // End namespace Records
/*! @} End of Doxygen Groups*/
示例 2 - 在命名空间内
//! Generic record interfaces and implementations
namespace Records
{
/*!
* \addtogroup Records
* @{
*/
//! Describes the record interface
class Interface;
/*! @} End of Doxygen Groups*/
} // End namespace Records
我想要namespace Records
出现在 Doxygen 下命名空间选项卡并间接位于Modules标签。单击中的项目命名空间页面应该生成一个包含以下内容的页面Records::Interface
。单击中的项目Modules选项卡还应该生成一个包含以下内容的页面Records::Interface
.
在我的 Doxygen 文档中,我缺少以下项目命名空间选项卡位于Modules反之亦然,由于这种困境导致我的不一致。
那么示例 1 和示例 2 哪一个才是正确的方法呢?
{Doxygen 手册对此主题没有明确说明。}
Doxygen: \addtogroup http://www.doxygen.nl/manual/commands.html#cmdaddtogroup
Doxygen:记录命名空间 http://www.doxygen.nl/docblocks.html
我使用 Doxygen 和两个示例进行了实验,结果如下。
示例中的类名称已重命名,以避免与 Doxygen 混淆。
示例 1,外部命名空间
/*!
* \addtogroup Records
* @{
*/
//! Generic record interfaces and implementations
namespace Records
{
//! Describes the record interface
class Interface;
} // End namespace Records
/*! @} End of Doxygen Groups*/
多氧结果:
单击“模块”按钮(在主栏中)。
单击窗口中的“记录”模块。
示例 2:在命名空间内(类重命名为 Fields)
//! Generic record interfaces and implementations
namespace Fields
{
/*!
* \addtogroup Fields
* @{
*/
//! Describes the record interface
class Interface;
/*! @} End of Doxygen Groups*/
} // End namespace Fields
多氧结果:
单击“模块”按钮(在主栏中)。
单击窗口中的“记录”模块。
Summary
多氧根的位置\addtogroup
命令具有不同的结果,具体取决于它是否位于namespace
定义或外部。当在命名空间之外声明时,DoxygenModules选项卡将显示命名空间,如上面的示例 1 所示。当。。。的时候\addtogroup
命令被放置在命名空间内,DoxygenModules选项卡不会显示名称空间,如上面的示例 2 所示。如果您希望您的名称空间列在 Doxygen 中Modules选项卡,找到\addtogroup
命名空间之外的命令。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)