Doxygen 的 C++ 异常文档类运算符
如果我的文件中有一个类,我无法更改,但我需要在 doxygen 中记录,最好的方法是什么?我知道最好在实际的 .h 或 .cpp 文件中进行记录,但在这个特定实例中,这是不可能的。
我已经弄清楚如何记录一些成员,但我无法以可靠的方式记录操作员。让我举个例子。这是一个示例类,其中一个成员引起了问题,而一个成员工作正常:
class Foo
{
public:
int Bar();
bool operator!() const;
};
在 doxygen 查看的其他一些文件中,我放置了以下内容:
/// @fn Foo::Bar
/// @brief Some info about the constructor
/// @return Some stuff about what bar returns
构造函数的文档有效,但这不起作用:
/// @fn Foo::operator!
/// @brief Some info about the operator
/// @return Some stuff about what the operator! returns
也没有:
/// @fn operator!
/// @memberof Foo
/// @brief Some info about the operator
/// @return Some stuff about what the operator! returns
我还尝试使用 % 和 转义各个部分。所以它看起来像“/// @fn %operator!”、“/// @fn operator%!”或“/// @fn 运算符!”但没有任何像这样的帮助。
有关运营商的信息永远不会显示。有几次我尝试将一个唯一值放入操作员 doxygen 注释中,并在 doxygen 输出中查找它,但结果是空的。我做错了什么?
If I have a class in a file I can't change, but I need to document in doxygen, what is the best way to do it? I know it would be best to document in the actual .h or .cpp file, but in this specific instance, that is not possible.
I have figured out how to document some members, but I cannot document operators in a reliable way. Let me provide an example. Here is an example class with a member that has caused problems and one that worked fine:
class Foo
{
public:
int Bar();
bool operator!() const;
};
In some other file that doxygen looks through, I have put the following:
/// @fn Foo::Bar
/// @brief Some info about the constructor
/// @return Some stuff about what bar returns
The documentation for the constructor works, but this doesn't:
/// @fn Foo::operator!
/// @brief Some info about the operator
/// @return Some stuff about what the operator! returns
neither does:
/// @fn operator!
/// @memberof Foo
/// @brief Some info about the operator
/// @return Some stuff about what the operator! returns
I have also tried escaping various parts with a % and . So it looked like "/// @fn %operator!", "/// @fn operator%!" or "/// @fn operator!" but nothing likes this has helped.
The Info about the operator never shows up. A few times I tried putting a unique value into the operator doxygen comments and grepping for it in the doxygen output and I came up empty. What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您查看 doxygen 输出,应该会出现警告
,在这种情况下,请更改文档以
记下附加到
@fn
标识符的附加() const
。If you look at your doxygen output, there should be a warning
in which case, change your documentation to
note the additional
() const
appended to the@fn
identifier.