是否可以在Doxygen中定义类似宏的内容?
我想写这样的评论:
/**
\return return_self_reference
*/
Doxygen将用我定义的字符串替换return_self_reference
。
Doxygen将会阅读的评论就是这个:
/**
\return A reference to the instance that the operator was called on.
*/
请注意,尽管我之前将其称为宏,但我不想在实际代码中定义C宏或类似的东西。
答案 0 :(得分: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"
,我们将得到以下结果: