breathe
breathe copied to clipboard
:no-private: option for doxygenfile directive
By default the doxygenfile
directive includes private members of classes. Can we have a :no-private-members:
option to exclude them?
Hi, I think this is a good enhancement but there is currently a shortage of developer time, so it is unlikely this is implemented soon.
As a workaround perhaps DoxyGen's EXTRACT_PRIVATE
can be used: https://www.stack.nl/~dimitri/doxygen/manual/config.html#cfg_extract_private
If you do want private except for select cases you could abuse Breathe's project
option. In that case you would generate Doxygen XML twice, one of them with EXTRACT_PRIVATE
set to NO
. Then you could write:
.. doxygenfile:: foo.h
:project: no-private
or similar.
@melvinvermeeren Thanks for the reply. The EXTRACT_PRIVATE
is already set to False for my project. But this parameter only applied to the documentation generated by doxygen, not the xml data. So the private members are still present in the xml and included by breathe.
I did not know that, appears to be odd behaviour in Doxygen first reported in 2007:
https://github.com/doxygen/doxygen/issues/2405
https://github.com/doxygen/doxygen/issues/4504
The latest update to https://github.com/doxygen/doxygen/issues/2405#issuecomment-820277374 suggests this is a feature, not a bug, in doxygen. So it should be up to breathe to control whether the private members are displayed or not. In the meantime, I might have to try pre-processing the XML before passing it to breathe