是否可以让 Doxygen 扩展枚举初始值设定项?
对于以下输入:
enum A
{
A1 = 1,
A2 = 2
};
enum B
{
B1 = A2,
B2 = A2 * A2 + 1
}
我希望 doxygen 扩展/解析 B::B1 和 B::B2 的初始值设定项。我希望在 B1 和 B2 的初始值设定项中使用 2
和 5
,而不是 A2
和 A2 * A2 + 1< /代码>。是否可以?如果可以,如何实现?
请注意,我只询问有关枚举初始值设定项的问题。这些在编译时是已知的,因此(理论上)doxygen 应该能够计算。
编辑:从枚举定义中删除了 ;
。
For the following input:
enum A
{
A1 = 1,
A2 = 2
};
enum B
{
B1 = A2,
B2 = A2 * A2 + 1
}
I would like doxygen to expand/resolve initializers of B::B1 and B::B2. I would like to have respectably 2
and 5
in initializers of B1 and B2, rather then A2
and A2 * A2 + 1
. Is it possible? If so, how can this be achieved?
Please mind that I am asking only about enum initializers. Those are known at the compile time, so (in theory) doxygen should be able to compute.
EDIT: Removed ;
from enum definitions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这是不可能的,但是,对于您提出的简单情况,您可以通过使用
#define
以某种方式伪造它这适用于您的代码,并且 doxygen 仍然可以解析这些值。您的代码可能如下所示:
并且在 doxygen 配置中,您需要启用
ENABLE_PREPROCESSING
和MACRO_EXPANSION
。I do not think this is possible, but, for a simple case as you presented, you can fake it by using
#define
in a way that would work for your code, and still be possible fordoxygen
to resolve the values.Your code can look like this:
And in the doxygen configuration you need to enable
ENABLE_PREPROCESSING
andMACRO_EXPANSION
.