Doxygen private function

11,191

Solution 1

I set the following in the config file:

EXTRACT_PRIVATE = YES

HIDE_UNDOC_MEMBERS = YES

This has the desired effect but will still show the documentation for all documented private members.

I then use @internal as the first line for the documentation of private members that I do not want to show.

Also, I can still document private members with a normal C++ comment. ie. dont use /** ... */ use /* ... */. Usually I use a normal comment for member variables.

Finally, if I really want to show all that private documentation I can set:

INTERNAL_DOCS = YES

to create a more expansive version of the documentation.

Solution 2

The section between \cond and \endcond commands can be included by adding its section label to the ENABLED_SECTIONS configuration option. If the section label is omitted, the section will be excluded from processing unconditionally.

/** An interface */
class Intf
{
  public:
    /** A method */
    virtual void func() = 0;

    /// @cond COND1

    /** A method used for testing */
    virtual void test() = 0;

    /// @endcond
};

See cond help

Not to see COND1 sections: just do not add it to ENABLED_SECTIONS configuration option.

Share:
11,191
duffsterlp
Author by

duffsterlp

Updated on July 20, 2022

Comments

  • duffsterlp
    duffsterlp almost 2 years

    Is there a way to have doxygen show the documentation for individual private functions? I want doxygen to not show the documentation for the vast majority of private functions but show it for a select few private functions. My motivation is that these C++ private functions are provided to Python as extensions and I want their documentation to show up in Doxygen. However, I don't want them to be public because they are only needed by the classes themselves; they definitely belong in the private sector.

    Thanks

  • duffsterlp
    duffsterlp almost 12 years
    This would definitely be do-able, however many many private functions already have doxygen documentation, and I'm not going to de-doxygen them.
  • tenpn
    tenpn about 11 years
    For private fields, this only works if EXTRACT_PRIVATE is enabled.