breathe icon indicating copy to clipboard operation
breathe copied to clipboard

:no-private: option for doxygenfile directive

Open peendebak opened this issue 6 years ago • 4 comments

By default the doxygenfile directive includes private members of classes. Can we have a :no-private-members: option to exclude them?

peendebak avatar Oct 08 '18 16:10 peendebak

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.

vermeeren avatar Oct 09 '18 11:10 vermeeren

@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.

eendebakpt avatar Oct 09 '18 12:10 eendebakpt

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

vermeeren avatar Oct 09 '18 13:10 vermeeren

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

JamesRandom avatar Apr 15 '21 10:04 JamesRandom