diff options
Diffstat (limited to 'src/classlist.cpp')
-rw-r--r-- | src/classlist.cpp | 205 |
1 files changed, 54 insertions, 151 deletions
diff --git a/src/classlist.cpp b/src/classlist.cpp index f06f744..af64478 100644 --- a/src/classlist.cpp +++ b/src/classlist.cpp @@ -26,98 +26,52 @@ #include "arguments.h" #include "groupdef.h" -ClassList::ClassList() : QList<ClassDef>() +bool ClassLinkedRefMap::declVisible(const ClassDef::CompoundType *filter) const { -} - -ClassList::~ClassList() -{ -} - -static int compItems(const ClassDef *c1,const ClassDef *c2) -{ - static bool b = Config_getBool(SORT_BY_SCOPE_NAME); - if (b) - { - return qstricmp(c1->name(), c2->name()); - } - else - { - return qstricmp(c1->className(), c2->className()); - } -} - -int ClassList::compareValues(const ClassDef *item1, const ClassDef *item2) const -{ - return compItems(item1,item2); -} - -int ClassSDict::compareValues(const ClassDef *item1, const ClassDef *item2) const -{ - return compItems(item1,item2); -} - -ClassListIterator::ClassListIterator(const ClassList &cllist) : - QListIterator<ClassDef>(cllist) -{ -} - -bool ClassSDict::declVisible(const ClassDef::CompoundType *filter) const -{ - static bool hideUndocClasses = Config_getBool(HIDE_UNDOC_CLASSES); - static bool extractLocalClasses = Config_getBool(EXTRACT_LOCAL_CLASSES); - if (count()>0) + bool hideUndocClasses = Config_getBool(HIDE_UNDOC_CLASSES); + bool extractLocalClasses = Config_getBool(EXTRACT_LOCAL_CLASSES); + for (const auto &cd : *this) { - ClassSDict::Iterator sdi(*this); - ClassDef *cd=0; - for (sdi.toFirst();(cd=sdi.current());++sdi) + if (!cd->isAnonymous() && + (filter==0 || *filter==cd->compoundType()) + ) { - if (!cd->isAnonymous() && - (filter==0 || *filter==cd->compoundType()) + bool isLink = cd->isLinkable(); + if (isLink || + (!hideUndocClasses && + (!cd->isLocal() || extractLocalClasses) + ) ) { - bool isLink = cd->isLinkable(); - if (isLink || - (!hideUndocClasses && - (!cd->isLocal() || extractLocalClasses) - ) - ) - { - return TRUE; - } + return true; } } } - return FALSE; + return false; } -void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *filter, - const char *header,bool localNames) const +void ClassLinkedRefMap::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *filter, + const char *header,bool localNames) const { static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE); - if (count()>0) + bool found=FALSE; + for (const auto &cd : *this) { - ClassSDict::Iterator sdi(*this); - ClassDef *cd=0; - bool found=FALSE; - for (sdi.toFirst();(cd=sdi.current());++sdi) + //printf(" ClassLinkedRefMap::writeDeclaration for %s\n",cd->name().data()); + if (!cd->isAnonymous() && + !cd->isExtension() && + (cd->protection()!=Private || extractPrivate) && + (filter==0 || *filter==cd->compoundType()) + ) { - //printf(" ClassSDict::writeDeclaration for %s\n",cd->name().data()); - if (!cd->isAnonymous() && - !cd->isExtension() && - (cd->protection()!=Private || extractPrivate) && - (filter==0 || *filter==cd->compoundType()) - ) - { - //printf("writeDeclarationLink()\n"); - cd->writeDeclarationLink(ol,found,header,localNames); - } + //printf("writeDeclarationLink()\n"); + cd->writeDeclarationLink(ol,found,header,localNames); } - if (found) ol.endMemberList(); } + if (found) ol.endMemberList(); } -void ClassSDict::writeDocumentation(OutputList &ol,const Definition * container) const +void ClassLinkedRefMap::writeDocumentation(OutputList &ol,const Definition * container) const { static bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN); @@ -125,89 +79,38 @@ void ClassSDict::writeDocumentation(OutputList &ol,const Definition * container) static bool inlineSimpleClasses = Config_getBool(INLINE_SIMPLE_STRUCTS); if (!inlineGroupedClasses && !inlineSimpleClasses) return; - if (count()>0) - { - bool found=FALSE; + bool found=FALSE; - ClassSDict::Iterator sdi(*this); - ClassDef *cd=0; - for (sdi.toFirst();(cd=sdi.current());++sdi) + for (const auto &cd : *this) + { + //printf("%s:writeDocumentation() %p linkable=%d embedded=%d container=%p partOfGroups=%zu\n", + // cd->name().data(),cd->getOuterScope(),cd->isLinkableInProject(),cd->isEmbeddedInOuterScope(), + // container,cd->partOfGroups()->size()); + + if (!cd->isAnonymous() && + cd->isLinkableInProject() && + cd->isEmbeddedInOuterScope() && + !cd->isAlias() && + (container==0 || cd->partOfGroups().empty()) // if container==0 -> show as part of the group docs, otherwise only show if not part of a group + ) { - //printf("%s:writeDocumentation() %p linkable=%d embedded=%d container=%p partOfGroups=%d\n", - // cd->name().data(),cd->getOuterScope(),cd->isLinkableInProject(),cd->isEmbeddedInOuterScope(), - // container,cd->partOfGroups() ? cd->partOfGroups()->count() : 0); - - if (!cd->isAnonymous() && - cd->isLinkableInProject() && - cd->isEmbeddedInOuterScope() && - !cd->isAlias() && - (container==0 || cd->partOfGroups()==0) // if container==0 -> show as part of the group docs, otherwise only show if not part of a group - ) + //printf(" showing class %s\n",cd->name().data()); + if (!found) { - //printf(" showing class %s\n",cd->name().data()); - if (!found) - { - ol.writeRuler(); - ol.startGroupHeader(); - ol.parseText(fortranOpt?theTranslator->trTypeDocumentation(): - theTranslator->trClassDocumentation()); - ol.endGroupHeader(); - found=TRUE; - } - cd->writeInlineDocumentation(ol); + ol.writeRuler(); + ol.startGroupHeader(); + ol.parseText(fortranOpt?theTranslator->trTypeDocumentation(): + theTranslator->trClassDocumentation()); + ol.endGroupHeader(); + found=TRUE; + } + ClassDefMutable *cdm = toClassDefMutable(cd); + if (cdm) + { + cdm->writeInlineDocumentation(ol); } } } } -//------------------------------------------- - -void GenericsSDict::insert(const QCString &key,ClassDef *cd) -{ - int i=key.find('<'); - if (i==-1) return; - ArgumentList argList; - stringToArgumentList(SrcLangExt_CSharp, key.mid(i),argList); - int c = argList.size(); - if (c==0) return; - GenericsCollection *collection = m_dict.find(key.left(i)); - if (collection==0) // new name - { - collection = new GenericsCollection; - m_dict.append(key.left(i),collection); - } - if (collection->find(c)==0) // should always be 0! - { - collection->insert(c,cd); - } -} - -ClassDef *GenericsSDict::find(const QCString &key) -{ - int i=key.find('<'); - if (i==-1) - { - GenericsCollection *collection = m_dict.find(key); - if (collection && collection->count()==1) - { - QIntDictIterator<ClassDef> it(*collection); - return it.current(); - } - } - else - { - GenericsCollection *collection = m_dict.find(key.left(i)); - if (collection) - { - ArgumentList argList; - stringToArgumentList(SrcLangExt_CSharp,key.mid(i),argList); - int c = argList.size(); - return collection->find(c); - } - } - return 0; -} - - - |