是否可以选择显示哪个 Doxygen 警告?

发布于 2024-11-15 00:06:41 字数 111 浏览 2 评论 0原文

Doxygen 显示一个化合物 ?没有记录。 构建时发出警告。对于特定项目,我不想记录化合物。为了消除混乱,我想看到除该警告之外的所有其他警告。有没有办法清理 Doxygen 输出?

Doxygen shows a Compound ? is not documented. warning when building. For a specific project I don't want to document Compounds. To remove clutter I want to see all other warnings except that one. Is there a way to clean the Doxygen output?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

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

评论(3

一绘本一梦想 2024-11-22 00:06:41

我认为这是不可能的,除非编写自己的后处理器来过滤 doxygen 输出。在你的情况下,这应该不会太难,一个简单的 grep 应该就足够了:

doxygen <config_file> | grep -v "warning: Compound .* is not documented"

我不太确定为什么 doxygen 不提供此功能:也许它需要太多选项,或更复杂选项。另一种可能性是,他们假设由于您希望在未记录某些内容时收到警告,因此除非在源代码中明确指定(使用 \cond\endcond< /code>,例如),其理由是这种省略只能根据具体情况来决定。或者也许没有人要求他们包含此功能:请随意填写功能请求

I don't think this is possible, except by writing your own post-processor to filter doxygen output. In your case, this should not be too hard, a simple grep should be sufficient:

doxygen <config_file> | grep -v "warning: Compound .* is not documented"

I'm not really sure why doxygen does not provide this feature: perhaps it would require too much options, or more complicated options. Another possibility is that they assumed that since you want to be warned when something is not documented, there should be no exceptions except when explicitly specified in the source code (using \cond and \endcond, for example), with the rationale that this kind of omission should only be decided on a case-by-case basis. Or perhaps nobody ever asked them to include this feature: feel free to fill in a feature request.

鹤舞 2024-11-22 00:06:41

我认为您正在寻找的是 ififnotendif 命令。只需决定一个合适的标签,然后使用正确的标签即可。例如:

/*
* \if DISPLAY_COMPOUND
* Compound doc.
* ...
* \endif
*/

doxygen 将评估它是否知道这个标签,如果不知道,他将忽略同一注释块中 \endif 命令之前的任何注释

然后您需要定义(或不是)您的 doxyfile 中 ENABLED_SECTIONS 中的该标签。

#comment the next line if you don't want to document Compound
ENABLED_SECTIONS = DISPLAY_COMPOUND

看看 \cond\endcond 命令,它们相似但不完全相同(它们启用或禁用文件的整个部分,而不仅仅是单个注释堵塞)。

I think what you're looking for is the if, ifnot and endif commands. Just decide an appropriate label then use the correct tag. Ex.:

/*
* \if DISPLAY_COMPOUND
* Compound doc.
* ...
* \endif
*/

doxygen will evaluate if it knows of this label and if it doesn't, he'll ignore any comment up to the \endif command in the same comment block

Then you need to define (or not) that label in your doxyfile in the ENABLED_SECTIONS.

#comment the next line if you don't want to document Compound
ENABLED_SECTIONS = DISPLAY_COMPOUND

Have a look at the \cond and \endcond commands too which are similar but not quite the same (they enable or disable entire sections of a file, not just a single comment block).

秉烛思 2024-11-22 00:06:41

您可以在 doxygen 配置中关闭警告。
请参阅此处:doxygen 文档

我最喜欢的是:WARN_IF_UNDOCUMENTED = NO

You can switch off warnings in the doxygen configuration.
See here: doxygen documenation

My favorite is: WARN_IF_UNDOCUMENTED = NO

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文