Is there a way how to distinguish groups in enum using doxygen?

233 Views Asked by At

I would like to comment big enum and to have grouped some enum elements (which are following each other)

Imagine enum like this:

/** @brief device OpCodes
 */
typedef enum opCodes_e {
    A = 0, ///< init
/** @addtogroup bluetooth commands group
 *  @{
 */
    B0 = 1, ///< BLE connect
    B1 = 2, ///< BLE disconnect
/** @} */
    C = 3  ///< handle pressure sensor
} t_opCodes;

and I want:

  1. result in one table.
  2. have there also name of the group
  3. visually display which enum elements are within the group

For example result could look something like this:

device OpCodes
A        init
---------------------------
bluetooth commands group
  B0     BLE connect
  B1     BLE disconnect
---------------------------
C        handle pressure sensor

I do not wish any particular view. The above is just illustration what I want. Do you know if something like this is possible within doxygen? If so then how?

1

There are 1 best solutions below

0
On

Bit of a tricky business to get it working and this solution is just for HTML output

/** @brief device OpCodes
 */
typedef enum opCodes_e {

A = 0, /**< inlet2 */
/**< @htmlonly <tr><td colspan=2 align=center class="fieldname"><b>BlueTooth</b></td></tr> @endhtmlonly */
B0 = 1, ///< BLE connect2
B1 = 2, ///< BLE disconnect2
C = 3  ///< handle pressure sensor
} t_opCodes;

Note: that the header of A hast to be in /** ..*. otherwise an extra empty line occurs.