1

我有一个带有 doxygen 注释的文件(比如 file1.doxy):

/**
 * 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有可能这样做吗?

4

2 回答 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.doc,file2.doc分别file3.doc包含Comment block 1, Comment block 2, 和Comment block 3, 。为此,您必须将EXAMPLE_PATHDoxyfile的路径设置为file{1,2,3}.doc(*)。不过,这不会扩展 @ doxygen 命令file{1,2,3}.doc

另一种方法是使用 doxygen预处理INPUT_FILTER.

(*) 您可能还必须设置EXTRACT_ALLYES

于 2009-10-09T20:01:10.920 回答
2

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

于 2011-04-10T16:15:35.230 回答