1 /******************************************************************************
5 * Copyright (C) 1997-2015 by Dimitri van Heesch.
7 * Permission to use, copy, modify, and distribute this software and its
8 * documentation under the terms of the GNU General Public License is hereby
9 * granted. No representations are made about the suitability of this software
10 * for any purpose. It is provided "as is" without express or implied warranty.
11 * See the GNU General Public License for more details.
13 * Documents produced by Doxygen are derivative works derived from the
14 * input used in their production; they are not affected by this license.
20 #include "memberlist.h"
26 #include "outputlist.h"
29 #include "vhdldocgen.h"
30 #include "namespacedef.h"
32 #include "membergroup.h"
34 #include "docparser.h"
36 MemberList::MemberList() : m_listType(MemberListType_pubMethods)
47 m_numDecMembers=-1; // special value indicating that value needs to be computed
48 m_numDocMembers=-1; // special value indicating that value needs to be computed
54 MemberList::MemberList(MemberListType lt) : m_listType(lt)
65 m_numDecMembers=-1; // special value indicating that value needs to be computed
66 m_numDocMembers=-1; // special value indicating that value needs to be computed
72 MemberList::~MemberList()
74 delete memberGroupList;
77 int MemberList::compareValues(const MemberDef *c1, const MemberDef *c2) const
79 static bool sortConstructorsFirst = Config_getBool(SORT_MEMBERS_CTORS_1ST);
80 if (sortConstructorsFirst) {
81 int ord1 = c1->isConstructor() ? 2 : (c1->isDestructor() ? 1 : 0);
82 int ord2 = c2->isConstructor() ? 2 : (c2->isDestructor() ? 1 : 0);
88 int cmp = qstricmp(c1->name(),c2->name());
89 return cmp!=0 ? cmp : c1->getDefLine()-c2->getDefLine();
92 int MemberList::countInheritableMembers(ClassDef *inheritedFrom) const
95 QListIterator<MemberDef> mli(*this);
97 for (mli.toFirst();(md=mli.current());++mli)
99 if (md->isBriefSectionVisible())
101 if (md->memberType()!=MemberType_Friend &&
102 md->memberType()!=MemberType_EnumValue)
104 //printf("member %s: isReimplementedBy(%s)=%d\n",md->name().data(),
105 // inheritedFrom->name().data(),
106 // md->isReimplementedBy(inheritedFrom));
107 if (md->memberType()==MemberType_Function)
109 if (!md->isReimplementedBy(inheritedFrom)) count++;
120 MemberGroupListIterator mgli(*memberGroupList);
122 for (;(mg=mgli.current());++mgli)
124 count+=mg->countInheritableMembers(inheritedFrom);
127 //printf("%s::countInheritableMembers(%s)=%d\n",
128 // listTypeAsString().data(),
129 // inheritedFrom->name().data(),count);
133 /*! Count the number of members in this list that are visible in
134 * the declaration part of a compound's documentation page.
136 void MemberList::countDecMembers(bool countEnumValues,GroupDef *gd)
138 if (m_numDecMembers!=-1) return;
140 //printf("----- countDecMembers count=%d ----\n",count());
141 m_varCnt=m_funcCnt=m_enumCnt=m_enumValCnt=0;
142 m_typeCnt=m_protoCnt=m_defCnt=m_friendCnt=0;
144 QListIterator<MemberDef> mli(*this);
146 for (mli.toFirst();(md=mli.current());++mli)
148 //printf("MemberList::countDecMembers(md=%s,%d)\n",md->name().data(),md->isBriefSectionVisible());
149 if (md->isBriefSectionVisible())
151 switch(md->memberType())
153 case MemberType_Variable: // fall through
154 case MemberType_Event: // fall through
155 case MemberType_Property: m_varCnt++,m_numDecMembers++;
157 // apparently necessary to get this to show up in declarations section?
158 case MemberType_Interface: // fall through
159 case MemberType_Service: // fall through
160 case MemberType_Function: // fall through
161 case MemberType_Signal: // fall through
162 case MemberType_DCOP: // fall through
163 case MemberType_Slot: if (!md->isRelated() || md->getClassDef())
164 m_funcCnt++,m_numDecMembers++;
166 case MemberType_Enumeration: m_enumCnt++,m_numDecMembers++; break;
167 case MemberType_EnumValue: if (countEnumValues)
168 m_enumValCnt++,m_numDecMembers++;
170 case MemberType_Typedef: m_typeCnt++,m_numDecMembers++; break;
171 //case MemberType_Prototype: m_protoCnt++,m_numDecMembers++; break;
172 case MemberType_Define: if (Config_getBool(EXTRACT_ALL) ||
174 !md->initializer().isEmpty() ||
175 md->hasDocumentation()
176 ) m_defCnt++,m_numDecMembers++;
178 case MemberType_Friend: m_friendCnt++,m_numDecMembers++;
181 err("Unknown member type found for member `%s'\n!",md->name().data());
187 MemberGroupListIterator mgli(*memberGroupList);
189 for (;(mg=mgli.current());++mgli)
191 mg->countDecMembers(gd);
192 m_varCnt+=mg->varCount();
193 m_funcCnt+=mg->funcCount();
194 m_enumCnt+=mg->enumCount();
195 m_enumValCnt+=mg->enumValueCount();
196 m_typeCnt+=mg->typedefCount();
197 m_protoCnt+=mg->protoCount();
198 m_defCnt+=mg->defineCount();
199 m_friendCnt+=mg->friendCount();
200 m_numDecMembers+=mg->numDecMembers();
203 //printf("----- end countDecMembers ----\n");
205 //printf("MemberList::countDecMembers()=%d\n",m_numDecMembers);
208 void MemberList::countDocMembers(bool countEnumValues)
210 if (m_numDocMembers!=-1) return; // used cached value
212 QListIterator<MemberDef> mli(*this);
214 for (mli.toFirst();(md=mli.current());++mli)
216 if (md->isDetailedSectionVisible(m_inGroup,m_inFile))
218 // do not count enum values, since they do not produce entries of their own
219 if (countEnumValues || md->memberType()!=MemberType_EnumValue)
225 MemberGroupListIterator mgli(*memberGroupList);
227 for (;(mg=mgli.current());++mgli)
229 mg->countDocMembers();
230 m_numDocMembers+=mg->numDocMembers();
233 //printf("MemberList::countDocMembers()=%d memberGroupList=%p\n",m_numDocMembers,memberGroupList);
236 void MemberList::inSort(const MemberDef *md)
238 QList<MemberDef>::inSort(md);
241 void MemberList::append(const MemberDef *md)
243 QList<MemberDef>::append(md);
246 void MemberList::remove(const MemberDef *md)
248 QList<MemberDef>::remove(md);
251 void MemberList::sort()
253 QList<MemberDef>::sort();
256 uint MemberList::count() const
258 return QList<MemberDef>::count();
261 int MemberList::findRef(const MemberDef *md) const
263 return QList<MemberDef>::findRef(md);
266 MemberDef *MemberList::getFirst() const
268 return QList<MemberDef>::getFirst();
271 MemberDef *MemberList::take(uint index)
273 return QList<MemberDef>::take(index);
276 MemberListIterator::MemberListIterator(const MemberList &l) :
277 QListIterator<MemberDef>(l)
281 int MemberList::countEnumValues(MemberDef *md,bool setAnonEnumType) const
284 MemberListIterator vmli(*this);
286 QCString name(md->name());
287 int i=name.findRev("::");
288 if (i!=-1) name=name.right(name.length()-i-2); // strip scope (TODO: is this needed?)
289 if (name[0]=='@') // anonymous enum => append variables
291 for ( ; (vmd=vmli.current()) ; ++vmli)
293 QCString vtype=vmd->typeString();
294 if ((vtype.find(name))!=-1)
299 vmd->setAnonymousEnumType(md);
307 bool MemberList::declVisible() const
309 MemberListIterator mli(*this);
311 for ( ; (md=mli.current()); ++mli )
313 if (md->isBriefSectionVisible())
315 switch (md->memberType())
317 case MemberType_Define: // fall through
318 case MemberType_Typedef: // fall through
319 case MemberType_Variable: // fall through
320 case MemberType_Function: // fall through
321 case MemberType_Signal: // fall through
322 case MemberType_Slot: // fall through
323 case MemberType_DCOP: // fall through
324 case MemberType_Property: // fall through
325 case MemberType_Interface: // fall through
326 case MemberType_Service: // fall through
327 case MemberType_Event:
329 case MemberType_Enumeration:
331 // if this is an anonymous enum and there are variables of this
332 // enum type (i.e. enumVars>0), then we do not show the enum here.
333 if (countEnumValues(md,FALSE)==0) // show enum here
339 case MemberType_Friend:
341 case MemberType_EnumValue:
355 void MemberList::writePlainDeclarations(OutputList &ol,
356 ClassDef *cd,NamespaceDef *nd,FileDef *fd,
357 GroupDef *gd,ClassDef *inheritedFrom,const char *inheritId
360 //printf("----- writePlainDeclaration() ----\n");
361 static bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
363 if (numDecMembers()==0)
365 //printf(" --> no members!\n");
366 return; // no members in this list
368 //printf(" --> writePlainDeclaration() numDecMembers()=%d\n",
371 ol.pushGeneratorState();
375 MemberListIterator mli(*this);
376 for ( ; (md=mli.current()); ++mli )
378 //printf(">>> Member `%s' type=%d visible=%d\n",
379 // md->name().data(),md->memberType(),md->isBriefSectionVisible());
380 if ((inheritedFrom==0 || !md->isReimplementedBy(inheritedFrom)) &&
381 md->isBriefSectionVisible())
383 //printf(">>> rendering\n");
384 switch(md->memberType())
386 case MemberType_Define: // fall through
387 //case MemberType_Prototype: // fall through
388 case MemberType_Typedef: // fall through
389 case MemberType_Variable: // fall through
390 case MemberType_Function: // fall through
391 case MemberType_Signal: // fall through
392 case MemberType_Slot: // fall through
393 case MemberType_DCOP: // fall through
394 case MemberType_Property: // fall through
395 case MemberType_Interface: // fall through
396 case MemberType_Service: // fall through
397 case MemberType_Event:
399 if (first) ol.startMemberList(),first=FALSE;
400 md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup,inheritedFrom,inheritId);
403 case MemberType_Enumeration:
405 // if this is an anonymous enum and there are variables of this
406 // enum type (i.e. enumVars>0), then we do not show the enum here.
407 if (countEnumValues(md,TRUE)==0) // show enum here
409 //printf("Enum!!\n");
412 ol.startMemberList();
415 ol.startMemberDeclaration();
416 ol.startMemberItem(md->anchor(),0,inheritId);
417 bool detailsLinkable = md->isDetailedSectionLinkable();
418 if (!detailsLinkable)
420 ol.startDoxyAnchor(md->getOutputFileBase(),0,md->anchor(),md->name(),QCString());
422 ol.writeString("enum ");
423 ol.insertMemberAlign();
424 md->writeEnumDeclaration(ol,cd,nd,fd,gd);
425 if (!detailsLinkable)
427 ol.endDoxyAnchor(md->getOutputFileBase(),md->anchor());
430 if (!md->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
432 DocRoot *rootNode = validatingParseDoc(
433 md->briefFile(),md->briefLine(),
435 md->briefDescription(),
436 TRUE,FALSE,0,TRUE,FALSE
438 if (rootNode && !rootNode->isEmpty())
440 ol.startMemberDescription(md->anchor());
441 ol.writeDoc(rootNode,cd,md);
442 if (md->isDetailedSectionLinkable())
444 ol.disableAllBut(OutputGenerator::Html);
446 ol.startTextLink(md->getOutputFileBase(),
448 ol.parseText(theTranslator->trMore());
452 ol.endMemberDescription();
456 ol.endMemberDeclaration(md->anchor(),inheritId);
458 md->warnIfUndocumented();
461 case MemberType_Friend:
462 if (inheritedFrom==0)
466 ol.startMemberList();
469 md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup,inheritedFrom,inheritId);
472 case MemberType_EnumValue:
476 //printf("EnumValue!\n");
477 if (first) ol.startMemberList(),first=FALSE;
478 md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup,inheritedFrom,inheritId);
486 // handle members that are inside anonymous compounds and for which
487 // no variables of the anonymous compound type exist.
490 MemberListIterator mli(*this);
491 for ( ; (md=mli.current()) ; ++mli )
493 if (md->fromAnonymousScope() && !md->anonymousDeclShown())
495 md->setFromAnonymousScope(FALSE);
496 //printf("anonymous compound members\n");
497 if (md->isBriefSectionVisible())
501 ol.startMemberList();
504 md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup);
506 md->setFromAnonymousScope(TRUE);
516 ol.popGeneratorState();
517 //printf("----- end writePlainDeclaration() ----\n");
520 /** Writes the list of members to the output.
521 * @param ol Output list to write to
522 * @param cd non-null if this list is part of class documentation.
523 * @param nd non-null if this list is part of namespace documentation.
524 * @param fd non-null if this list is part of file documentation.
525 * @param gd non-null if this list is part of group documentation.
526 * @param title Title to use for the member list.
527 * @param subtitle Sub title to use for the member list.
528 * @param showEnumValues Obsolete, always set to FALSE.
529 * @param showInline if set to TRUE if title is rendered differently
530 * @param inheritedFrom if not 0, the list is shown inside the
531 * given class as inherited members, parameter cd points to the
532 * class containing the members.
533 * @param lt Type of list that is inherited from.
535 void MemberList::writeDeclarations(OutputList &ol,
536 ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd,
537 const char *title,const char *subtitle, bool showEnumValues,
538 bool showInline,ClassDef *inheritedFrom,MemberListType lt)
540 (void)showEnumValues; // unused
542 //printf("----- writeDeclaration() this=%p ---- inheritedFrom=%p\n",this,inheritedFrom);
543 static bool optimizeVhdl = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
546 countDecMembers(/*showEnumValues*/FALSE,gd); // count members shown in this section
547 Definition *ctx = cd;
548 if (ctx==0 && nd) ctx = nd;
549 if (ctx==0 && gd) ctx = gd;
550 if (ctx==0 && fd) ctx = fd;
552 //printf("%p: MemberList::writeDeclaration(title=`%s',subtitle=`%s')=%d inheritedFrom=%p\n",
553 // this,title,subtitle,numDecMembers(),inheritedFrom);
555 int num = numDecMembers();
558 //if ( cd && !optimizeVhdl && countInheritableMembers(inheritedFrom)>0 )
559 if ( cd && !optimizeVhdl && cd->countMembersIncludingGrouped(
560 m_listType,inheritedFrom,TRUE)>0 )
562 ol.pushGeneratorState();
563 ol.disableAllBut(OutputGenerator::Html);
564 inheritId = substitute(listTypeAsString(lt),"-","_")+"_"+
565 stripPath(cd->getOutputFileBase());
568 ol.writeInheritedSectionTitle(inheritId,cd->getReference(),
569 cd->getOutputFileBase(),
570 cd->anchor(),title,cd->displayName());
572 ol.popGeneratorState();
581 ol.startInlineHeader();
585 ol.startMemberHeader(listTypeAsString(m_listType));
590 ol.endInlineHeader();
594 ol.endMemberHeader();
599 QCString st=subtitle;
600 st = st.stripWhiteSpace();
603 ol.startMemberSubtitle();
604 ol.generateDoc("[generated]",-1,ctx,0,subtitle,FALSE,FALSE,0,FALSE,FALSE);
605 ol.endMemberSubtitle();
611 // TODO: Two things need to be worked out for proper VHDL output:
612 // 1. Signals and types under the group need to be
613 // formatted to associate them with the group somehow
614 // indentation, or at the very least, extra space after
616 // 2. This might need to be repeated below for memberGroupLists
617 if (optimizeVhdl) // use specific declarations function
619 VhdlDocGen::writeVhdlDeclarations(this,ol,0,cd,0,0);
623 writePlainDeclarations(ol,cd,nd,fd,gd,inheritedFrom,inheritId);
626 //printf("memberGroupList=%p\n",memberGroupList);
629 MemberGroupListIterator mgli(*memberGroupList);
631 while ((mg=mgli.current()))
633 bool hasHeader=!mg->header().isEmpty() && mg->header()!="[NOHEADER]";
634 if (inheritId.isEmpty())
636 //printf("mg->header=%s hasHeader=%d\n",mg->header().data(),hasHeader);
637 ol.startMemberGroupHeader(hasHeader);
640 ol.parseText(mg->header());
642 ol.endMemberGroupHeader();
643 if (!mg->documentation().isEmpty())
645 //printf("Member group has docs!\n");
646 ol.startMemberGroupDocs();
647 ol.generateDoc(mg->docFile(),mg->docLine(),ctx,0,mg->documentation()+"\n",FALSE,FALSE);
648 ol.endMemberGroupDocs();
650 ol.startMemberGroup();
652 //printf("--- mg->writePlainDeclarations ---\n");
653 mg->writePlainDeclarations(ol,cd,nd,fd,gd,inheritedFrom,inheritId);
654 if (inheritId.isEmpty())
656 ol.endMemberGroup(hasHeader);
662 if (inheritedFrom && cd)
664 // also add members that of this list type, that are grouped together
665 // in a separate list in class 'inheritedFrom'
666 cd->addGroupedInheritedMembers(ol,m_listType,inheritedFrom,inheritId);
668 //printf("----- end writeDeclaration() ----\n");
671 void MemberList::writeDocumentation(OutputList &ol,
672 const char *scopeName, Definition *container,
673 const char *title,bool showEnumValues,bool showInline)
675 //printf("MemberList::writeDocumentation()\n");
677 countDocMembers(showEnumValues);
678 if (numDocMembers()==0) return;
682 ol.pushGeneratorState();
683 ol.disable(OutputGenerator::Html);
685 ol.popGeneratorState();
686 ol.startGroupHeader(showInline ? 2 : 0);
688 ol.endGroupHeader(showInline ? 2 : 0);
690 ol.startMemberDocList();
692 MemberListIterator mli(*this);
695 // count the number of overloaded members
696 QDict<uint> overloadTotalDict(67);
697 QDict<uint> overloadCountDict(67);
698 overloadTotalDict.setAutoDelete(TRUE);
699 overloadCountDict.setAutoDelete(TRUE);
700 for (mli.toFirst() ; (md=mli.current()) ; ++mli)
702 if (md->isDetailedSectionVisible(m_inGroup,container->definitionType()==Definition::TypeFile) &&
703 !(md->isEnumValue() && !showInline))
705 uint *pCount = overloadTotalDict.find(md->name());
712 overloadTotalDict.insert(md->name(),new uint(1));
713 overloadCountDict.insert(md->name(),new uint(1));
718 for (mli.toFirst() ; (md=mli.current()) ; ++mli)
720 if (md->isDetailedSectionVisible(m_inGroup,container->definitionType()==Definition::TypeFile) &&
721 !(md->isEnumValue() && !showInline))
723 uint overloadCount = *overloadTotalDict.find(md->name());
724 uint *pCount = overloadCountDict.find(md->name());
725 md->writeDocumentation(this,*pCount,overloadCount,ol,scopeName,container,
726 m_inGroup,showEnumValues,showInline);
732 printf("MemberList::writeDocumentation() -- member groups %d\n",memberGroupList->count());
733 MemberGroupListIterator mgli(*memberGroupList);
735 for (;(mg=mgli.current());++mgli)
737 mg->writeDocumentation(ol,scopeName,container,showEnumValues,showInline);
740 ol.endMemberDocList();
743 // members in a table
744 void MemberList::writeSimpleDocumentation(OutputList &ol,
745 Definition *container)
747 countDocMembers(FALSE);
748 //printf("MemberList count=%d\n",numDocMembers());
749 if (numDocMembers()==0) return;
752 if (container && container->definitionType()==Definition::TypeClass)
754 cd = (ClassDef*)container;
756 ol.startMemberDocSimple(cd && cd->isJavaEnum());
757 MemberListIterator mli(*this);
759 for ( ; (md=mli.current()) ; ++mli)
761 md->writeMemberDocSimple(ol,container);
763 ol.endMemberDocSimple(cd && cd->isJavaEnum());
766 // separate member pages
767 void MemberList::writeDocumentationPage(OutputList &ol,
768 const char *scopeName, Definition *container)
770 static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
772 // count the number of overloaded members
773 QDict<uint> overloadTotalDict(67);
774 QDict<uint> overloadCountDict(67);
775 overloadTotalDict.setAutoDelete(TRUE);
776 overloadCountDict.setAutoDelete(TRUE);
777 MemberListIterator mli(*this);
779 for (mli.toFirst() ; (md=mli.current()) ; ++mli)
781 if (md->isDetailedSectionLinkable())
783 uint *pCount = overloadTotalDict.find(md->name());
790 overloadTotalDict.insert(md->name(),new uint(1));
791 overloadCountDict.insert(md->name(),new uint(1));
796 for ( mli.toFirst() ; (md=mli.current()) ; ++mli)
798 if (md->isDetailedSectionLinkable())
800 uint overloadCount = *overloadTotalDict.find(md->name());
801 uint *pCount = overloadCountDict.find(md->name());
802 QCString diskName=md->getOutputFileBase();
803 QCString title=md->qualifiedName();
804 startFile(ol,diskName,md->name(),title,HLI_None,!generateTreeView,diskName);
805 if (!generateTreeView)
807 container->writeNavigationPath(ol);
808 ol.endQuickIndices();
812 if (generateTreeView)
814 md->writeDocumentation(this,*pCount,overloadCount,ol,scopeName,container,m_inGroup);
817 endFileWithNavPath(container,ol);
821 ol.writeString("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n"
823 " <td valign=\"top\">\n");
825 container->writeQuickMemberLinks(ol,md);
827 ol.writeString(" </td>\n");
828 ol.writeString(" <td valign=\"top\" class=\"mempage\">\n");
830 md->writeDocumentation(this,*pCount,overloadCount,ol,scopeName,container,m_inGroup);
833 ol.writeString(" </td>\n");
834 ol.writeString(" </tr>\n");
835 ol.writeString("</table>\n");
843 //printf("MemberList::writeDocumentation() -- member groups\n");
844 MemberGroupListIterator mgli(*memberGroupList);
846 for (;(mg=mgli.current());++mgli)
848 mg->writeDocumentationPage(ol,scopeName,container);
853 void MemberList::addMemberGroup(MemberGroup *mg)
855 if (memberGroupList==0)
857 memberGroupList=new MemberGroupList;
859 //printf("addMemberGroup: this=%p mg=%p\n",this,mg);
860 memberGroupList->append(mg);
863 void MemberList::addListReferences(Definition *def)
865 MemberListIterator mli(*this);
867 for ( ; (md=mli.current()) ; ++mli)
869 if (md->getGroupDef()==0 || def->definitionType()==Definition::TypeGroup)
871 md->addListReference(def);
872 MemberList *enumFields = md->enumFieldList();
873 if (md->memberType()==MemberType_Enumeration && enumFields)
875 //printf(" Adding enum values!\n");
876 MemberListIterator vmli(*enumFields);
878 for ( ; (vmd=vmli.current()) ; ++vmli)
880 //printf(" adding %s\n",vmd->name().data());
881 vmd->addListReference(def);
888 MemberGroupListIterator mgli(*memberGroupList);
890 for (;(mg=mgli.current());++mgli)
892 mg->addListReferences(def);
897 void MemberList::findSectionsInDocumentation()
899 MemberListIterator mli(*this);
901 for ( ; (md=mli.current()) ; ++mli)
903 md->findSectionsInDocumentation();
907 MemberGroupListIterator mgli(*memberGroupList);
909 for (;(mg=mgli.current());++mgli)
911 mg->findSectionsInDocumentation();
916 void MemberList::marshal(StorageIntf *s)
918 marshalInt(s,(int)m_listType);
919 marshalInt(s,m_varCnt);
920 marshalInt(s,m_funcCnt);
921 marshalInt(s,m_enumCnt);
922 marshalInt(s,m_enumValCnt);
923 marshalInt(s,m_typeCnt);
924 marshalInt(s,m_protoCnt);
925 marshalInt(s,m_defCnt);
926 marshalInt(s,m_friendCnt);
927 marshalInt(s,m_numDecMembers);
928 marshalInt(s,m_numDocMembers);
929 marshalBool(s,m_inGroup);
930 marshalBool(s,m_inFile);
931 marshalBool(s,m_needsSorting);
932 if (memberGroupList==0)
934 marshalUInt(s,NULL_LIST); // null pointer representation
938 marshalUInt(s,memberGroupList->count());
939 QListIterator<MemberGroup> mgi(*memberGroupList);
941 for (mgi.toFirst();(mg=mgi.current());++mgi)
948 void MemberList::unmarshal(StorageIntf *s)
950 m_listType = (MemberListType)unmarshalInt(s);
951 m_varCnt = unmarshalInt(s);
952 m_funcCnt = unmarshalInt(s);
953 m_enumCnt = unmarshalInt(s);
954 m_enumValCnt = unmarshalInt(s);
955 m_typeCnt = unmarshalInt(s);
956 m_protoCnt = unmarshalInt(s);
957 m_defCnt = unmarshalInt(s);
958 m_friendCnt = unmarshalInt(s);
959 m_numDecMembers = unmarshalInt(s);
960 m_numDocMembers = unmarshalInt(s);
961 m_inGroup = unmarshalBool(s);
962 m_inFile = unmarshalBool(s);
963 m_needsSorting = unmarshalBool(s);
964 uint i,count = unmarshalUInt(s);
965 if (count==NULL_LIST) // empty list
969 else // add member groups
971 memberGroupList = new MemberGroupList;
972 for (i=0;i<count;i++)
974 MemberGroup *mg = new MemberGroup;
976 memberGroupList->append(mg);
981 void MemberList::setNeedsSorting(bool b)
986 QCString MemberList::listTypeAsString(MemberListType type)
990 case MemberListType_pubMethods: return "pub-methods";
991 case MemberListType_proMethods: return "pro-methods";
992 case MemberListType_pacMethods: return "pac-methods";
993 case MemberListType_priMethods: return "pri-methods";
994 case MemberListType_pubStaticMethods: return "pub-static-methods";
995 case MemberListType_proStaticMethods: return "pro-static-methods";
996 case MemberListType_pacStaticMethods: return "pac-static-methods";
997 case MemberListType_priStaticMethods: return "pri-static-methods";
998 case MemberListType_pubSlots: return "pub-slots";
999 case MemberListType_proSlots: return "pro-slots";
1000 case MemberListType_priSlots: return "pri-slots";
1001 case MemberListType_pubAttribs: return "pub-attribs";
1002 case MemberListType_proAttribs: return "pro-attribs";
1003 case MemberListType_pacAttribs: return "pac-attribs";
1004 case MemberListType_priAttribs: return "pri-attribs";
1005 case MemberListType_pubStaticAttribs: return "pub-static-attribs";
1006 case MemberListType_proStaticAttribs: return "pro-static-attribs";
1007 case MemberListType_pacStaticAttribs: return "pac-static-attribs";
1008 case MemberListType_priStaticAttribs: return "pri-static-attribs";
1009 case MemberListType_pubTypes: return "pub-types";
1010 case MemberListType_proTypes: return "pro-types";
1011 case MemberListType_pacTypes: return "pac-types";
1012 case MemberListType_priTypes: return "pri-types";
1013 case MemberListType_related: return "related";
1014 case MemberListType_signals: return "signals";
1015 case MemberListType_friends: return "friends";
1016 case MemberListType_dcopMethods: return "dcop-methods";
1017 case MemberListType_properties: return "properties";
1018 case MemberListType_events: return "events";
1019 case MemberListType_interfaces: return "interfaces";
1020 case MemberListType_services: return "services";
1021 case MemberListType_decDefineMembers: return "define-members";
1022 case MemberListType_decProtoMembers: return "proto-members";
1023 case MemberListType_decTypedefMembers: return "typedef-members";
1024 case MemberListType_decEnumMembers: return "enum-members";
1025 case MemberListType_decFuncMembers: return "func-members";
1026 case MemberListType_decVarMembers: return "var-members";
1027 case MemberListType_decEnumValMembers: return "enumval-members";
1028 case MemberListType_decPubSlotMembers: return "pub-slot-members";
1029 case MemberListType_decProSlotMembers: return "pro-slot-members";
1030 case MemberListType_decPriSlotMembers: return "pri-slot-members";
1031 case MemberListType_decSignalMembers: return "signal-members";
1032 case MemberListType_decEventMembers: return "event-members";
1033 case MemberListType_decFriendMembers: return "friend-members";
1034 case MemberListType_decPropMembers: return "prop-members";
1035 case MemberListType_enumFields: return "enum-fields";
1036 case MemberListType_memberGroup: return "member-group";
1042 void MemberList::writeTagFile(FTextStream &tagFile)
1044 MemberListIterator mli(*this);
1046 for ( ; (md=mli.current()) ; ++mli)
1048 if (md->getLanguage()!=SrcLangExt_VHDL)
1050 md->writeTagFile(tagFile);
1051 if (md->memberType()==MemberType_Enumeration && md->enumFieldList() && !md->isStrong())
1053 MemberListIterator vmli(*md->enumFieldList());
1055 for ( ; (vmd=vmli.current()) ; ++vmli)
1057 vmd->writeTagFile(tagFile);
1063 VhdlDocGen::writeTagFile(md,tagFile);
1066 if (memberGroupList)
1068 MemberGroupListIterator mgli(*memberGroupList);
1070 for (;(mg=mgli.current());++mgli)
1072 mg->writeTagFile(tagFile);
1077 //--------------------------------------------------------------------------
1079 int MemberSDict::compareValues(const MemberDef *c1, const MemberDef *c2) const
1081 //printf("MemberSDict::compareValues(%s,%s)\n",c1->name().data(),c2->name().data());
1082 int cmp = qstricmp(c1->name(),c2->name());
1089 return c1->getDefLine()-c2->getDefLine();