记录C中用doxygen的常数
我想用doxygen记录的c .h文件中有各种组的常数。
示例:轴,方向,可能的值。
#define TYPE_LAT 0x01
#define TYPE_LONG 0x02
#define NORTH 0x01
#define SOUTH 0x02
#define EAST 0x01
#define WEST 0x02
#define TROPIC_OF_CANCER 23.5
#define EQUATOR 0
#define PRIME_MERIDIAN 0
#define SYD_LAT_DIR SOUTH
#define SYD_LNG_DIR EAST
#define SYD_LAT_VAL 151.21
#define SYD_LNG_VAL 33.9
这些将是参数的论点:
void SetOneDimension(int axis, int direction, float value);
对于悉尼,我要做的:
SetOneDimension(TYPE_LAT, SYD_LAT_DIR, SYD_LAT_VAL);
SetOneDimension(TYPE_LNG, SYD_LNG_DIR, SYD_LNG_VAL);
理想情况下,我想对常数进行分类,我将它们显示为适当的“父母”的子段,如
Dimension types:
#define TYPE_LAT 0x01
Directions:
#define NORTH 0x01
#define SOUTH 0x02
#define SYD_LAT_DIR SOUTH
Key Values:
#define EQUATOR 0
#define TROPIC_OF_CANCER 23.5
#define SYD_LAT_VAL 151.21
#define TYPE_LAT 0x02
Directions:
#define EAST 0x01
#define WEST 0x02
#define SYD_LNG_DIR EAST
Key Values:
#define PRIME_MERIDIAN 0
#define SYD_LNG_VAL 33.9
:每个人的相关评论。这可以快速目击参数的有效集 /组合。上面的示例很简单 - 我实际上具有具有多个命令,子命令和可能值的功能。
Doxygen成员团体会很棒,但我认为他们不允许像我这样的子组。有可能使用模块组的可能性,但我将这些都超出了我在这里的关注。
您对如何使用doxygen有任何建议吗?
I have various groups of constants in a C .h file that I'd like to document with Doxygen.
Example: axis, direction, possible values.
#define TYPE_LAT 0x01
#define TYPE_LONG 0x02
#define NORTH 0x01
#define SOUTH 0x02
#define EAST 0x01
#define WEST 0x02
#define TROPIC_OF_CANCER 23.5
#define EQUATOR 0
#define PRIME_MERIDIAN 0
#define SYD_LAT_DIR SOUTH
#define SYD_LNG_DIR EAST
#define SYD_LAT_VAL 151.21
#define SYD_LNG_VAL 33.9
These would be arguments for parameters in a function like:
void SetOneDimension(int axis, int direction, float value);
and for Sydney I'd do:
SetOneDimension(TYPE_LAT, SYD_LAT_DIR, SYD_LAT_VAL);
SetOneDimension(TYPE_LNG, SYD_LNG_DIR, SYD_LNG_VAL);
Ideally in the documentation I'd like to categorise the constants where I show them as sub-sections to their appropriate "parents," like this:
Dimension types:
#define TYPE_LAT 0x01
Directions:
#define NORTH 0x01
#define SOUTH 0x02
#define SYD_LAT_DIR SOUTH
Key Values:
#define EQUATOR 0
#define TROPIC_OF_CANCER 23.5
#define SYD_LAT_VAL 151.21
#define TYPE_LAT 0x02
Directions:
#define EAST 0x01
#define WEST 0x02
#define SYD_LNG_DIR EAST
Key Values:
#define PRIME_MERIDIAN 0
#define SYD_LNG_VAL 33.9
with a relevant comment for each. This allows a quick sighting for valid sets / combinations of parameters. The example above is simple - I would actually have functions with multiple commands, sub-commands and possible values.
Doxygen member groups would be great but I don't think they allow sub-groups like I am after. There is the possibility of using module groups but I htink these go beyond what I'm after here.
Do you have any suggestions on how to document these with Doxygen?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论