doxygen 一次注释多个变量

发布于 2024-11-03 05:33:05 字数 561 浏览 3 评论 0原文

如果我有以下内容:

/**
 * @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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

偏爱你一生 2024-11-10 05:33:05

我已经在这个问题上敲了一段时间了。结果你必须在配置中设置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.

神仙妹妹 2024-11-10 05:33:05

我会使用成员组 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.

猫九 2024-11-10 05:33:05

我意识到这是一个老问题,但我一直遇到类似的问题,并找到了一种解决方法,该方法不能完全解决问题,但在某些情况下可能是可接受的替代方法。

通过在成员组块上方添加注释并使用 \name 装饰器作为前缀,您将获得显示在 Doxygen 页面属性列表中成员组中所有变量上方的描述。我相信这是一个简短的描述,但如果您愿意,您可以在此处放置任意长的描述。

这不会产生在成员组中每个变量的详细信息字段中添加相同注释的效果(详细信息字段将为空,或者如果您在成员组块内添加注释,它仍然只适用于第一个变量),但它确实具有将一组相关变量记录在一起的效果,这似乎就是问题的初衷。

例子:

/*! \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 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;
//@}
一绘本一梦想 2024-11-10 05:33:05

我已在“专家”选项卡中设置了选项“DISTRIBUTE_GROUP_DOC”。然后小组里的所有成员都收到了同样的评论。

//@{
/** same comment for all members */
char aaa;
char bbb;
int ccc;
//@}

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

//@{
/** same comment for all members */
char aaa;
char bbb;
int ccc;
//@}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文