Exclude Documentation for Protected Members in Doxygen Output.

Doxygen is a tool for generating documentation by extracting code structure and relations, code signatures and specially formatted comments from application source code. It’s a very powerful tool that I’ve used on several personal and work related projects. One of the features it provides is customizability.

For example, it can be configured to generate separate documentation for internal or external use. Internally used documentation may include all public and private methods of classes while external documentation my only provide documentation for public APIs.

To exclude private class members the configuration option EXTRACT_PRIVATE which defaults to YES should be set to NO.

If you really want to generate public documentation you likely want to exclude protected members as well. There is no EXTRACT_PROTECTED configuration option but you can work around it by using the following:

ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
PREDEFINED = protected=private

This will cause the Doxygen engine to treat the protected keyword as a macro and replace it with private during processing. With EXTRACT_PRIVATE set to NO, protected members will also be excluded.

Source: https://osdir.com/ml/text.doxygen.general/2004-12/msg00047.html

Related Posts

Leave a Reply