Doxygen默认评论

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

是否可以在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个回答
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"

我们将得到以下结果:

Result

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