【问题标题】:Doxygen default commentsDoxygen 默认注释
【发布时间】:2019-02-13 06:04:01
【问题描述】:
是否可以在 Doxygen 中定义类似宏的东西?
我想写这样的评论:
/**
\return return_self_reference
*/
并且 Doxygen 会将return_self_reference 替换为我定义的字符串。
Doxygen 将读取的评论将是这样的:
/**
\return A reference to the instance that the operator was called on.
*/
请注意,尽管我之前称它为宏,但我不想在实际代码中定义 C 宏或类似的东西。
【问题讨论】:
标签:
documentation
doxygen
documentation-generation
code-documentation
【解决方案1】:
Doxygen 为这些情况提供了配置参数ALIASES。
举个例子:
/** \file
*/
/**
* \return the normal version
*/
int fie0(void);
/**
* \return \str1_repl
*/
int fie1(void);
/**
* \str2_repl
*/
int fie2(void);
并在 doxygen 配置文件中设置以下ALIASES(另请参阅手册了解更多ALIASES 的可能性):
ALIASES = "str1_repl=just the text in replacement" \
"str2_repl=\return return and the text in replacement"
我们会得到以下结果: