12

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

PiotrNycz
  • 23,099
  • 7
  • 66
  • 112
duffsterlp
  • 347
  • 1
  • 5
  • 15
  • see this http://stackoverflow.com/questions/562763/doxygen-hiding-private-protected-method-and-tips – PiotrNycz Aug 27 '12 at 18:59
  • 2
    This does not answer my question. That determines how to enable or disable all private functions, which is not what I wanted to do. I'm hoping for some sort of conditional. I tried turning private docs off and enabling the internal docs, but that didn't work. – duffsterlp Aug 27 '12 at 19:25
  • see my answer about conditionals. It requires only a few edits per class. – PiotrNycz Aug 27 '12 at 19:45
  • *nudge* did you ever get anywhere with this? – tenpn May 27 '13 at 20:00

3 Answers3

8

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.

Striezel
  • 3,693
  • 7
  • 23
  • 37
4

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.

albert
  • 8,285
  • 3
  • 19
  • 32
PiotrNycz
  • 23,099
  • 7
  • 66
  • 112
0

There are a couple of ways to achieve this.

You could simply not document those functions that you don't want visible. By default, Doxygen will not show any members that you did not document. Thus, you can just tell it to show privates and any undocumented private members will not be shown.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
  • This would definitely be do-able, however many many private functions already have doxygen documentation, and I'm not going to de-doxygen them. – duffsterlp Aug 27 '12 at 19:26