From d18b3eaf3486e224fa9de7e77b536883952b40b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 1 Jan 2019 18:01:22 +0100 Subject: 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 --- src/classdef.cpp | 4 ++ src/config.xml | 8 +++ src/memberdef.cpp | 17 +++-- testing/081/class_interface.xml | 110 ++++++++++++++++++++++++++++++++ testing/081_extract_private_virtual.cpp | 35 ++++++++++ 5 files changed, 169 insertions(+), 5 deletions(-) create mode 100644 testing/081/class_interface.xml create mode 100644 testing/081_extract_private_virtual.cpp 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()) diff --git a/src/config.xml b/src/config.xml index fdc562d..8bf45bb 100644 --- a/src/config.xml +++ b/src/config.xml @@ -838,6 +838,14 @@ Go to the next section or return to the ]]> +