开发者

Why does Doxygen documentation only appear for the last of multiple adjacent groups?

I'm trying to document several similar functions at once using Doxygen groups. I would like the functions to share the same documentation as shown in the example here.

// @{
//! @brief Some documen开发者_高级运维tation
int func1(void);
int func2(void);
// @}

// @{
//! @brief Some other documentation
int func3(void);
int func4(void);
// @}

However, when I run doxygen, only the 2nd group displays the @brief message in the HTML output. Am I doing something wrong, or is this a potential bug?

Note, I am not trying to nest groups, which the doxygen documentation says is not allowed.


For this to work you need to have DISTRIBUTE_GROUP_DOC on in your config. And code specified as:

//@{
//! Same documentation for both members. Details ...
void func1InGroup1();
void func2InGroup1();
//@}

And if you want to name the grouped section:

//! @name Group name
//@{
//! Same documentation for both members. Details ...
void func1InGroup1();
void func2InGroup1();
//@}


Solved!

The documentation to be factored out for each function group must precede the opening braces:

//! @brief Some documentation
// @{
int func1(void);
int func2(void);
// @}

//! @brief Some other documentation
// @{
int func3(void);
int func4(void);
// @}


Just a thought: Doxygen is picky when it comes to whitespace. Make sure to use '//@{' and not '// @{'.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜