Private and Undocumented Members in UML

Olaf Kahler <[email protected]>
Newsgroups gmane.text.doxygen.devel
Message-ID <[email protected]>
Dear Doxygen Developers,

Please find a patch in the attachments that fixes the display of
private and undocumented members in the UML diagrams created with dot.

The issue has been raised before on the doxygen-users list back at
2009-01-15 13:45. No action was taken at that time, however (see e.g.
http://old.nabble.com/Hide-private-members-in-UML-td21477924.html ). As
of version 1.7.1 the same issue annoys me enough to send in this
patch. :)

The patch simply avoids printing the "unlinkable" members, if
HIDE_UNDOC_MEMBERS has been specified and does not print any private
members, unless EXTRACT_PRIVATE is set to true. I've tested the four
obvious combinations and it seems to work fine for all of them.

Best regards,
    Olaf

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first

_______________________________________________
Doxygen-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/doxygen-develop
doxygen_uml_hide.patch (text/x-patch, 2.5 KB)
diff -aur doxygen-1.7.1/src/dot.cpp doxygen-1.7.1-patched//src/dot.cpp
--- doxygen-1.7.1/src/dot.cpp	2010-06-23 12:30:02.000000000 +0100
+++ doxygen-1.7.1-patched//src/dot.cpp	2010-07-19 20:39:38.000000000 +0100
@@ -1061,6 +1061,8 @@
     MemberDef *mma;
     for (mlia.toFirst();(mma = mlia.current());++mlia)
     {
+      if ((Config_getBool("HIDE_UNDOC_MEMBERS"))&&
+          ((!mma->isLinkable())||(!scope->isLinkable()))) continue;
       if (mma->getClassDef() == scope)
       {
         t << prot << " " << convertLabel(mma->name());
@@ -1111,8 +1113,10 @@
     writeBoxMemberList(t,'~',m_classDef->getMemberList(MemberList::pacStaticAttribs),m_classDef);
     writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberList::proAttribs),m_classDef);
     writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberList::proStaticAttribs),m_classDef);
-    writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberList::priAttribs),m_classDef);
-    writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberList::priStaticAttribs),m_classDef);
+    if (Config_getBool("EXTRACT_PRIVATE")) {
+      writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberList::priAttribs),m_classDef);
+      writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberList::priStaticAttribs),m_classDef);
+    }
     t << "|";
     writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberList::pubMethods),m_classDef);
     writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberList::pubStaticMethods),m_classDef);
@@ -1122,9 +1126,11 @@
     writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberList::proMethods),m_classDef);
     writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberList::proStaticMethods),m_classDef);
     writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberList::proSlots),m_classDef);
-    writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberList::priMethods),m_classDef);
-    writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberList::priStaticMethods),m_classDef);
-    writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberList::priSlots),m_classDef);
+    if (Config_getBool("EXTRACT_PRIVATE")) {
+      writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberList::priMethods),m_classDef);
+      writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberList::priStaticMethods),m_classDef);
+      writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberList::priSlots),m_classDef);
+    }
     if (m_classDef->getMemberGroupSDict())
     {
       MemberGroupSDict::Iterator mgdi(*m_classDef->getMemberGroupSDict());
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.