diff options
author | Vladimír Vondruš <mosra@centrum.cz> | 2019-01-01 17:01:22 (GMT) |
---|---|---|
committer | Vladimír Vondruš <mosra@centrum.cz> | 2019-01-03 10:32:17 (GMT) |
commit | d18b3eaf3486e224fa9de7e77b536883952b40b9 (patch) | |
tree | 045620bc9c59d68e2fb32bf035f0147e164a360b /src/classdef.cpp | |
parent | 3b2198babbaf8edafe03e5298e7c194763a1f9fa (diff) | |
download | Doxygen-d18b3eaf3486e224fa9de7e77b536883952b40b9.zip Doxygen-d18b3eaf3486e224fa9de7e77b536883952b40b9.tar.gz Doxygen-d18b3eaf3486e224fa9de7e77b536883952b40b9.tar.bz2 |
Implement a new EXTRACT_PRIVATE_VIRTUAL option.
The classic article about virtuality from Herb Sutter [1] suggests that
virtual functions are always private and public class interface is never
virtual. Until now, it was not really possible to document these
functions in Doxygen:
* Enabling EXTRACT_PRIVATE would show all internals, not just virtual
functions, which is not wanted.
* Enabling HIDE_UNDOC_MEMBERS and HIDE_UNDOC_CLASSES would effectively
disable warnings about *all* undocumented members, which is not wanted.
The usual workaround was to put the members into protected scope just
for Doxygen:
#ifdef DOXYGEN_GENERATING_OUTPUT
protected:
#else
private:
#endif
/** @brief Documented private virtual function */
virtual doStuff();
The new EXTRACT_PRIVATE_VIRTUAL option makes these visible (and able to
be linked to), but shows them *only* if they are documented.
[1] http://www.gotw.ca/publications/mill18.htm
Diffstat (limited to 'src/classdef.cpp')
-rw-r--r-- | src/classdef.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp index e9d39d5..f275d1d 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -620,6 +620,10 @@ void ClassDef::internalInsertMember(MemberDef *md, { addMemberToList(MemberListType_relatedMembers,md,FALSE); } + else if (md->isFunction() && md->protection()==Private && md->virtualness()!=Normal && Config_getBool(EXTRACT_PRIVATE_VIRTUAL)) + { + addMemberToList(MemberListType_functionMembers,md,FALSE); + } else { switch (md->memberType()) |