从其他页面的部分生成Doxygen页面

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

我有一个文件(比如file1.doxy)和doxygen评论:

/**
 * Comment block 1
*/

...

/**
 * Comment block 2
 */

...

/**
 * Comment block 3
 */

我想创建文件file2.doxy,其输出与以下内容相同:

/**
 * Comment block 1
 *
 * Comment block 3
 */

实际上我想从文件file2.doxy引用文件file1.doxy而不是从file1.doxy复制粘贴信息,但我可以将所需的标记标签插入file1.doxy。

用doxygen可能吗?

documentation doxygen
2个回答
3
投票

你可以使用\verbinclude <file-name>,像这样:

file1.doxy

/**
 * @verbinclude file1.doc
 */
function f1() {}

/**
 * @verbinclude file2.doc
 */
function f2() {}

/**
 * @verbinclude file3.doc
 */
function f3() {}

file2.doxy

/**
 * @verbinclude file1.doc
 *
 * @verbinclude file3.doc
 */
function f1() {}

file1.docfile2.docfile3.doc分别包含Comment block 1Comment block 2Comment block 3。要使其工作,你必须将EXAMPLE_PATH中的Doxyfile设置为file{1,2,3}.doc(*)的路径。但是,这不会扩展file{1,2,3}.doc中的@ doxygen命令。

另一种选择可能是使用doxygen preprocessingINPUT_FILTER

(*)您可能还需要将EXTRACT_ALL设置为YES


2
投票

根据原始注释块的性质,是的,您可以在Doxygen注释中使用@copydoc命令将块的副本提取到另一个文件中。

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