doxygen comment multiple variables at once

微笑、不失礼 提交于 2019-12-03 23:50:01
evnu

I would use member groups http://www.doxygen.nl/manual/grouping.html#memgroup for this. The syntax and output is a little bit different to what you want to achieve, but I think that shouldn't hurt.

Been banging my head on this one for a while. Turns out you have to set DISTRIBUTE_GROUP_DOC = YES in the configuration.

I realize this is an old question, but I've been having a similar problem and found a workaround that doesn't exactly solve the problem but might be an acceptable substitute in certain cases.

By putting a comment above the member group block and prefixing it with the \name decorator, you get a description that shows up above all of the variables in the member group in the attributes list of the Doxygen page. I believe this is intended to be a short description, but you can put arbitrarily long descriptions here if you wish.

This doesn't have the effect of putting the same comments in the detail field for each of the variables in the member group (the detail fields will be empty, or if you put a comment inside the member group block it will still only apply to the first variable), but it does have the effect of documenting a related group of variables together, which seems like what the original intent of the question was.

Example:

/*! \name This will be the description for the following group of variables
          It can be arbitrarily long, but the first line will show up in bold,
          and any subsequent lines will show up like a description under it
*/
//@{
int relatedVariable1;
int relatedVariable2;
char* relatedVariable3;
//@}

I've set the option "DISTRIBUTE_GROUP_DOC" in the "Expert" tab. Them all the members of the group received the same comment.

//@{
/** same comment for all members */
char aaa;
char bbb;
int ccc;
//@}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!