Given:
namespace Foo { class Foo { public: /// Foo enum, possible ways to foo enum class Foo { /// Foo it with an A A, /// Foo it with a B B, /// Foo it with a C C } } }
And the default Doxyfile made with doxygen -g
, I get this:
How can I get the enum values documented? I tried putting the comment before/after the member, using ///<
, etc, to no avail. Might this just be a bug in doxygen? The examples in the docs work. (Clicking on the name of the enum doesn't bring me anywhere)
In order to document an enum in Swagger, we need to declare the models using annotation @ApiModel. In this example, we created an enum Role with four possible values – Engineer, Clerk, Driver, and Janitor. As we need to document this enum, we'll add @ApiModel to the enum Role.
Putting the command @brief will generate a short description of the function when you generate the doxygen documentation. That short description can be extended if you want. Follow this answer to receive notifications.
To create a Doxygen comment from scratch: Type one of the following symbols: /// , //! , /** or /*! and press Enter .
With Doxygen 1.8.2, both the following work for me:
Using ///
/// This is an enum class enum class fooenum { FOO, ///< this is foo BAR, ///< this is bar };
Using /*! ... */
/*! This is an enum class */ enum class fooenum { FOO, /*!< this is foo */ BAR, /*!< this is bar */ };
The doxygen changelog says that enum class
is supported in Doxygen 1.8.2, so I suspect there may be some minor syntax issue in your commands. Could you please compare your commands with the above two snippets?
New features
Added support for C++11:
strongly typed enums, e.g.: enum class E
Note that I personally hate to have header files that go at length (because documenting means writing at least 2 or 3 lines of documentation, not one word so I generally don't have enough with the brief) so I prefer to document in the .cpp file.
To do that you use the \var
feature of Doxygen.
So the header comes bare:
namespace Foo { class Foo { public: enum class Foo { A, B, C }; }; }
And the .cpp file has:
namespace Foo { /** \enum Foo::Foo * \brief Foo enum, possible ways to foo * * All the necessary details about this enumeration. */ /** \var Foo::A * \brief Foo it with an A * * When you use A... etc. */ /** \var Foo::B * \brief Foo it with a B * * When you use B... etc. */ /** \var Foo::C * \brief Foo it with a C * * When you use C... etc. */ }
That way, I can really document at length which happens often to me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With