I'm trying to create a custom command for easier group handling. The idea is in general...
ALIASES += opengroup{1}="^^* \addtogroup \1_GROUP ^^ * \{ ^^"
ALIASES += close="\}"
...to use in code file as...
/** \opengroup{LEVEL_1} */
// ...code statements...
/** \close */ // opengroup
...to get the doxygen result comment:
/**
* \addtogroup LEVEL_1_GROUP
* \{
*/
// ...code statements...
/** \} */ // opengroup
I tried with Doxygen 1.8.14. Unfortunately, this doesn't work. Any ideas?
Edit: I think the root problem is the \addtogroup command with its syntax. My hope was to clear this with inserting '^^' to force a new line, but it seems to me doxygen is parsing the command in one line instead of resolving the '^^' new line in a pre-step...
A bit weird. With the alias:
ALIASES += opengroup{1}="^^* \addtogroup \1_GROUP ^^ * \\{ ^^"
so with a double backslash (\\
) before the curly bracket open ({
) I got it working.
I also get it working with:
ALIASES += opengroup{1}="^^* \addtogroup \1_GROUP ^^ * @{ ^^"
so it looks like the extra backslash is eaten at an unexpected place. The \
and @
should be synonyms, but as \
is also an escape character so it is quite often tricky.
Note:
doxygen -d commentscan
to see the replacementALIASES
can be nested and after a change the new string is seen as input. When needing a literal {
, }
or ,
in the expanded output one has to escape them with a \
and the \
is removed at the en. Problem here arises with the commands \{
and \}
as here the \
serves as 'command indicator'. Best to use @{
and @}
in case the 'block commands' are needed. the \}
in \close
doesn't have the problem as it is not re-evaluated.