使用doxygen分别提取类的公共方法列表
Extract the list of public methods of a class separately using Doxygen
我正在为我的C 项目使用doxygen,该项目将托管在github中。
我想在读书文件中包含类的方法列表,我正在考虑自动化它的方法。
我将在存储库中包含整个生成的HTML页面,但认为通过在readme文件中包括主类的成员来给出API的想法。
到目前为止,我找不到生成降价文件的方法。我的下一个想法是编写一些将自动复制成员列表并将其包含在readme文件中的shell脚本,为此,我需要分别生成类的成员函数列表。
是否可以配置doxygen只能单独输出类的成员列表?
我最近有一个项目,我想将几个功能识别为公共API的一部分。我觉得不需要将它们放入读数文件中,所以我所做的并不是您真正追求的,而是您可能会发现它潜在的妥协。
我创建了一个与:
的组/**
defgroup public_api Public API
brief This is a list of the primary functions that comprise the
public API.
*/
然后我在主页上引用了它:
/**
mainpage Some Project
...
See ref public_api "Public API" for details on these functions.
*/
然后,我明确将每个公共API函数标记为该组。
/**
brief Perform any necessary initialisation before processing.
ingroup public_api
This function must be called prior to any of the other public
api functions to allow initialisation to be performed prior to use.
*/
void init();
网络结果是单个页面上从主页链接到的函数的列表。我知道这并不是您所追求的,但是我有点像Doxygen将所有文档都带入一个易于导航的地方。
如果您确实解决了问题以满意,请发布。我一直对doxygen的非典型用途感兴趣。
您可以从doxygen XML输出中提取类成员列表。将GENERATE_XML
设置为配置文件中的YES
,生成看起来像这样的XML文件:
xml/classtest.xml
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.7.6.1">
<compounddef id="classTest" kind="class" prot="public">
<compoundname>Test</compoundname>
<sectiondef kind="public-func">
<memberdef kind="function" id="classTest_1a99f2bbfac6c95612322b0f10e607ebe5"
prot="public" static="no" const="no"
explicit="no" inline="no" virt="non-virtual">
<type></type>
<definition>Test::Test</definition>
<argsstring>()</argsstring>
<name>Test</name>
<briefdescription> </briefdescription>
<detaileddescription>
<para>A constructor. A more elaborate description of the constructor. </para>
</detaileddescription>
<inbodydescription> </inbodydescription>
<location file="/home/davidl/SO/test.cpp" line="23"/>
</memberdef>
</sectiondef>
</compounddef>
</doxygen>
相关文章:
- 没有为自己的结构调用列表推回方法
- Qt - QVector 和模型视图 - 从列表视图获取自定义类的最佳方法是什么?
- 如何将类成员方法的参数列表自动填充写入可变参数?
- 如何将成员函数作为参数传递并在派生对象上执行方法列表
- 有什么方法可以将元素添加到列表中,如图所示?
- 如何获取列表的每个对象并调用getName方法来打印其名称
- 处理从列表中删除指向对象的指针的"healthy"方法是什么?
- 从列表/向量制作嵌套 for 循环的最佳方法是什么?
- 生成包含给定类型的 N 个参数的可变参数列表的最佳方法?
- C++中有没有一种方法可以通过指定列表中的每个成员变量来构造对象
- 在 c++ 中迭代对列表的正确方法?
- 获取位于特定区间的已排序值列表的子列表的最短方法
- 提供初始值设定项列表构造函数的有效方法
- 使用 clang 获取类中的方法列表
- 使用doxygen分别提取类的公共方法列表
- 用于在C++代码库中检索函数和方法列表的工具
- 如何使用带有clang绑定的python获取C++头中的方法列表
- 使用android NativeActivity的方法列表
- 不同参数计数的结构方法列表
- 生成从可执行文件调用的c++方法列表