如何从doxygen函数中的注释添加文档到类描述中?

问题描述 投票:0回答:1

当将C ++与doxygen一起使用时,我想从函数中添加到类描述中。我基本上想添加有关正在执行的函数调用的信息。

class_name.h

/**
 * This is the overall description of the class
 */
class ClassName
{
...
}

class_name.cpp:

void ClassName::randomFunction()
{
    /**
     * @class ClassName 
     *
     * calls testData on stuff (this should be appended to the class description)
     */
    testData(stuff);
}

氧气输出:

<b>Detailed Description</b>
<br>
This is the overall description of the class
<br>
calls testData on stuff

当我将注释放在函数外部时,此方法有效,但是如示例所示,如果将注释放在randomFunction中,则该方法不会显示在任何地方。最后,我希望文档的读者可以看到对类的描述,然后是示例中的代码片段。这样可以更轻松地使我的文档与代码保持同步,并立即告诉用户我正在调用的重要功能。

我想这样做的原因是将类生成的网络消息记录在一个地方,而不是让用户搜索有关多个成员函数的文档。

编辑:doxygen版本是1.8.5

补充说明

c++ comments doxygen
1个回答
2
投票

使用的doxygen版本(2013年8月23日,1.8.5)有点旧,建议将其更新为当前版本(1.8.17)。

要在其他地方放置代码片段或文档片段,doxygen也可以使用命令\snippet(请参阅http://doxygen.nl/manual/commands.html#cmdsnippet)。

要在不同位置对信息进行分组,doxygen具有分组命令,例如\defgrouphttp://doxygen.nl/manual/commands.html#cmddefgroup),\ingrouphttp://doxygen.nl/manual/commands.html#cmdingroup),\addtogrouphttp://doxygen.nl/manual/commands.html#cmdaddtogroup)。另请参见doxgen文档(http://doxygen.nl/manual/grouping.html)中的分组chappetr。

© www.soinside.com 2019 - 2024. All rights reserved.