Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Documenting enum class values with doxygen

Tags:

c++

doxygen

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

Output: Doxygen output

Any idea of what is the problem?

like image 555
madduci Avatar asked Aug 14 '14 07:08

madduci


1 Answers

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

and similar for the other.

like image 171
martin Avatar answered Sep 23 '22 00:09

martin