使用doxygen记录枚举类值 [英] Documenting enum class values with doxygen

查看:221
本文介绍了使用doxygen记录枚举类值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中我使用枚举类很多,我使用doxygen作为文档系统。
当在同一个文件中声明多个枚举类并且它们具有相同的成员时,我发现很难生成枚举类的文档。
例如,以下代码不会为最终HTML输出中的枚举类IMAGE_REPORTING生成正确的文档:

in my project I use enum class a lot and I'm using doxygen as documentation system. I find very difficult to produce documentation of enum classes when multiple enum classes are declared in the same file and they have the same members. For example, the following code is not generating the correct documentation for enum class IMAGE_REPORTING in final HTML output:

namespace mapper
{
  /* CONNECTION RELATED */
  /** @enum mapper::SECURE_WEBSOCKET
   *  \author Michele Adduci
   *  \ingroup Core
   *  @brief is a strongly typed enum class representing the status of websocket connection
   *  @var mapper::SECURE_WEBSOCKET::DISABLED
   *  is coded as std::int8_t of value 0
   *  @var mapper::SECURE_WEBSOCKET::ENABLED
   *  is coded as std::int8_t of value 1
   */
  enum class SECURE_WEBSOCKET : std::int8_t {DISABLED = 0, ENABLED = 1};

  /* IMAGE RELATED */
  /** @enum mapper::IMAGE_REPORTING
   *  \author Michele Adduci
   *  \ingroup Core
   *  @brief is a strongly typed enum class representing the status of image reporting
   *  @var mapper::IMAGE_REPORTING::DISABLED
   *  is coded as std::int8_t of value 0
   *  @var mapper::IMAGE_REPORTING::ENABLED
   *  is coded as std::int8_t of value 1
 */
  enum class IMAGE_REPORTING : std::int8_t {DISABLED = 0, ENABLED = 1};
}

输出:

有什么问题吗?

推荐答案

您可以使用内联文档,它适用于我:

You can use inline documentation, which works for me:

/** @enum mapper::IMAGE_REPORTING
 *  \author Michele Adduci
 *  \ingroup Core
 *  @brief is a strongly typed enum class representing the status of image reporting
 */
enum class IMAGE_REPORTING : std::int8_t {
  DISABLED = 0, /**< is coded as std::int8_t of value 0 */
  ENABLED = 1   /**< is coded as std::int8_t of value 1 */
}

其他。

这篇关于使用doxygen记录枚举类值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆