分组记录一组枚举成员

时间:2012-04-13 11:04:47

标签: doxygen

是否可以记录一组枚举值,类似于此(此示例不起作用):

enum MyEnum
{
  MYENUM_FIRST,
//@{
//@name These two members' description
  MYENUM_SECOND,
  MYENUM_THIRD,
//@}

  MYENUM_FOURTH, ///third member documentation
  MYENUM_FIFTH
};

1 个答案:

答案 0 :(得分:1)

两个突出的事物:

  • 您没有记录MYENUM_SECONDMYENUM_THIRD,因为您没有用有效的doxygen评论包装它们:您应该写///@{而不是//@{

  • 您的MYENUM_FOURTH文档应为

    ///< third member documentation
    

    否则您正在记录MYENUM_FIFTH而不是MYENUM_FOURTH

我可以使用以下代码获取MYENUM_SECONDMYENUM_THIRD的文档

enum MyEnum
{
  MYENUM_FIRST,
  ///@{
  /// These two members' description
  MYENUM_SECOND,
  MYENUM_THIRD,
  ///@}

  MYENUM_FOURTH, ///< third member documentation
  MYENUM_FIFTH
};

并在配置文件中设置DISTRIBUTE_GROUP_DOC = YES。请注意,我已从您的示例中删除了\name命令。