GNOME Bugzilla – Bug 630645
\cond keyword enhancement
Last modified: 2013-01-05 13:28:20 UTC
In the Doxygen maillist (subject: \cond keword) there has been a discussion after the following initial posting: In Doxygen it is possible to have some documentation depending of the setting of ENABLED_SECTIONS by means of the kewords: \if, \ifnot, \else, \elseif, \endif these keywords work within one documentation block; \cond and \endcond work in different comment blocks. In the current project I need a \condnot (analogous to \ifnot). I would therefore propose to add the keyword \condend to Doxygen. For completeness I would also propose to add \elseifnot The result of the discussion is that an enhancement would be the best in the form: I think a better approach is to allow simple constant C-style expressions, i.e. \if !SOME_SECTION_NAME ... \endif or even: \if SOME_SECTION_NAME && (!THIS_ALTERNATIVE || THAT_ALTERNATIVE) ... \endif The same could be done for \cond. Where compatibility (\ifnot) has to be considered.
This bug has been split into 2 parts: - bug_683215 for the \condnot keyword - extension of the logical expression with \cons and \if (this bug)
Created attachment 223857 [details] [review] PATCH: entension of logical expersions for @if, @cond etc. This patch, for my convenience put in doxygen.cpp and doxygen.h, enables the possibility to use logical expressions with the commands like @if, @cond etc. A logical expressing consisting of ENABLED_SECTION names having the value TRUE and a missing section names having the value FALSE. These values can be used in combination with the logical operators & (AND), | (OR) and ! (NOT). Furthermore round brackets are possible to change the order of evaluation inside the expression. This patch is based on the C++ expression parser by Jos de Jong, http://www.speqmath.com which again is based on the example "A mini C++ Interpreter" from the book "The art of C++" by Herbert Schildt.
Thanks, I'll include the patch in the next subversion update, but decided to restructure it quite a bit to bring it more in line with the rest of the code.
This bug was previously marked ASSIGNED, which means it should be fixed in doxygen version 1.8.3. Please verify if this is indeed the case. Reopen the bug if you think it is not fixed and please include any additional information that you think can be relevant.
Tested and works as expected.