记录枚举类值与doxygen的

问题描述 投票:6回答:2

在项目中,我使用枚举类了很多,我使用的doxygen作为文件系统。我发现很难在多个枚举类在同一个文件中声明产生枚举类的文档和他们有相同的成员。例如,下面的代码不生成用于在最终的HTML输出枚举类IMAGE_REPORTING正确的文档:

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};
}

输出:

任何想法的问题是什么?

c++ doxygen
2个回答
7
投票

您可以使用内联文档,这对我的作品:

/** @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 */
}

和类似的其他。


2
投票

我是有全球枚举类似的问题。有些头文件生成一个链接,枚举和其他头文件没有。你必须明确文档的文件。

下面是从这个页面的文档INT一个节选。 http://www.doxygen.nl/manual/docblocks.html#memberdoc

为了证明一个全局C函数,类型定义,枚举或预处理定义必须先记录包含它的文件(通常这将是一个头文件,因为文件包含了导出到其它源文件的信息)。

注意让我们重复一下,因为它常常被忽略:记录全局对象(函数,类型定义,枚举,宏等),您必须文件,其中定义它们的文件。换句话说,必须至少是一个

/*! \file */ 

or a

/** @file */ 

line in this file.
© www.soinside.com 2019 - 2024. All rights reserved.