doxygen 一次注释多个变量
如果我有以下内容:
/**
* @brief (x,y,z) points for block
*/
int x, y, z;
它只会生成 x 的文档,是否可以在 doxygen 中让它用一条注释来注释所有 x、y 和 z?
编辑 根据 envu 的建议,我现在有以下内容(基于 http://www.doxygen. nl/manual/grouping.html#memgroup)
//@{
/** some documentation here */
int x, y, z;
//@}
或
//@{
/**
* @brief some documentation here
*/
int x, y, z;
//@}
但是这两个仍然只记录 x。 尝试使用不同的形式我还没有得到相同的文档字符串来跨越多个变量
If I have the following:
/**
* @brief (x,y,z) points for block
*/
int x, y, z;
It will only generate that documentation for x, is it possible in doxygen to get it to comment all x, y and z with one comment?
EDIT
Following the suggestions of envu I now have the following (based off http://www.doxygen.nl/manual/grouping.html#memgroup)
//@{
/** some documentation here */
int x, y, z;
//@}
or
//@{
/**
* @brief some documentation here
*/
int x, y, z;
//@}
However both of these still only document x.
Trying it with different forms I have yet to get the same documentation string to span multiple variables
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我已经在这个问题上敲了一段时间了。结果你必须在配置中设置
DISTRIBUTE_GROUP_DOC = YES
。Been banging my head on this one for a while. Turns out you have to set
DISTRIBUTE_GROUP_DOC = YES
in the configuration.我会使用成员组 http://www.doxygen。 nl/manual/grouping.html#memgroup 为此。语法和输出与您想要实现的效果有点不同,但我认为这不会有什么坏处。
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.
我意识到这是一个老问题,但我一直遇到类似的问题,并找到了一种解决方法,该方法不能完全解决问题,但在某些情况下可能是可接受的替代方法。
通过在成员组块上方添加注释并使用
\name
装饰器作为前缀,您将获得显示在 Doxygen 页面属性列表中成员组中所有变量上方的描述。我相信这是一个简短的描述,但如果您愿意,您可以在此处放置任意长的描述。这不会产生在成员组中每个变量的详细信息字段中添加相同注释的效果(详细信息字段将为空,或者如果您在成员组块内添加注释,它仍然只适用于第一个变量),但它确实具有将一组相关变量记录在一起的效果,这似乎就是问题的初衷。
例子:
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:
我已在“专家”选项卡中设置了选项“DISTRIBUTE_GROUP_DOC”。然后小组里的所有成员都收到了同样的评论。
I've set the option "DISTRIBUTE_GROUP_DOC" in the "Expert" tab. Then all the members of the group received the same comment.