summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addon/doxywizard/config_doxyw.l1
-rw-r--r--addon/doxywizard/inputstrlist.cpp69
-rw-r--r--src/clangparser.cpp12
-rw-r--r--src/classdef.cpp213
-rw-r--r--src/classdef.h4
-rw-r--r--src/commentcnv.l10
-rw-r--r--src/config.xml25
-rw-r--r--src/configimpl.l2
-rw-r--r--src/context.cpp172
-rw-r--r--src/context.h53
-rw-r--r--src/dirdef.cpp53
-rw-r--r--src/dirdef.h102
-rw-r--r--src/docgroup.cpp41
-rw-r--r--src/dotdirdeps.cpp30
-rw-r--r--src/dotnode.cpp21
-rw-r--r--src/doxygen.cpp473
-rw-r--r--src/doxygen.h4
-rw-r--r--src/filedef.cpp93
-rw-r--r--src/filedef.h3
-rw-r--r--src/groupdef.cpp57
-rw-r--r--src/groupdef.h4
-rw-r--r--src/index.cpp418
-rw-r--r--src/index.h7
-rw-r--r--src/latexdocvisitor.cpp21
-rw-r--r--src/memberdef.cpp15
-rw-r--r--src/membergroup.h30
-rw-r--r--src/memberlist.cpp174
-rw-r--r--src/memberlist.h9
-rw-r--r--src/namespacedef.cpp72
-rw-r--r--src/namespacedef.h4
-rw-r--r--src/perlmodgen.cpp69
-rw-r--r--src/searchindex.cpp648
-rw-r--r--src/searchindex.h76
-rw-r--r--src/sortdict.h362
-rw-r--r--src/sqlite3gen.cpp42
-rw-r--r--src/util.cpp92
-rw-r--r--src/util.h29
-rw-r--r--src/vhdldocgen.cpp128
-rw-r--r--src/xmlgen.cpp42
-rw-r--r--templates/html/search.css2
40 files changed, 1486 insertions, 2196 deletions
diff --git a/addon/doxywizard/config_doxyw.l b/addon/doxywizard/config_doxyw.l
index 6b487ee..b93a79d 100644
--- a/addon/doxywizard/config_doxyw.l
+++ b/addon/doxywizard/config_doxyw.l
@@ -729,6 +729,7 @@ void writeStringValue(QTextStream &t,QTextCodec *codec,const QString &s)
while (!(c=*p++).isNull() && !needsEscaping)
{
needsEscaping = (c==QChar::fromLatin1(' ') ||
+ c==QChar::fromLatin1(',') ||
c==QChar::fromLatin1('\n') ||
c==QChar::fromLatin1('\t') ||
c==QChar::fromLatin1('"'));
diff --git a/addon/doxywizard/inputstrlist.cpp b/addon/doxywizard/inputstrlist.cpp
index fae45b5..cdc7d14 100644
--- a/addon/doxywizard/inputstrlist.cpp
+++ b/addon/doxywizard/inputstrlist.cpp
@@ -258,48 +258,57 @@ void InputStrList::writeValue(QTextStream &t,QTextCodec *codec)
}
}
-#include <QMessageBox>
bool InputStrList::isDefault()
{
- bool isEq = m_strList==m_default;
+ if (m_strList==m_default) return true;
- if (!isEq)
+ auto it1 = m_strList.begin();
+ auto it2 = m_default.begin();
+ while (it1!=m_strList.end() && (*it1).isEmpty())
{
- isEq = true;
+ ++it1;
+ }
+ while (it2!=m_default.end() && (*it2).isEmpty())
+ {
+ ++it2;
+ }
+ // both lists are empty
+ if (it1==m_strList.end() && it2==m_default.end()) return true;
- auto it1 = m_strList.begin();
- auto it2 = m_default.begin();
- while (it1!=m_strList.end() && it2!=m_default.end())
+ // one list is empty but the other is not
+ if (it1==m_default.end()) return false;
+ if (it2==m_strList.end()) return false;
+
+ it1 = m_strList.begin();
+ it2 = m_default.begin();
+ while (it1!=m_strList.end() && it2!=m_default.end())
+ {
+ // skip over empty values
+ while (it1!=m_strList.end() && (*it1).isEmpty())
{
- // skip over empty values
- while (it1!=m_strList.end() && (*it1).isEmpty())
- {
++it1;
- }
- while (it2!=m_default.end() && (*it2).isEmpty())
- {
- ++it2;
- }
- if ((it1!=m_strList.end()) && (it2!=m_default.end()))
- {
- if ((*it1).trimmed()!= (*it2).trimmed()) // difference so not the default
- {
- isEq=false;
- break;
- }
- ++it1;
- ++it2;
- }
- else if ((it1!=m_strList.end()) || (it2!=m_default.end()))
+ }
+ while (it2!=m_default.end() && (*it2).isEmpty())
+ {
+ ++it2;
+ }
+ if ((it1!=m_strList.end()) && (it2!=m_default.end()))
+ {
+ if ((*it1).trimmed()!= (*it2).trimmed()) // difference so not the default
{
- // one list empty so cannot be the default
- isEq=false;
- break;
+ return false;
}
+ ++it1;
+ ++it2;
+ }
+ else if ((it1!=m_strList.end()) || (it2!=m_default.end()))
+ {
+ // one list empty so cannot be the default
+ return false;
}
}
- return isEq;
+ return true;
}
bool InputStrList::isEmpty()
diff --git a/src/clangparser.cpp b/src/clangparser.cpp
index 934da31..2593d27 100644
--- a/src/clangparser.cpp
+++ b/src/clangparser.cpp
@@ -163,6 +163,7 @@ void ClangTUParser::parse()
//printf("ClangTUParser::ClangTUParser(fileName=%s,#filesInSameTU=%d)\n",
// qPrint(fileName),(int)p->filesInSameTU.size());
bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING);
+ bool clangIncludeInputPaths = Config_getBool(CLANG_INCLUDE_INPUT_PATHS);
bool filterSourceFiles = Config_getBool(FILTER_SOURCE_FILES);
const StringVector &includePath = Config_getList(INCLUDE_PATH);
const StringVector &clangOptions = Config_getList(CLANG_OPTIONS);
@@ -211,11 +212,14 @@ void ClangTUParser::parse()
else
{
// add include paths for input files
- for (const std::string &path : Doxygen::inputPaths)
+ if (clangIncludeInputPaths)
{
- QCString inc = QCString("-I")+path.data();
- argv[argc++]=qstrdup(inc.data());
- //printf("argv[%d]=%s\n",argc,argv[argc]);
+ for (const std::string &path : Doxygen::inputPaths)
+ {
+ QCString inc = QCString("-I")+path.data();
+ argv[argc++]=qstrdup(inc.data());
+ //printf("argv[%d]=%s\n",argc,argv[argc]);
+ }
}
// add external include paths
for (size_t i=0;i<includePath.size();i++)
diff --git a/src/classdef.cpp b/src/classdef.cpp
index b3eb353..4492f3e 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -223,7 +223,7 @@ class ClassDefImpl : public DefinitionMixin<ClassDefMutable>
virtual QCString className() const;
virtual MemberList *getMemberList(MemberListType lt) const;
virtual const QList<MemberList> &getMemberLists() const;
- virtual MemberGroupSDict *getMemberGroupSDict() const;
+ virtual const MemberGroupList &getMemberGroups() const;
virtual QDict<int> *getTemplateBaseClassNames() const;
virtual ClassDef *getVariableInstance(const char *templSpec) const;
virtual bool isUsedOnly() const;
@@ -495,8 +495,8 @@ class ClassDefAliasImpl : public DefinitionAliasMixin<ClassDef>
{ return getCdAlias()->getMemberList(lt); }
virtual const QList<MemberList> &getMemberLists() const
{ return getCdAlias()->getMemberLists(); }
- virtual MemberGroupSDict *getMemberGroupSDict() const
- { return getCdAlias()->getMemberGroupSDict(); }
+ virtual const MemberGroupList &getMemberGroups() const
+ { return getCdAlias()->getMemberGroups(); }
virtual QDict<int> *getTemplateBaseClassNames() const
{ return getCdAlias()->getTemplateBaseClassNames(); }
virtual ClassDef *getVariableInstance(const char *templSpec) const
@@ -677,7 +677,7 @@ class ClassDefImpl::IMPL
QList<MemberList> memberLists;
/* user defined member groups */
- MemberGroupSDict *memberGroupSDict = 0;
+ MemberGroupList memberGroups;
/*! Is this an abstract class? */
bool isAbstract = false;
@@ -741,7 +741,6 @@ void ClassDefImpl::IMPL::init(const char *defFileName, const char *name,
usedByImplClassDict=0;
usesIntfClassDict=0;
constraintClassDict=0;
- memberGroupSDict = 0;
subGrouping=Config_getBool(SUBGROUPING);
templateInstances = 0;
variableInstances = 0;
@@ -787,7 +786,6 @@ ClassDefImpl::IMPL::~IMPL()
delete usesIntfClassDict;
delete constraintClassDict;
delete incInfo;
- delete memberGroupSDict;
delete templateInstances;
delete variableInstances;
delete templBaseClassNames;
@@ -861,22 +859,17 @@ void ClassDefImpl::addMembersToMemberGroup()
{
if ((ml->listType()&MemberListType_detailedLists)==0)
{
- ::addMembersToMemberGroup(ml,&m_impl->memberGroupSDict,this);
+ ::addMembersToMemberGroup(ml,&m_impl->memberGroups,this);
}
}
// add members inside sections to their groups
- if (m_impl->memberGroupSDict)
+ for (const auto &mg : m_impl->memberGroups)
{
- MemberGroupSDict::Iterator mgli(*m_impl->memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
+ if (mg->allMembersInSameSection() && m_impl->subGrouping)
{
- if (mg->allMembersInSameSection() && m_impl->subGrouping)
- {
- //printf("addToDeclarationSection(%s)\n",mg->header().data());
- mg->addToDeclarationSection();
- }
+ //printf("addToDeclarationSection(%s)\n",mg->header().data());
+ mg->addToDeclarationSection();
}
}
}
@@ -1194,27 +1187,17 @@ void ClassDefImpl::computeAnchors()
}
}
- if (m_impl->memberGroupSDict)
+ for (const auto &mg : m_impl->memberGroups)
{
- MemberGroupSDict::Iterator mgli(*m_impl->memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->setAnchors();
- }
+ mg->setAnchors();
}
}
void ClassDefImpl::distributeMemberGroupDocumentation()
{
- if (m_impl->memberGroupSDict)
+ for (const auto &mg : m_impl->memberGroups)
{
- MemberGroupSDict::Iterator mgli(*m_impl->memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->distributeMemberGroupDocumentation();
- }
+ mg->distributeMemberGroupDocumentation();
}
}
@@ -1222,14 +1205,9 @@ void ClassDefImpl::findSectionsInDocumentation()
{
docFindSections(briefDescription(),this,docFile());
docFindSections(documentation(),this,docFile());
- if (m_impl->memberGroupSDict)
+ for (const auto &mg : m_impl->memberGroups)
{
- MemberGroupSDict::Iterator mgli(*m_impl->memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->findSectionsInDocumentation(this);
- }
+ mg->findSectionsInDocumentation(this);
}
QListIterator<MemberList> mli(m_impl->memberLists);
MemberList *ml;
@@ -2004,22 +1982,16 @@ void ClassDefImpl::writeIncludeFiles(OutputList &ol) const
void ClassDefImpl::writeMemberGroups(OutputList &ol,bool showInline) const
{
// write user defined member groups
- if (m_impl->memberGroupSDict)
+ for (const auto &mg : m_impl->memberGroups)
{
- m_impl->memberGroupSDict->sort();
- MemberGroupSDict::Iterator mgli(*m_impl->memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
+ if (!mg->allMembersInSameSection() || !m_impl->subGrouping) // group is in its own section
{
- if (!mg->allMembersInSameSection() || !m_impl->subGrouping) // group is in its own section
- {
- mg->writeDeclarations(ol,this,0,0,0,showInline);
- }
- else // add this group to the corresponding member section
- {
- //printf("addToDeclarationSection(%s)\n",mg->header().data());
- //mg->addToDeclarationSection();
- }
+ mg->writeDeclarations(ol,this,0,0,0,showInline);
+ }
+ else // add this group to the corresponding member section
+ {
+ //printf("addToDeclarationSection(%s)\n",mg->header().data());
+ //mg->addToDeclarationSection();
}
}
}
@@ -2230,14 +2202,9 @@ void ClassDefImpl::writeTagFile(FTextStream &tagFile)
break;
case LayoutDocEntry::MemberGroups:
{
- if (m_impl->memberGroupSDict)
+ for (const auto &mg : m_impl->memberGroups)
{
- MemberGroupSDict::Iterator mgli(*m_impl->memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->writeTagFile(tagFile);
- }
+ mg->writeTagFile(tagFile);
}
}
break;
@@ -3218,11 +3185,13 @@ void ClassDefImpl::addTypeConstraint(const QCString &typeConstraint,const QCStri
getDefColumn(),
typeConstraint,
ClassDef::Class))));
-
- cd->setUsedOnly(TRUE);
- cd->setLanguage(getLanguage());
- //printf("Adding undocumented constraint '%s' to class %s on type %s\n",
- // typeConstraint.data(),name().data(),type.data());
+ if (cd)
+ {
+ cd->setUsedOnly(TRUE);
+ cd->setLanguage(getLanguage());
+ //printf("Adding undocumented constraint '%s' to class %s on type %s\n",
+ // typeConstraint.data(),name().data(),type.data());
+ }
}
if (cd)
{
@@ -3340,15 +3309,10 @@ void ClassDefImpl::writeDeclaration(OutputList &ol,const MemberDef *md,bool inGr
ol.endMemberItem();
// write user defined member groups
- if (m_impl->memberGroupSDict)
+ for (const auto &mg : m_impl->memberGroups)
{
- MemberGroupSDict::Iterator mgli(*m_impl->memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->setInGroup(inGroup);
- mg->writePlainDeclarations(ol,this,0,0,0,inheritedFrom,inheritId);
- }
+ mg->setInGroup(inGroup);
+ mg->writePlainDeclarations(ol,this,0,0,0,inheritedFrom,inheritId);
}
QListIterator<LayoutDocEntry> eli(
@@ -4035,34 +3999,38 @@ ClassDef *ClassDefImpl::insertTemplateInstance(const QCString &fileName,
QCString tcname = removeRedundantWhiteSpace(localName()+templSpec);
Debug::print(Debug::Classes,0," New template instance class '%s''%s' inside '%s' hidden=%d\n",qPrint(name()),qPrint(templSpec),qPrint(name()),isHidden());
- templateClass = toClassDefMutable(Doxygen::classLinkedMap->find(tcname));
- if (templateClass==0)
+ ClassDef *foundCd = Doxygen::classLinkedMap->find(tcname);
+ if (foundCd)
{
- templateClass =
+ return foundCd;
+ }
+ templateClass =
+ toClassDefMutable(
+ Doxygen::classLinkedMap->add(tcname,
+ std::unique_ptr<ClassDef>(
+ new ClassDefImpl(fileName,startLine,startColumn,tcname,ClassDef::Class))));
+ templateClass->setTemplateMaster(this);
+ templateClass->setOuterScope(getOuterScope());
+ templateClass->setHidden(isHidden());
+ m_impl->templateInstances->insert(templSpec,templateClass);
+
+ // also add nested classes
+ for (const auto &innerCd : m_impl->innerClasses)
+ {
+ QCString innerName = tcname+"::"+innerCd->localName();
+ ClassDefMutable *innerClass =
toClassDefMutable(
- Doxygen::classLinkedMap->add(tcname,
+ Doxygen::classLinkedMap->add(innerName,
std::unique_ptr<ClassDef>(
- new ClassDefImpl(fileName,startLine,startColumn,tcname,ClassDef::Class))));
- templateClass->setTemplateMaster(this);
- templateClass->setOuterScope(getOuterScope());
- templateClass->setHidden(isHidden());
- m_impl->templateInstances->insert(templSpec,templateClass);
-
- // also add nested classes
- for (const auto &innerCd : m_impl->innerClasses)
+ new ClassDefImpl(fileName,startLine,startColumn,innerName,ClassDef::Class))));
+ if (innerClass)
{
- QCString innerName = tcname+"::"+innerCd->localName();
- ClassDefMutable *innerClass =
- toClassDefMutable(
- Doxygen::classLinkedMap->add(innerName,
- std::unique_ptr<ClassDef>(
- new ClassDefImpl(fileName,startLine,startColumn,innerName,ClassDef::Class))));
templateClass->addInnerCompound(innerClass);
innerClass->setOuterScope(templateClass);
innerClass->setHidden(isHidden());
}
- freshInstance=TRUE;
}
+ freshInstance=TRUE;
}
return templateClass;
}
@@ -4232,14 +4200,9 @@ void ClassDefImpl::addListReferences()
this
);
}
- if (m_impl->memberGroupSDict)
+ for (const auto &mg : m_impl->memberGroups)
{
- MemberGroupSDict::Iterator mgli(*m_impl->memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->addListReferences(this);
- }
+ mg->addListReferences(this);
}
QListIterator<MemberList> mli(m_impl->memberLists);
MemberList *ml;
@@ -4371,11 +4334,9 @@ int ClassDefImpl::countMemberDeclarations(MemberListType lt,const ClassDef *inhe
//printf("-> ml2=%d\n",ml2->numDecMembers());
}
// also include grouped members that have their own section in the class (see bug 722759)
- if (inheritedFrom && m_impl->memberGroupSDict)
+ if (inheritedFrom)
{
- MemberGroupSDict::Iterator mgli(*m_impl->memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
+ for (const auto &mg : m_impl->memberGroups)
{
count+=mg->countGroupedInheritedMembers(lt);
if (lt2!=1) count+=mg->countGroupedInheritedMembers((MemberListType)lt2);
@@ -4409,14 +4370,9 @@ void ClassDefImpl::setAnonymousEnumType()
}
else if (lde->kind()==LayoutDocEntry::MemberGroups)
{
- if (m_impl->memberGroupSDict)
+ for (const auto &mg : m_impl->memberGroups)
{
- MemberGroupSDict::Iterator mgli(*m_impl->memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->setAnonymousEnumType();
- }
+ mg->setAnonymousEnumType();
}
}
}
@@ -4431,15 +4387,10 @@ void ClassDefImpl::countMembers()
ml->countDecMembers();
ml->countDocMembers();
}
- if (m_impl->memberGroupSDict)
+ for (const auto &mg : m_impl->memberGroups)
{
- MemberGroupSDict::Iterator mgli(*m_impl->memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->countDecMembers();
- mg->countDocMembers();
- }
+ mg->countDecMembers();
+ mg->countDocMembers();
}
}
@@ -4557,18 +4508,13 @@ int ClassDefImpl::countMembersIncludingGrouped(MemberListType lt,
count=ml->countInheritableMembers(inheritedFrom);
}
//printf("%s:countMembersIncludingGrouped: count=%d\n",name().data(),count);
- if (m_impl->memberGroupSDict)
+ for (const auto &mg : m_impl->memberGroups)
{
- MemberGroupSDict::Iterator mgli(*m_impl->memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
+ bool hasOwnSection = !mg->allMembersInSameSection() ||
+ !m_impl->subGrouping; // group is in its own section
+ if ((additional && hasOwnSection) || (!additional && !hasOwnSection))
{
- bool hasOwnSection = !mg->allMembersInSameSection() ||
- !m_impl->subGrouping; // group is in its own section
- if ((additional && hasOwnSection) || (!additional && !hasOwnSection))
- {
- count+=mg->countGroupedInheritedMembers(lt);
- }
+ count+=mg->countGroupedInheritedMembers(lt);
}
}
//printf("%s:countMembersIncludingGrouped(lt=%d,%s)=%d\n",
@@ -4673,16 +4619,11 @@ void ClassDefImpl::addGroupedInheritedMembers(OutputList &ol,MemberListType lt,
const ClassDef *inheritedFrom,const QCString &inheritId) const
{
//printf("** %s::addGroupedInheritedMembers(%p) inheritId=%s\n",name().data(),m_impl->memberGroupSDict,inheritId.data());
- if (m_impl->memberGroupSDict)
+ for (const auto &mg : m_impl->memberGroups)
{
- MemberGroupSDict::Iterator mgli(*m_impl->memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
+ if (!mg->allMembersInSameSection() || !m_impl->subGrouping) // group is in its own section
{
- if (!mg->allMembersInSameSection() || !m_impl->subGrouping) // group is in its own section
- {
- mg->addGroupedInheritedMembers(ol,this,lt,inheritedFrom,inheritId);
- }
+ mg->addGroupedInheritedMembers(ol,this,lt,inheritedFrom,inheritId);
}
}
}
@@ -4884,9 +4825,9 @@ const QList<MemberList> &ClassDefImpl::getMemberLists() const
return m_impl->memberLists;
}
-MemberGroupSDict *ClassDefImpl::getMemberGroupSDict() const
+const MemberGroupList &ClassDefImpl::getMemberGroups() const
{
- return m_impl->memberGroupSDict;
+ return m_impl->memberGroups;
}
void ClassDefImpl::setNamespace(NamespaceDef *nd)
diff --git a/src/classdef.h b/src/classdef.h
index 217002d..408c8d2 100644
--- a/src/classdef.h
+++ b/src/classdef.h
@@ -28,6 +28,7 @@
#include "containers.h"
#include "definition.h"
#include "arguments.h"
+#include "membergroup.h"
struct Argument;
class MemberDef;
@@ -45,7 +46,6 @@ class ExampleSDict;
class MemberNameInfoLinkedMap;
class UsesClassDict;
class ConstraintClassDict;
-class MemberGroupSDict;
class QTextStream;
class PackageDef;
class GroupDef;
@@ -321,7 +321,7 @@ class ClassDef : public Definition
virtual const QList<MemberList> &getMemberLists() const = 0;
/** Returns the member groups defined for this class */
- virtual MemberGroupSDict *getMemberGroupSDict() const = 0;
+ virtual const MemberGroupList &getMemberGroups() const = 0;
virtual QDict<int> *getTemplateBaseClassNames() const = 0;
diff --git a/src/commentcnv.l b/src/commentcnv.l
index aaa4bad..b5f8e41 100644
--- a/src/commentcnv.l
+++ b/src/commentcnv.l
@@ -348,6 +348,16 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
yyextra->commentStack.push(new CommentCtx(yyextra->lineNr));
}
}
+<Scan>"--"[^!][^\n]* {
+ if (yyextra->lang!=SrcLangExt_VHDL)
+ {
+ REJECT;
+ }
+ else
+ {
+ copyToOutput(yyscanner,yytext,(int)yyleng);
+ }
+ }
<Scan>"--!" {
if (yyextra->lang!=SrcLangExt_VHDL)
{
diff --git a/src/config.xml b/src/config.xml
index 3f0d406..811a3db 100644
--- a/src/config.xml
+++ b/src/config.xml
@@ -982,14 +982,14 @@ Go to the <a href="commands.html">next</a> section or return to the
<docs>
<![CDATA[
With the correct setting of option \c CASE_SENSE_NAMES doxygen will better be able to match the
- capabilities of the underlying filesystem.
+ capabilities of the underlying filesystem.
- In case the filesystem is case sensitive (i.e. it supports files in the same directory
+ In case the filesystem is case sensitive (i.e. it supports files in the same directory
whose names only differ in casing), the option must be set to \c YES to properly deal with such files
- in case they appear in the input.
-
- For filesystems that are not case sensitive the option should be be set to \c NO to properly
- deal with output files written for symbols that only differ in casing, such as for two classes,
+ in case they appear in the input.
+
+ For filesystems that are not case sensitive the option should be be set to \c NO to properly
+ deal with output files written for symbols that only differ in casing, such as for two classes,
one named \c CLASS and the other named \c Class, and to also support references to files without
having to specify the exact matching casing.
@@ -1740,6 +1740,15 @@ to disable this feature.
]]>
</docs>
</option>
+ <option type='bool' id='CLANG_INCLUDE_INPUT_PATHS' setting='USE_LIBCLANG' defval='1'>
+ <docs>
+<![CDATA[
+ If clang assisted parsing is enabled and the \c CLANG_INCLUDE_INPUT_PATHS tag
+ is set to \c YES then doxygen will add the directory of each input to the
+ include path.
+]]>
+ </docs>
+ </option>
<option type='list' id='CLANG_OPTIONS' format='string' setting='USE_LIBCLANG' depends='CLANG_ASSISTED_PARSING'>
<docs>
<![CDATA[
@@ -2429,7 +2438,7 @@ The \c DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
<option type='string' id='FORMULA_MACROFILE' format='file' defval=''>
<docs>
<![CDATA[
- The \c FORMULA_MACROFILE can contain \f$\mbox{\LaTeX}\f$ `\newcommand` and
+ The \c FORMULA_MACROFILE can contain \f$\mbox{\LaTeX}\f$ `\newcommand` and
`\renewcommand` commands to create new \f$\mbox{\LaTeX}\f$ commands to be used
in formulas as building blocks.
See the section \ref formulas for details.
@@ -2863,7 +2872,7 @@ or
<option type='string' id='LATEX_EMOJI_DIRECTORY' format='dir' defval='' depends='GENERATE_LATEX'>
<docs>
<![CDATA[
- The \c LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
+ The \c LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
path from which the emoji images will be read.
If a relative path is entered, it will be relative to the \ref cfg_latex_output "LATEX_OUTPUT"
directory. If left blank the \ref cfg_latex_output "LATEX_OUTPUT" directory will be used.
diff --git a/src/configimpl.l b/src/configimpl.l
index e2ef8eb..17e56b3 100644
--- a/src/configimpl.l
+++ b/src/configimpl.l
@@ -153,7 +153,7 @@ void ConfigOption::writeStringValue(FTextStream &t,const QCString &s)
{
t << " ";
while ((c=*p++)!=0 && !needsEscaping)
- needsEscaping = (c==' ' || c=='\n' || c=='\t' || c=='"' || c=='#');
+ needsEscaping = (c==' ' || c== ',' || c=='\n' || c=='\t' || c=='"' || c=='#');
if (needsEscaping)
{
t << "\"";
diff --git a/src/context.cpp b/src/context.cpp
index b7a547f..58a297a 100644
--- a/src/context.cpp
+++ b/src/context.cpp
@@ -2500,9 +2500,9 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
Cachable &cache = getCache();
if (!cache.memberGroups)
{
- if (m_classDef->getMemberGroupSDict())
+ if (!m_classDef->getMemberGroups().empty())
{
- cache.memberGroups.reset(MemberGroupListContext::alloc(m_classDef,relPathAsString(),m_classDef->getMemberGroupSDict(),m_classDef->subGrouping()));
+ cache.memberGroups.reset(MemberGroupListContext::alloc(m_classDef,relPathAsString(),m_classDef->getMemberGroups(),m_classDef->subGrouping()));
}
else
{
@@ -2848,9 +2848,9 @@ class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Pri
Cachable &cache = getCache();
if (!cache.memberGroups)
{
- if (m_namespaceDef->getMemberGroupSDict())
+ if (!m_namespaceDef->getMemberGroups().empty())
{
- cache.memberGroups.reset(MemberGroupListContext::alloc(m_namespaceDef,relPathAsString(),m_namespaceDef->getMemberGroupSDict(),m_namespaceDef->subGrouping()));
+ cache.memberGroups.reset(MemberGroupListContext::alloc(m_namespaceDef,relPathAsString(),m_namespaceDef->getMemberGroups(),m_namespaceDef->subGrouping()));
}
else
{
@@ -3291,9 +3291,9 @@ class FileContext::Private : public DefinitionContext<FileContext::Private>
Cachable &cache = getCache();
if (!cache.memberGroups)
{
- if (m_fileDef->getMemberGroupSDict())
+ if (!m_fileDef->getMemberGroups().empty())
{
- cache.memberGroups.reset(MemberGroupListContext::alloc(m_fileDef,relPathAsString(),m_fileDef->getMemberGroupSDict(),m_fileDef->subGrouping()));
+ cache.memberGroups.reset(MemberGroupListContext::alloc(m_fileDef,relPathAsString(),m_fileDef->getMemberGroups(),m_fileDef->subGrouping()));
}
else
{
@@ -5588,9 +5588,9 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private>
Cachable &cache = getCache();
if (!cache.memberGroups)
{
- if (m_groupDef->getMemberGroupSDict())
+ if (!m_groupDef->getMemberGroups().empty())
{
- cache.memberGroups.reset(MemberGroupListContext::alloc(m_groupDef,relPathAsString(),m_groupDef->getMemberGroupSDict(),m_groupDef->subGrouping()));
+ cache.memberGroups.reset(MemberGroupListContext::alloc(m_groupDef,relPathAsString(),m_groupDef->getMemberGroups(),m_groupDef->subGrouping()));
}
else
{
@@ -8818,7 +8818,7 @@ class MemberGroupInfoContext::Private
{
if (!m_cache.memberGroups)
{
- m_cache.memberGroups.reset(MemberGroupListContext::alloc(m_def,m_relPath,0));
+ m_cache.memberGroups.reset(MemberGroupListContext::alloc());
}
return m_cache.memberGroups.get();
}
@@ -8895,33 +8895,23 @@ MemberGroupListContext::MemberGroupListContext() : RefCountedContext("MemberGrou
p = new Private;
}
-MemberGroupListContext::MemberGroupListContext(const Definition *def,const QCString &relPath,const MemberGroupList *list) : RefCountedContext("MemberGroupListContext")
+MemberGroupListContext::MemberGroupListContext(const Definition *def,const QCString &relPath,const MemberGroupRefList &list) : RefCountedContext("MemberGroupListContext")
{
p = new Private;
- if (list)
+ for (const auto &mg : list)
{
- MemberGroupListIterator mgli(*list);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- p->addMemberGroup(def,relPath,mg);
- }
+ p->addMemberGroup(def,relPath,mg);
}
}
-MemberGroupListContext::MemberGroupListContext(const Definition *def,const QCString &relPath,const MemberGroupSDict *dict,bool subGrouping) : RefCountedContext("MemberGroupListContext")
+MemberGroupListContext::MemberGroupListContext(const Definition *def,const QCString &relPath,const MemberGroupList &list,bool subGrouping) : RefCountedContext("MemberGroupListContext")
{
p = new Private;
- if (dict)
+ for (const auto &mg : list)
{
- MemberGroupSDict::Iterator di(*dict);
- const MemberGroup *mg;
- for (di.toFirst();(mg=di.current());++di)
+ if (!mg->allMembersInSameSection() || !subGrouping)
{
- if (!mg->allMembersInSameSection() || !subGrouping)
- {
- p->addMemberGroup(def,relPath,mg);
- }
+ p->addMemberGroup(def,relPath,mg.get());
}
}
}
@@ -9180,38 +9170,30 @@ class InheritedMemberInfoListContext::Private : public GenericNodeListContext
if (ml)
{
addMemberList(inheritedFrom,ml,combinedList);
- if (ml->getMemberGroupList())
+ for (const auto *mg : ml->getMemberGroupList())
{
- MemberGroupListIterator mgli(*ml->getMemberGroupList());
- MemberGroup *mg;
- for (mgli.toFirst();(mg=mgli.current());++mgli)
- {
- addMemberList(inheritedFrom,mg->members(),combinedList);
- }
+ addMemberList(inheritedFrom,mg->members(),combinedList);
}
}
}
void addMemberGroupsOfClass(const ClassDef *inheritedFrom,
const ClassDef *cd,MemberListType lt,MemberList *combinedList)
{
- if (cd->getMemberGroupSDict())
+ // TODO: why this there no addMemberGroupsOfNamespace, addMembersGroupsOfFile,
+ // addMemberGroupsOfGroup?
+ for (const auto &mg: cd->getMemberGroups())
{
- MemberGroupSDict::Iterator mgli(*cd->getMemberGroupSDict());
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
+ if (mg->members() && (!mg->allMembersInSameSection() || !cd->subGrouping())) // group is in its own section
{
- if (mg->members() && (!mg->allMembersInSameSection() || !cd->subGrouping())) // group is in its own section
+ MemberListIterator li(*mg->members());
+ MemberDef *md;
+ for (li.toFirst();(md=li.current());++li)
{
- MemberListIterator li(*mg->members());
- MemberDef *md;
- for (li.toFirst();(md=li.current());++li)
+ if (lt==md->getSectionList(mg->container())->listType() &&
+ !md->isReimplementedBy(inheritedFrom) &&
+ md->isBriefSectionVisible())
{
- if (lt==md->getSectionList(mg->container())->listType() &&
- !md->isReimplementedBy(inheritedFrom) &&
- md->isBriefSectionVisible())
- {
- combinedList->append(md);
- }
+ combinedList->append(md);
}
}
}
@@ -9610,25 +9592,26 @@ TemplateVariant SymbolContext::get(const char *name) const
class SymbolListContext::Private : public GenericNodeListContext
{
public:
- Private(const SearchDefinitionList *sdl)
+ Private(const SearchIndexList::const_iterator &start,
+ const SearchIndexList::const_iterator &end)
{
- QListIterator<Definition> li(*sdl);
- const Definition *def;
const Definition *prev = 0;
- for (li.toFirst();(def=li.current());)
+ for (auto it = start; it!=end;)
{
- ++li;
- const Definition *next = li.current();
+ const Definition *def = *it;
+ ++it;
+ const Definition *next = it!=end ? *it : 0;
append(SymbolContext::alloc(def,prev,next));
prev = def;
}
}
};
-SymbolListContext::SymbolListContext(const SearchDefinitionList *sdl)
+SymbolListContext::SymbolListContext(const SearchIndexList::const_iterator &start,
+ const SearchIndexList::const_iterator &end)
: RefCountedContext("SymbolListContext")
{
- p = new Private(sdl);
+ p = new Private(start,end);
}
SymbolListContext::~SymbolListContext()
@@ -9659,7 +9642,8 @@ TemplateListIntf::ConstIterator *SymbolListContext::createIterator() const
class SymbolGroupContext::Private
{
public:
- Private(const SearchDefinitionList *sdl) : m_sdl(sdl)
+ Private(const SearchIndexList::const_iterator &start,
+ const SearchIndexList::const_iterator &end) : m_start(start), m_end(end)
{
static bool init=FALSE;
if (!init)
@@ -9676,22 +9660,23 @@ class SymbolGroupContext::Private
}
TemplateVariant id() const
{
- return m_sdl->id();
+ return searchId(*m_start);
}
TemplateVariant name() const
{
- return m_sdl->name();
+ return searchName(*m_start);
}
TemplateVariant symbolList() const
{
if (!m_cache.symbolList)
{
- m_cache.symbolList.reset(SymbolListContext::alloc(m_sdl));
+ m_cache.symbolList.reset(SymbolListContext::alloc(m_start,m_end));
}
return m_cache.symbolList.get();
}
private:
- const SearchDefinitionList *m_sdl;
+ SearchIndexList::const_iterator m_start;
+ SearchIndexList::const_iterator m_end;
struct Cachable
{
SharedPtr<SymbolListContext> symbolList;
@@ -9703,10 +9688,11 @@ class SymbolGroupContext::Private
PropertyMapper<SymbolGroupContext::Private> SymbolGroupContext::Private::s_inst;
-SymbolGroupContext::SymbolGroupContext(const SearchDefinitionList *sdl)
+SymbolGroupContext::SymbolGroupContext(const SearchIndexList::const_iterator &start,
+ const SearchIndexList::const_iterator &end)
: RefCountedContext("SymbolGroupContext")
{
- p = new Private(sdl);
+ p = new Private(start,end);
}
SymbolGroupContext::~SymbolGroupContext()
@@ -9725,18 +9711,30 @@ TemplateVariant SymbolGroupContext::get(const char *name) const
class SymbolGroupListContext::Private : public GenericNodeListContext
{
public:
- Private(const SearchIndexList *sil)
+ Private(const SearchIndexList &sil)
{
- SDict<SearchDefinitionList>::Iterator li(*sil);
- SearchDefinitionList *dl;
- for (li.toFirst();(dl=li.current());++li)
+ QCString lastName;
+ auto it = sil.begin();
+ auto it_begin = it;
+ while (it!=sil.end())
+ {
+ QCString name = searchName(*it);
+ if (name!=lastName)
+ {
+ append(SymbolGroupContext::alloc(it_begin,it));
+ it_begin = it;
+ lastName = name;
+ }
+ ++it;
+ }
+ if (it_begin!=sil.end())
{
- append(SymbolGroupContext::alloc(dl));
+ append(SymbolGroupContext::alloc(it_begin,sil.end()));
}
}
};
-SymbolGroupListContext::SymbolGroupListContext(const SearchIndexList *sil)
+SymbolGroupListContext::SymbolGroupListContext(const SearchIndexList &sil)
: RefCountedContext("SymbolGroupListContext")
{
p = new Private(sil);
@@ -9770,7 +9768,9 @@ TemplateListIntf::ConstIterator *SymbolGroupListContext::createIterator() const
class SymbolIndexContext::Private
{
public:
- Private(const SearchIndexList *sl,const QCString &name) : m_searchList(sl), m_name(name)
+ Private(const std::string &letter,
+ const SearchIndexList &sl,
+ const QCString &name) : m_letter(letter), m_searchList(sl), m_name(name)
{
static bool init=FALSE;
if (!init)
@@ -9791,7 +9791,7 @@ class SymbolIndexContext::Private
}
TemplateVariant letter() const
{
- return QString(QChar(m_searchList->letter())).utf8();
+ return m_letter;
}
TemplateVariant symbolGroups() const
{
@@ -9802,7 +9802,8 @@ class SymbolIndexContext::Private
return m_cache.symbolGroups.get();
}
private:
- const SearchIndexList *m_searchList;
+ QCString m_letter;
+ const SearchIndexList &m_searchList;
QCString m_name;
struct Cachable
{
@@ -9815,10 +9816,10 @@ class SymbolIndexContext::Private
PropertyMapper<SymbolIndexContext::Private> SymbolIndexContext::Private::s_inst;
-SymbolIndexContext::SymbolIndexContext(const SearchIndexList *sl,const QCString &name)
+SymbolIndexContext::SymbolIndexContext(const std::string &letter,const SearchIndexList &sl,const QCString &name)
: RefCountedContext("SymbolIndexContext")
{
- p = new Private(sl,name);
+ p = new Private(letter,sl,name);
}
SymbolIndexContext::~SymbolIndexContext()
@@ -9837,19 +9838,17 @@ TemplateVariant SymbolIndexContext::get(const char *name) const
class SymbolIndicesContext::Private : public GenericNodeListContext
{
public:
- Private(const SearchIndexInfo *info)
+ Private(const SearchIndexInfo &info)
{
// use info->symbolList to populate the list
- SIntDict<SearchIndexList>::Iterator it(info->symbolList);
- const SearchIndexList *sl;
- for (it.toFirst();(sl=it.current());++it) // for each letter
+ for (const auto &kv : info.symbolMap)
{
- append(SymbolIndexContext::alloc(sl,info->name));
+ append(SymbolIndexContext::alloc(kv.first,kv.second,info.name));
}
}
};
-SymbolIndicesContext::SymbolIndicesContext(const SearchIndexInfo *info) : RefCountedContext("SymbolIndicesContext")
+SymbolIndicesContext::SymbolIndicesContext(const SearchIndexInfo &info) : RefCountedContext("SymbolIndicesContext")
{
p = new Private(info);
}
@@ -9882,7 +9881,7 @@ TemplateListIntf::ConstIterator *SymbolIndicesContext::createIterator() const
class SearchIndexContext::Private
{
public:
- Private(const SearchIndexInfo *info) : m_info(info)
+ Private(const SearchIndexInfo &info) : m_info(info)
{
static bool init=FALSE;
if (!init)
@@ -9899,11 +9898,11 @@ class SearchIndexContext::Private
}
TemplateVariant name() const
{
- return m_info->name;
+ return m_info.name;
}
TemplateVariant text() const
{
- return m_info->text;
+ return m_info.getText();
}
TemplateVariant symbolIndices() const
{
@@ -9914,7 +9913,7 @@ class SearchIndexContext::Private
return m_cache.symbolIndices.get();
}
private:
- const SearchIndexInfo *m_info;
+ const SearchIndexInfo &m_info;
struct Cachable
{
SharedPtr<SymbolIndicesContext> symbolIndices;
@@ -9926,7 +9925,7 @@ class SearchIndexContext::Private
PropertyMapper<SearchIndexContext::Private> SearchIndexContext::Private::s_inst;
-SearchIndexContext::SearchIndexContext(const SearchIndexInfo *info)
+SearchIndexContext::SearchIndexContext(const SearchIndexInfo &info)
: RefCountedContext("SearchIndexContext")
{
p = new Private(info);
@@ -9950,10 +9949,9 @@ class SearchIndicesContext::Private : public GenericNodeListContext
public:
Private()
{
- const SearchIndexInfo *indices = getSearchIndices();
- for (int i=0;i<NUM_SEARCH_INDICES;i++)
+ for (const auto &si : getSearchIndices())
{
- append(SearchIndexContext::alloc(&indices[i]));
+ append(SearchIndexContext::alloc(si));
}
}
};
diff --git a/src/context.h b/src/context.h
index 1a2df8c..9b4b0fe 100644
--- a/src/context.h
+++ b/src/context.h
@@ -22,6 +22,8 @@
#include <stdio.h>
#include "dirdef.h"
#include "classdef.h"
+#include "searchindex.h"
+#include "membergroup.h"
class Definition;
class PageDef;
@@ -47,14 +49,8 @@ struct Argument;
class ArgumentList;
class MemberNameInfoLinkedMap;
class MemberInfo;
-class MemberGroup;
-class MemberGroupSDict;
-class MemberGroupList;
class DotNode;
class DotGfxHierarchyTable;
-struct SearchIndexInfo;
-class SearchIndexList;
-class SearchDefinitionList;
//----------------------------------------------------
@@ -1008,10 +1004,10 @@ class MemberGroupListContext : public RefCountedContext, public TemplateListIntf
public:
static MemberGroupListContext *alloc()
{ return new MemberGroupListContext; }
- static MemberGroupListContext *alloc(const Definition *def,const QCString &relPath,const MemberGroupList *list)
+ static MemberGroupListContext *alloc(const Definition *def,const QCString &relPath,const MemberGroupRefList &list)
{ return new MemberGroupListContext(def,relPath,list); }
- static MemberGroupListContext *alloc(const Definition *def,const QCString &relPath,const MemberGroupSDict *dict,bool subGrouping)
- { return new MemberGroupListContext(def,relPath,dict,subGrouping); }
+ static MemberGroupListContext *alloc(const Definition *def,const QCString &relPath,const MemberGroupList &list,bool subGrouping)
+ { return new MemberGroupListContext(def,relPath,list,subGrouping); }
// TemplateListIntf
virtual uint count() const;
@@ -1022,8 +1018,8 @@ class MemberGroupListContext : public RefCountedContext, public TemplateListIntf
private:
MemberGroupListContext();
- MemberGroupListContext(const Definition *def,const QCString &relPath,const MemberGroupList *list);
- MemberGroupListContext(const Definition *def,const QCString &relPath,const MemberGroupSDict *mgDict,bool subGrouping);
+ MemberGroupListContext(const Definition *def,const QCString &relPath,const MemberGroupRefList &list);
+ MemberGroupListContext(const Definition *def,const QCString &relPath,const MemberGroupList &list,bool subGrouping);
~MemberGroupListContext();
class Private;
Private *p;
@@ -1206,8 +1202,9 @@ class SymbolContext : public RefCountedContext, public TemplateStructIntf
class SymbolListContext : public RefCountedContext, public TemplateListIntf
{
public:
- static SymbolListContext *alloc(const SearchDefinitionList *sdl)
- { return new SymbolListContext(sdl); }
+ static SymbolListContext *alloc(const SearchIndexList::const_iterator &start,
+ const SearchIndexList::const_iterator &end)
+ { return new SymbolListContext(start,end); }
// TemplateListIntf
virtual uint count() const;
@@ -1217,7 +1214,8 @@ class SymbolListContext : public RefCountedContext, public TemplateListIntf
virtual int release() { return RefCountedContext::release(); }
private:
- SymbolListContext(const SearchDefinitionList *sdl);
+ SymbolListContext(const SearchIndexList::const_iterator &start,
+ const SearchIndexList::const_iterator &end);
~SymbolListContext();
class Private;
Private *p;
@@ -1228,8 +1226,9 @@ class SymbolListContext : public RefCountedContext, public TemplateListIntf
class SymbolGroupContext : public RefCountedContext, public TemplateStructIntf
{
public:
- static SymbolGroupContext *alloc(const SearchDefinitionList *sdl)
- { return new SymbolGroupContext(sdl); }
+ static SymbolGroupContext *alloc(const SearchIndexList::const_iterator &start,
+ const SearchIndexList::const_iterator &end)
+ { return new SymbolGroupContext(start,end); }
// TemplateStructIntf methods
virtual TemplateVariant get(const char *name) const;
@@ -1237,7 +1236,8 @@ class SymbolGroupContext : public RefCountedContext, public TemplateStructIntf
virtual int release() { return RefCountedContext::release(); }
private:
- SymbolGroupContext(const SearchDefinitionList *sdl);
+ SymbolGroupContext(const SearchIndexList::const_iterator &start,
+ const SearchIndexList::const_iterator &end);
~SymbolGroupContext();
class Private;
Private *p;
@@ -1248,7 +1248,7 @@ class SymbolGroupContext : public RefCountedContext, public TemplateStructIntf
class SymbolGroupListContext : public RefCountedContext, public TemplateListIntf
{
public:
- static SymbolGroupListContext *alloc(const SearchIndexList *sil)
+ static SymbolGroupListContext *alloc(const SearchIndexList &sil)
{ return new SymbolGroupListContext(sil); }
// TemplateListIntf
@@ -1259,7 +1259,7 @@ class SymbolGroupListContext : public RefCountedContext, public TemplateListIntf
virtual int release() { return RefCountedContext::release(); }
private:
- SymbolGroupListContext(const SearchIndexList *sil);
+ SymbolGroupListContext(const SearchIndexList &sil);
~SymbolGroupListContext();
class Private;
Private *p;
@@ -1270,8 +1270,9 @@ class SymbolGroupListContext : public RefCountedContext, public TemplateListIntf
class SymbolIndexContext : public RefCountedContext, public TemplateStructIntf
{
public:
- static SymbolIndexContext *alloc(const SearchIndexList *sl,const QCString &name)
- { return new SymbolIndexContext(sl,name); }
+ static SymbolIndexContext *alloc(const std::string &letter,
+ const SearchIndexList &sl,const QCString &name)
+ { return new SymbolIndexContext(letter,sl,name); }
// TemplateStructIntf methods
virtual TemplateVariant get(const char *name) const;
@@ -1279,7 +1280,7 @@ class SymbolIndexContext : public RefCountedContext, public TemplateStructIntf
virtual int release() { return RefCountedContext::release(); }
private:
- SymbolIndexContext(const SearchIndexList *sl,const QCString &name);
+ SymbolIndexContext(const std::string &letter,const SearchIndexList &sl,const QCString &name);
~SymbolIndexContext();
class Private;
Private *p;
@@ -1290,7 +1291,7 @@ class SymbolIndexContext : public RefCountedContext, public TemplateStructIntf
class SymbolIndicesContext : public RefCountedContext, public TemplateListIntf
{
public:
- static SymbolIndicesContext *alloc(const SearchIndexInfo *info)
+ static SymbolIndicesContext *alloc(const SearchIndexInfo &info)
{ return new SymbolIndicesContext(info); }
// TemplateListIntf
@@ -1301,7 +1302,7 @@ class SymbolIndicesContext : public RefCountedContext, public TemplateListIntf
virtual int release() { return RefCountedContext::release(); }
private:
- SymbolIndicesContext(const SearchIndexInfo *info);
+ SymbolIndicesContext(const SearchIndexInfo &info);
~SymbolIndicesContext();
class Private;
Private *p;
@@ -1312,7 +1313,7 @@ class SymbolIndicesContext : public RefCountedContext, public TemplateListIntf
class SearchIndexContext : public RefCountedContext, public TemplateStructIntf
{
public:
- static SearchIndexContext *alloc(const SearchIndexInfo *info)
+ static SearchIndexContext *alloc(const SearchIndexInfo &info)
{ return new SearchIndexContext(info); }
// TemplateStructIntf methods
@@ -1321,7 +1322,7 @@ class SearchIndexContext : public RefCountedContext, public TemplateStructIntf
virtual int release() { return RefCountedContext::release(); }
private:
- SearchIndexContext(const SearchIndexInfo *info);
+ SearchIndexContext(const SearchIndexInfo &info);
~SearchIndexContext();
class Private;
Private *p;
diff --git a/src/dirdef.cpp b/src/dirdef.cpp
index 14d978e..52cbe6f 100644
--- a/src/dirdef.cpp
+++ b/src/dirdef.cpp
@@ -1,6 +1,22 @@
-#include "md5.h"
+/******************************************************************************
+ *
+ * Copyright (C) 1997-2020 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ *
+ */
+
+#include <algorithm>
#include "dirdef.h"
+#include "md5.h"
#include "filename.h"
#include "doxygen.h"
#include "util.h"
@@ -15,7 +31,7 @@
#include "docparser.h"
#include "definitionimpl.h"
#include "filedef.h"
-#include <algorithm>
+
//----------------------------------------------------------------------
@@ -40,7 +56,7 @@ class DirDefImpl : public DefinitionMixin<DirDef>
virtual int level() const { return m_level; }
virtual DirDef *parent() const { return m_parent; }
virtual int dirCount() const { return m_dirCount; }
- virtual const QDict<UsedDir> *usedDirs() const { return m_usedDirs; }
+ virtual const UsedDirLinkedMap &usedDirs() const { return m_usedDirs; }
virtual bool isParentOf(const DirDef *dir) const;
virtual bool depGraphIsTrivial() const;
virtual QCString shortTitle() const;
@@ -79,7 +95,7 @@ class DirDefImpl : public DefinitionMixin<DirDef>
int m_dirCount;
int m_level;
DirDef *m_parent;
- QDict<UsedDir> *m_usedDirs;
+ UsedDirLinkedMap m_usedDirs;
};
DirDef *createDirDef(const char *path)
@@ -117,8 +133,6 @@ DirDefImpl::DirDefImpl(const char *path) : DefinitionMixin(path,1,1,path)
}
m_fileList = new FileList;
- m_usedDirs = new QDict<UsedDir>(257);
- m_usedDirs->setAutoDelete(TRUE);
m_dirCount = g_dirCount++;
m_level=-1;
m_parent=0;
@@ -127,7 +141,6 @@ DirDefImpl::DirDefImpl(const char *path) : DefinitionMixin(path,1,1,path)
DirDefImpl::~DirDefImpl()
{
delete m_fileList;
- delete m_usedDirs;
}
bool DirDefImpl::isLinkableInProject() const
@@ -641,10 +654,10 @@ void DirDefImpl::addUsesDependency(DirDef *dir,FileDef *srcFd,
// levels match => add direct dependency
bool added=FALSE;
- UsedDir *usedDir = m_usedDirs->find(dir->getOutputFileBase());
+ UsedDir *usedDir = m_usedDirs.find(dir->getOutputFileBase());
if (usedDir) // dir dependency already present
{
- FilePair *usedPair = usedDir->findFilePair(
+ const FilePair *usedPair = usedDir->findFilePair(
srcFd->getOutputFileBase()+dstFd->getOutputFileBase());
if (usedPair==0) // new file dependency
{
@@ -660,9 +673,9 @@ void DirDefImpl::addUsesDependency(DirDef *dir,FileDef *srcFd,
else // new directory dependency
{
//printf(" => new file\n");
- usedDir = new UsedDir(dir,inherited);
- usedDir->addFileDep(srcFd,dstFd);
- m_usedDirs->insert(dir->getOutputFileBase(),usedDir);
+ auto newUsedDir = std::make_unique<UsedDir>(dir,inherited);
+ newUsedDir->addFileDep(srcFd,dstFd);
+ usedDir = m_usedDirs.add(dir->getOutputFileBase(),std::move(newUsedDir));
added=TRUE;
}
if (added)
@@ -717,14 +730,14 @@ void DirDefImpl::computeDependencies()
}
}
}
- if (m_usedDirs)
+
+ std::sort(m_usedDirs.begin(),m_usedDirs.end(),
+ [](const auto &u1,const auto &u2)
+ { return qstricmp(u1->dir()->getOutputFileBase(),u2->dir()->getOutputFileBase())<0; });
+
+ for (const auto& usedDirectory : m_usedDirs)
{
- QDictIterator<UsedDir> udi(*m_usedDirs);
- UsedDir *udir;
- for (udi.toFirst();(udir=udi.current());++udi)
- {
- udir->sort();
- }
+ usedDirectory->sort();
}
}
@@ -740,7 +753,7 @@ bool DirDefImpl::isParentOf(const DirDef *dir) const
bool DirDefImpl::depGraphIsTrivial() const
{
- return m_usedDirs->count()==0;
+ return m_usedDirs.empty();
}
//----------------------------------------------------------------------
diff --git a/src/dirdef.h b/src/dirdef.h
index 1057049..bbb5fe6 100644
--- a/src/dirdef.h
+++ b/src/dirdef.h
@@ -16,10 +16,12 @@
#ifndef DIRDEF_H
#define DIRDEF_H
+#include "linkedmap.h"
#include "sortdict.h"
#include "definition.h"
#include <vector>
+#include <map>
#include <qglobal.h>
#include <qcstring.h>
@@ -29,7 +31,8 @@ class FileDef;
class OutputList;
class UsedDir;
class FTextStream;
-
+class FilePair;
+class FilePairDict;
class DirDef;
/** A list of directories. */
@@ -37,12 +40,62 @@ typedef std::vector<DirDef*> DirList;
bool compareDirDefs(const DirDef *item1, const DirDef *item2);
+// ------------------
+
+/** Class representing a pair of FileDef objects */
+class FilePair
+{
+ public:
+ FilePair(FileDef *src,FileDef *dst) : m_src(src), m_dst(dst) {}
+ const FileDef *source() const { return m_src; }
+ const FileDef *destination() const { return m_dst; }
+ private:
+ FileDef *m_src;
+ FileDef *m_dst;
+};
+
+// ------------------
+
+/** A sorted dictionary of FilePair objects. */
+class FilePairDict : public SDict<FilePair>
+{
+ public:
+ FilePairDict(uint size) : SDict<FilePair>(size) {}
+ private:
+ int compareValues(const FilePair *item1,const FilePair *item2) const;
+};
+
+// ------------------
+
+/** Usage information of a directory. */
+class UsedDir
+{
+ public:
+ UsedDir(const DirDef *dir,bool inherited);
+ virtual ~UsedDir();
+ void addFileDep(FileDef *srcFd,FileDef *dstFd);
+ FilePair *findFilePair(const char *name);
+ const FilePairDict &filePairs() const { return m_filePairs; }
+ const DirDef *dir() const { return m_dir; }
+ bool inherited() const { return m_inherited; }
+ void sort();
+
+ private:
+ const DirDef *m_dir;
+ FilePairDict m_filePairs;
+ bool m_inherited;
+};
+
+// ------------------
+
/** A model of a directory symbol. */
class DirDef : public DefinitionMutable, public Definition
{
public:
virtual ~DirDef() {}
+ class UsedDirLinkedMap : public LinkedMap<UsedDir> {};
+
// accessors
virtual DefType definitionType() const = 0;
virtual QCString getOutputFileBase() const = 0;
@@ -59,7 +112,7 @@ class DirDef : public DefinitionMutable, public Definition
virtual int level() const = 0;
virtual DirDef *parent() const = 0;
virtual int dirCount() const = 0;
- virtual const QDict<UsedDir> *usedDirs() const = 0;
+ virtual const UsedDirLinkedMap &usedDirs() const = 0;
virtual bool isParentOf(const DirDef *dir) const = 0;
virtual bool depGraphIsTrivial() const = 0;
virtual QCString shortTitle() const = 0;
@@ -83,49 +136,6 @@ class DirDef : public DefinitionMutable, public Definition
DirDef *toDirDef(Definition *d);
const DirDef *toDirDef(const Definition *d);
-// ------------------
-
-
-/** Class representing a pair of FileDef objects */
-class FilePair
-{
- public:
- FilePair(FileDef *src,FileDef *dst) : m_src(src), m_dst(dst) {}
- const FileDef *source() const { return m_src; }
- const FileDef *destination() const { return m_dst; }
- private:
- FileDef *m_src;
- FileDef *m_dst;
-};
-
-/** A sorted dictionary of FilePair objects. */
-class FilePairDict : public SDict<FilePair>
-{
- public:
- FilePairDict(uint size) : SDict<FilePair>(size) {}
- private:
- int compareValues(const FilePair *item1,const FilePair *item2) const;
-};
-
-/** Usage information of a directory. */
-class UsedDir
-{
- public:
- UsedDir(const DirDef *dir,bool inherited);
- virtual ~UsedDir();
- void addFileDep(FileDef *srcFd,FileDef *dstFd);
- FilePair *findFilePair(const char *name);
- const FilePairDict &filePairs() const { return m_filePairs; }
- const DirDef *dir() const { return m_dir; }
- bool inherited() const { return m_inherited; }
- void sort();
-
- private:
- const DirDef *m_dir;
- FilePairDict m_filePairs;
- bool m_inherited;
-};
-
/** A usage relation between two directories. */
class DirRelation
{
@@ -154,6 +164,8 @@ class DirSDict : public SDict<DirDef>
}
};
+// ------------------
+
void buildDirectories();
void generateDirDocs(OutputList &ol);
diff --git a/src/docgroup.cpp b/src/docgroup.cpp
index d82d1b3..49fb9dc 100644
--- a/src/docgroup.cpp
+++ b/src/docgroup.cpp
@@ -3,8 +3,8 @@
* Copyright (C) 1997-2019 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
- * documentation under the terms of the GNU General Public License is hereby
- * granted. No representations are made about the suitability of this software
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
@@ -62,7 +62,7 @@ void DocGroup::enterCompound(const char *fileName,int line,const char *name)
m_memberGroupDocs.resize(0);
m_compoundName = name;
int i = m_compoundName.find('(');
- if (i!=-1)
+ if (i!=-1)
{
m_compoundName=m_compoundName.left(i); // strip category (Obj-C)
}
@@ -89,17 +89,15 @@ void DocGroup::leaveCompound(const char *,int,const char * /*name*/)
int DocGroup::findExistingGroup(const MemberGroupInfo *info)
{
//printf("findExistingGroup %s:%s\n",info->header.data(),info->compoundName.data());
- QIntDictIterator<MemberGroupInfo> di(Doxygen::memGrpInfoDict);
- MemberGroupInfo *mi;
- for (di.toFirst();(mi=di.current());++di)
+ for (const auto &kv : Doxygen::memberGroupInfoMap)
{
- if (m_compoundName==mi->compoundName && // same file or scope
- !mi->header.isEmpty() && // not a nameless group
- qstricmp(mi->header,info->header)==0 // same header name
+ if (m_compoundName==kv.second->compoundName && // same file or scope
+ !kv.second->header.isEmpty() && // not a nameless group
+ qstricmp(kv.second->header,info->header)==0 // same header name
)
{
//printf("Found it!\n");
- return (int)di.currentKey(); // put the item in this group
+ return kv.first; // put the item in this group
}
}
return ++g_groupId; // start new group
@@ -119,13 +117,16 @@ void DocGroup::open(Entry *e,const char *,int, bool implicit)
//printf(" membergroup id=%d %s\n",m_memberGroupId,m_memberGroupHeader.data());
if (m_memberGroupId==DOX_NOGROUP) // no group started yet
{
- MemberGroupInfo *info = new MemberGroupInfo;
+ auto info = std::make_unique<MemberGroupInfo>();
info->header = m_memberGroupHeader.stripWhiteSpace();
info->compoundName = m_compoundName;
- m_memberGroupId = findExistingGroup(info);
- //printf(" use membergroup %d\n",m_memberGroupId);
- Doxygen::memGrpInfoDict.insert(m_memberGroupId,info);
-
+ m_memberGroupId = findExistingGroup(info.get());
+ auto it = Doxygen::memberGroupInfoMap.find(m_memberGroupId);
+ if (it==Doxygen::memberGroupInfoMap.end())
+ {
+ //printf(" use membergroup %d\n",m_memberGroupId);
+ Doxygen::memberGroupInfoMap.insert(std::make_pair(m_memberGroupId,std::move(info)));
+ }
m_memberGroupRelates = e->relates;
e->mGrpId = m_memberGroupId;
}
@@ -149,9 +150,10 @@ void DocGroup::close(Entry *e,const char *fileName,int line,bool foundInline,boo
// e->name.data(),e->section,fileName,line,m_autoGroupStack.size());
if (m_memberGroupId!=DOX_NOGROUP) // end of member group
{
- MemberGroupInfo *info=Doxygen::memGrpInfoDict.find(m_memberGroupId);
- if (info) // known group
+ auto it = Doxygen::memberGroupInfoMap.find(m_memberGroupId);
+ if (it!=Doxygen::memberGroupInfoMap.end()) // known group
{
+ auto &info = it->second;
info->doc = m_memberGroupDocs;
info->docFile = fileName;
info->docLine = line;
@@ -199,9 +201,10 @@ void DocGroup::addDocs(Entry *e)
m_memberGroupDocs+="\n\n";
}
m_memberGroupDocs+=e->doc;
- MemberGroupInfo *info=Doxygen::memGrpInfoDict.find(m_memberGroupId);
- if (info)
+ auto it =Doxygen::memberGroupInfoMap.find(m_memberGroupId);
+ if (it!=Doxygen::memberGroupInfoMap.end())
{
+ auto &info = it->second;
info->doc = m_memberGroupDocs;
info->docFile = e->docFile;
info->docLine = e->docLine;
diff --git a/src/dotdirdeps.cpp b/src/dotdirdeps.cpp
index c0e4712..a670d68 100644
--- a/src/dotdirdeps.cpp
+++ b/src/dotdirdeps.cpp
@@ -39,8 +39,8 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations)
if (dd->parent())
{
t << " subgraph cluster" << dd->parent()->getOutputFileBase() << " {\n";
- t << " graph [ bgcolor=\"#ddddee\", pencolor=\"black\", label=\""
- << dd->parent()->shortName()
+ t << " graph [ bgcolor=\"#ddddee\", pencolor=\"black\", label=\""
+ << dd->parent()->shortName()
<< "\" fontname=\"" << fontName << "\", fontsize=\"" << fontSize << "\", URL=\"";
t << dd->parent()->getOutputFileBase() << Doxygen::htmlFileExtension;
t << "\"]\n";
@@ -49,9 +49,9 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations)
{
t << " subgraph cluster" << dd->getOutputFileBase() << " {\n";
t << " graph [ bgcolor=\"#eeeeff\", pencolor=\"black\", label=\"\""
- << " URL=\"" << dd->getOutputFileBase() << Doxygen::htmlFileExtension
+ << " URL=\"" << dd->getOutputFileBase() << Doxygen::htmlFileExtension
<< "\"];\n";
- t << " " << dd->getOutputFileBase() << " [shape=plaintext label=\""
+ t << " " << dd->getOutputFileBase() << " [shape=plaintext label=\""
<< dd->shortName() << "\"];\n";
// add nodes for sub directories
@@ -77,9 +77,9 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations)
}
else
{
- t << " " << dd->getOutputFileBase() << " [shape=box, label=\""
+ t << " " << dd->getOutputFileBase() << " [shape=box, label=\""
<< dd->shortName() << "\", style=\"filled\", fillcolor=\"#eeeeff\","
- << " pencolor=\"black\", URL=\"" << dd->getOutputFileBase()
+ << " pencolor=\"black\", URL=\"" << dd->getOutputFileBase()
<< Doxygen::htmlFileExtension << "\"];\n";
}
if (dd->parent())
@@ -89,13 +89,11 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations)
// add nodes for other used directories
{
- QDictIterator<UsedDir> udi(*dd->usedDirs());
- UsedDir *udir;
//printf("*** For dir %s\n",shortName().data());
- for (udi.toFirst();(udir=udi.current());++udi)
+ for (const auto &udir : dd->usedDirs())
// for each used dir (=directly used or a parent of a directly used dir)
{
- const DirDef *usedDir=udir->dir();
+ const DirDef *usedDir = udir->dir();
const DirDef *dir=dd;
while (dir)
{
@@ -106,11 +104,11 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations)
// shortName().data(),
// !usedDir->isParentOf(this)
// );
- if (dir!=usedDir && dir->parent()==usedDir->parent() &&
+ if (dir!=usedDir && dir->parent()==usedDir->parent() &&
!usedDir->isParentOf(dd))
// include if both have the same parent (or no parent)
{
- t << " " << usedDir->getOutputFileBase() << " [shape=box label=\""
+ t << " " << usedDir->getOutputFileBase() << " [shape=box label=\""
<< usedDir->shortName() << "\"";
if (usedDir->isCluster())
{
@@ -120,7 +118,7 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations)
}
t << " color=\"red\"";
}
- t << " URL=\"" << usedDir->getOutputFileBase()
+ t << " URL=\"" << usedDir->getOutputFileBase()
<< Doxygen::htmlFileExtension << "\"];\n";
dirsInGraph.insert(usedDir->getOutputFileBase(),usedDir);
break;
@@ -135,9 +133,7 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations)
QDictIterator<DirDef> di(dirsInGraph);
for (;(dir=di.current());++di) // foreach dir in the graph
{
- QDictIterator<UsedDir> udi(*dir->usedDirs());
- UsedDir *udir;
- for (udi.toFirst();(udir=udi.current());++udi) // foreach used dir
+ for (const auto &udir : dir->usedDirs())
{
const DirDef *usedDir=udir->dir();
if ((dir!=dd || !udir->inherited()) && // only show direct dependencies for this dir
@@ -151,7 +147,7 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations)
{
// new relation
Doxygen::dirRelations.append(relationName,
- new DirRelation(relationName,dir,udir));
+ new DirRelation(relationName,dir,udir.get()));
}
int nrefs = udir->filePairs().count();
t << " " << dir->getOutputFileBase() << "->"
diff --git a/src/dotnode.cpp b/src/dotnode.cpp
index 86f99a2..06de5f4 100644
--- a/src/dotnode.cpp
+++ b/src/dotnode.cpp
@@ -119,7 +119,7 @@ static UmlDetailLevel getUmlDetailLevelFromConfig()
result=UmlDetailLevel::None;
}
return result;
-}
+}
static QCString escapeTooltip(const QCString &tooltip)
{
@@ -197,17 +197,11 @@ static void writeBoxMemberList(FTextStream &t,
}
}
// write member groups within the memberlist
- MemberGroupList *mgl = ml->getMemberGroupList();
- if (mgl)
+ for (const auto &mg : ml->getMemberGroupList())
{
- MemberGroupListIterator mgli(*mgl);
- MemberGroup *mg;
- for (mgli.toFirst();(mg=mgli.current());++mgli)
+ if (mg->members())
{
- if (mg->members())
- {
- writeBoxMemberList(t,prot,mg->members(),scope,isStatic,skipNames);
- }
+ writeBoxMemberList(t,prot,mg->members(),scope,isStatic,skipNames);
}
}
}
@@ -483,12 +477,9 @@ void DotNode::writeBox(FTextStream &t,
writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberListType_priStaticMethods),m_classDef,TRUE);
writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberListType_priSlots),m_classDef);
}
- if (m_classDef->getLanguage()!=SrcLangExt_Fortran &&
- m_classDef->getMemberGroupSDict())
+ if (m_classDef->getLanguage()!=SrcLangExt_Fortran)
{
- MemberGroupSDict::Iterator mgdi(*m_classDef->getMemberGroupSDict());
- MemberGroup *mg;
- for (mgdi.toFirst();(mg=mgdi.current());++mgdi)
+ for (const auto &mg : m_classDef->getMemberGroups())
{
if (mg->members())
{
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 3472f8f..642ea0d 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -134,10 +134,10 @@ FileNameLinkedMap *Doxygen::imageNameLinkedMap = 0; // images
FileNameLinkedMap *Doxygen::dotFileNameLinkedMap = 0; // dot files
FileNameLinkedMap *Doxygen::mscFileNameLinkedMap = 0; // msc files
FileNameLinkedMap *Doxygen::diaFileNameLinkedMap = 0; // dia files
-StringUnorderedMap Doxygen::namespaceAliasMap; // all namespace aliases
-StringDict Doxygen::tagDestinationDict(257); // all tag locations
-StringUnorderedSet Doxygen::expandAsDefinedSet; // all macros that should be expanded
-QIntDict<MemberGroupInfo> Doxygen::memGrpInfoDict(1009); // dictionary of the member groups heading
+StringUnorderedMap Doxygen::namespaceAliasMap; // all namespace aliases
+StringDict Doxygen::tagDestinationDict(257); // all tag locations
+StringUnorderedSet Doxygen::expandAsDefinedSet; // all macros that should be expanded
+MemberGroupInfoMap Doxygen::memberGroupInfoMap; // dictionary of the member groups heading
PageDef *Doxygen::mainPage = 0;
bool Doxygen::insideMainPage = FALSE; // are we generating docs for the main page?
NamespaceDefMutable *Doxygen::globalScope = 0;
@@ -261,6 +261,8 @@ void statistics()
Doxygen::mscFileNameDict->statistics();
fprintf(stderr,"--- diaFileNameDict stats ----\n");
Doxygen::diaFileNameDict->statistics();
+ fprintf(stderr,"--- memGrpInfoDict stats ----\n");
+ Doxygen::memGrpInfoDict.statistics();
#endif
//fprintf(stderr,"--- g_excludeNameDict stats ----\n");
//g_excludeNameDict.statistics();
@@ -270,8 +272,6 @@ void statistics()
Doxygen::tagDestinationDict.statistics();
fprintf(stderr,"--- g_compoundKeywordDict stats ----\n");
g_compoundKeywordDict.statistics();
- fprintf(stderr,"--- memGrpInfoDict stats ----\n");
- Doxygen::memGrpInfoDict.statistics();
}
@@ -1089,39 +1089,44 @@ static void addClassToContext(const Entry *root)
std::unique_ptr<ClassDef>(
createClassDef(tagInfo?tagName:root->fileName,root->startLine,root->startColumn,
fullName,sec,tagName,refFileName,TRUE,root->spec&Entry::Enum) )));
- Debug::print(Debug::Classes,0," New class '%s' (sec=0x%08x)! #tArgLists=%d tagInfo=%p hidden=%d artificial=%d\n",
- qPrint(fullName),sec,root->tArgLists.size(), tagInfo,root->hidden,root->artificial);
- cd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition
- cd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
- cd->setLanguage(root->lang);
- cd->setId(root->id);
- cd->setHidden(root->hidden);
- cd->setArtificial(root->artificial);
- cd->setClassSpecifier(root->spec);
- cd->setTypeConstraints(root->typeConstr);
- //printf("new ClassDef %s tempArgList=%p specScope=%s\n",fullName.data(),root->tArgList,root->scopeSpec.data());
-
- //printf("class %s template args=%s\n",fullName.data(),
- // tArgList ? tempArgListToString(tArgList,root->lang).data() : "<none>");
- if (tArgList)
+ if (cd)
{
- cd->setTemplateArguments(*tArgList);
- }
- cd->setProtection(root->protection);
- cd->setIsStatic(root->stat);
-
- // file definition containing the class cd
- cd->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
- cd->setBodyDef(fd);
-
- cd->setMetaData(root->metaData);
+ Debug::print(Debug::Classes,0," New class '%s' (sec=0x%08x)! #tArgLists=%d tagInfo=%p hidden=%d artificial=%d\n",
+ qPrint(fullName),sec,root->tArgLists.size(), tagInfo,root->hidden,root->artificial);
+ cd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition
+ cd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
+ cd->setLanguage(root->lang);
+ cd->setId(root->id);
+ cd->setHidden(root->hidden);
+ cd->setArtificial(root->artificial);
+ cd->setClassSpecifier(root->spec);
+ cd->setTypeConstraints(root->typeConstr);
+ //printf("new ClassDef %s tempArgList=%p specScope=%s\n",fullName.data(),root->tArgList,root->scopeSpec.data());
+
+ //printf("class %s template args=%s\n",fullName.data(),
+ // tArgList ? tempArgListToString(tArgList,root->lang).data() : "<none>");
+ if (tArgList)
+ {
+ cd->setTemplateArguments(*tArgList);
+ }
+ cd->setProtection(root->protection);
+ cd->setIsStatic(root->stat);
- // see if the class is found inside a namespace
- //bool found=addNamespace(root,cd);
+ // file definition containing the class cd
+ cd->setBodySegment(root->startLine,root->bodyLine,root->endBodyLine);
+ cd->setBodyDef(fd);
- cd->insertUsedFile(fd);
+ cd->setMetaData(root->metaData);
+ // see if the class is found inside a namespace
+ //bool found=addNamespace(root,cd);
+ cd->insertUsedFile(fd);
+ }
+ else
+ {
+ Debug::print(Debug::Classes,0," Not added class '%s', already exists as alias\n", qPrint(fullName));
+ }
}
cd->addSectionsToDefinition(root->anchors);
@@ -1333,64 +1338,67 @@ static ClassDefMutable *createTagLessInstance(const ClassDef *rootCd,const Class
templ->getDefColumn(),
fullName,
templ->compoundType()))));
- cd->setDocumentation(templ->documentation(),templ->docFile(),templ->docLine()); // copy docs to definition
- cd->setBriefDescription(templ->briefDescription(),templ->briefFile(),templ->briefLine());
- cd->setLanguage(templ->getLanguage());
- cd->setBodySegment(templ->getDefLine(),templ->getStartBodyLine(),templ->getEndBodyLine());
- cd->setBodyDef(templ->getBodyDef());
-
- cd->setOuterScope(rootCd->getOuterScope());
- if (rootCd->getOuterScope()!=Doxygen::globalScope)
+ if (cd)
{
- DefinitionMutable *outerScope = toDefinitionMutable(rootCd->getOuterScope());
- if (outerScope)
+ cd->setDocumentation(templ->documentation(),templ->docFile(),templ->docLine()); // copy docs to definition
+ cd->setBriefDescription(templ->briefDescription(),templ->briefFile(),templ->briefLine());
+ cd->setLanguage(templ->getLanguage());
+ cd->setBodySegment(templ->getDefLine(),templ->getStartBodyLine(),templ->getEndBodyLine());
+ cd->setBodyDef(templ->getBodyDef());
+
+ cd->setOuterScope(rootCd->getOuterScope());
+ if (rootCd->getOuterScope()!=Doxygen::globalScope)
{
- outerScope->addInnerCompound(cd);
+ DefinitionMutable *outerScope = toDefinitionMutable(rootCd->getOuterScope());
+ if (outerScope)
+ {
+ outerScope->addInnerCompound(cd);
+ }
}
- }
- FileDef *fd = templ->getFileDef();
- if (fd)
- {
- cd->setFileDef(fd);
- fd->insertClass(cd);
- }
- GroupList *groups = rootCd->partOfGroups();
- if ( groups!=0 )
- {
- GroupListIterator gli(*groups);
- GroupDef *gd;
- for (gli.toFirst();(gd=gli.current());++gli)
+ FileDef *fd = templ->getFileDef();
+ if (fd)
+ {
+ cd->setFileDef(fd);
+ fd->insertClass(cd);
+ }
+ GroupList *groups = rootCd->partOfGroups();
+ if ( groups!=0 )
{
- cd->makePartOfGroup(gd);
- gd->addClass(cd);
+ GroupListIterator gli(*groups);
+ GroupDef *gd;
+ for (gli.toFirst();(gd=gli.current());++gli)
+ {
+ cd->makePartOfGroup(gd);
+ gd->addClass(cd);
+ }
}
- }
- MemberList *ml = templ->getMemberList(MemberListType_pubAttribs);
- if (ml)
- {
- MemberListIterator li(*ml);
- MemberDef *md;
- for (li.toFirst();(md=li.current());++li)
+ MemberList *ml = templ->getMemberList(MemberListType_pubAttribs);
+ if (ml)
{
- //printf(" Member %s type=%s\n",md->name().data(),md->typeString());
- MemberDefMutable *imd = createMemberDef(md->getDefFileName(),md->getDefLine(),md->getDefColumn(),
- md->typeString(),md->name(),md->argsString(),md->excpString(),
- md->protection(),md->virtualness(),md->isStatic(),Member,
- md->memberType(),
- ArgumentList(),ArgumentList(),"");
- imd->setMemberClass(cd);
- imd->setDocumentation(md->documentation(),md->docFile(),md->docLine());
- imd->setBriefDescription(md->briefDescription(),md->briefFile(),md->briefLine());
- imd->setInbodyDocumentation(md->inbodyDocumentation(),md->inbodyFile(),md->inbodyLine());
- imd->setMemberSpecifiers(md->getMemberSpecifiers());
- imd->setMemberGroupId(md->getMemberGroupId());
- imd->setInitializer(md->initializer());
- imd->setMaxInitLines(md->initializerLines());
- imd->setBitfields(md->bitfieldString());
- imd->setLanguage(md->getLanguage());
- cd->insertMember(imd);
+ MemberListIterator li(*ml);
+ MemberDef *md;
+ for (li.toFirst();(md=li.current());++li)
+ {
+ //printf(" Member %s type=%s\n",md->name().data(),md->typeString());
+ MemberDefMutable *imd = createMemberDef(md->getDefFileName(),md->getDefLine(),md->getDefColumn(),
+ md->typeString(),md->name(),md->argsString(),md->excpString(),
+ md->protection(),md->virtualness(),md->isStatic(),Member,
+ md->memberType(),
+ ArgumentList(),ArgumentList(),"");
+ imd->setMemberClass(cd);
+ imd->setDocumentation(md->documentation(),md->docFile(),md->docLine());
+ imd->setBriefDescription(md->briefDescription(),md->briefFile(),md->briefLine());
+ imd->setInbodyDocumentation(md->inbodyDocumentation(),md->inbodyFile(),md->inbodyLine());
+ imd->setMemberSpecifiers(md->getMemberSpecifiers());
+ imd->setMemberGroupId(md->getMemberGroupId());
+ imd->setInitializer(md->initializer());
+ imd->setMaxInitLines(md->initializerLines());
+ imd->setBitfields(md->bitfieldString());
+ imd->setLanguage(md->getLanguage());
+ cd->insertMember(imd);
+ }
}
}
return cd;
@@ -1435,29 +1443,32 @@ static void processTagLessClasses(const ClassDef *rootCd,
if (!prefix.isEmpty()) name.prepend(prefix+".");
//printf(" found %s for class %s\n",name.data(),cd->name().data());
ClassDefMutable *ncd = createTagLessInstance(rootCd,icd,name);
- processTagLessClasses(rootCd,icd,ncd,name,count+1);
- //printf(" addTagged %s to %s\n",ncd->name().data(),tagParentCd->name().data());
- ncd->setTagLessReference(icd);
-
- // replace tag-less type for generated/original member
- // by newly created class name.
- // note the difference between changing cd and tagParentCd.
- // for the initial call this is the same pointer, but for
- // recursive calls cd is the original tag-less struct (of which
- // there is only one instance) and tagParentCd is the newly
- // generated tagged struct of which there can be multiple instances!
- MemberList *pml = tagParentCd->getMemberList(MemberListType_pubAttribs);
- if (pml)
+ if (ncd)
{
- MemberListIterator pli(*pml);
- MemberDef *pmd;
- for (pli.toFirst();(pmd=pli.current());++pli)
+ processTagLessClasses(rootCd,icd,ncd,name,count+1);
+ //printf(" addTagged %s to %s\n",ncd->name().data(),tagParentCd->name().data());
+ ncd->setTagLessReference(icd);
+
+ // replace tag-less type for generated/original member
+ // by newly created class name.
+ // note the difference between changing cd and tagParentCd.
+ // for the initial call this is the same pointer, but for
+ // recursive calls cd is the original tag-less struct (of which
+ // there is only one instance) and tagParentCd is the newly
+ // generated tagged struct of which there can be multiple instances!
+ MemberList *pml = tagParentCd->getMemberList(MemberListType_pubAttribs);
+ if (pml)
{
- MemberDefMutable *pmdm = toMemberDefMutable(pmd);
- if (pmdm && pmd->name()==md->name())
+ MemberListIterator pli(*pml);
+ MemberDef *pmd;
+ for (pli.toFirst();(pmd=pli.current());++pli)
{
- pmdm->setAccessorType(ncd,substitute(pmd->typeString(),icd->name(),ncd->name()));
- //pmd->setType(substitute(pmd->typeString(),icd->name(),ncd->name()));
+ MemberDefMutable *pmdm = toMemberDefMutable(pmd);
+ if (pmdm && pmd->name()==md->name())
+ {
+ pmdm->setAccessorType(ncd,substitute(pmd->typeString(),icd->name(),ncd->name()));
+ //pmd->setType(substitute(pmd->typeString(),icd->name(),ncd->name()));
+ }
}
}
}
@@ -1469,29 +1480,41 @@ static void processTagLessClasses(const ClassDef *rootCd,
}
}
-static void findTagLessClasses(const ClassDef *cd)
+static void findTagLessClasses(std::vector<ClassDefMutable*> &candidates,const ClassDef *cd)
{
for (const auto &icd : cd->getClasses())
{
if (icd->name().find("@")==-1) // process all non-anonymous inner classes
{
- findTagLessClasses(icd);
+ findTagLessClasses(candidates,icd);
}
}
- processTagLessClasses(cd,cd,toClassDefMutable(cd),"",0); // process tag less inner struct/classes (if any)
+ ClassDefMutable *cdm = toClassDefMutable(cd);
+ if (cdm)
+ {
+ candidates.push_back(cdm);
+ }
}
static void findTagLessClasses()
{
+ std::vector<ClassDefMutable *> candidates;
for (const auto &cd : *Doxygen::classLinkedMap)
{
Definition *scope = cd->getOuterScope();
if (scope && scope->definitionType()!=Definition::TypeClass) // that is not nested
{
- findTagLessClasses(cd.get());
+ findTagLessClasses(candidates,cd.get());
}
}
+
+ // since processTagLessClasses is potentially adding classes to Doxygen::classLinkedMap
+ // we need to call it outside of the loop above, otherwise the iterator gets invalidated!
+ for (auto &cd : candidates)
+ {
+ processTagLessClasses(cd,cd,cd,"",0); // process tag less inner struct/classes
+ }
}
@@ -1521,32 +1544,36 @@ static void buildNamespaceList(const Entry *root)
{
//printf("Found namespace %s in %s at line %d\n",root->name.data(),
// root->fileName.data(), root->startLine);
- NamespaceDefMutable *nd;
- if ((nd=toNamespaceDefMutable(Doxygen::namespaceLinkedMap->find(fullName)))) // existing namespace
+ NamespaceDef *ndi = Doxygen::namespaceLinkedMap->find(fullName);
+ if (ndi) // existing namespace
{
- nd->setDocumentation(root->doc,root->docFile,root->docLine);
- nd->setName(fullName); // change name to match docs
- nd->addSectionsToDefinition(root->anchors);
- nd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
- if (nd->getLanguage()==SrcLangExt_Unknown)
+ NamespaceDefMutable *nd = toNamespaceDefMutable(ndi);
+ if (nd) // non-inline namespace
{
- nd->setLanguage(root->lang);
- }
- if (root->tagInfo()==0) // if we found the namespace in a tag file
- // and also in a project file, then remove
- // the tag file reference
- {
- nd->setReference("");
- nd->setFileName(fullName);
- }
- nd->setMetaData(root->metaData);
+ nd->setDocumentation(root->doc,root->docFile,root->docLine);
+ nd->setName(fullName); // change name to match docs
+ nd->addSectionsToDefinition(root->anchors);
+ nd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
+ if (nd->getLanguage()==SrcLangExt_Unknown)
+ {
+ nd->setLanguage(root->lang);
+ }
+ if (root->tagInfo()==0) // if we found the namespace in a tag file
+ // and also in a project file, then remove
+ // the tag file reference
+ {
+ nd->setReference("");
+ nd->setFileName(fullName);
+ }
+ nd->setMetaData(root->metaData);
- // file definition containing the namespace nd
- FileDef *fd=root->fileDef();
- // insert the namespace in the file definition
- if (fd) fd->insertNamespace(nd);
- addNamespaceToGroups(root,nd);
- nd->setRefItems(root->sli);
+ // file definition containing the namespace nd
+ FileDef *fd=root->fileDef();
+ // insert the namespace in the file definition
+ if (fd) fd->insertNamespace(nd);
+ addNamespaceToGroups(root,nd);
+ nd->setRefItems(root->sli);
+ }
}
else // fresh namespace
{
@@ -1560,7 +1587,7 @@ static void buildNamespaceList(const Entry *root)
}
//printf("++ new namespace %s lang=%s tagName=%s\n",fullName.data(),langToString(root->lang).data(),tagName.data());
// add namespace to the list
- nd = toNamespaceDefMutable(
+ NamespaceDefMutable *nd = toNamespaceDefMutable(
Doxygen::namespaceLinkedMap->add(fullName,
std::unique_ptr<NamespaceDef>(
createNamespaceDef(tagInfo?tagName:root->fileName,root->startLine,
@@ -1628,9 +1655,9 @@ static void buildNamespaceList(const Entry *root)
if (dm)
{
NamespaceDef *aliasNd = createNamespaceDefAlias(d,nd);
- //printf("adding %s to %s\n",qPrint(aliasNd->name()),qPrint(d->name()));
dm->addInnerCompound(aliasNd);
QCString aliasName = aliasNd->name();
+ //printf("adding alias %s (%p) to %s\n",qPrint(aliasName),aliasNd,qPrint(d->name()));
Doxygen::namespaceLinkedMap->add(
aliasName,std::unique_ptr<NamespaceDef>(aliasNd));
}
@@ -1767,38 +1794,41 @@ static void findUsingDirectives(const Entry *root)
Doxygen::namespaceLinkedMap->add(name,
std::unique_ptr<NamespaceDef>(
createNamespaceDef(root->fileName,root->startLine,root->startColumn,name))));
- nd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition
- nd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
- nd->addSectionsToDefinition(root->anchors);
- //printf("** Adding namespace %s hidden=%d\n",name.data(),root->hidden);
- nd->setHidden(root->hidden);
- nd->setArtificial(TRUE);
- nd->setLanguage(root->lang);
- nd->setId(root->id);
- nd->setMetaData(root->metaData);
- nd->setInline((root->spec&Entry::Inline)!=0);
-
- //QListIterator<Grouping> gli(*root->groups);
- //Grouping *g;
- //for (;(g=gli.current());++gli)
- for (const Grouping &g : root->groups)
+ if (nd)
{
- GroupDef *gd=0;
- if (!g.groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g.groupname)))
- gd->addNamespace(nd);
- }
+ nd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition
+ nd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
+ nd->addSectionsToDefinition(root->anchors);
+ //printf("** Adding namespace %s hidden=%d\n",name.data(),root->hidden);
+ nd->setHidden(root->hidden);
+ nd->setArtificial(TRUE);
+ nd->setLanguage(root->lang);
+ nd->setId(root->id);
+ nd->setMetaData(root->metaData);
+ nd->setInline((root->spec&Entry::Inline)!=0);
+
+ //QListIterator<Grouping> gli(*root->groups);
+ //Grouping *g;
+ //for (;(g=gli.current());++gli)
+ for (const Grouping &g : root->groups)
+ {
+ GroupDef *gd=0;
+ if (!g.groupname.isEmpty() && (gd=Doxygen::groupSDict->find(g.groupname)))
+ gd->addNamespace(nd);
+ }
- // insert the namespace in the file definition
- if (fd)
- {
- fd->insertNamespace(nd);
- fd->addUsingDirective(nd);
- }
+ // insert the namespace in the file definition
+ if (fd)
+ {
+ fd->insertNamespace(nd);
+ fd->addUsingDirective(nd);
+ }
- // the empty string test is needed for extract all case
- nd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
- nd->insertUsedFile(fd);
- nd->setRefItems(root->sli);
+ // the empty string test is needed for extract all case
+ nd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
+ nd->insertUsedFile(fd);
+ nd->setRefItems(root->sli);
+ }
}
}
}
@@ -1884,8 +1914,11 @@ static void findUsingDeclarations(const Entry *root)
Doxygen::hiddenClassLinkedMap->add(name,
std::unique_ptr<ClassDef>(
createClassDef( "<using>",1,1, name, ClassDef::Class))));
- usingCd->setArtificial(TRUE);
- usingCd->setLanguage(root->lang);
+ if (usingCd)
+ {
+ usingCd->setArtificial(TRUE);
+ usingCd->setLanguage(root->lang);
+ }
}
else
{
@@ -3972,10 +4005,13 @@ static void findUsedClassesForClass(const Entry *root,
masterCd->getDefColumn(),
usedName,
ClassDef::Class))));
- //printf("making %s a template argument!!!\n",usedCd->name().data());
- usedCd->makeTemplateArgument();
- usedCd->setUsedOnly(TRUE);
- usedCd->setLanguage(masterCd->getLanguage());
+ if (usedCd)
+ {
+ //printf("making %s a template argument!!!\n",usedCd->name().data());
+ usedCd->makeTemplateArgument();
+ usedCd->setUsedOnly(TRUE);
+ usedCd->setLanguage(masterCd->getLanguage());
+ }
}
if (isArtificial) usedCd->setArtificial(TRUE);
Debug::print(Debug::Classes,0," Adding used class '%s' (1)\n", qPrint(usedCd->name()));
@@ -4021,8 +4057,11 @@ static void findUsedClassesForClass(const Entry *root,
masterCd->getDefFileName(),masterCd->getDefLine(),
masterCd->getDefColumn(),
type,ClassDef::Class))));
- usedCd->setUsedOnly(TRUE);
- usedCd->setLanguage(masterCd->getLanguage());
+ if (usedCd)
+ {
+ usedCd->setUsedOnly(TRUE);
+ usedCd->setLanguage(masterCd->getLanguage());
+ }
}
if (usedCd)
{
@@ -4517,8 +4556,8 @@ static bool findClassRelation(
baseClass=0;
if (isATemplateArgument)
{
- baseClass=toClassDefMutable(Doxygen::hiddenClassLinkedMap->find(baseClassName));
- if (baseClass==0)
+ baseClass = toClassDefMutable(Doxygen::hiddenClassLinkedMap->find(baseClassName));
+ if (baseClass==0) // not found (or alias)
{
baseClass= toClassDefMutable(
Doxygen::hiddenClassLinkedMap->add(baseClassName,
@@ -4526,14 +4565,16 @@ static bool findClassRelation(
createClassDef(root->fileName,root->startLine,root->startColumn,
baseClassName,
ClassDef::Class))));
- if (isArtificial) baseClass->setArtificial(TRUE);
- baseClass->setLanguage(root->lang);
-
+ if (baseClass) // really added (not alias)
+ {
+ if (isArtificial) baseClass->setArtificial(TRUE);
+ baseClass->setLanguage(root->lang);
+ }
}
}
else
{
- baseClass=toClassDefMutable(Doxygen::classLinkedMap->find(baseClassName));
+ baseClass = toClassDefMutable(Doxygen::classLinkedMap->find(baseClassName));
//printf("*** classDDict->find(%s)=%p biName=%s templSpec=%s\n",
// baseClassName.data(),baseClass,biName.data(),templSpec.data());
if (baseClass==0)
@@ -4544,41 +4585,51 @@ static bool findClassRelation(
createClassDef(root->fileName,root->startLine,root->startColumn,
baseClassName,
ClassDef::Class))));
- if (isArtificial) baseClass->setArtificial(TRUE);
- baseClass->setLanguage(root->lang);
- si = baseClassName.findRev("::");
- if (si!=-1) // class is nested
+ if (baseClass)
{
- Definition *sd = findScopeFromQualifiedName(Doxygen::globalScope,baseClassName.left(si),0,root->tagInfo());
- if (sd==0 || sd==Doxygen::globalScope) // outer scope not found
+ if (isArtificial) baseClass->setArtificial(TRUE);
+ baseClass->setLanguage(root->lang);
+ si = baseClassName.findRev("::");
+ if (si!=-1) // class is nested
{
- baseClass->setArtificial(TRUE); // see bug678139
+ Definition *sd = findScopeFromQualifiedName(Doxygen::globalScope,baseClassName.left(si),0,root->tagInfo());
+ if (sd==0 || sd==Doxygen::globalScope) // outer scope not found
+ {
+ baseClass->setArtificial(TRUE); // see bug678139
+ }
}
}
}
}
- if (biName.right(2)=="-p")
+ if (baseClass)
{
- biName="<"+biName.left(biName.length()-2)+">";
- }
- // add base class to this class
- cd->insertBaseClass(baseClass,biName,bi->prot,bi->virt,templSpec);
- // add this class as super class to the base class
- baseClass->insertSubClass(cd,bi->prot,bi->virt,templSpec);
- // the undocumented base was found in this file
- baseClass->insertUsedFile(root->fileDef());
-
- Definition *scope = buildScopeFromQualifiedName(baseClass->name(),root->lang,0);
- if (scope!=baseClass)
- {
- baseClass->setOuterScope(scope);
- }
+ if (biName.right(2)=="-p")
+ {
+ biName="<"+biName.left(biName.length()-2)+">";
+ }
+ // add base class to this class
+ cd->insertBaseClass(baseClass,biName,bi->prot,bi->virt,templSpec);
+ // add this class as super class to the base class
+ baseClass->insertSubClass(cd,bi->prot,bi->virt,templSpec);
+ // the undocumented base was found in this file
+ baseClass->insertUsedFile(root->fileDef());
+
+ Definition *scope = buildScopeFromQualifiedName(baseClass->name(),root->lang,0);
+ if (scope!=baseClass)
+ {
+ baseClass->setOuterScope(scope);
+ }
- if (baseClassName.right(2)=="-p")
+ if (baseClassName.right(2)=="-p")
+ {
+ baseClass->setCompoundType(ClassDef::Protocol);
+ }
+ return TRUE;
+ }
+ else
{
- baseClass->setCompoundType(ClassDef::Protocol);
+ Debug::print(Debug::Classes,0," Base class '%s' not created (alias?)\n",qPrint(biName));
}
- return TRUE;
}
else
{
@@ -7423,22 +7474,19 @@ static void addMembersToIndex()
for (const auto &mn : *Doxygen::functionNameLinkedMap)
{
// for each member definition
- for (const auto &imd : *mn)
+ for (const auto &md : *mn)
{
- MemberDefMutable *md = toMemberDefMutable(imd.get());
- if (md)
+ if (md->getNamespaceDef())
{
- if (md->getNamespaceDef())
- {
- addNamespaceMemberNameToIndex(md);
- }
- else
- {
- addFileMemberNameToIndex(md);
- }
+ addNamespaceMemberNameToIndex(md.get());
+ }
+ else
+ {
+ addFileMemberNameToIndex(md.get());
}
}
}
+ sortMemberIndexLists();
}
//----------------------------------------------------------------------
@@ -10142,7 +10190,6 @@ void initDoxygen()
Doxygen::pageSDict->setAutoDelete(TRUE);
Doxygen::exampleSDict = new PageSDict(1009); // all examples
Doxygen::exampleSDict->setAutoDelete(TRUE);
- Doxygen::memGrpInfoDict.setAutoDelete(TRUE);
Doxygen::tagDestinationDict.setAutoDelete(TRUE);
Doxygen::dirRelations.setAutoDelete(TRUE);
Doxygen::indexList = new IndexList;
diff --git a/src/doxygen.h b/src/doxygen.h
index fb984f6..7f03f04 100644
--- a/src/doxygen.h
+++ b/src/doxygen.h
@@ -88,6 +88,8 @@ struct LookupInfo
extern QCString g_spaces;
+using MemberGroupInfoMap = std::unordered_map< int,std::unique_ptr<MemberGroupInfo> >;
+
/*! \brief This class serves as a namespace for global variables used by doxygen.
*
* All fields in this class are public and static, so they can be used directly.
@@ -116,7 +118,7 @@ class Doxygen
static NamespaceLinkedMap *namespaceLinkedMap;
static StringDict tagDestinationDict;
static StringDict aliasDict;
- static QIntDict<MemberGroupInfo> memGrpInfoDict;
+ static MemberGroupInfoMap memberGroupInfoMap;
static StringUnorderedSet expandAsDefinedSet;
static NamespaceDefMutable *globalScope;
static QCString htmlFileExtension;
diff --git a/src/filedef.cpp b/src/filedef.cpp
index e8d6066..49fb4d9 100644
--- a/src/filedef.cpp
+++ b/src/filedef.cpp
@@ -85,7 +85,7 @@ class FileDefImpl : public DefinitionMixin<FileDef>
virtual void getAllIncludeFilesRecursively(StringVector &incFiles) const;
virtual MemberList *getMemberList(MemberListType lt) const;
virtual const QList<MemberList> &getMemberLists() const { return m_memberLists; }
- virtual MemberGroupSDict *getMemberGroupSDict() const { return m_memberGroupSDict; }
+ virtual const MemberGroupList &getMemberGroups() const { return m_memberGroups; }
virtual NamespaceLinkedRefMap getNamespaces() const { return m_namespaces; }
virtual ClassLinkedRefMap getClasses() const { return m_classes; }
virtual QCString title() const;
@@ -169,7 +169,7 @@ class FileDefImpl : public DefinitionMixin<FileDef>
PackageDef *m_package;
DirDef *m_dir;
QList<MemberList> m_memberLists;
- MemberGroupSDict *m_memberGroupSDict;
+ MemberGroupList m_memberGroups;
NamespaceLinkedRefMap m_namespaces;
ClassLinkedRefMap m_classes;
ClassLinkedRefMap m_interfaces;
@@ -241,7 +241,6 @@ FileDefImpl::FileDefImpl(const char *p,const char *nm,
m_docname.prepend(stripFromPath(m_path.copy()));
}
setLanguage(getLanguageFromFileName(name()));
- m_memberGroupSDict = 0;
acquireFileVersion();
m_subGrouping=Config_getBool(SUBGROUPING);
}
@@ -255,7 +254,6 @@ FileDefImpl::~FileDefImpl()
delete m_includedByList;
delete m_srcDefDict;
delete m_srcMemberDict;
- delete m_memberGroupSDict;
}
void FileDefImpl::setDiskName(const QCString &name)
@@ -284,14 +282,9 @@ void FileDefImpl::computeAnchors()
void FileDefImpl::distributeMemberGroupDocumentation()
{
//printf("FileDefImpl::distributeMemberGroupDocumentation()\n");
- if (m_memberGroupSDict)
+ for (const auto &mg : m_memberGroups)
{
- MemberGroupSDict::Iterator mgli(*m_memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->distributeMemberGroupDocumentation();
- }
+ mg->distributeMemberGroupDocumentation();
}
}
@@ -299,14 +292,9 @@ void FileDefImpl::findSectionsInDocumentation()
{
docFindSections(briefDescription(),this,docFile());
docFindSections(documentation(),this,docFile());
- if (m_memberGroupSDict)
+ for (const auto &mg : m_memberGroups)
{
- MemberGroupSDict::Iterator mgli(*m_memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->findSectionsInDocumentation(this);
- }
+ mg->findSectionsInDocumentation(this);
}
QListIterator<MemberList> mli(m_memberLists);
@@ -411,14 +399,9 @@ void FileDefImpl::writeTagFile(FTextStream &tagFile)
break;
case LayoutDocEntry::MemberGroups:
{
- if (m_memberGroupSDict)
+ for (const auto &mg : m_memberGroups)
{
- MemberGroupSDict::Iterator mgli(*m_memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->writeTagFile(tagFile);
- }
+ mg->writeTagFile(tagFile);
}
}
break;
@@ -751,18 +734,12 @@ void FileDefImpl::endMemberDocumentation(OutputList &ol)
void FileDefImpl::writeMemberGroups(OutputList &ol)
{
/* write user defined member groups */
- if (m_memberGroupSDict)
+ for (const auto &mg : m_memberGroups)
{
- m_memberGroupSDict->sort();
- MemberGroupSDict::Iterator mgli(*m_memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
+ if ((!mg->allMembersInSameSection() || !m_subGrouping)
+ && mg->header()!="[NOHEADER]")
{
- if ((!mg->allMembersInSameSection() || !m_subGrouping)
- && mg->header()!="[NOHEADER]")
- {
- mg->writeDeclarations(ol,0,0,this,0);
- }
+ mg->writeDeclarations(ol,0,0,this,0);
}
}
}
@@ -1273,22 +1250,17 @@ void FileDefImpl::addMembersToMemberGroup()
{
if (ml->listType()&MemberListType_declarationLists)
{
- ::addMembersToMemberGroup(ml,&m_memberGroupSDict,this);
+ ::addMembersToMemberGroup(ml,&m_memberGroups,this);
}
}
// add members inside sections to their groups
- if (m_memberGroupSDict)
+ for (const auto &mg : m_memberGroups)
{
- MemberGroupSDict::Iterator mgli(*m_memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
+ if (mg->allMembersInSameSection() && m_subGrouping)
{
- if (mg->allMembersInSameSection() && m_subGrouping)
- {
- //printf("----> addToDeclarationSection(%s)\n",mg->header().data());
- mg->addToDeclarationSection();
- }
+ //printf("----> addToDeclarationSection(%s)\n",mg->header().data());
+ mg->addToDeclarationSection();
}
}
}
@@ -1575,14 +1547,9 @@ void FileDefImpl::addListReferences()
0
);
}
- if (m_memberGroupSDict)
+ for (const auto &mg : m_memberGroups)
{
- MemberGroupSDict::Iterator mgli(*m_memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->addListReferences(this);
- }
+ mg->addListReferences(this);
}
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
@@ -1982,15 +1949,10 @@ void FileDefImpl::sortMemberLists()
if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(FALSE); }
}
- if (m_memberGroupSDict)
+ for (const auto &mg : m_memberGroups)
{
- MemberGroupSDict::Iterator mgli(*m_memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- MemberList *mlg = mg->members();
- if (mlg->needsSorting()) { mlg->sort(); mlg->setNeedsSorting(FALSE); }
- }
+ MemberList *mlg = mg->members();
+ if (mlg->needsSorting()) { mlg->sort(); mlg->setNeedsSorting(FALSE); }
}
if (Config_getBool(SORT_BRIEF_DOCS))
@@ -2116,15 +2078,10 @@ void FileDefImpl::countMembers()
ml->countDecMembers();
ml->countDocMembers();
}
- if (m_memberGroupSDict)
+ for (const auto &mg : m_memberGroups)
{
- MemberGroupSDict::Iterator mgli(*m_memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->countDecMembers();
- mg->countDocMembers();
- }
+ mg->countDecMembers();
+ mg->countDocMembers();
}
}
diff --git a/src/filedef.h b/src/filedef.h
index 26e5de5..2e0de97 100644
--- a/src/filedef.h
+++ b/src/filedef.h
@@ -39,7 +39,6 @@ class MemberDef;
class OutputList;
class NamespaceDef;
class NamespaceLinkedRefMap;
-class MemberGroupSDict;
class PackageDef;
class DirDef;
class FTextStream;
@@ -132,7 +131,7 @@ class FileDef : public DefinitionMutable, public Definition
virtual const QList<MemberList> &getMemberLists() const = 0;
/* user defined member groups */
- virtual MemberGroupSDict *getMemberGroupSDict() const = 0;
+ virtual const MemberGroupList &getMemberGroups() const = 0;
virtual NamespaceLinkedRefMap getNamespaces() const = 0;
virtual ClassLinkedRefMap getClasses() const = 0;
diff --git a/src/groupdef.cpp b/src/groupdef.cpp
index e0d60bd..84f02e9 100644
--- a/src/groupdef.cpp
+++ b/src/groupdef.cpp
@@ -98,7 +98,7 @@ class GroupDefImpl : public DefinitionMixin<GroupDef>
virtual const QList<MemberList> &getMemberLists() const { return m_memberLists; }
/* user defined member groups */
- virtual MemberGroupSDict *getMemberGroupSDict() const { return m_memberGroupSDict; }
+ virtual const MemberGroupList &getMemberGroups() const { return m_memberGroups; }
virtual FileList * getFiles() const { return m_fileList; }
virtual ClassLinkedRefMap getClasses() const { return m_classes; }
@@ -150,7 +150,7 @@ class GroupDefImpl : public DefinitionMixin<GroupDef>
MemberNameInfoLinkedMap m_allMemberNameInfoLinkedMap;
Definition * m_groupScope;
QList<MemberList> m_memberLists;
- MemberGroupSDict * m_memberGroupSDict;
+ MemberGroupList m_memberGroups;
bool m_subGrouping;
};
@@ -180,8 +180,6 @@ GroupDefImpl::GroupDefImpl(const char *df,int dl,const char *na,const char *t,
m_fileName = convertNameToFile(QCString("group_")+na);
}
setGroupTitle( t );
- m_memberGroupSDict = new MemberGroupSDict;
- m_memberGroupSDict->setAutoDelete(TRUE);
m_allMemberList = new MemberList(MemberListType_allMembersList);
@@ -197,7 +195,6 @@ GroupDefImpl::~GroupDefImpl()
delete m_pageDict;
delete m_exampleDict;
delete m_allMemberList;
- delete m_memberGroupSDict;
}
void GroupDefImpl::setGroupTitle( const char *t )
@@ -218,9 +215,7 @@ void GroupDefImpl::setGroupTitle( const char *t )
void GroupDefImpl::distributeMemberGroupDocumentation()
{
- MemberGroupSDict::Iterator mgli(*m_memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
+ for (const auto &mg : m_memberGroups)
{
mg->distributeMemberGroupDocumentation();
}
@@ -230,9 +225,8 @@ void GroupDefImpl::findSectionsInDocumentation()
{
docFindSections(briefDescription(),this,docFile());
docFindSections(documentation(),this,docFile());
- MemberGroupSDict::Iterator mgli(*m_memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
+
+ for (const auto &mg : m_memberGroups)
{
mg->findSectionsInDocumentation(this);
}
@@ -313,14 +307,12 @@ void GroupDefImpl::addMembersToMemberGroup()
{
if (ml->listType()&MemberListType_declarationLists)
{
- ::addMembersToMemberGroup(ml,&m_memberGroupSDict,this);
+ ::addMembersToMemberGroup(ml,&m_memberGroups,this);
}
}
//printf("GroupDefImpl::addMembersToMemberGroup() memberGroupList=%d\n",memberGroupList->count());
- MemberGroupSDict::Iterator mgli(*m_memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
+ for (const auto &mg : m_memberGroups)
{
mg->setInGroup(TRUE);
}
@@ -599,15 +591,10 @@ void GroupDefImpl::countMembers()
ml->countDecMembers();
ml->countDocMembers();
}
- if (m_memberGroupSDict)
+ for (const auto &mg : m_memberGroups)
{
- MemberGroupSDict::Iterator mgli(*m_memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->countDecMembers();
- mg->countDocMembers();
- }
+ mg->countDecMembers();
+ mg->countDocMembers();
}
}
@@ -738,14 +725,9 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile)
break;
case LayoutDocEntry::MemberGroups:
{
- if (m_memberGroupSDict)
+ for (const auto &mg : m_memberGroups)
{
- MemberGroupSDict::Iterator mgli(*m_memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->writeTagFile(tagFile);
- }
+ mg->writeTagFile(tagFile);
}
}
break;
@@ -1036,16 +1018,9 @@ void GroupDefImpl::writePageDocumentation(OutputList &ol)
void GroupDefImpl::writeMemberGroups(OutputList &ol)
{
/* write user defined member groups */
- if (m_memberGroupSDict)
+ for (const auto &mg : m_memberGroups)
{
- m_memberGroupSDict->sort();
- /* write user defined member groups */
- MemberGroupSDict::Iterator mgli(*m_memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->writeDeclarations(ol,0,0,0,this);
- }
+ mg->writeDeclarations(ol,0,0,0,this);
}
}
@@ -1601,9 +1576,7 @@ void GroupDefImpl::addListReferences()
0
);
}
- MemberGroupSDict::Iterator mgli(*m_memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
+ for (const auto &mg : m_memberGroups)
{
mg->addListReferences(this);
}
diff --git a/src/groupdef.h b/src/groupdef.h
index 0b682c2..f8d17b9 100644
--- a/src/groupdef.h
+++ b/src/groupdef.h
@@ -24,6 +24,7 @@
#include "definition.h"
#include "dirdef.h"
#include "layout.h"
+#include "membergroup.h"
class MemberList;
class FileList;
@@ -35,7 +36,6 @@ class NamespaceDef;
class GroupList;
class OutputList;
class NamespaceSDict;
-class MemberGroupSDict;
class PageSDict;
class PageDef;
class DirDef;
@@ -93,7 +93,7 @@ class GroupDef : public DefinitionMutable, public Definition
virtual const QList<MemberList> &getMemberLists() const = 0;
/* user defined member groups */
- virtual MemberGroupSDict *getMemberGroupSDict() const = 0;
+ virtual const MemberGroupList &getMemberGroups() const = 0;
virtual FileList * getFiles() const = 0;
virtual ClassLinkedRefMap getClasses() const = 0;
diff --git a/src/index.cpp b/src/index.cpp
index e68f7eb..dff2515 100644
--- a/src/index.cpp
+++ b/src/index.cpp
@@ -21,6 +21,8 @@
#include <stdlib.h>
+#include <array>
+
#include <assert.h>
#include <qtextstream.h>
#include <qdatetime.h>
@@ -145,29 +147,25 @@ static void endIndexHierarchy(OutputList &ol,int level)
//----------------------------------------------------------------------------
-class MemberIndexList : public QList<MemberDef>
-{
- public:
- typedef const MemberDef ElementType;
- MemberIndexList(uint letter) : QList<MemberDef>(), m_letter(letter) {}
- ~MemberIndexList() {}
- int compareValues(const MemberDef *md1, const MemberDef *md2) const
- {
- int result = qstricmp(md1->name(),md2->name());
- if (result==0)
- {
- result = qstricmp(md1->qualifiedName(),md2->qualifiedName());
- }
- return result;
- }
- uint letter() const { return m_letter; }
- private:
- uint m_letter;
-};
+using MemberIndexList = std::vector<const MemberDef *>;
+using MemberIndexMap = std::map<std::string,MemberIndexList>;
-static LetterToIndexMap<MemberIndexList> g_memberIndexLetterUsed[CMHL_Total];
-static LetterToIndexMap<MemberIndexList> g_fileIndexLetterUsed[FMHL_Total];
-static LetterToIndexMap<MemberIndexList> g_namespaceIndexLetterUsed[NMHL_Total];
+static std::array<MemberIndexMap,CMHL_Total> g_classIndexLetterUsed;
+static std::array<MemberIndexMap,FMHL_Total> g_fileIndexLetterUsed;
+static std::array<MemberIndexMap,NMHL_Total> g_namespaceIndexLetterUsed;
+
+void MemberIndexMap_add(MemberIndexMap &map,const std::string &letter,const MemberDef *md)
+{
+ auto it = map.find(letter);
+ if (it!=map.end())
+ {
+ it->second.push_back(md);
+ }
+ else
+ {
+ map.insert(std::make_pair(letter,std::vector<const MemberDef*>({md})));
+ }
+}
const int maxItemsBeforeQuickIndex = MAX_ITEMS_BEFORE_QUICK_INDEX;
@@ -357,7 +355,7 @@ void addMembersToIndex(T *def,LayoutDocManager::LayoutPart part,
const QCString &name,const QCString &anchor,
bool addToIndex=TRUE,bool preventSeparateIndex=FALSE)
{
- bool hasMembers = def->getMemberLists().count()>0 || def->getMemberGroupSDict()!=0;
+ bool hasMembers = def->getMemberLists().count()>0 || !def->getMemberGroups().empty();
Doxygen::indexList->addContentsItem(hasMembers,name,
def->getReference(),def->getOutputFileBase(),anchor,
hasMembers && !preventSeparateIndex,
@@ -2024,11 +2022,6 @@ inline bool isId1(int c)
return (c<127 && c>31); // printable ASCII character
}
-static QCString letterToString(uint letter)
-{
- return QString(QChar(letter)).utf8();
-}
-
static QCString letterToLabel(const char *startLetter)
{
const char *p = startLetter;
@@ -2052,44 +2045,6 @@ static QCString letterToLabel(const char *startLetter)
return result;
}
-static QCString letterToLabel(uint startLetter)
-{
- char s[11]; // max 0x12345678 + '\0'
- if (isId1(startLetter)) // printable ASCII character
- {
- s[0]=(char)startLetter;
- s[1]=0;
- }
- else
- {
- const char hex[]="0123456789abcdef";
- int i=0;
- s[i++]='0';
- s[i++]='x';
- if (startLetter>(1<<24)) // 4 byte character
- {
- s[i++]=hex[(startLetter>>28)&0xf];
- s[i++]=hex[(startLetter>>24)&0xf];
- }
- if (startLetter>(1<<16)) // 3 byte character
- {
- s[i++]=hex[(startLetter>>20)&0xf];
- s[i++]=hex[(startLetter>>16)&0xf];
- }
- if (startLetter>(1<<8)) // 2 byte character
- {
- s[i++]=hex[(startLetter>>12)&0xf];
- s[i++]=hex[(startLetter>>8)&0xf];
- }
- // one byte character
- s[i++]=hex[(startLetter>>4)&0xf];
- s[i++]=hex[(startLetter>>0)&0xf];
- s[i++]=0;
- }
- return s;
-}
-
-
//----------------------------------------------------------------------------
/** Class representing a cell in the alphabetical class index. */
@@ -2544,7 +2499,7 @@ static void writeAnnotatedExceptionIndex(OutputList &ol)
}
//----------------------------------------------------------------------------
-static void writeClassLinkForMember(OutputList &ol,MemberDef *md,const char *separator,
+static void writeClassLinkForMember(OutputList &ol,const MemberDef *md,const char *separator,
QCString &prevClassName)
{
const ClassDef *cd=md->getClassDef();
@@ -2558,7 +2513,7 @@ static void writeClassLinkForMember(OutputList &ol,MemberDef *md,const char *sep
}
}
-static void writeFileLinkForMember(OutputList &ol,MemberDef *md,const char *separator,
+static void writeFileLinkForMember(OutputList &ol,const MemberDef *md,const char *separator,
QCString &prevFileName)
{
const FileDef *fd=md->getFileDef();
@@ -2572,7 +2527,7 @@ static void writeFileLinkForMember(OutputList &ol,MemberDef *md,const char *sepa
}
}
-static void writeNamespaceLinkForMember(OutputList &ol,MemberDef *md,const char *separator,
+static void writeNamespaceLinkForMember(OutputList &ol,const MemberDef *md,const char *separator,
QCString &prevNamespaceName)
{
const NamespaceDef *nd=md->getNamespaceDef();
@@ -2586,14 +2541,14 @@ static void writeNamespaceLinkForMember(OutputList &ol,MemberDef *md,const char
}
}
-static void writeMemberList(OutputList &ol,bool useSections,int page,
- const LetterToIndexMap<MemberIndexList> &memberLists,
+static void writeMemberList(OutputList &ol,bool useSections,const std::string &page,
+ const MemberIndexMap &memberIndexMap,
Definition::DefType type)
{
int index = (int)type;
ASSERT(index<3);
- typedef void (*writeLinkForMember_t)(OutputList &ol,MemberDef *md,const char *separator,
+ typedef void (*writeLinkForMember_t)(OutputList &ol,const MemberDef *md,const char *separator,
QCString &prevNamespaceName);
// each index tab has its own write function
@@ -2608,20 +2563,26 @@ static void writeMemberList(OutputList &ol,bool useSections,int page,
bool first=TRUE;
bool firstSection=TRUE;
bool firstItem=TRUE;
- MemberIndexList *ml;
- SIntDict<MemberIndexList>::Iterator it(memberLists);
- for (it.toFirst();(ml=it.current());++it)
+ const MemberIndexList *mil = 0;
+ std::string letter;
+ for (const auto &kv : memberIndexMap)
{
- if (page!=-1)
+ if (!page.empty()) // specific page mode
+ {
+ auto it = memberIndexMap.find(page);
+ if (it != memberIndexMap.end())
+ {
+ mil = &it->second;
+ letter = page;
+ }
+ }
+ else // do all pages
{
- ml = memberLists[page];
- it.toLast();
+ mil = &kv.second;
+ letter = kv.first;
}
- if (ml==0 || ml->count()==0) continue;
- ml->sort();
- QListIterator<MemberDef> mli(*ml);
- MemberDef *md;
- for (mli.toFirst();(md=mli.current());++mli)
+ if (mil==0 || mil->empty()) continue;
+ for (const auto &md : *mil)
{
const char *sep;
bool isFunc=!md->isObjCMethod() &&
@@ -2636,10 +2597,9 @@ static void writeMemberList(OutputList &ol,bool useSections,int page,
{
if (!firstItem) ol.endItemListItem();
if (!firstSection) ol.endItemList();
- QCString cs = letterToLabel(ml->letter());
- QCString cl = letterToString(ml->letter());
+ QCString cs = letterToLabel(letter.c_str());
QCString anchor=(QCString)"index_"+convertToId(cs);
- QCString title=(QCString)"- "+cl+" -";
+ QCString title=(QCString)"- "+letter.c_str()+" -";
ol.startSection(anchor,title,SectionType::Subsection);
ol.docify(title);
ol.endSection(anchor,SectionType::Subsection);
@@ -2677,6 +2637,10 @@ static void writeMemberList(OutputList &ol,bool useSections,int page,
writeLinkForMemberMap[index](ol,md,sep,prevDefName);
}
}
+ if (!page.empty())
+ {
+ break;
+ }
}
if (!firstItem) ol.endItemListItem();
ol.endItemList();
@@ -2690,11 +2654,11 @@ void initClassMemberIndices()
for (j=0;j<CMHL_Total;j++)
{
documentedClassMembers[j]=0;
- g_memberIndexLetterUsed[j].clear();
+ g_classIndexLetterUsed[j].clear();
}
}
-void addClassMemberNameToIndex(MemberDef *md)
+void addClassMemberNameToIndex(const MemberDef *md)
{
static bool hideFriendCompounds = Config_getBool(HIDE_FRIEND_COMPOUNDS);
const ClassDef *cd=0;
@@ -2706,8 +2670,8 @@ void addClassMemberNameToIndex(MemberDef *md)
{
QCString n = md->name();
int index = getPrefixIndex(n);
- uint letter = getUtf8CodeToLower(n,index);
- if (!n.isEmpty())
+ char letter[MAX_UTF8_CHAR_SIZE];
+ if (getUtf8Char(n.data()+index,letter,CaseModifier::ToLower)>0)
{
bool isFriendToHide = hideFriendCompounds &&
(QCString(md->typeString())=="friend class" ||
@@ -2717,48 +2681,48 @@ void addClassMemberNameToIndex(MemberDef *md)
(!md->isEnumValue() || (md->getEnumScope() && !md->getEnumScope()->isStrong()))
)
{
- g_memberIndexLetterUsed[CMHL_All].append(letter,md);
+ MemberIndexMap_add(g_classIndexLetterUsed[CMHL_All],letter,md);
documentedClassMembers[CMHL_All]++;
}
if (md->isFunction() || md->isSlot() || md->isSignal())
{
- g_memberIndexLetterUsed[CMHL_Functions].append(letter,md);
+ MemberIndexMap_add(g_classIndexLetterUsed[CMHL_Functions],letter,md);
documentedClassMembers[CMHL_Functions]++;
}
else if (md->isVariable())
{
- g_memberIndexLetterUsed[CMHL_Variables].append(letter,md);
+ MemberIndexMap_add(g_classIndexLetterUsed[CMHL_Variables],letter,md);
documentedClassMembers[CMHL_Variables]++;
}
else if (md->isTypedef())
{
- g_memberIndexLetterUsed[CMHL_Typedefs].append(letter,md);
+ MemberIndexMap_add(g_classIndexLetterUsed[CMHL_Typedefs],letter,md);
documentedClassMembers[CMHL_Typedefs]++;
}
else if (md->isEnumerate())
{
- g_memberIndexLetterUsed[CMHL_Enums].append(letter,md);
+ MemberIndexMap_add(g_classIndexLetterUsed[CMHL_Enums],letter,md);
documentedClassMembers[CMHL_Enums]++;
}
else if (md->isEnumValue() && md->getEnumScope() && !md->getEnumScope()->isStrong())
{
- g_memberIndexLetterUsed[CMHL_EnumValues].append(letter,md);
+ MemberIndexMap_add(g_classIndexLetterUsed[CMHL_EnumValues],letter,md);
documentedClassMembers[CMHL_EnumValues]++;
}
else if (md->isProperty())
{
- g_memberIndexLetterUsed[CMHL_Properties].append(letter,md);
+ MemberIndexMap_add(g_classIndexLetterUsed[CMHL_Properties],letter,md);
documentedClassMembers[CMHL_Properties]++;
}
else if (md->isEvent())
{
- g_memberIndexLetterUsed[CMHL_Events].append(letter,md);
+ MemberIndexMap_add(g_classIndexLetterUsed[CMHL_Events],letter,md);
documentedClassMembers[CMHL_Events]++;
}
else if (md->isRelated() || md->isForeign() ||
(md->isFriend() && !isFriendToHide))
{
- g_memberIndexLetterUsed[CMHL_Related].append(letter,md);
+ MemberIndexMap_add(g_classIndexLetterUsed[CMHL_Related],letter,md);
documentedClassMembers[CMHL_Related]++;
}
}
@@ -2777,55 +2741,55 @@ void initNamespaceMemberIndices()
}
}
-void addNamespaceMemberNameToIndex(MemberDef *md)
+void addNamespaceMemberNameToIndex(const MemberDef *md)
{
const NamespaceDef *nd=md->getNamespaceDef();
if (nd && nd->isLinkableInProject() && md->isLinkableInProject())
{
QCString n = md->name();
int index = getPrefixIndex(n);
- uint letter = getUtf8CodeToLower(n,index);
- if (!n.isEmpty())
+ char letter[MAX_UTF8_CHAR_SIZE];
+ if (getUtf8Char(n.data()+index,letter,CaseModifier::ToLower)>0)
{
if (!md->isEnumValue() || (md->getEnumScope() && !md->getEnumScope()->isStrong()))
{
- g_namespaceIndexLetterUsed[NMHL_All].append(letter,md);
+ MemberIndexMap_add(g_namespaceIndexLetterUsed[NMHL_All],letter,md);
documentedNamespaceMembers[NMHL_All]++;
}
if (md->isFunction())
{
- g_namespaceIndexLetterUsed[NMHL_Functions].append(letter,md);
+ MemberIndexMap_add(g_namespaceIndexLetterUsed[NMHL_Functions],letter,md);
documentedNamespaceMembers[NMHL_Functions]++;
}
else if (md->isVariable())
{
- g_namespaceIndexLetterUsed[NMHL_Variables].append(letter,md);
+ MemberIndexMap_add(g_namespaceIndexLetterUsed[NMHL_Variables],letter,md);
documentedNamespaceMembers[NMHL_Variables]++;
}
else if (md->isTypedef())
{
- g_namespaceIndexLetterUsed[NMHL_Typedefs].append(letter,md);
+ MemberIndexMap_add(g_namespaceIndexLetterUsed[NMHL_Typedefs],letter,md);
documentedNamespaceMembers[NMHL_Typedefs]++;
}
else if (md->isSequence())
{
- g_namespaceIndexLetterUsed[NMHL_Sequences].append(letter,md);
+ MemberIndexMap_add(g_namespaceIndexLetterUsed[NMHL_Sequences],letter,md);
documentedNamespaceMembers[NMHL_Sequences]++;
}
else if (md->isDictionary())
{
- g_namespaceIndexLetterUsed[NMHL_Dictionaries].append(letter,md);
+ MemberIndexMap_add(g_namespaceIndexLetterUsed[NMHL_Dictionaries],letter,md);
documentedNamespaceMembers[NMHL_Dictionaries]++;
}
else if (md->isEnumerate())
{
- g_namespaceIndexLetterUsed[NMHL_Enums].append(letter,md);
+ MemberIndexMap_add(g_namespaceIndexLetterUsed[NMHL_Enums],letter,md);
documentedNamespaceMembers[NMHL_Enums]++;
}
else if (md->isEnumValue() && md->getEnumScope() && !md->getEnumScope()->isStrong())
{
- g_namespaceIndexLetterUsed[NMHL_EnumValues].append(letter,md);
+ MemberIndexMap_add(g_namespaceIndexLetterUsed[NMHL_EnumValues],letter,md);
documentedNamespaceMembers[NMHL_EnumValues]++;
}
}
@@ -2844,60 +2808,60 @@ void initFileMemberIndices()
}
}
-void addFileMemberNameToIndex(MemberDef *md)
+void addFileMemberNameToIndex(const MemberDef *md)
{
const FileDef *fd=md->getFileDef();
if (fd && fd->isLinkableInProject() && md->isLinkableInProject())
{
QCString n = md->name();
int index = getPrefixIndex(n);
- uint letter = getUtf8CodeToLower(n,index);
- if (!n.isEmpty())
+ char letter[MAX_UTF8_CHAR_SIZE];
+ if (getUtf8Char(n.data()+index,letter,CaseModifier::ToLower)>0)
{
if (!md->isEnumValue() || (md->getEnumScope() && !md->getEnumScope()->isStrong()))
{
- g_fileIndexLetterUsed[FMHL_All].append(letter,md);
+ MemberIndexMap_add(g_fileIndexLetterUsed[FMHL_All],letter,md);
documentedFileMembers[FMHL_All]++;
}
if (md->isFunction())
{
- g_fileIndexLetterUsed[FMHL_Functions].append(letter,md);
+ MemberIndexMap_add(g_fileIndexLetterUsed[FMHL_Functions],letter,md);
documentedFileMembers[FMHL_Functions]++;
}
else if (md->isVariable())
{
- g_fileIndexLetterUsed[FMHL_Variables].append(letter,md);
+ MemberIndexMap_add(g_fileIndexLetterUsed[FMHL_Variables],letter,md);
documentedFileMembers[FMHL_Variables]++;
}
else if (md->isTypedef())
{
- g_fileIndexLetterUsed[FMHL_Typedefs].append(letter,md);
+ MemberIndexMap_add(g_fileIndexLetterUsed[FMHL_Typedefs],letter,md);
documentedFileMembers[FMHL_Typedefs]++;
}
else if (md->isSequence())
{
- g_fileIndexLetterUsed[FMHL_Sequences].append(letter,md);
+ MemberIndexMap_add(g_fileIndexLetterUsed[FMHL_Sequences],letter,md);
documentedFileMembers[FMHL_Sequences]++;
}
else if (md->isDictionary())
{
- g_fileIndexLetterUsed[FMHL_Dictionaries].append(letter,md);
+ MemberIndexMap_add(g_fileIndexLetterUsed[FMHL_Dictionaries],letter,md);
documentedFileMembers[FMHL_Dictionaries]++;
}
else if (md->isEnumerate())
{
- g_fileIndexLetterUsed[FMHL_Enums].append(letter,md);
+ MemberIndexMap_add(g_fileIndexLetterUsed[FMHL_Enums],letter,md);
documentedFileMembers[FMHL_Enums]++;
}
else if (md->isEnumValue() && md->getEnumScope() && !md->getEnumScope()->isStrong())
{
- g_fileIndexLetterUsed[FMHL_EnumValues].append(letter,md);
+ MemberIndexMap_add(g_fileIndexLetterUsed[FMHL_EnumValues],letter,md);
documentedFileMembers[FMHL_EnumValues]++;
}
else if (md->isDefine())
{
- g_fileIndexLetterUsed[FMHL_Defines].append(letter,md);
+ MemberIndexMap_add(g_fileIndexLetterUsed[FMHL_Defines],letter,md);
documentedFileMembers[FMHL_Defines]++;
}
}
@@ -2906,19 +2870,47 @@ void addFileMemberNameToIndex(MemberDef *md)
//----------------------------------------------------------------------------
+static void sortMemberIndexList(MemberIndexMap &map)
+{
+ for (auto &kv : map)
+ {
+ std::sort(kv.second.begin(),kv.second.end(),
+ [](const MemberDef *md1,const MemberDef *md2)
+ {
+ int result = qstricmp(md1->name(),md2->name());
+ return result==0 ? qstricmp(md1->qualifiedName(),md2->qualifiedName())<0 : result<0;
+ });
+ }
+}
+
+void sortMemberIndexLists()
+{
+ for (auto &idx : g_classIndexLetterUsed)
+ {
+ sortMemberIndexList(idx);
+ }
+ for (auto &idx : g_fileIndexLetterUsed)
+ {
+ sortMemberIndexList(idx);
+ }
+ for (auto &idx : g_namespaceIndexLetterUsed)
+ {
+ sortMemberIndexList(idx);
+ }
+}
+
+//----------------------------------------------------------------------------
+
static void writeQuickMemberIndex(OutputList &ol,
- const LetterToIndexMap<MemberIndexList> &charUsed,uint page,
+ const MemberIndexMap &map,const std::string &page,
QCString fullName,bool multiPage)
{
bool first=TRUE;
startQuickIndexList(ol,TRUE);
- SIntDict<MemberIndexList>::Iterator it(charUsed);
- MemberIndexList *ml;
- for (it.toFirst();(ml=it.current());++it)
+ for (const auto &kv : map)
{
- uint i = ml->letter();
- QCString is = letterToLabel(i);
- QCString ci = letterToString(i);
+ QCString ci = kv.first.c_str();
+ QCString is = letterToLabel(ci);
QCString anchor;
QCString extension=Doxygen::htmlFileExtension;
if (!multiPage)
@@ -2926,8 +2918,8 @@ static void writeQuickMemberIndex(OutputList &ol,
else if (first)
anchor=fullName+extension+"#index_";
else
- anchor=fullName+"_"+letterToLabel(i)+extension+"#index_";
- startQuickIndexItem(ol,anchor+convertToId(is),i==page,TRUE,first);
+ anchor=fullName+"_"+is+extension+"#index_";
+ startQuickIndexItem(ol,anchor+convertToId(is),kv.first==page,TRUE,first);
ol.writeString(ci);
endQuickIndexItem(ol);
first=FALSE;
@@ -2945,7 +2937,7 @@ struct CmhlInfo
QCString title;
};
-static const CmhlInfo *getCmhlInfo(int hl)
+static const CmhlInfo *getCmhlInfo(size_t hl)
{
static bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
static bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
@@ -2996,19 +2988,17 @@ static void writeClassMemberIndexFiltered(OutputList &ol, ClassMemberHighlight h
}
bool first=TRUE;
- SIntDict<MemberIndexList>::Iterator it(g_memberIndexLetterUsed[hl]);
- MemberIndexList *ml;
- for (it.toFirst();(ml=it.current());++it)
+ for (const auto &kv : g_classIndexLetterUsed[hl])
{
- uint page = ml->letter();
+ std::string page = kv.first;
QCString fileName = getCmhlInfo(hl)->fname;
if (multiPageIndex)
{
+ QCString cs = page;
if (!first)
{
- fileName+="_"+letterToLabel(page);
+ fileName+="_"+letterToLabel(cs);
}
- QCString cs = letterToString(page);
if (addToIndex)
{
Doxygen::indexList->addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE);
@@ -3051,7 +3041,7 @@ static void writeClassMemberIndexFiltered(OutputList &ol, ClassMemberHighlight h
// quick alphabetical index
if (quickIndex)
{
- writeQuickMemberIndex(ol,g_memberIndexLetterUsed[hl],page,
+ writeQuickMemberIndex(ol,g_classIndexLetterUsed[hl],page,
getCmhlInfo(hl)->fname,multiPageIndex);
}
}
@@ -3076,8 +3066,8 @@ static void writeClassMemberIndexFiltered(OutputList &ol, ClassMemberHighlight h
}
writeMemberList(ol,quickIndex,
- multiPageIndex?page:-1,
- g_memberIndexLetterUsed[hl],
+ multiPageIndex ? page : std::string(),
+ g_classIndexLetterUsed[hl],
Definition::TypeClass);
endFile(ol);
first=FALSE;
@@ -3124,7 +3114,7 @@ struct FmhlInfo
QCString title;
};
-static const FmhlInfo *getFmhlInfo(int hl)
+static const FmhlInfo *getFmhlInfo(size_t hl)
{
static bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
static bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
@@ -3175,19 +3165,17 @@ static void writeFileMemberIndexFiltered(OutputList &ol, FileMemberHighlight hl)
}
bool first=TRUE;
- SIntDict<MemberIndexList>::Iterator it(g_fileIndexLetterUsed[hl]);
- MemberIndexList *ml;
- for (it.toFirst();(ml=it.current());++it)
+ for (const auto &kv : g_fileIndexLetterUsed[hl])
{
- uint page = ml->letter();
+ std::string page = kv.first;
QCString fileName = getFmhlInfo(hl)->fname;
if (multiPageIndex)
{
+ QCString cs = page;
if (!first)
{
- fileName+="_"+letterToLabel(page);
+ fileName+="_"+letterToLabel(cs);
}
- QCString cs = letterToString(page);
if (addToIndex)
{
Doxygen::indexList->addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE);
@@ -3252,7 +3240,7 @@ static void writeFileMemberIndexFiltered(OutputList &ol, FileMemberHighlight hl)
}
writeMemberList(ol,quickIndex,
- multiPageIndex?page:-1,
+ multiPageIndex ? page : std::string(),
g_fileIndexLetterUsed[hl],
Definition::TypeFile);
endFile(ol);
@@ -3297,7 +3285,7 @@ struct NmhlInfo
QCString title;
};
-static const NmhlInfo *getNmhlInfo(int hl)
+static const NmhlInfo *getNmhlInfo(size_t hl)
{
static bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
static bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
@@ -3351,19 +3339,17 @@ static void writeNamespaceMemberIndexFiltered(OutputList &ol,
}
bool first=TRUE;
- SIntDict<MemberIndexList>::Iterator it(g_namespaceIndexLetterUsed[hl]);
- MemberIndexList *ml;
- for (it.toFirst();(ml=it.current());++it)
+ for (const auto &kv : g_namespaceIndexLetterUsed[hl])
{
- uint page = ml->letter();
+ std::string page = kv.first;
QCString fileName = getNmhlInfo(hl)->fname;
if (multiPageIndex)
{
+ QCString cs = page;
if (!first)
{
- fileName+="_"+letterToLabel(page);
+ fileName+="_"+letterToLabel(cs);
}
- QCString cs = letterToString(page);
if (addToIndex)
{
Doxygen::indexList->addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE);
@@ -3428,7 +3414,7 @@ static void writeNamespaceMemberIndexFiltered(OutputList &ol,
}
writeMemberList(ol,quickIndex,
- multiPageIndex?page:-1,
+ multiPageIndex ? page : std::string(),
g_namespaceIndexLetterUsed[hl],
Definition::TypeNamespace);
endFile(ol);
@@ -4026,41 +4012,6 @@ static void writeGroupHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex)
}
}
-#if 0
-static void writeGroupTree(GroupDef *gd,FTVHelp *ftv,int level,bool addToIndex)
-{
- static bool externalGroups = Config_getBool(EXTERNAL_GROUPS);
- /* Some groups should appear twice under different parent-groups.
- * That is why we should not check if it was visited
- */
- if ((!gd->isASubGroup() || level>0) &&
- gd->isVisible() &&
- (!gd->isReference() || externalGroups) // hide external groups by default
- )
- {
- if (ftv)
- {
- ftv->addContentsItem(hasSubGroups,gd->groupTitle(),gd->getReference(),gd->getOutputFileBase(),0);
- ftv->incContentsDepth();
- }
- if (ftv)
- {
- ftv->decContentsDepth();
- }
- }
-}
-
-static void writeGroupTree(FTVHelp *ftv,bool addToIndex)
-{
- GroupSDict::Iterator gli(*Doxygen::groupSDict);
- GroupDef *gd;
- for (gli.toFirst();(gd=gli.current());++gli)
- {
- writeGroupTree(gd,ftv,0,addToIndex);
- }
-}
-#endif
-
//----------------------------------------------------------------------------
static void writeGroupIndex(OutputList &ol)
@@ -4133,62 +4084,6 @@ static void writeGroupIndex(OutputList &ol)
//----------------------------------------------------------------------------
-#if 0
-static void writeDirIndex(OutputList &ol)
-{
- if (documentedDirs==0) return;
- ol.pushGeneratorState();
- ol.disable(OutputGenerator::Man);
- LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Dirs);
- QCString title = lne ? lne->title() : theTranslator->trDirectories();
- bool addToIndex=FALSE; //lne==0 || lne->visible();
-
- startFile(ol,"dirs",0,title,HLI_Directories);
- startTitle(ol,0);
- ol.parseText(title);
- endTitle(ol,0,0);
- ol.startContents();
- ol.startTextBlock();
-
- if (addToIndex)
- {
- Doxygen::indexList->addContentsItem(TRUE,title,0,"dirs",0,TRUE,TRUE);
- Doxygen::indexList->incContentsDepth();
- }
- ol.parseText(lne ? lne->intro() : theTranslator->trDirDescription());
- ol.endTextBlock();
-
- FTVHelp* ftv = 0;
- bool treeView=Config_getBool(USE_INLINE_TREES);
- if (treeView)
- {
- ftv = new FTVHelp(FALSE);
- }
-
- writeDirHierarchy(ol,ftv,addToIndex);
-
- if (ftv)
- {
- QGString outStr;
- FTextStream t(&outStr);
- ftv->generateTreeViewInline(t);
- ol.pushGeneratorState();
- ol.disableAllBut(OutputGenerator::Html);
- ol.writeString(outStr);
- ol.popGeneratorState();
- delete ftv;
- }
- if (addToIndex)
- {
- Doxygen::indexList->decContentsDepth();
- }
- endFile(ol);
- ol.popGeneratorState();
-}
-#endif
-
-//----------------------------------------------------------------------------
-
static void writeUserGroupStubPage(OutputList &ol,LayoutNavEntry *lne)
{
if (lne->baseFile().left(9)=="usergroup")
@@ -4956,14 +4851,15 @@ static bool quickLinkVisible(LayoutNavEntry::Kind kind)
return FALSE;
}
-template<class T>
+template<class T,std::size_t total>
void renderMemberIndicesAsJs(FTextStream &t,
- int total,const int *numDocumented,const LetterToIndexMap<MemberIndexList> *memberLists,
- const T *(*getInfo)(int hl))
+ const int *numDocumented,
+ const std::array<MemberIndexMap,total> &memberLists,
+ const T *(*getInfo)(size_t hl))
{
// index items per category member lists
bool firstMember=TRUE;
- for (int i=0;i<total;i++)
+ for (std::size_t i=0;i<total;i++)
{
if (numDocumented[i]>0)
{
@@ -4988,14 +4884,12 @@ void renderMemberIndicesAsJs(FTextStream &t,
}
t << ",children:[" << endl;
bool firstLetter=TRUE;
- SIntDict<MemberIndexList>::Iterator it(memberLists[i]);
- MemberIndexList *ml;
- for (it.toFirst();(ml=it.current());++it)
+ for (const auto &kv : memberLists[i])
{
if (!firstLetter) t << "," << endl;
- uint letter = ml->letter();
- QCString is = letterToLabel(letter);
- QCString ci = letterToString(letter);
+ std::string letter = kv.first;
+ QCString ci = letter;
+ QCString is = letterToLabel(ci);
QCString anchor;
QCString extension=Doxygen::htmlFileExtension;
QCString fullName = getInfo(i)->fname;
@@ -5044,17 +4938,17 @@ static bool renderQuickLinksAsJs(FTextStream &t,LayoutNavEntry *root,bool first)
bool hasChildren=FALSE;
if (entry->kind()==LayoutNavEntry::NamespaceMembers)
{
- renderMemberIndicesAsJs(t,NMHL_Total,documentedNamespaceMembers,
+ renderMemberIndicesAsJs(t,documentedNamespaceMembers,
g_namespaceIndexLetterUsed,getNmhlInfo);
}
else if (entry->kind()==LayoutNavEntry::ClassMembers)
{
- renderMemberIndicesAsJs(t,CMHL_Total,documentedClassMembers,
- g_memberIndexLetterUsed,getCmhlInfo);
+ renderMemberIndicesAsJs(t,documentedClassMembers,
+ g_classIndexLetterUsed,getCmhlInfo);
}
else if (entry->kind()==LayoutNavEntry::FileGlobals)
{
- renderMemberIndicesAsJs(t,FMHL_Total,documentedFileMembers,
+ renderMemberIndicesAsJs(t,documentedFileMembers,
g_fileIndexLetterUsed,getFmhlInfo);
}
else // recursive into child list
diff --git a/src/index.h b/src/index.h
index 6cca60d..5088c46 100644
--- a/src/index.h
+++ b/src/index.h
@@ -257,9 +257,10 @@ void endFileWithNavPath(const Definition *d,OutputList &ol);
void initClassMemberIndices();
void initFileMemberIndices();
void initNamespaceMemberIndices();
-void addClassMemberNameToIndex(MemberDef *md);
-void addFileMemberNameToIndex(MemberDef *md);
-void addNamespaceMemberNameToIndex(MemberDef *md);
+void addClassMemberNameToIndex(const MemberDef *md);
+void addFileMemberNameToIndex(const MemberDef *md);
+void addNamespaceMemberNameToIndex(const MemberDef *md);
+void sortMemberIndexLists();
QCString fixSpaces(const QCString &s);
#endif
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp
index fbb6530..e6c9363 100644
--- a/src/latexdocvisitor.cpp
+++ b/src/latexdocvisitor.cpp
@@ -951,6 +951,26 @@ void LatexDocVisitor::visitPost(DocHtmlListItem *)
// m_t << "\\end{alltt}\\normalsize " << endl;
//}
+static bool listIsNested(const DocNode *n)
+{
+ bool isNested=false;
+ if (n)
+ {
+ if (n->kind()==DocNode::Kind_HtmlDescList && ((DocHtmlDescList *)n)->attribs().find("class") == "reflist") return false;
+ n = n->parent();
+ }
+ while (n && !isNested)
+ {
+ if (n->kind()==DocNode::Kind_HtmlDescList)
+ {
+ QCString val = ((DocHtmlDescList *)n)->attribs().find("class");
+ isNested = (val!="reflist");
+ }
+ n = n->parent();
+ }
+ return isNested;
+}
+
void LatexDocVisitor::visitPre(DocHtmlDescList *dl)
{
if (m_hide) return;
@@ -961,6 +981,7 @@ void LatexDocVisitor::visitPre(DocHtmlDescList *dl)
}
else
{
+ if (listIsNested(dl)) m_t << "\n\\hfill";
m_t << "\n\\begin{DoxyDescription}";
}
}
diff --git a/src/memberdef.cpp b/src/memberdef.cpp
index ecc07d7..638af9e 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -2000,12 +2000,17 @@ bool MemberDefImpl::isBriefSectionVisible() const
// "", //getFileDef()->name().data(),
// argsString());
- MemberGroupInfo *info = Doxygen::memGrpInfoDict[m_impl->grpId];
- //printf("name=%s m_impl->grpId=%d info=%p\n",name().data(),m_impl->grpId,info);
- //QCString *pMemGrp = Doxygen::memberDocDict[grpId];
- bool hasDocs = hasDocumentation() ||
+ auto it = Doxygen::memberGroupInfoMap.find(m_impl->grpId);
+ bool hasDocs = hasDocumentation();
+ if (it!=Doxygen::memberGroupInfoMap.end())
+ {
+ auto &info = it->second;
+ //printf("name=%s m_impl->grpId=%d info=%p\n",name().data(),m_impl->grpId,info);
+ //QCString *pMemGrp = Doxygen::memberDocDict[grpId];
+ hasDocs = hasDocs ||
// part of a documented member group
- (m_impl->grpId!=-1 && info && !(info->doc.isEmpty() && info->header.isEmpty()));
+ (m_impl->grpId!=-1 && !(info->doc.isEmpty() && info->header.isEmpty()));
+ }
// only include static members with file/namespace scope if
// explicitly enabled in the config file
diff --git a/src/membergroup.h b/src/membergroup.h
index e1dae25..72e25ed 100644
--- a/src/membergroup.h
+++ b/src/membergroup.h
@@ -19,6 +19,8 @@
#define MEMBERGROUP_H
#include <vector>
+#include <map>
+#include <memory>
#include <qlist.h>
#include "sortdict.h"
@@ -105,31 +107,9 @@ class MemberGroup
RefItemVector m_xrefListItems;
};
-/** A list of MemberGroup objects. */
-class MemberGroupList : public QList<MemberGroup>
-{
-};
-
-/** An iterator for MemberGroup objects in a MemberGroupList. */
-class MemberGroupListIterator : public QListIterator<MemberGroup>
-{
- public:
- MemberGroupListIterator(const MemberGroupList &l) :
- QListIterator<MemberGroup>(l) {}
-};
-
-/** A sorted dictionary of MemberGroup objects. */
-class MemberGroupSDict : public SIntDict<MemberGroup>
-{
- public:
- MemberGroupSDict(int size=17) : SIntDict<MemberGroup>(size) {}
- ~MemberGroupSDict() {}
- private:
- int compareValues(const MemberGroup *item1,const MemberGroup *item2) const
- {
- return item1->groupId() - item2->groupId();
- }
-};
+using MemberGroupRefList = std::vector<MemberGroup *>;
+//using MemberGroupMap = std::map< int, std::unique_ptr<MemberGroup> >;
+using MemberGroupList = std::vector< std::unique_ptr<MemberGroup> >;
/** Data collected for a member group */
struct MemberGroupInfo
diff --git a/src/memberlist.cpp b/src/memberlist.cpp
index bbc6e5d..4daedb5 100644
--- a/src/memberlist.cpp
+++ b/src/memberlist.cpp
@@ -35,7 +35,6 @@
MemberList::MemberList() : m_listType(MemberListType_pubMethods)
{
//printf("%p: MemberList::MemberList()\n",this);
- memberGroupList=0;
m_numDecMembers=-1; // special value indicating that value needs to be computed
m_numDecEnumValues=0;
m_numDocMembers=-1; // special value indicating that value needs to be computed
@@ -48,7 +47,6 @@ MemberList::MemberList() : m_listType(MemberListType_pubMethods)
MemberList::MemberList(MemberListType lt) : m_listType(lt)
{
//printf("%p: MemberList::MemberList(%d)\n",this,lt);
- memberGroupList=0;
m_numDecMembers=-1; // special value indicating that value needs to be computed
m_numDecEnumValues=0;
m_numDocMembers=-1; // special value indicating that value needs to be computed
@@ -60,7 +58,6 @@ MemberList::MemberList(MemberListType lt) : m_listType(lt)
MemberList::~MemberList()
{
- delete memberGroupList;
}
int genericCompareMembers(const MemberDef *c1,const MemberDef *c2)
@@ -126,14 +123,9 @@ int MemberList::countInheritableMembers(const ClassDef *inheritedFrom) const
}
}
}
- if (memberGroupList)
+ for (const auto &mg : m_memberGroupRefList)
{
- MemberGroupListIterator mgli(*memberGroupList);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- count+=mg->countInheritableMembers(inheritedFrom);
- }
+ count+=mg->countInheritableMembers(inheritedFrom);
}
//printf("%s::countInheritableMembers(%s)=%d\n",
// listTypeAsString().data(),
@@ -208,28 +200,23 @@ void MemberList::countDecMembers()
}
}
}
- if (memberGroupList)
+ for (const auto &mg : m_memberGroupRefList)
{
- MemberGroupListIterator mgli(*memberGroupList);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->countDecMembers();
- /*
- m_varCnt+=mg->varCount();
- m_funcCnt+=mg->funcCount();
- m_enumCnt+=mg->enumCount();
- m_enumValCnt+=mg->enumValueCount();
- m_typeCnt+=mg->typedefCount();
- m_seqCnt+=mg->sequenceCount();
- m_dictCnt+=mg->dictionaryCount();
- m_protoCnt+=mg->protoCount();
- m_defCnt+=mg->defineCount();
- m_friendCnt+=mg->friendCount();
- */
- m_numDecMembers+=mg->numDecMembers();
- m_numDecEnumValues+=mg->numDecEnumValues();
- }
+ mg->countDecMembers();
+ /*
+ m_varCnt+=mg->varCount();
+ m_funcCnt+=mg->funcCount();
+ m_enumCnt+=mg->enumCount();
+ m_enumValCnt+=mg->enumValueCount();
+ m_typeCnt+=mg->typedefCount();
+ m_seqCnt+=mg->sequenceCount();
+ m_dictCnt+=mg->dictionaryCount();
+ m_protoCnt+=mg->protoCount();
+ m_defCnt+=mg->defineCount();
+ m_friendCnt+=mg->friendCount();
+ */
+ m_numDecMembers+=mg->numDecMembers();
+ m_numDecEnumValues+=mg->numDecEnumValues();
}
//printf("----- end countDecMembers ----\n");
@@ -254,16 +241,11 @@ void MemberList::countDocMembers()
m_numDocMembers++;
}
}
- if (memberGroupList)
+ for (const auto &mg : m_memberGroupRefList)
{
- MemberGroupListIterator mgli(*memberGroupList);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->countDocMembers();
- m_numDocMembers+=mg->numDocMembers();
- m_numDocEnumValues+=mg->numDocEnumValues();
- }
+ mg->countDocMembers();
+ m_numDocMembers+=mg->numDocMembers();
+ m_numDocEnumValues+=mg->numDocEnumValues();
}
//printf("MemberList::countDocMembers()=%d memberGroupList=%p\n",m_numDocMembers,memberGroupList);
}
@@ -348,14 +330,9 @@ void MemberList::setAnonymousEnumType()
}
}
}
- if (memberGroupList)
+ for (const auto &mg : m_memberGroupRefList)
{
- MemberGroupListIterator mgli(*memberGroupList);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->setAnonymousEnumType();
- }
+ mg->setAnonymousEnumType();
}
}
@@ -718,39 +695,33 @@ void MemberList::writeDeclarations(OutputList &ol,
}
//printf("memberGroupList=%p\n",memberGroupList);
- if (memberGroupList)
+ for (const auto &mg : m_memberGroupRefList)
{
- MemberGroupListIterator mgli(*memberGroupList);
- MemberGroup *mg;
- while ((mg=mgli.current()))
+ bool hasHeader=!mg->header().isEmpty() && mg->header()!="[NOHEADER]";
+ if (inheritId.isEmpty())
{
- bool hasHeader=!mg->header().isEmpty() && mg->header()!="[NOHEADER]";
- if (inheritId.isEmpty())
+ //printf("mg->header=%s hasHeader=%d\n",mg->header().data(),hasHeader);
+ ol.startMemberGroupHeader(hasHeader);
+ if (hasHeader)
{
- //printf("mg->header=%s hasHeader=%d\n",mg->header().data(),hasHeader);
- ol.startMemberGroupHeader(hasHeader);
- if (hasHeader)
- {
- ol.parseText(mg->header());
- }
- ol.endMemberGroupHeader();
- if (!mg->documentation().isEmpty())
- {
- //printf("Member group has docs!\n");
- ol.startMemberGroupDocs();
- ol.generateDoc(mg->docFile(),mg->docLine(),ctx,0,mg->documentation()+"\n",FALSE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
- ol.endMemberGroupDocs();
- }
- ol.startMemberGroup();
+ ol.parseText(mg->header());
}
- //printf("--- mg->writePlainDeclarations ---\n");
- mg->writePlainDeclarations(ol,cd,nd,fd,gd,inheritedFrom,inheritId);
- if (inheritId.isEmpty())
+ ol.endMemberGroupHeader();
+ if (!mg->documentation().isEmpty())
{
- ol.endMemberGroup(hasHeader);
+ //printf("Member group has docs!\n");
+ ol.startMemberGroupDocs();
+ ol.generateDoc(mg->docFile(),mg->docLine(),ctx,0,mg->documentation()+"\n",FALSE,FALSE,
+ 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ ol.endMemberGroupDocs();
}
- ++mgli;
+ ol.startMemberGroup();
+ }
+ //printf("--- mg->writePlainDeclarations ---\n");
+ mg->writePlainDeclarations(ol,cd,nd,fd,gd,inheritedFrom,inheritId);
+ if (inheritId.isEmpty())
+ {
+ ol.endMemberGroup(hasHeader);
}
}
}
@@ -834,15 +805,10 @@ void MemberList::writeDocumentation(OutputList &ol,
}
}
}
- if (memberGroupList)
+ //printf("MemberList::writeDocumentation() -- member groups %d\n",memberGroupList->count());
+ for (const auto &mg : m_memberGroupRefList)
{
- //printf("MemberList::writeDocumentation() -- member groups %d\n",memberGroupList->count());
- MemberGroupListIterator mgli(*memberGroupList);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->writeDocumentation(ol,scopeName,container,showEnumValues,showInline);
- }
+ mg->writeDocumentation(ol,scopeName,container,showEnumValues,showInline);
}
ol.endMemberDocList();
}
@@ -953,26 +919,15 @@ void MemberList::writeDocumentationPage(OutputList &ol,
}
}
}
- if (memberGroupList)
+ for (const auto &mg : m_memberGroupRefList)
{
- //printf("MemberList::writeDocumentation() -- member groups\n");
- MemberGroupListIterator mgli(*memberGroupList);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->writeDocumentationPage(ol,scopeName,container);
- }
+ mg->writeDocumentationPage(ol,scopeName,container);
}
}
void MemberList::addMemberGroup(MemberGroup *mg)
{
- if (memberGroupList==0)
- {
- memberGroupList=new MemberGroupList;
- }
- //printf("addMemberGroup: this=%p mg=%p\n",this,mg);
- memberGroupList->append(mg);
+ m_memberGroupRefList.push_back(mg);
}
void MemberList::addListReferences(Definition *def)
@@ -1003,14 +958,9 @@ void MemberList::addListReferences(Definition *def)
}
}
}
- if (memberGroupList)
+ for (const auto &mg : m_memberGroupRefList)
{
- MemberGroupListIterator mgli(*memberGroupList);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->addListReferences(def);
- }
+ mg->addListReferences(def);
}
}
@@ -1026,14 +976,9 @@ void MemberList::findSectionsInDocumentation(const Definition *d)
md->findSectionsInDocumentation();
}
}
- if (memberGroupList)
+ for (const auto &mg : m_memberGroupRefList)
{
- MemberGroupListIterator mgli(*memberGroupList);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->findSectionsInDocumentation(d);
- }
+ mg->findSectionsInDocumentation(d);
}
}
@@ -1132,14 +1077,9 @@ void MemberList::writeTagFile(FTextStream &tagFile)
}
}
}
- if (memberGroupList)
+ for (const auto &mg : m_memberGroupRefList)
{
- MemberGroupListIterator mgli(*memberGroupList);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->writeTagFile(tagFile);
- }
+ mg->writeTagFile(tagFile);
}
}
diff --git a/src/memberlist.h b/src/memberlist.h
index e62655b..2c2d5ee 100644
--- a/src/memberlist.h
+++ b/src/memberlist.h
@@ -16,14 +16,15 @@
#ifndef MEMBERLIST_H
#define MEMBERLIST_H
+#include <vector>
+
#include <qlist.h>
#include "memberdef.h"
#include "sortdict.h"
#include "types.h"
+#include "membergroup.h"
class GroupDef;
-class MemberGroup;
-class MemberGroupList;
/** A list of MemberDef objects. */
class MemberList : private QList<MemberDef>
@@ -88,7 +89,7 @@ class MemberList : private QList<MemberDef>
void addListReferences(Definition *def);
void findSectionsInDocumentation(const Definition *d);
void setNeedsSorting(bool b);
- MemberGroupList *getMemberGroupList() const { return memberGroupList; }
+ const MemberGroupRefList &getMemberGroupList() const { return m_memberGroupRefList; }
void setAnonymousEnumType();
void setAnchors();
@@ -110,7 +111,7 @@ class MemberList : private QList<MemberDef>
int m_numDecEnumValues;
int m_numDocMembers; // number of members in the detailed part of the memberlist
int m_numDocEnumValues;
- MemberGroupList *memberGroupList;
+ MemberGroupRefList m_memberGroupRefList;
bool m_inGroup; // is this list part of a group definition
bool m_inFile; // is this list part of a file definition
MemberListType m_listType;
diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp
index 11597bc..0651fdf 100644
--- a/src/namespacedef.cpp
+++ b/src/namespacedef.cpp
@@ -97,7 +97,7 @@ class NamespaceDefImpl : public DefinitionMixin<NamespaceDefMutable>
virtual MemberList *getMemberList(MemberListType lt) const;
virtual const QList<MemberList> &getMemberLists() const { return m_memberLists; }
virtual MemberDef *getMemberByName(const QCString &) const;
- virtual MemberGroupSDict *getMemberGroupSDict() const { return memberGroupSDict; }
+ virtual const MemberGroupList &getMemberGroups() const { return m_memberGroups; }
virtual ClassLinkedRefMap getClasses() const { return classes; }
virtual ClassLinkedRefMap getInterfaces() const { return interfaces; }
virtual ClassLinkedRefMap getStructs() const { return structs; }
@@ -140,7 +140,7 @@ class NamespaceDefImpl : public DefinitionMixin<NamespaceDefMutable>
MemberSDict *m_allMembersDict = 0;
QList<MemberList> m_memberLists;
- MemberGroupSDict *memberGroupSDict = 0;
+ MemberGroupList m_memberGroups;
ClassLinkedRefMap classes;
ClassLinkedRefMap interfaces;
ClassLinkedRefMap structs;
@@ -212,8 +212,8 @@ class NamespaceDefAliasImpl : public DefinitionAliasMixin<NamespaceDef>
{ return getNSAlias()->getMemberLists(); }
virtual MemberDef *getMemberByName(const QCString &name) const
{ return getNSAlias()->getMemberByName(name); }
- virtual MemberGroupSDict *getMemberGroupSDict() const
- { return getNSAlias()->getMemberGroupSDict(); }
+ virtual const MemberGroupList &getMemberGroups() const
+ { return getNSAlias()->getMemberGroups(); }
virtual ClassLinkedRefMap getClasses() const
{ return getNSAlias()->getClasses(); }
virtual ClassLinkedRefMap getInterfaces() const
@@ -266,8 +266,6 @@ NamespaceDefImpl::NamespaceDefImpl(const char *df,int dl,int dc,
m_innerCompounds = new SDict<Definition>(17);
m_allMembersDict = 0;
setReference(lref);
- memberGroupSDict = new MemberGroupSDict;
- memberGroupSDict->setAutoDelete(TRUE);
m_inline=FALSE;
m_subGrouping=Config_getBool(SUBGROUPING);
if (type && !strcmp("module", type))
@@ -291,7 +289,6 @@ NamespaceDefImpl::NamespaceDefImpl(const char *df,int dl,int dc,
NamespaceDefImpl::~NamespaceDefImpl()
{
delete m_innerCompounds;
- delete memberGroupSDict;
delete m_allMembersDict;
}
@@ -309,9 +306,7 @@ void NamespaceDefImpl::setFileName(const QCString &fn)
void NamespaceDefImpl::distributeMemberGroupDocumentation()
{
- MemberGroupSDict::Iterator mgli(*memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
+ for (const auto &mg : m_memberGroups)
{
mg->distributeMemberGroupDocumentation();
}
@@ -321,9 +316,7 @@ void NamespaceDefImpl::findSectionsInDocumentation()
{
docFindSections(briefDescription(),this,docFile());
docFindSections(documentation(),this,docFile());
- MemberGroupSDict::Iterator mgli(*memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
+ for (const auto &mg : m_memberGroups)
{
mg->findSectionsInDocumentation(this);
}
@@ -400,22 +393,17 @@ void NamespaceDefImpl::addMembersToMemberGroup()
{
if (ml->listType()&MemberListType_declarationLists)
{
- ::addMembersToMemberGroup(ml,&memberGroupSDict,this);
+ ::addMembersToMemberGroup(ml,&m_memberGroups,this);
}
}
// add members inside sections to their groups
- if (memberGroupSDict)
+ for (const auto &mg : m_memberGroups)
{
- MemberGroupSDict::Iterator mgli(*memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
+ if (mg->allMembersInSameSection() && m_subGrouping)
{
- if (mg->allMembersInSameSection() && m_subGrouping)
- {
- //printf("----> addToDeclarationSection(%s)\n",mg->header().data());
- mg->addToDeclarationSection();
- }
+ //printf("----> addToDeclarationSection(%s)\n",mg->header().data());
+ mg->addToDeclarationSection();
}
}
}
@@ -620,14 +608,9 @@ void NamespaceDefImpl::writeTagFile(FTextStream &tagFile)
break;
case LayoutDocEntry::MemberGroups:
{
- if (memberGroupSDict)
+ for (const auto &mg : m_memberGroups)
{
- MemberGroupSDict::Iterator mgli(*memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->writeTagFile(tagFile);
- }
+ mg->writeTagFile(tagFile);
}
}
break;
@@ -789,18 +772,12 @@ void NamespaceDefImpl::writeNamespaceDeclarations(OutputList &ol,const QCString
void NamespaceDefImpl::writeMemberGroups(OutputList &ol)
{
/* write user defined member groups */
- if (memberGroupSDict)
+ for (const auto &mg : m_memberGroups)
{
- memberGroupSDict->sort();
- MemberGroupSDict::Iterator mgli(*memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
+ if ((!mg->allMembersInSameSection() || !m_subGrouping)
+ && mg->header()!="[NOHEADER]")
{
- if ((!mg->allMembersInSameSection() || !m_subGrouping)
- && mg->header()!="[NOHEADER]")
- {
- mg->writeDeclarations(ol,0,this,0,0);
- }
+ mg->writeDeclarations(ol,0,this,0,0);
}
}
}
@@ -1146,15 +1123,10 @@ void NamespaceDefImpl::countMembers()
ml->countDecMembers();
ml->countDocMembers();
}
- if (memberGroupSDict)
+ for (const auto &mg : m_memberGroups)
{
- MemberGroupSDict::Iterator mgli(*memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- mg->countDecMembers();
- mg->countDocMembers();
- }
+ mg->countDecMembers();
+ mg->countDocMembers();
}
}
@@ -1213,9 +1185,7 @@ void NamespaceDefImpl::addListReferences()
this
);
}
- MemberGroupSDict::Iterator mgli(*memberGroupSDict);
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
+ for (const auto &mg : m_memberGroups)
{
mg->addListReferences(this);
}
diff --git a/src/namespacedef.h b/src/namespacedef.h
index e9bf86f..fb6a0d5 100644
--- a/src/namespacedef.h
+++ b/src/namespacedef.h
@@ -22,13 +22,13 @@
#include "definition.h"
#include "filedef.h"
#include "linkedmap.h"
+#include "membergroup.h"
class MemberList;
class ClassDef;
class OutputList;
class ClassLinkedRefMap;
class MemberDef;
-class MemberGroupSDict;
class NamespaceDef;
class FTextStream;
class NamespaceDef;
@@ -79,7 +79,7 @@ class NamespaceDef : public Definition
virtual MemberDef *getMemberByName(const QCString &) const = 0;
/*! Returns the user defined member groups */
- virtual MemberGroupSDict *getMemberGroupSDict() const = 0;
+ virtual const MemberGroupList &getMemberGroups() const = 0;
/*! Returns the classes contained in this namespace */
virtual ClassLinkedRefMap getClasses() const = 0;
diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp
index d84d5e4..e7a41c6 100644
--- a/src/perlmodgen.cpp
+++ b/src/perlmodgen.cpp
@@ -1529,7 +1529,7 @@ public:
inline PerlModGenerator(bool pretty) : m_output(pretty) { }
void generatePerlModForMember(const MemberDef *md, const Definition *);
- void generatePerlUserDefinedSection(const Definition *d, const MemberGroupSDict *gsd);
+ void generatePerlUserDefinedSection(const Definition *d, const MemberGroupList &mgl);
void generatePerlModSection(const Definition *d, MemberList *ml,
const char *name, const char *header=0);
void addListOfAllMembers(const ClassDef *cd);
@@ -1776,37 +1776,33 @@ void PerlModGenerator::addListOfAllMembers(const ClassDef *cd)
m_output.closeList();
}
-/* DGA: fix #7490 Perlmod generation issue with multiple grouped functions (member groups) */
-void PerlModGenerator::generatePerlUserDefinedSection(const Definition *d, const MemberGroupSDict *gsd)
-{
- if (gsd)
- {
- MemberGroupSDict::Iterator mgli(*gsd);
- MemberGroup *mg;
- m_output.openList("user_defined");
- for (; (mg = mgli.current()); ++mgli)
- {
- m_output.openHash();
- if (mg->header())
- m_output.addFieldQuotedString("header", mg->header());
-
- if (mg->members())
- {
- m_output.openList("members");
- MemberListIterator mli(*mg->members());
- const MemberDef *md;
- for (mli.toFirst(); (md = mli.current()); ++mli)
- {
- generatePerlModForMember(md, d);
- }
- m_output.closeList();
- }
- m_output.closeHash();
- }
- m_output.closeList();
- }
-}
-/* DGA: end of fix #7490 */
+void PerlModGenerator::generatePerlUserDefinedSection(const Definition *d, const MemberGroupList &mgl)
+{
+ if (!mgl.empty())
+ {
+ m_output.openList("user_defined");
+ for (const auto &mg : mgl)
+ {
+ m_output.openHash();
+ if (mg->header())
+ m_output.addFieldQuotedString("header", mg->header());
+
+ if (mg->members())
+ {
+ m_output.openList("members");
+ MemberListIterator mli(*mg->members());
+ const MemberDef *md;
+ for (mli.toFirst(); (md = mli.current()); ++mli)
+ {
+ generatePerlModForMember(md, d);
+ }
+ m_output.closeList();
+ }
+ m_output.closeHash();
+ }
+ m_output.closeList();
+ }
+}
void PerlModGenerator::generatePerlModForClass(const ClassDef *cd)
{
@@ -1892,7 +1888,7 @@ void PerlModGenerator::generatePerlModForClass(const ClassDef *cd)
addTemplateList(cd,m_output);
addListOfAllMembers(cd);
- generatePerlUserDefinedSection(cd, cd->getMemberGroupSDict());
+ generatePerlUserDefinedSection(cd, cd->getMemberGroups());
generatePerlModSection(cd,cd->getMemberList(MemberListType_pubTypes),"public_typedefs");
generatePerlModSection(cd,cd->getMemberList(MemberListType_pubMethods),"public_methods");
@@ -1986,7 +1982,7 @@ void PerlModGenerator::generatePerlModForNamespace(const NamespaceDef *nd)
m_output.closeList();
}
- generatePerlUserDefinedSection(nd, nd->getMemberGroupSDict());
+ generatePerlUserDefinedSection(nd, nd->getMemberGroups());
generatePerlModSection(nd,nd->getMemberList(MemberListType_decDefineMembers),"defines");
generatePerlModSection(nd,nd->getMemberList(MemberListType_decProtoMembers),"prototypes");
@@ -2057,8 +2053,7 @@ void PerlModGenerator::generatePerlModForFile(const FileDef *fd)
}
m_output.closeList();
- /* DGA: fix #7494 Perlmod does not generate grouped members from files */
- generatePerlUserDefinedSection(fd, fd->getMemberGroupSDict());
+ generatePerlUserDefinedSection(fd, fd->getMemberGroups());
generatePerlModSection(fd,fd->getMemberList(MemberListType_decDefineMembers),"defines");
generatePerlModSection(fd,fd->getMemberList(MemberListType_decProtoMembers),"prototypes");
@@ -2152,7 +2147,7 @@ void PerlModGenerator::generatePerlModForGroup(const GroupDef *gd)
m_output.closeList();
}
- generatePerlUserDefinedSection(gd, gd->getMemberGroupSDict());
+ generatePerlUserDefinedSection(gd, gd->getMemberGroups());
generatePerlModSection(gd,gd->getMemberList(MemberListType_decDefineMembers),"defines");
generatePerlModSection(gd,gd->getMemberList(MemberListType_decProtoMembers),"prototypes");
diff --git a/src/searchindex.cpp b/src/searchindex.cpp
index 42601b9..0b2b219 100644
--- a/src/searchindex.cpp
+++ b/src/searchindex.cpp
@@ -1,8 +1,6 @@
/******************************************************************************
*
- *
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2020 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
@@ -15,6 +13,7 @@
*
*/
+
#include <ctype.h>
#include <assert.h>
@@ -31,7 +30,6 @@
#include "message.h"
#include "version.h"
#include "groupdef.h"
-#include "classlist.h"
#include "filedef.h"
#include "memberdef.h"
#include "filename.h"
@@ -40,6 +38,10 @@
#include "namespacedef.h"
#include "classdef.h"
+//---------------------------------------------------------------------------------------------
+// the following part is for the server based search engine
+//---------------------------------------------------------------------------------------------
+
// file format: (all multi-byte values are stored in big endian format)
// 4 byte header
// 256*256*4 byte index (4 bytes)
@@ -532,11 +534,96 @@ void SearchIndexExternal::write(const char *fileName)
}
}
-//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------------
// the following part is for the javascript based search engine
+//---------------------------------------------------------------------------------------------
+
+QCString searchName(const Definition *d)
+{
+ return d->definitionType()==Definition::TypeGroup ? QCString(toGroupDef(d)->groupTitle()) :
+ d->definitionType()==Definition::TypePage ? toPageDef(d)->title() :
+ d->localName();
+}
+
+QCString searchId(const Definition *d)
+{
+ QCString s = searchName(d);
+ int c;
+ uint i;
+ QCString result;
+ for (i=0;i<s.length();i++)
+ {
+ c=s.at(i);
+ if (c>0x7f || c<0) // part of multibyte character
+ {
+ result+=(char)c;
+ }
+ else if (isalnum(c)) // simply alpha numerical character
+ {
+ result+=(char)tolower(c);
+ }
+ else // other 'unprintable' characters
+ {
+ char val[4];
+ sprintf(val,"_%02x",(uchar)c);
+ result+=val;
+ }
+ }
+ return result;
+}
-static SearchIndexInfo g_searchIndexInfo[NUM_SEARCH_INDICES];
+#define SEARCH_INDEX_ALL 0
+#define SEARCH_INDEX_CLASSES 1
+#define SEARCH_INDEX_INTERFACES 2
+#define SEARCH_INDEX_STRUCTS 3
+#define SEARCH_INDEX_EXCEPTIONS 4
+#define SEARCH_INDEX_NAMESPACES 5
+#define SEARCH_INDEX_FILES 6
+#define SEARCH_INDEX_FUNCTIONS 7
+#define SEARCH_INDEX_VARIABLES 8
+#define SEARCH_INDEX_TYPEDEFS 9
+#define SEARCH_INDEX_SEQUENCES 10
+#define SEARCH_INDEX_DICTIONARIES 11
+#define SEARCH_INDEX_ENUMS 12
+#define SEARCH_INDEX_ENUMVALUES 13
+#define SEARCH_INDEX_PROPERTIES 14
+#define SEARCH_INDEX_EVENTS 15
+#define SEARCH_INDEX_RELATED 16
+#define SEARCH_INDEX_DEFINES 17
+#define SEARCH_INDEX_GROUPS 18
+#define SEARCH_INDEX_PAGES 19
+
+static std::array<SearchIndexInfo,NUM_SEARCH_INDICES> g_searchIndexInfo =
+{ {
+ // index name getText symbolList
+ { /* SEARCH_INDEX_ALL */ "all" , []() { return theTranslator->trAll(); }, {} },
+ { /* SEARCH_INDEX_CLASSES */ "classes" , []() { return theTranslator->trClasses(); }, {} },
+ { /* SEARCH_INDEX_INTERFACES */ "interfaces" , []() { return theTranslator->trSliceInterfaces(); }, {} },
+ { /* SEARCH_INDEX_STRUCTS */ "structs" , []() { return theTranslator->trStructs(); }, {} },
+ { /* SEARCH_INDEX_EXCEPTIONS */ "exceptions" , []() { return theTranslator->trExceptions(); }, {} },
+ { /* SEARCH_INDEX_NAMESPACES */ "namespaces" , []() { return Config_getBool(OPTIMIZE_OUTPUT_SLICE) ?
+ theTranslator->trModules() :
+ theTranslator->trNamespace(TRUE,FALSE); }, {} },
+ { /* SEARCH_INDEX_FILES */ "files" , []() { return theTranslator->trFile(TRUE,FALSE); }, {} },
+ { /* SEARCH_INDEX_FUNCTIONS */ "functions" , []() { return Config_getBool(OPTIMIZE_OUTPUT_SLICE) ?
+ theTranslator->trOperations() :
+ theTranslator->trFunctions(); }, {} },
+ { /* SEARCH_INDEX_VARIABLES */ "variables" , []() { return Config_getBool(OPTIMIZE_OUTPUT_SLICE) ?
+ theTranslator->trConstants() :
+ theTranslator->trVariables(); }, {} },
+ { /* SEARCH_INDEX_TYPEDEFS */ "typedefs" , []() { return theTranslator->trTypedefs(); }, {} },
+ { /* SEARCH_INDEX_SEQUENCES */ "sequences" , []() { return theTranslator->trSequences(); }, {} },
+ { /* SEARCH_INDEX_DICTIONARIES */ "dictionaries", []() { return theTranslator->trDictionaries(); }, {} },
+ { /* SEARCH_INDEX_ENUMS */ "enums" , []() { return theTranslator->trEnumerations(); }, {} },
+ { /* SEARCH_INDEX_ENUMVALUES */ "enumvalues" , []() { return theTranslator->trEnumerationValues(); }, {} },
+ { /* SEARCH_INDEX_PROPERTIES */ "properties" , []() { return theTranslator->trProperties(); }, {} },
+ { /* SEARCH_INDEX_EVENTS */ "events" , []() { return theTranslator->trEvents(); }, {} },
+ { /* SEARCH_INDEX_RELATED */ "related" , []() { return theTranslator->trFriends(); }, {} },
+ { /* SEARCH_INDEX_DEFINES */ "defines" , []() { return theTranslator->trDefines(); }, {} },
+ { /* SEARCH_INDEX_GROUPS */ "groups" , []() { return theTranslator->trGroup(TRUE,FALSE); }, {} },
+ { /* SEARCH_INDEX_PAGES */ "pages" , []() { return theTranslator->trPage(TRUE,FALSE); }, {} }
+} };
static void addMemberToSearchIndex(const MemberDef *md)
{
@@ -556,55 +643,56 @@ static void addMemberToSearchIndex(const MemberDef *md)
QCString n = md->name();
if (!n.isEmpty())
{
- uint letter = getUtf8CodeToLower(n,0);
+ char letter[MAX_UTF8_CHAR_SIZE];
+ getUtf8Char(n,letter,CaseModifier::ToLower);
bool isFriendToHide = hideFriendCompounds &&
(QCString(md->typeString())=="friend class" ||
QCString(md->typeString())=="friend struct" ||
QCString(md->typeString())=="friend union");
if (!(md->isFriend() && isFriendToHide))
{
- g_searchIndexInfo[SEARCH_INDEX_ALL].symbolList.append(letter,md);
+ g_searchIndexInfo[SEARCH_INDEX_ALL].add(letter,md);
}
if (md->isFunction() || md->isSlot() || md->isSignal())
{
- g_searchIndexInfo[SEARCH_INDEX_FUNCTIONS].symbolList.append(letter,md);
+ g_searchIndexInfo[SEARCH_INDEX_FUNCTIONS].add(letter,md);
}
else if (md->isVariable())
{
- g_searchIndexInfo[SEARCH_INDEX_VARIABLES].symbolList.append(letter,md);
+ g_searchIndexInfo[SEARCH_INDEX_VARIABLES].add(letter,md);
}
else if (md->isSequence())
{
- g_searchIndexInfo[SEARCH_INDEX_SEQUENCES].symbolList.append(letter,md);
+ g_searchIndexInfo[SEARCH_INDEX_SEQUENCES].add(letter,md);
}
else if (md->isDictionary())
{
- g_searchIndexInfo[SEARCH_INDEX_DICTIONARIES].symbolList.append(letter,md);
+ g_searchIndexInfo[SEARCH_INDEX_DICTIONARIES].add(letter,md);
}
else if (md->isTypedef())
{
- g_searchIndexInfo[SEARCH_INDEX_TYPEDEFS].symbolList.append(letter,md);
+ g_searchIndexInfo[SEARCH_INDEX_TYPEDEFS].add(letter,md);
}
else if (md->isEnumerate())
{
- g_searchIndexInfo[SEARCH_INDEX_ENUMS].symbolList.append(letter,md);
+ g_searchIndexInfo[SEARCH_INDEX_ENUMS].add(letter,md);
}
else if (md->isEnumValue())
{
- g_searchIndexInfo[SEARCH_INDEX_ENUMVALUES].symbolList.append(letter,md);
+ g_searchIndexInfo[SEARCH_INDEX_ENUMVALUES].add(letter,md);
}
else if (md->isProperty())
{
- g_searchIndexInfo[SEARCH_INDEX_PROPERTIES].symbolList.append(letter,md);
+ g_searchIndexInfo[SEARCH_INDEX_PROPERTIES].add(letter,md);
}
else if (md->isEvent())
{
- g_searchIndexInfo[SEARCH_INDEX_EVENTS].symbolList.append(letter,md);
+ g_searchIndexInfo[SEARCH_INDEX_EVENTS].add(letter,md);
}
else if (md->isRelated() || md->isForeign() ||
(md->isFriend() && !isFriendToHide))
{
- g_searchIndexInfo[SEARCH_INDEX_RELATED].symbolList.append(letter,md);
+ g_searchIndexInfo[SEARCH_INDEX_RELATED].add(letter,md);
}
}
}
@@ -617,155 +705,80 @@ static void addMemberToSearchIndex(const MemberDef *md)
QCString n = md->name();
if (!n.isEmpty())
{
- uint letter = getUtf8CodeToLower(n,0);
- g_searchIndexInfo[SEARCH_INDEX_ALL].symbolList.append(letter,md);
+ char letter[MAX_UTF8_CHAR_SIZE];
+ getUtf8Char(n,letter,CaseModifier::ToLower);
+ g_searchIndexInfo[SEARCH_INDEX_ALL].add(letter,md);
if (md->isFunction())
{
- g_searchIndexInfo[SEARCH_INDEX_FUNCTIONS].symbolList.append(letter,md);
+ g_searchIndexInfo[SEARCH_INDEX_FUNCTIONS].add(letter,md);
}
else if (md->isVariable())
{
- g_searchIndexInfo[SEARCH_INDEX_VARIABLES].symbolList.append(letter,md);
+ g_searchIndexInfo[SEARCH_INDEX_VARIABLES].add(letter,md);
}
else if (md->isSequence())
{
- g_searchIndexInfo[SEARCH_INDEX_SEQUENCES].symbolList.append(letter,md);
+ g_searchIndexInfo[SEARCH_INDEX_SEQUENCES].add(letter,md);
}
else if (md->isDictionary())
{
- g_searchIndexInfo[SEARCH_INDEX_DICTIONARIES].symbolList.append(letter,md);
+ g_searchIndexInfo[SEARCH_INDEX_DICTIONARIES].add(letter,md);
}
else if (md->isTypedef())
{
- g_searchIndexInfo[SEARCH_INDEX_TYPEDEFS].symbolList.append(letter,md);
+ g_searchIndexInfo[SEARCH_INDEX_TYPEDEFS].add(letter,md);
}
else if (md->isEnumerate())
{
- g_searchIndexInfo[SEARCH_INDEX_ENUMS].symbolList.append(letter,md);
+ g_searchIndexInfo[SEARCH_INDEX_ENUMS].add(letter,md);
}
else if (md->isEnumValue())
{
- g_searchIndexInfo[SEARCH_INDEX_ENUMVALUES].symbolList.append(letter,md);
+ g_searchIndexInfo[SEARCH_INDEX_ENUMVALUES].add(letter,md);
}
else if (md->isDefine())
{
- g_searchIndexInfo[SEARCH_INDEX_DEFINES].symbolList.append(letter,md);
+ g_searchIndexInfo[SEARCH_INDEX_DEFINES].add(letter,md);
}
}
}
}
-// see also function convertToId() in search.js, which should match in
-// behaviour
-static QCString searchId(const QCString &s)
-{
- int c;
- uint i;
- QCString result;
- for (i=0;i<s.length();i++)
- {
- c=s.at(i);
- if (c>0x7f || c<0) // part of multibyte character
- {
- result+=(char)c;
- }
- else if (isalnum(c)) // simply alpha numerical character
- {
- result+=(char)tolower(c);
- }
- else // other 'unprintable' characters
- {
- char val[4];
- sprintf(val,"_%02x",(uchar)c);
- result+=val;
- }
- }
- return result;
-}
+//---------------------------------------------------------------------------------------------
void createJavaScriptSearchIndex()
{
- bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
-
- // set index names
- g_searchIndexInfo[SEARCH_INDEX_ALL].name = "all";
- g_searchIndexInfo[SEARCH_INDEX_CLASSES].name = "classes";
- g_searchIndexInfo[SEARCH_INDEX_INTERFACES].name = "interfaces";
- g_searchIndexInfo[SEARCH_INDEX_STRUCTS].name = "structs";
- g_searchIndexInfo[SEARCH_INDEX_EXCEPTIONS].name = "exceptions";
- g_searchIndexInfo[SEARCH_INDEX_NAMESPACES].name = "namespaces";
- g_searchIndexInfo[SEARCH_INDEX_FILES].name = "files";
- g_searchIndexInfo[SEARCH_INDEX_FUNCTIONS].name = "functions";
- g_searchIndexInfo[SEARCH_INDEX_VARIABLES].name = "variables";
- g_searchIndexInfo[SEARCH_INDEX_TYPEDEFS].name = "typedefs";
- g_searchIndexInfo[SEARCH_INDEX_SEQUENCES].name = "sequences";
- g_searchIndexInfo[SEARCH_INDEX_DICTIONARIES].name = "dictionaries";
- g_searchIndexInfo[SEARCH_INDEX_ENUMS].name = "enums";
- g_searchIndexInfo[SEARCH_INDEX_ENUMVALUES].name = "enumvalues";
- g_searchIndexInfo[SEARCH_INDEX_PROPERTIES].name = "properties";
- g_searchIndexInfo[SEARCH_INDEX_EVENTS].name = "events";
- g_searchIndexInfo[SEARCH_INDEX_RELATED].name = "related";
- g_searchIndexInfo[SEARCH_INDEX_DEFINES].name = "defines";
- g_searchIndexInfo[SEARCH_INDEX_GROUPS].name = "groups";
- g_searchIndexInfo[SEARCH_INDEX_PAGES].name = "pages";
-
- // set index texts
- g_searchIndexInfo[SEARCH_INDEX_ALL].text = theTranslator->trAll();
- g_searchIndexInfo[SEARCH_INDEX_CLASSES].text = theTranslator->trClasses();
- g_searchIndexInfo[SEARCH_INDEX_INTERFACES].text = theTranslator->trSliceInterfaces();
- g_searchIndexInfo[SEARCH_INDEX_STRUCTS].text = theTranslator->trStructs();
- g_searchIndexInfo[SEARCH_INDEX_EXCEPTIONS].text = theTranslator->trExceptions();
- g_searchIndexInfo[SEARCH_INDEX_NAMESPACES].text = sliceOpt ? theTranslator->trModules() :
- theTranslator->trNamespace(TRUE,FALSE);
- g_searchIndexInfo[SEARCH_INDEX_FILES].text = theTranslator->trFile(TRUE,FALSE);
- g_searchIndexInfo[SEARCH_INDEX_FUNCTIONS].text = sliceOpt ? theTranslator->trOperations() :
- theTranslator->trFunctions();
- g_searchIndexInfo[SEARCH_INDEX_VARIABLES].text = sliceOpt ? theTranslator->trConstants() :
- theTranslator->trVariables();
- g_searchIndexInfo[SEARCH_INDEX_TYPEDEFS].text = theTranslator->trTypedefs();
- g_searchIndexInfo[SEARCH_INDEX_SEQUENCES].text = theTranslator->trSequences();
- g_searchIndexInfo[SEARCH_INDEX_DICTIONARIES].text = theTranslator->trDictionaries();
- g_searchIndexInfo[SEARCH_INDEX_ENUMS].text = theTranslator->trEnumerations();
- g_searchIndexInfo[SEARCH_INDEX_ENUMVALUES].text = theTranslator->trEnumerationValues();
- g_searchIndexInfo[SEARCH_INDEX_PROPERTIES].text = theTranslator->trProperties();
- g_searchIndexInfo[SEARCH_INDEX_EVENTS].text = theTranslator->trEvents();
- g_searchIndexInfo[SEARCH_INDEX_RELATED].text = theTranslator->trFriends();
- g_searchIndexInfo[SEARCH_INDEX_DEFINES].text = theTranslator->trDefines();
- g_searchIndexInfo[SEARCH_INDEX_GROUPS].text = theTranslator->trGroup(TRUE,FALSE);
- g_searchIndexInfo[SEARCH_INDEX_PAGES].text = theTranslator->trPage(TRUE,FALSE);
-
- // add symbols to letter -> symbol list map
-
// index classes
for (const auto &cd : *Doxygen::classLinkedMap)
{
- uint letter = getUtf8CodeToLower(cd->localName(),0);
- if (cd->isLinkable() && isId(letter))
+ char letter[MAX_UTF8_CHAR_SIZE];
+ getUtf8Char(cd->localName(),letter,CaseModifier::ToLower);
+ if (cd->isLinkable())
{
- g_searchIndexInfo[SEARCH_INDEX_ALL].symbolList.append(letter,cd.get());
- if (sliceOpt)
+ g_searchIndexInfo[SEARCH_INDEX_ALL].add(letter,cd.get());
+ if (Config_getBool(OPTIMIZE_OUTPUT_SLICE))
{
if (cd->compoundType()==ClassDef::Interface)
{
- g_searchIndexInfo[SEARCH_INDEX_INTERFACES].symbolList.append(letter,cd.get());
+ g_searchIndexInfo[SEARCH_INDEX_INTERFACES].add(letter,cd.get());
}
else if (cd->compoundType()==ClassDef::Struct)
{
- g_searchIndexInfo[SEARCH_INDEX_STRUCTS].symbolList.append(letter,cd.get());
+ g_searchIndexInfo[SEARCH_INDEX_STRUCTS].add(letter,cd.get());
}
else if (cd->compoundType()==ClassDef::Exception)
{
- g_searchIndexInfo[SEARCH_INDEX_EXCEPTIONS].symbolList.append(letter,cd.get());
+ g_searchIndexInfo[SEARCH_INDEX_EXCEPTIONS].add(letter,cd.get());
}
else // cd->compoundType()==ClassDef::Class
{
- g_searchIndexInfo[SEARCH_INDEX_CLASSES].symbolList.append(letter,cd.get());
+ g_searchIndexInfo[SEARCH_INDEX_CLASSES].add(letter,cd.get());
}
}
else // non slice optimisation: group all types under classes
{
- g_searchIndexInfo[SEARCH_INDEX_CLASSES].symbolList.append(letter,cd.get());
+ g_searchIndexInfo[SEARCH_INDEX_CLASSES].add(letter,cd.get());
}
}
}
@@ -773,11 +786,12 @@ void createJavaScriptSearchIndex()
// index namespaces
for (const auto &nd : *Doxygen::namespaceLinkedMap)
{
- uint letter = getUtf8CodeToLower(nd->name(),0);
- if (nd->isLinkable() && isId(letter))
+ char letter[MAX_UTF8_CHAR_SIZE];
+ getUtf8Char(nd->name(),letter,CaseModifier::ToLower);
+ if (nd->isLinkable())
{
- g_searchIndexInfo[SEARCH_INDEX_ALL].symbolList.append(letter,nd.get());
- g_searchIndexInfo[SEARCH_INDEX_NAMESPACES].symbolList.append(letter,nd.get());
+ g_searchIndexInfo[SEARCH_INDEX_ALL].add(letter,nd.get());
+ g_searchIndexInfo[SEARCH_INDEX_NAMESPACES].add(letter,nd.get());
}
}
@@ -786,11 +800,12 @@ void createJavaScriptSearchIndex()
{
for (const auto &fd : *fn)
{
- uint letter = getUtf8CodeToLower(fd->name(),0);
- if (fd->isLinkable() && isId(letter))
+ char letter[MAX_UTF8_CHAR_SIZE];
+ getUtf8Char(fd->name(),letter,CaseModifier::ToLower);
+ if (fd->isLinkable())
{
- g_searchIndexInfo[SEARCH_INDEX_ALL].symbolList.append(letter,fd.get());
- g_searchIndexInfo[SEARCH_INDEX_FILES].symbolList.append(letter,fd.get());
+ g_searchIndexInfo[SEARCH_INDEX_ALL].add(letter,fd.get());
+ g_searchIndexInfo[SEARCH_INDEX_FILES].add(letter,fd.get());
}
}
}
@@ -831,13 +846,10 @@ void createJavaScriptSearchIndex()
QCString title = gd->groupTitle();
if (!title.isEmpty()) // TODO: able searching for all word in the title
{
- uchar charCode = title.at(0);
- uint letter = charCode<128 ? tolower(charCode) : charCode;
- if (isId(letter))
- {
- g_searchIndexInfo[SEARCH_INDEX_ALL].symbolList.append(letter,gd);
- g_searchIndexInfo[SEARCH_INDEX_GROUPS].symbolList.append(letter,gd);
- }
+ char letter[MAX_UTF8_CHAR_SIZE];
+ getUtf8Char(title,letter,CaseModifier::ToLower);
+ g_searchIndexInfo[SEARCH_INDEX_ALL].add(letter,gd);
+ g_searchIndexInfo[SEARCH_INDEX_GROUPS].add(letter,gd);
}
}
}
@@ -852,13 +864,10 @@ void createJavaScriptSearchIndex()
QCString title = pd->title();
if (!title.isEmpty())
{
- uchar charCode = title.at(0);
- uint letter = charCode<128 ? tolower(charCode) : charCode;
- if (isId(letter))
- {
- g_searchIndexInfo[SEARCH_INDEX_ALL].symbolList.append(letter,pd);
- g_searchIndexInfo[SEARCH_INDEX_PAGES].symbolList.append(letter,pd);
- }
+ char letter[MAX_UTF8_CHAR_SIZE];
+ getUtf8Char(title,letter,CaseModifier::ToLower);
+ g_searchIndexInfo[SEARCH_INDEX_ALL].add(letter,pd);
+ g_searchIndexInfo[SEARCH_INDEX_PAGES].add(letter,pd);
}
}
}
@@ -867,45 +876,43 @@ void createJavaScriptSearchIndex()
QCString title = Doxygen::mainPage->title();
if (!title.isEmpty())
{
- uchar charCode = title.at(0);
- uint letter = charCode<128 ? tolower(charCode) : charCode;
- if (isId(letter))
- {
- g_searchIndexInfo[SEARCH_INDEX_ALL].symbolList.append(letter,Doxygen::mainPage);
- g_searchIndexInfo[SEARCH_INDEX_PAGES].symbolList.append(letter,Doxygen::mainPage);
- }
+ char letter[MAX_UTF8_CHAR_SIZE];
+ getUtf8Char(title,letter,CaseModifier::ToLower);
+ g_searchIndexInfo[SEARCH_INDEX_ALL].add(letter,Doxygen::mainPage);
+ g_searchIndexInfo[SEARCH_INDEX_PAGES].add(letter,Doxygen::mainPage);
}
}
// sort all lists
- int i;
- for (i=0;i<NUM_SEARCH_INDICES;i++)
+ for (auto &sii : g_searchIndexInfo) // for each index
{
- SIntDict<SearchIndexList>::Iterator it(g_searchIndexInfo[i].symbolList);
- SearchIndexList *sl;
- for (it.toFirst();(sl=it.current());++it)
+ for (auto &kv : sii.symbolMap) // for each symbol in the index
{
- sl->sort();
+ // sort the symbols (first on "search" name, and then on full name)
+ std::sort(kv.second.begin(),
+ kv.second.end(),
+ [](const Definition *d1,const Definition *d2)
+ {
+ int eq = qstricmp(searchName(d1),searchName(d2)); // search name first
+ return eq==0 ? qstricmp(d1->name(),d2->name())<0 : eq<0; // then full name
+ });
}
}
}
void writeJavaScriptSearchIndex()
{
- int i;
int cnt = 0;
// write index files
QCString searchDirName = Config_getString(HTML_OUTPUT)+"/search";
- for (i=0;i<NUM_SEARCH_INDICES;i++) // for each index
+ for (auto &sii : g_searchIndexInfo)
{
- SIntDict<SearchIndexList>::Iterator it(g_searchIndexInfo[i].symbolList);
- SearchIndexList *sl;
int p=0;
- for (it.toFirst();(sl=it.current());++it,++p) // for each letter
+ for (const auto &kv : sii.symbolMap)
{
QCString baseName;
- baseName.sprintf("%s_%x",g_searchIndexInfo[i].name.data(),p);
+ baseName.sprintf("%s_%x",sii.name.data(),p);
QCString fileName = searchDirName + "/"+baseName+Doxygen::htmlFileExtension;
QCString dataFileName = searchDirName + "/"+baseName+".js";
@@ -975,44 +982,61 @@ void writeJavaScriptSearchIndex()
ti << "[" << endl;
bool firstEntry=TRUE;
- SDict<SearchDefinitionList>::Iterator li(*sl);
- SearchDefinitionList *dl;
- int itemCount=0;
- for (li.toFirst();(dl=li.current());++li)
+ int childCount=0;
+ QCString lastName;
+ const Definition *prevScope = 0;
+ for (auto it = kv.second.begin(); it!=kv.second.end();)
{
- const Definition *d = dl->getFirst();
+ const Definition *d = *it;
+ QCString sname = searchName(d);
+ QCString id = searchId(d);
- if (!firstEntry)
+ if (sname!=lastName) // this item has a different search word
{
- ti << "," << endl;
+ if (!firstEntry)
+ {
+ ti << "]]]";
+ ti << "," << endl;
+ }
+ firstEntry=FALSE;
+
+ ti << " ['" << id << "_" << cnt++ << "',['" << convertToXML(sname) << "',[";
+ childCount=0;
+ prevScope=0;
}
- firstEntry=FALSE;
- ti << " ['" << dl->id() << "_" << cnt++ << "',['" << convertToXML(dl->name()) << "',[";
+ ++it;
+ const Definition *scope = d->getOuterScope();
+ const Definition *next = it!=kv.second.end() ? *it : 0;
+ const Definition *nextScope = 0;
+ const MemberDef *md = toMemberDef(d);
+ if (next) nextScope = next->getOuterScope();
+ QCString anchor = d->anchor();
- if (dl->count()==1) // item with a unique name
+ if (childCount>0)
{
- const MemberDef *md = toMemberDef(d);
- QCString anchor = d->anchor();
-
- ti << "'" << externalRef("../",d->getReference(),TRUE)
- << addHtmlExtensionIfMissing(d->getOutputFileBase());
- if (!anchor.isEmpty())
- {
- ti << "#" << anchor;
- }
- ti << "',";
+ ti << "],[";
+ }
+ ti << "'" << externalRef("../",d->getReference(),TRUE)
+ << addHtmlExtensionIfMissing(d->getOutputFileBase());
+ if (!anchor.isEmpty())
+ {
+ ti << "#" << anchor;
+ }
+ ti << "',";
- static bool extLinksInWindow = Config_getBool(EXT_LINKS_IN_WINDOW);
- if (!extLinksInWindow || d->getReference().isEmpty())
- {
- ti << "1,";
- }
- else
- {
- ti << "0,";
- }
+ static bool extLinksInWindow = Config_getBool(EXT_LINKS_IN_WINDOW);
+ if (!extLinksInWindow || d->getReference().isEmpty())
+ {
+ ti << "1,";
+ }
+ else
+ {
+ ti << "0,";
+ }
+ if (lastName!=sname && (next==0 || searchName(next)!=sname)) // unique name
+ {
if (d->getOuterScope()!=Doxygen::globalScope)
{
ti << "'" << convertToXML(d->getOuterScope()->name()) << "'";
@@ -1030,127 +1054,84 @@ void writeJavaScriptSearchIndex()
{
ti << "''";
}
- ti << "]]";
}
- else // multiple items with the same name
+ else // multiple entries with the same name
{
- QListIterator<Definition> di(*dl);
- bool overloadedFunction = FALSE;
- const Definition *prevScope = 0;
- int childCount=0;
- for (di.toFirst();(d=di.current());)
+ bool found=FALSE;
+ bool overloadedFunction = ((prevScope!=0 && scope==prevScope) ||
+ (scope && scope==nextScope)) && md && (md->isFunction() || md->isSlot());
+ QCString prefix;
+ if (md) prefix=convertToXML(md->localName());
+ if (overloadedFunction) // overloaded member function
{
- ++di;
- const Definition *scope = d->getOuterScope();
- const Definition *next = di.current();
- const Definition *nextScope = 0;
- const MemberDef *md = toMemberDef(d);
- if (next) nextScope = next->getOuterScope();
- QCString anchor = d->anchor();
-
- if (childCount>0)
- {
- ti << "],[";
- }
- ti << "'" << externalRef("../",d->getReference(),TRUE)
- << addHtmlExtensionIfMissing(d->getOutputFileBase());
- if (!anchor.isEmpty())
- {
- ti << "#" << anchor;
- }
- ti << "',";
-
- static bool extLinksInWindow = Config_getBool(EXT_LINKS_IN_WINDOW);
- if (!extLinksInWindow || d->getReference().isEmpty())
- {
- ti << "1,";
- }
- else
- {
- ti << "0,";
- }
- bool found=FALSE;
- overloadedFunction = ((prevScope!=0 && scope==prevScope) ||
- (scope && scope==nextScope)
- ) && md &&
- (md->isFunction() || md->isSlot());
- QCString prefix;
- if (md) prefix=convertToXML(md->localName());
- if (overloadedFunction) // overloaded member function
- {
- prefix+=convertToXML(md->argsString());
- // show argument list to disambiguate overloaded functions
- }
- else if (md) // unique member function
- {
- prefix+="()"; // only to show it is a function
- }
- QCString name;
- if (d->definitionType()==Definition::TypeClass)
- {
- name = convertToXML((toClassDef(d))->displayName());
- found = TRUE;
- }
- else if (d->definitionType()==Definition::TypeNamespace)
- {
- name = convertToXML((toNamespaceDef(d))->displayName());
- found = TRUE;
- }
- else if (scope==0 || scope==Doxygen::globalScope) // in global scope
+ prefix+=convertToXML(md->argsString());
+ // show argument list to disambiguate overloaded functions
+ }
+ else if (md) // unique member function
+ {
+ prefix+="()"; // only to show it is a function
+ }
+ QCString name;
+ if (d->definitionType()==Definition::TypeClass)
+ {
+ name = convertToXML((toClassDef(d))->displayName());
+ found = TRUE;
+ }
+ else if (d->definitionType()==Definition::TypeNamespace)
+ {
+ name = convertToXML((toNamespaceDef(d))->displayName());
+ found = TRUE;
+ }
+ else if (scope==0 || scope==Doxygen::globalScope) // in global scope
+ {
+ if (md)
{
- if (md)
+ const FileDef *fd = md->getBodyDef();
+ if (fd==0) fd = md->resolveAlias()->getFileDef();
+ if (fd)
{
- const FileDef *fd = md->getBodyDef();
- if (fd==0) fd = md->resolveAlias()->getFileDef();
- if (fd)
- {
- if (!prefix.isEmpty()) prefix+=":&#160;";
- name = prefix + convertToXML(fd->localName());
- found = TRUE;
- }
+ if (!prefix.isEmpty()) prefix+=":&#160;";
+ name = prefix + convertToXML(fd->localName());
+ found = TRUE;
}
}
- else if (md && (md->resolveAlias()->getClassDef() || md->resolveAlias()->getNamespaceDef()))
- // member in class or namespace scope
- {
- SrcLangExt lang = md->getLanguage();
- name = convertToXML(d->getOuterScope()->qualifiedName())
- + getLanguageSpecificSeparator(lang) + prefix;
- found = TRUE;
- }
- else if (scope) // some thing else? -> show scope
- {
- name = prefix + convertToXML(scope->name());
- found = TRUE;
- }
- if (!found) // fallback
- {
- name = prefix + "("+theTranslator->trGlobalNamespace()+")";
- }
-
- ti << "'" << name << "'";
-
- prevScope = scope;
- childCount++;
}
+ else if (md && (md->resolveAlias()->getClassDef() || md->resolveAlias()->getNamespaceDef()))
+ // member in class or namespace scope
+ {
+ SrcLangExt lang = md->getLanguage();
+ name = convertToXML(d->getOuterScope()->qualifiedName())
+ + getLanguageSpecificSeparator(lang) + prefix;
+ found = TRUE;
+ }
+ else if (scope) // some thing else? -> show scope
+ {
+ name = prefix + convertToXML(scope->name());
+ found = TRUE;
+ }
+ if (!found) // fallback
+ {
+ name = prefix + "("+theTranslator->trGlobalNamespace()+")";
+ }
+
+ ti << "'" << name << "'";
- ti << "]]";
+ prevScope = scope;
+ childCount++;
}
- ti << "]";
- itemCount++;
+ lastName = sname;
}
if (!firstEntry)
{
- ti << endl;
+ ti << "]]]" << endl;
}
-
ti << "];" << endl;
-
}
else
{
err("Failed to open file '%s' for writing...\n",fileName.data());
}
+ p++;
}
}
@@ -1161,64 +1142,57 @@ void writeJavaScriptSearchIndex()
FTextStream t(&f);
t << "var indexSectionsWithContent =" << endl;
t << "{" << endl;
- bool first=TRUE;
int j=0;
- for (i=0;i<NUM_SEARCH_INDICES;i++)
+ for (const auto &sii : g_searchIndexInfo)
{
- if (g_searchIndexInfo[i].symbolList.count()>0)
+ if (!sii.symbolMap.empty())
{
- if (!first) t << "," << endl;
+ if (j>0) t << "," << endl;
t << " " << j << ": \"";
- SIntDict<SearchIndexList>::Iterator it(g_searchIndexInfo[i].symbolList);
- SearchIndexList *sl;
- for (it.toFirst();(sl=it.current());++it) // for each letter
+ for (const auto &kv : sii.symbolMap)
{
- if ( sl->letter() == '"' ) t << QString( QChar( '\\' ) ).utf8();
- t << QString( QChar( sl->letter() ) ).utf8();
+ if ( kv.first == "\"" ) t << "\\";
+ t << kv.first.c_str();
}
t << "\"";
- first=FALSE;
j++;
}
}
- if (!first) t << "\n";
+ if (j>0) t << "\n";
t << "};" << endl << endl;
t << "var indexSectionNames =" << endl;
t << "{" << endl;
- first=TRUE;
j=0;
- for (i=0;i<NUM_SEARCH_INDICES;i++)
+ for (const auto &sii : g_searchIndexInfo)
{
- if (g_searchIndexInfo[i].symbolList.count()>0)
+ if (!sii.symbolMap.empty())
{
- if (!first) t << "," << endl;
- t << " " << j << ": \"" << g_searchIndexInfo[i].name << "\"";
- first=FALSE;
+ if (j>0) t << "," << endl;
+ t << " " << j << ": \"" << sii.name << "\"";
j++;
}
}
- if (!first) t << "\n";
+ if (j>0) t << "\n";
t << "};" << endl << endl;
t << "var indexSectionLabels =" << endl;
t << "{" << endl;
- first=TRUE;
j=0;
- for (i=0;i<NUM_SEARCH_INDICES;i++)
+ for (const auto &sii : g_searchIndexInfo)
{
- if (g_searchIndexInfo[i].symbolList.count()>0)
+ if (!sii.symbolMap.empty())
{
- if (!first) t << "," << endl;
- t << " " << j << ": \"" << convertToXML(g_searchIndexInfo[i].text) << "\"";
- first=FALSE;
+ if (j>0) t << "," << endl;
+ t << " " << j << ": \"" << convertToXML(sii.getText()) << "\"";
j++;
}
}
- if (!first) t << "\n";
+ if (j>0) t << "\n";
t << "};" << endl << endl;
}
ResourceMgr::instance().copyResource("search.js",searchDirName);
}
+
{
QFile f(searchDirName+"/nomatches"+Doxygen::htmlFileExtension);
if (f.open(IO_WriteOnly))
@@ -1244,53 +1218,23 @@ void writeJavaScriptSearchIndex()
Doxygen::indexList->addStyleSheetFile("search/search.js");
}
-const SearchIndexInfo *getSearchIndices()
+void SearchIndexInfo::add(const std::string &letter,const Definition *def)
{
- return g_searchIndexInfo;
-}
-
-//---------------------------------------------------------------------------------------------
-
-SearchIndexList::SearchIndexList(uint letter)
- : SDict< SearchDefinitionList >(17,FALSE), m_letter(letter)
-{
- setAutoDelete(TRUE);
-}
-
-SearchIndexList::~SearchIndexList()
-{
-}
-
-void SearchIndexList::append(const Definition *d)
-{
- QCString dispName = d->localName();
- SearchDefinitionList *l = find(dispName);
- if (l==0)
+ //printf("%p: %s->%s (full=%s)\n",this,letter.data(),searchName(def).data(),def->name().data());
+ auto it = symbolMap.find(letter);
+ if (it!=symbolMap.end())
{
- if (d->definitionType()==Definition::TypeGroup)
- {
- dispName = (toGroupDef(d))->groupTitle();
- }
- else if (d->definitionType()==Definition::TypePage)
- {
- dispName = (toPageDef(d))->title();
- }
- l=new SearchDefinitionList(searchId(dispName),dispName);
- SDict< SearchDefinitionList >::append(dispName,l);
+ it->second.push_back(def);
+ }
+ else
+ {
+ symbolMap.insert(std::make_pair(letter,std::vector<const Definition*>({def})));
}
- l->append(d);
-}
-
-uint SearchIndexList::letter() const
-{
- return m_letter;
}
-int SearchIndexList::compareValues(const SearchDefinitionList *md1, const SearchDefinitionList *md2) const
+const std::array<SearchIndexInfo,NUM_SEARCH_INDICES> &getSearchIndices()
{
- QCString n1 = md1->getFirst()->localName();
- QCString n2 = md2->getFirst()->localName();
- return qstricmp(n1.data(),n2.data());
+ return g_searchIndexInfo;
}
//---------------------------------------------------------------------------------------------
diff --git a/src/searchindex.h b/src/searchindex.h
index 71c1ce1..9039f00 100644
--- a/src/searchindex.h
+++ b/src/searchindex.h
@@ -1,8 +1,6 @@
/******************************************************************************
*
- *
- *
- * Copyright (C) 1997-2015 by Dimitri van Heesch.
+ * Copyright (C) 1997-2020 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
@@ -15,25 +13,20 @@
*
*/
-#ifndef _SEARCHINDEX_H
-#define _SEARCHINDEX_H
+#ifndef SEARCHINDEX_H
+#define SEARCHINDEX_H
#include <memory>
#include <vector>
#include <map>
#include <unordered_map>
#include <string>
+#include <array>
+#include <functional>
-#include <qintdict.h>
-#include <qlist.h>
-#include <qintdict.h>
-#include "sortdict.h"
-#include "definition.h"
-#include "util.h"
+#include <qcstring.h>
-class FTextStream;
class Definition;
-class MemberDef;
/*! Initialize the search indexer */
void initSearchIndexer();
@@ -116,61 +109,24 @@ class SearchIndexExternal : public SearchIndexIntf
//------- client side search index ----------------------
-#define SEARCH_INDEX_ALL 0
-#define SEARCH_INDEX_CLASSES 1
-#define SEARCH_INDEX_INTERFACES 2
-#define SEARCH_INDEX_STRUCTS 3
-#define SEARCH_INDEX_EXCEPTIONS 4
-#define SEARCH_INDEX_NAMESPACES 5
-#define SEARCH_INDEX_FILES 6
-#define SEARCH_INDEX_FUNCTIONS 7
-#define SEARCH_INDEX_VARIABLES 8
-#define SEARCH_INDEX_TYPEDEFS 9
-#define SEARCH_INDEX_SEQUENCES 10
-#define SEARCH_INDEX_DICTIONARIES 11
-#define SEARCH_INDEX_ENUMS 12
-#define SEARCH_INDEX_ENUMVALUES 13
-#define SEARCH_INDEX_PROPERTIES 14
-#define SEARCH_INDEX_EVENTS 15
-#define SEARCH_INDEX_RELATED 16
-#define SEARCH_INDEX_DEFINES 17
-#define SEARCH_INDEX_GROUPS 18
-#define SEARCH_INDEX_PAGES 19
-#define NUM_SEARCH_INDICES 20
-
-class SearchDefinitionList : public QList<Definition>
-{
- public:
- SearchDefinitionList(const QCString &id,const QCString &name) : m_id(id), m_name(name) {}
- QCString id() const { return m_id; }
- QCString name() const { return m_name; }
- private:
- QCString m_id;
- QCString m_name;
-};
+#define NUM_SEARCH_INDICES 20
-class SearchIndexList : public SDict< SearchDefinitionList >
-{
- public:
- typedef const Definition ElementType;
- SearchIndexList(uint letter);
- ~SearchIndexList();
- void append(const Definition *d);
- uint letter() const;
- private:
- int compareValues(const SearchDefinitionList *md1, const SearchDefinitionList *md2) const;
- uint m_letter;
-};
+QCString searchId(const Definition *d);
+QCString searchName(const Definition *d);
+
+using SearchIndexList = std::vector<const Definition *>;
+using SearchIndexMap = std::map<std::string,SearchIndexList>;
struct SearchIndexInfo
{
- LetterToIndexMap<SearchIndexList> symbolList;
+ void add(const std::string &letter,const Definition *def);
QCString name;
- QCString text;
+ std::function<QCString()> getText;
+ SearchIndexMap symbolMap;
};
void createJavaScriptSearchIndex();
void writeJavaScriptSearchIndex();
-const SearchIndexInfo *getSearchIndices();
+const std::array<SearchIndexInfo,NUM_SEARCH_INDICES> &getSearchIndices();
#endif
diff --git a/src/sortdict.h b/src/sortdict.h
index 15282ec..907cb78 100644
--- a/src/sortdict.h
+++ b/src/sortdict.h
@@ -1,13 +1,13 @@
/******************************************************************************
*
- *
+ *
*
*
* Copyright (C) 1997-2015 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
- * documentation under the terms of the GNU General Public License is hereby
- * granted. No representations are made about the suitability of this software
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
@@ -26,7 +26,7 @@
#define AUTORESIZE 1
#if AUTORESIZE
-const uint SDict_primes[] =
+const uint SDict_primes[] =
{
17,
29,
@@ -71,10 +71,9 @@ const uint SDict_primes[] =
#endif
template<class T> class SDict;
-template<class T> class SIntDict;
-/** internal wrapper class that redirects compareValues() to the
- * dictionary
+/** internal wrapper class that redirects compareValues() to the
+ * dictionary
*/
template<class T>
class SList : public QList<T>
@@ -87,20 +86,20 @@ class SList : public QList<T>
return m_owner->compareValues(item1,item2);
}
private:
- SDict<T> *m_owner;
+ SDict<T> *m_owner;
};
-/** Ordered dictionary of elements of type T.
+/** Ordered dictionary of elements of type T.
* Internally uses a QList<T> and a QDict<T>.
*/
template<class T>
-class SDict
+class SDict
{
private:
SList<T> *m_list;
QDict<T> *m_dict;
uint m_sizeIndex;
-
+
public:
/*! Create an ordered dictionary.
* \param size The size of the dictionary. Should be a prime number for
@@ -120,7 +119,7 @@ class SDict
}
/*! Destroys the dictionary */
- virtual ~SDict()
+ virtual ~SDict()
{
delete m_list;
delete m_dict;
@@ -182,7 +181,7 @@ class SDict
}
/*! Sorts the members of the dictionary. First appending a number
- * of members and then sorting them is faster (O(NlogN) than using
+ * of members and then sorting them is faster (O(NlogN) than using
* inSort() for each member (O(N^2)).
*/
void sort()
@@ -224,10 +223,10 @@ class SDict
m_list->setAutoDelete(val);
}
- /*! Looks up a compound given its key.
+ /*! Looks up a compound given its key.
* \param key The key to identify this element.
* \return The requested compound or zero if it cannot be found.
- * \sa append()
+ * \sa append()
*/
T *find(const char *key)
{
@@ -274,7 +273,7 @@ class SDict
m_list->clear();
m_dict->clear();
}
-
+
/*! Returns the number of items stored in the dictionary
*/
uint count() const
@@ -302,16 +301,16 @@ class SDict
delete m_li;
}
- /*! Set the iterator to the first element in the list.
- * \return The first compound, or zero if the list was empty.
+ /*! Set the iterator to the first element in the list.
+ * \return The first compound, or zero if the list was empty.
*/
T *toFirst() const
{
return m_li->toFirst();
}
- /*! Set the iterator to the last element in the list.
- * \return The first compound, or zero if the list was empty.
+ /*! Set the iterator to the last element in the list.
+ * \return The first compound, or zero if the list was empty.
*/
T *toLast() const
{
@@ -323,7 +322,7 @@ class SDict
{
return m_li->current();
}
-
+
/*! Moves the iterator to the next element.
* \return the new "current" element, or zero if the iterator was
* already pointing at the last element.
@@ -366,16 +365,16 @@ class SDict
delete m_di;
}
- /*! Set the iterator to the first element in the list.
- * \return The first compound, or zero if the list was empty.
+ /*! Set the iterator to the first element in the list.
+ * \return The first compound, or zero if the list was empty.
*/
T *toFirst() const
{
return m_di->toFirst();
}
- /*! Set the iterator to the last element in the list.
- * \return The first compound, or zero if the list was empty.
+ /*! Set the iterator to the last element in the list.
+ * \return The first compound, or zero if the list was empty.
*/
T *toLast() const
{
@@ -387,322 +386,13 @@ class SDict
{
return m_di->current();
}
-
+
/*! Returns the current key */
QCString currentKey() const
{
return m_di->currentKey();
}
-
- /*! Moves the iterator to the next element.
- * \return the new "current" element, or zero if the iterator was
- * already pointing at the last element.
- */
- T *operator++()
- {
- return m_di->operator++();
- }
-
- /*! Moves the iterator to the previous element.
- * \return the new "current" element, or zero if the iterator was
- * already pointing at the first element.
- */
- T *operator--()
- {
- return m_di->operator--();
- }
-
- private:
- QDictIterator<T> *m_di;
- };
-};
-
-/** internal wrapper class that redirects compareValues() to the
- * dictionary
- */
-template<class T>
-class SIntList : public QList<T>
-{
- public:
- SIntList(SIntDict<T> *owner) : m_owner(owner) {}
- virtual ~SIntList() {}
- private:
- int compareValues(const T *item1,const T *item2) const
- {
- return m_owner->compareValues(item1,item2);
- }
- SIntDict<T> *m_owner;
-};
-
-/** Ordered dictionary of elements of type T.
- * Internally uses a QList<T> and a QIntDict<T>.
- */
-template<class T>
-class SIntDict
-{
- private:
- SIntList<T> *m_list;
- QIntDict<T> *m_dict;
- int m_sizeIndex;
-
- public:
- /*! Create an ordered dictionary.
- * \param size The size of the dictionary. Should be a prime number for
- * best distribution of elements.
- */
- SIntDict(int size=17) : m_sizeIndex(0)
- {
- m_list = new SIntList<T>(this);
-#if AUTORESIZE
- while ((uint)size>SDict_primes[m_sizeIndex]) m_sizeIndex++;
- m_dict = new QIntDict<T>(SDict_primes[m_sizeIndex]);
-#else
- m_dict = new QIntDict<T>(size);
-#endif
- }
-
- /*! Destroys the dictionary */
- virtual ~SIntDict()
- {
- delete m_list;
- delete m_dict;
- }
-
- /*! Appends a compound to the dictionary. The element is owned by the
- * dictionary.
- * \param key The unique key to use to quickly find the item later on.
- * \param d The compound to add.
- * \sa find()
- */
- void append(int key,const T *d)
- {
- m_list->append(d);
- m_dict->insert(key,d);
-#if AUTORESIZE
- if (m_dict->size()>SDict_primes[m_sizeIndex])
- {
- m_dict->resize(SDict_primes[++m_sizeIndex]);
- }
-#endif
- }
-
- /*! Prepend a compound to the dictionary. The element is owned by the
- * dictionary.
- * \param key The unique key to use to quickly find the item later on.
- * \param d The compound to add.
- * \sa find()
- */
- void prepend(int key,const T *d)
- {
- m_list->prepend(d);
- m_dict->insert(key,d);
-#if AUTORESIZE
- if (m_dict->size()>SDict_primes[m_sizeIndex])
- {
- m_dict->resize(SDict_primes[++m_sizeIndex]);
- }
-#endif
- }
-
- /*! Remove an item from the dictionary */
- bool remove(int key)
- {
- T *item = m_dict->take(key);
- return item ? m_list->remove(item) : FALSE;
- }
-
- /*! Sorts the members of the dictionary. First appending a number
- * of members and then sorting them is faster (O(NlogN) than using
- * inSort() for each member (O(N^2)).
- */
- void sort()
- {
- m_list->sort();
- }
-
- /*! Inserts a compound into the dictionary in a sorted way.
- * \param key The unique key to use to quickly find the item later on.
- * \param d The compound to add.
- * \sa find()
- */
- void inSort(int key,const T *d)
- {
- m_list->inSort(d);
- m_dict->insert(key,d);
-#if AUTORESIZE
- if (m_dict->size()>SDict_primes[m_sizeIndex])
- {
- m_dict->resize(SDict_primes[++m_sizeIndex]);
- }
-#endif
- }
-
- /*! Indicates whether or not the dictionary owns its elements */
- void setAutoDelete(bool val)
- {
- m_list->setAutoDelete(val);
- }
-
- /*! Looks up a compound given its key.
- * \param key The key to identify this element.
- * \return The requested compound or zero if it cannot be found.
- * \sa append()
- */
- T *find(int key)
- {
- return m_dict->find(key);
- }
-
- /*! Equivalent to find(). */
- T *operator[](int key) const
- {
- return m_dict->find(key);
- }
-
- /*! Returns the item at position \a i in the sorted dictionary */
- T *at(uint i)
- {
- return m_list->at(i);
- }
-
- /*! Function that is used to compare two items when sorting.
- * Overload this to properly sort items.
- * \sa inSort()
- */
- virtual int compareValues(const T *item1,const T *item2) const
- {
- return item1!=item2;
- }
-
- /*! Clears the dictionary. Will delete items if setAutoDelete() was
- * set to \c TRUE.
- * \sa setAutoDelete
- */
- void clear()
- {
- m_list->clear();
- m_dict->clear();
- }
-
- /*! Returns the number of items stored in the dictionary
- */
- int count() const
- {
- return m_list->count();
- }
-
- class Iterator; // first forward declare
- friend class Iterator; // then make it a friend
- /*! Simple iterator for SDict. It iterates in the order in which the
- * elements are stored.
- */
- class Iterator
- {
- public:
- /*! Create an iterator given the dictionary. */
- Iterator(const SIntDict<T> &dict)
- {
- m_li = new QListIterator<T>(*dict.m_list);
- }
-
- /*! Destroys the dictionary */
- virtual ~Iterator()
- {
- delete m_li;
- }
-
- /*! Set the iterator to the first element in the list.
- * \return The first compound, or zero if the list was empty.
- */
- T *toFirst() const
- {
- return m_li->toFirst();
- }
-
- /*! Set the iterator to the last element in the list.
- * \return The first compound, or zero if the list was empty.
- */
- T *toLast() const
- {
- return m_li->toLast();
- }
-
- /*! Returns the current compound */
- T *current() const
- {
- return m_li->current();
- }
-
- /*! Moves the iterator to the next element.
- * \return the new "current" element, or zero if the iterator was
- * already pointing at the last element.
- */
- T *operator++()
- {
- return m_li->operator++();
- }
-
- /*! Moves the iterator to the previous element.
- * \return the new "current" element, or zero if the iterator was
- * already pointing at the first element.
- */
- T *operator--()
- {
- return m_li->operator--();
- }
-
- private:
- QListIterator<T> *m_li;
- };
-
- class IteratorDict; // first forward declare
- friend class IteratorDict; // then make it a friend
- /*! Simple iterator for SDict. It iterates over the dictionary elements
- * in an unsorted way, but does provide information about the element's key.
- */
- class IteratorDict
- {
- public:
- /*! Create an iterator given the dictionary. */
- IteratorDict(const SIntDict<T> &dict)
- {
- m_di = new QIntDictIterator<T>(*dict.m_dict);
- }
- /*! Destroys the dictionary */
- virtual ~IteratorDict()
- {
- delete m_di;
- }
-
- /*! Set the iterator to the first element in the list.
- * \return The first compound, or zero if the list was empty.
- */
- T *toFirst() const
- {
- return m_di->toFirst();
- }
-
- /*! Set the iterator to the last element in the list.
- * \return The first compound, or zero if the list was empty.
- */
- T *toLast() const
- {
- return m_di->toLast();
- }
-
- /*! Returns the current compound */
- T *current() const
- {
- return m_di->current();
- }
-
- /*! Returns the current key */
- int currentKey() const
- {
- return m_di->currentKey();
- }
-
/*! Moves the iterator to the next element.
* \return the new "current" element, or zero if the iterator was
* already pointing at the last element.
@@ -724,7 +414,7 @@ class SIntDict
private:
QDictIterator<T> *m_di;
};
-
};
+
#endif
diff --git a/src/sqlite3gen.cpp b/src/sqlite3gen.cpp
index 97c7337..821f24a 100644
--- a/src/sqlite3gen.cpp
+++ b/src/sqlite3gen.cpp
@@ -2015,15 +2015,10 @@ static void generateSqlite3ForClass(const ClassDef *cd)
writeTemplateList(cd);
// + member groups
- if (cd->getMemberGroupSDict())
+ for (const auto &mg : cd->getMemberGroups())
{
- MemberGroupSDict::Iterator mgli(*cd->getMemberGroupSDict());
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- generateSqlite3Section(cd,mg->members(),refid,"user-defined",mg->header(),
- mg->documentation());
- }
+ generateSqlite3Section(cd,mg->members(),refid,"user-defined",mg->header(),
+ mg->documentation());
}
// this is just a list of *local* members
@@ -2079,15 +2074,10 @@ static void generateSqlite3ForNamespace(const NamespaceDef *nd)
writeInnerNamespaces(nd->getNamespaces(),refid);
// + member groups
- if (nd->getMemberGroupSDict())
+ for (const auto &mg : nd->getMemberGroups())
{
- MemberGroupSDict::Iterator mgli(*nd->getMemberGroupSDict());
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- generateSqlite3Section(nd,mg->members(),refid,"user-defined",mg->header(),
- mg->documentation());
- }
+ generateSqlite3Section(nd,mg->members(),refid,"user-defined",mg->header(),
+ mg->documentation());
}
// + normal members
@@ -2241,15 +2231,10 @@ static void generateSqlite3ForFile(const FileDef *fd)
writeInnerNamespaces(fd->getNamespaces(),refid);
// + member groups
- if (fd->getMemberGroupSDict())
+ for (const auto &mg : fd->getMemberGroups())
{
- MemberGroupSDict::Iterator mgli(*fd->getMemberGroupSDict());
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- generateSqlite3Section(fd,mg->members(),refid,"user-defined",mg->header(),
+ generateSqlite3Section(fd,mg->members(),refid,"user-defined",mg->header(),
mg->documentation());
- }
}
// + normal members
@@ -2315,15 +2300,10 @@ static void generateSqlite3ForGroup(const GroupDef *gd)
writeInnerGroups(gd->getSubGroups(),refid);
// + member groups
- if (gd->getMemberGroupSDict())
+ for (const auto &mg : gd->getMemberGroups())
{
- MemberGroupSDict::Iterator mgli(*gd->getMemberGroupSDict());
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- generateSqlite3Section(gd,mg->members(),refid,"user-defined",mg->header(),
- mg->documentation());
- }
+ generateSqlite3Section(gd,mg->members(),refid,"user-defined",mg->header(),
+ mg->documentation());
}
// + members
diff --git a/src/util.cpp b/src/util.cpp
index e4916cd..ec5d21f 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -4412,7 +4412,7 @@ QCString getOverloadDocs()
}
void addMembersToMemberGroup(MemberList *ml,
- MemberGroupSDict **ppMemberGroupSDict,
+ MemberGroupList *pMemberGroups,
const Definition *context)
{
ASSERT(context!=0);
@@ -4435,31 +4435,34 @@ void addMembersToMemberGroup(MemberList *ml,
int groupId=fmd->getMemberGroupId();
if (groupId!=-1)
{
- MemberGroupInfo *info = Doxygen::memGrpInfoDict[groupId];
- //QCString *pGrpHeader = Doxygen::memberHeaderDict[groupId];
- //QCString *pDocs = Doxygen::memberDocDict[groupId];
- if (info)
+ auto it = Doxygen::memberGroupInfoMap.find(groupId);
+ if (it!=Doxygen::memberGroupInfoMap.end())
{
- if (*ppMemberGroupSDict==0)
+ auto &info = it->second;
+ auto mg_it = std::find_if(pMemberGroups->begin(),
+ pMemberGroups->end(),
+ [&groupId](const auto &g)
+ { return g->groupId()==groupId; }
+ );
+ MemberGroup *mg_ptr = 0;
+ if (mg_it==pMemberGroups->end())
{
- *ppMemberGroupSDict = new MemberGroupSDict;
- (*ppMemberGroupSDict)->setAutoDelete(TRUE);
+ auto mg = std::make_unique<MemberGroup>(
+ context,
+ groupId,
+ info->header,
+ info->doc,
+ info->docFile,
+ info->docLine);
+ mg_ptr = mg.get();
+ pMemberGroups->push_back(std::move(mg));
}
- MemberGroup *mg = (*ppMemberGroupSDict)->find(groupId);
- if (mg==0)
+ else
{
- mg = new MemberGroup(
- context,
- groupId,
- info->header,
- info->doc,
- info->docFile,
- info->docLine
- );
- (*ppMemberGroupSDict)->append(groupId,mg);
+ mg_ptr = (*mg_it).get();
}
- mg->insertMember(fmd); // insert in member group
- fmd->setMemberGroup(mg);
+ mg_ptr->insertMember(fmd); // insert in member group
+ fmd->setMemberGroup(mg_ptr);
}
}
}
@@ -4468,33 +4471,36 @@ void addMembersToMemberGroup(MemberList *ml,
int groupId=md->getMemberGroupId();
if (groupId!=-1)
{
- MemberGroupInfo *info = Doxygen::memGrpInfoDict[groupId];
- //QCString *pGrpHeader = Doxygen::memberHeaderDict[groupId];
- //QCString *pDocs = Doxygen::memberDocDict[groupId];
- if (info)
- {
- if (*ppMemberGroupSDict==0)
+ auto it = Doxygen::memberGroupInfoMap.find(groupId);
+ if (it!=Doxygen::memberGroupInfoMap.end())
+ {
+ auto &info = it->second;
+ auto mg_it = std::find_if(pMemberGroups->begin(),
+ pMemberGroups->end(),
+ [&groupId](const auto &g)
+ { return g->groupId()==groupId; }
+ );
+ MemberGroup *mg_ptr = 0;
+ if (mg_it==pMemberGroups->end())
{
- *ppMemberGroupSDict = new MemberGroupSDict;
- (*ppMemberGroupSDict)->setAutoDelete(TRUE);
+ auto mg = std::make_unique<MemberGroup>(
+ context,
+ groupId,
+ info->header,
+ info->doc,
+ info->docFile,
+ info->docLine);
+ mg_ptr = mg.get();
+ pMemberGroups->push_back(std::move(mg));
}
- MemberGroup *mg = (*ppMemberGroupSDict)->find(groupId);
- if (mg==0)
+ else
{
- mg = new MemberGroup(
- context,
- groupId,
- info->header,
- info->doc,
- info->docFile,
- info->docLine
- );
- (*ppMemberGroupSDict)->append(groupId,mg);
+ mg_ptr = (*mg_it).get();
}
md = ml->take(index); // remove from member list
- mg->insertMember(md->resolveAlias()); // insert in member group
- mg->setRefItems(info->m_sli);
- md->setMemberGroup(mg);
+ mg_ptr->insertMember(md->resolveAlias()); // insert in member group
+ mg_ptr->setRefItems(info->m_sli);
+ md->setMemberGroup(mg_ptr);
continue;
}
}
diff --git a/src/util.h b/src/util.h
index 38e8b2e..4a8464e 100644
--- a/src/util.h
+++ b/src/util.h
@@ -51,7 +51,6 @@ class ExampleSDict;
class GroupDef;
class NamespaceSDict;
class ClassList;
-class MemberGroupSDict;
struct TagInfo;
class PageDef;
class SectionInfo;
@@ -94,32 +93,6 @@ class TextGeneratorOLImpl : public TextGeneratorIntf
//--------------------------------------------------------------------
-/** @brief maps a unicode character code to a list of T::ElementType's
- */
-template<class T>
-class LetterToIndexMap : public SIntDict<T>
-{
- public:
- LetterToIndexMap() { SIntDict<T>::setAutoDelete(TRUE); }
- void append(uint letter,typename T::ElementType *elem)
- {
- T *l = SIntDict<T>::find((int)letter);
- if (l==0)
- {
- l = new T(letter);
- SIntDict<T>::inSort((int)letter,l);
- }
- l->append(elem);
- }
- private:
- int compareValues(const T *l1, const T *l2) const
- {
- return (int)l1->letter()-(int)l2->letter();
- }
-};
-
-//--------------------------------------------------------------------
-
QCString langToString(SrcLangExt lang);
QCString getLanguageSpecificSeparator(SrcLangExt lang,bool classScope=FALSE);
@@ -291,7 +264,7 @@ QCString convertToPSString(const char *s);
QCString getOverloadDocs();
void addMembersToMemberGroup(/* in,out */ MemberList *ml,
- /* in,out */ MemberGroupSDict **ppMemberGroupSDict,
+ /* in,out */ MemberGroupList *pMemberGroups,
/* in */ const Definition *context);
int extractClassNameFromType(const QCString &type,int &pos,
diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp
index dd208aa..e3673fd 100644
--- a/src/vhdldocgen.cpp
+++ b/src/vhdldocgen.cpp
@@ -24,10 +24,10 @@
#include <stdlib.h>
#include <assert.h>
#include <string.h>
+#include <map>
#include <qcstring.h>
#include <qfileinfo.h>
#include <qcstringlist.h>
-#include <qmap.h>
/* --------------------------------------------------------------- */
@@ -642,9 +642,9 @@ ClassDef* VhdlDocGen::getPackageName(const QCString & name)
return getClass(name);
}
-static QMap<QCString,MemberDef*> varMap;
-static QList<ClassDef> qli;
-static QMap<ClassDef*,QList<ClassDef> > packages;
+static std::map<std::string,MemberDef*> g_varMap;
+static std::vector<ClassDef*> g_classList;
+static std::map<ClassDef*,std::vector<ClassDef*> > g_packages;
MemberDef* VhdlDocGen::findMember(const QCString& className, const QCString& memName)
{
@@ -712,7 +712,7 @@ MemberDef* VhdlDocGen::findMember(const QCString& className, const QCString& mem
}
if (acd) //d && d->definitionType()==Definition::TypeClass)
{
- if(!packages.contains(acd))
+ if(g_packages.find(acd)==g_packages.end())
{
VhdlDocGen::findAllPackages(acd);
}
@@ -721,20 +721,19 @@ MemberDef* VhdlDocGen::findMember(const QCString& className, const QCString& mem
else
{
ecd=cd;
- if (!packages.contains(ecd)) VhdlDocGen::findAllPackages(ecd);
+ if (g_packages.find(ecd)==g_packages.end()) VhdlDocGen::findAllPackages(ecd);
}
if (ecd)
{
- QMap<ClassDef*,QList<ClassDef> >::Iterator cList=packages.find(ecd);
- if (cList!=packages.end())
+ auto cList_it = g_packages.find(ecd);
+ if (cList_it!=g_packages.end())
{
- QList<ClassDef> mlist=cList.data();
- for (uint j=0;j<mlist.count();j++)
+ for (const auto &cdp : cList_it->second)
{
- mdef=VhdlDocGen::findMemberDef(mlist.at(j),memName,MemberListType_variableMembers);
+ mdef=VhdlDocGen::findMemberDef(cdp,memName,MemberListType_variableMembers);
if (mdef) return mdef;
- mdef=VhdlDocGen::findMemberDef(mlist.at(j),memName,MemberListType_pubMethods);
+ mdef=VhdlDocGen::findMemberDef(cdp,memName,MemberListType_pubMethods);
if (mdef) return mdef;
}
}
@@ -754,21 +753,21 @@ MemberDef* VhdlDocGen::findMemberDef(ClassDef* cd,const QCString& key,MemberList
QCString keyType=cd->symbolName()+"@"+key;
//printf("\n %s | %s | %s",cd->symbolName().data(),key.data(,),keyType.data());
- QMap<QCString, MemberDef*>::Iterator it =varMap.find(keyType);
- if (it.key())
+ auto it = g_varMap.find(keyType.str());
+ if (it!=g_varMap.end())
{
- md=it.data();
+ md=it->second;
if (md)
{
return md;
}
}
- if (qli.contains(cd))
+ if (std::find(g_classList.begin(),g_classList.end(),cd)!=g_classList.end())
{
return 0;
}
ml=cd->getMemberList(type);
- qli.append(cd);
+ g_classList.push_back(cd);
if (!ml)
{
return 0;
@@ -780,16 +779,15 @@ MemberDef* VhdlDocGen::findMemberDef(ClassDef* cd,const QCString& key,MemberList
for (fmni.toFirst();(md=fmni.current());++fmni)
{
QCString tkey=cd->symbolName()+"@"+md->name();
- if (varMap.contains(tkey))
+ if (g_varMap.find(tkey.str())==g_varMap.end())
{
- continue;
+ g_varMap.insert({tkey.str(),md});
}
- varMap.insert(tkey.data(),md);
}
- it=varMap.find(keyType.data());
- if (it.key())
+ it=g_varMap.find(keyType.str());
+ if (it!=g_varMap.end())
{
- md=it.data();
+ md=it->second;
if (md)
{
return md;
@@ -804,8 +802,8 @@ MemberDef* VhdlDocGen::findMemberDef(ClassDef* cd,const QCString& key,MemberList
void VhdlDocGen::findAllPackages( ClassDef *cdef)
{
- QList<ClassDef> cList;
- if (packages.contains(cdef)) return;
+ if (g_packages.find(cdef)!=g_packages.end()) return;
+ std::vector<ClassDef*> cList;
MemberList *mem=cdef->getMemberList(MemberListType_variableMembers);
MemberDef *md;
@@ -819,9 +817,9 @@ void VhdlDocGen::findAllPackages( ClassDef *cdef)
ClassDef* cd=VhdlDocGen::getPackageName(md->name());
if (cd)
{
- cList.append(cd);
+ cList.push_back(cd);
VhdlDocGen::findAllPackages(cd);
- packages.insert(cdef,cList);
+ g_packages.insert({cdef,cList});
}
}
}//for
@@ -2169,17 +2167,11 @@ static bool membersHaveSpecificType(const MemberList *ml,uint64 type)
return TRUE;
}
}
- if (ml->getMemberGroupList())
+ for (const auto &mg : ml->getMemberGroupList())
{
- MemberGroupListIterator mgli(*ml->getMemberGroupList());
- MemberGroup *mg;
- while ((mg=mgli.current()))
+ if (mg->members())
{
- if (mg->members())
- {
- if (membersHaveSpecificType(mg->members(),type)) return TRUE;
- }
- ++mgli;
+ if (membersHaveSpecificType(mg->members(),type)) return TRUE;
}
}
return FALSE;
@@ -2208,36 +2200,30 @@ void VhdlDocGen::writeVHDLDeclarations(const MemberList* ml,OutputList &ol,
VhdlDocGen::writePlainVHDLDeclarations(ml,ol,cd,nd,fd,gd,type);
- if (ml->getMemberGroupList())
+ for (const auto &mg : ml->getMemberGroupList())
{
- MemberGroupListIterator mgli(*ml->getMemberGroupList());
- MemberGroup *mg;
- while ((mg=mgli.current()))
+ if (membersHaveSpecificType(mg->members(),type))
{
- if (membersHaveSpecificType(mg->members(),type))
+ //printf("mg->header=%s\n",mg->header().data());
+ bool hasHeader=mg->header()!="[NOHEADER]";
+ ol.startMemberGroupHeader(hasHeader);
+ if (hasHeader)
{
- //printf("mg->header=%s\n",mg->header().data());
- bool hasHeader=mg->header()!="[NOHEADER]";
- ol.startMemberGroupHeader(hasHeader);
- if (hasHeader)
- {
- ol.parseText(mg->header());
- }
- ol.endMemberGroupHeader();
- if (!mg->documentation().isEmpty())
- {
- //printf("Member group has docs!\n");
- ol.startMemberGroupDocs();
- ol.generateDoc("[generated]",-1,0,0,mg->documentation()+"\n",FALSE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
- ol.endMemberGroupDocs();
- }
- ol.startMemberGroup();
- //printf("--- mg->writePlainDeclarations ---\n");
- VhdlDocGen::writePlainVHDLDeclarations(mg->members(),ol,cd,nd,fd,gd,type);
- ol.endMemberGroup(hasHeader);
+ ol.parseText(mg->header());
+ }
+ ol.endMemberGroupHeader();
+ if (!mg->documentation().isEmpty())
+ {
+ //printf("Member group has docs!\n");
+ ol.startMemberGroupDocs();
+ ol.generateDoc("[generated]",-1,0,0,mg->documentation()+"\n",FALSE,FALSE,
+ 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ ol.endMemberGroupDocs();
}
- ++mgli;
+ ol.startMemberGroup();
+ //printf("--- mg->writePlainDeclarations ---\n");
+ VhdlDocGen::writePlainVHDLDeclarations(mg->members(),ol,cd,nd,fd,gd,type);
+ ol.endMemberGroup(hasHeader);
}
}
}// writeVHDLDeclarations
@@ -2871,9 +2857,9 @@ void VhdlDocGen::createFlowChart(const MemberDef *mdef)
void VhdlDocGen::resetCodeVhdlParserState()
{
- varMap.clear();
- qli.clear();
- packages.clear();
+ g_varMap.clear();
+ g_classList.clear();
+ g_packages.clear();
}
bool VhdlDocGen::isConstraint(const MemberDef *mdef)
@@ -2984,7 +2970,7 @@ static struct
QList<FlowChart> FlowChart::flowList;
#ifdef DEBUGFLOW
-static QMap<QCString,int> keyMap;
+static std::map<std::string,int> g_keyMap;
#endif
void alignText(QCString & q)
@@ -3606,7 +3592,7 @@ void FlowChart::writeShape(FTextStream &t,const FlowChart* fl)
#ifdef DEBUGFLOW
QCString qq(getNodeName(fl->id).data());
- keyMap.insert(qq,fl->id);
+ g_keyMap.insert({qq.str(),fl->id});
#endif
bool dec=(fl->type & DECLN);
@@ -3695,11 +3681,11 @@ void FlowChart::writeEdge(FTextStream &t,const FlowChart* fl_from,const FlowChar
#ifdef DEBUGFLOW
QCString s1(getNodeName(fl_from->id).data());
QCString s2(getNodeName(fl_to->id).data());
- QMap<QCString, int>::Iterator it = keyMap.find(s1);
- QMap<QCString, int>::Iterator it1 = keyMap.find(s2);
+ auto it = g_keyMap.find(s1.str());
+ auto it1 = g_keyMap.find(s2.str());
// checks if the link is connected to a valid node
- assert(it.key());
- assert(it1.key());
+ assert(it!=g_keyMap.end());
+ assert(it1!=g_keyMap.end());
#endif
writeEdge(t,fl_from->id,fl_to->id,i,b,c);
diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp
index 8ffaca2..7eb09f1 100644
--- a/src/xmlgen.cpp
+++ b/src/xmlgen.cpp
@@ -1365,15 +1365,10 @@ static void generateXMLForClass(const ClassDef *cd,FTextStream &ti)
writeInnerClasses(cd->getClasses(),t);
writeTemplateList(cd,t);
- if (cd->getMemberGroupSDict())
+ for (const auto &mg : cd->getMemberGroups())
{
- MemberGroupSDict::Iterator mgli(*cd->getMemberGroupSDict());
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- generateXMLSection(cd,ti,t,mg->members(),"user-defined",mg->header(),
- mg->documentation());
- }
+ generateXMLSection(cd,ti,t,mg->members(),"user-defined",mg->header(),
+ mg->documentation());
}
QListIterator<MemberList> mli(cd->getMemberLists());
@@ -1469,15 +1464,10 @@ static void generateXMLForNamespace(const NamespaceDef *nd,FTextStream &ti)
writeInnerClasses(nd->getClasses(),t);
writeInnerNamespaces(nd->getNamespaces(),t);
- if (nd->getMemberGroupSDict())
+ for (const auto &mg : nd->getMemberGroups())
{
- MemberGroupSDict::Iterator mgli(*nd->getMemberGroupSDict());
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- generateXMLSection(nd,ti,t,mg->members(),"user-defined",mg->header(),
+ generateXMLSection(nd,ti,t,mg->members(),"user-defined",mg->header(),
mg->documentation());
- }
}
QListIterator<MemberList> mli(nd->getMemberLists());
@@ -1600,15 +1590,10 @@ static void generateXMLForFile(FileDef *fd,FTextStream &ti)
writeInnerClasses(fd->getClasses(),t);
writeInnerNamespaces(fd->getNamespaces(),t);
- if (fd->getMemberGroupSDict())
+ for (const auto &mg : fd->getMemberGroups())
{
- MemberGroupSDict::Iterator mgli(*fd->getMemberGroupSDict());
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- generateXMLSection(fd,ti,t,mg->members(),"user-defined",mg->header(),
- mg->documentation());
- }
+ generateXMLSection(fd,ti,t,mg->members(),"user-defined",mg->header(),
+ mg->documentation());
}
QListIterator<MemberList> mli(fd->getMemberLists());
@@ -1680,15 +1665,10 @@ static void generateXMLForGroup(const GroupDef *gd,FTextStream &ti)
writeInnerPages(gd->getPages(),t);
writeInnerGroups(gd->getSubGroups(),t);
- if (gd->getMemberGroupSDict())
+ for (const auto &mg : gd->getMemberGroups())
{
- MemberGroupSDict::Iterator mgli(*gd->getMemberGroupSDict());
- MemberGroup *mg;
- for (;(mg=mgli.current());++mgli)
- {
- generateXMLSection(gd,ti,t,mg->members(),"user-defined",mg->header(),
- mg->documentation());
- }
+ generateXMLSection(gd,ti,t,mg->members(),"user-defined",mg->header(),
+ mg->documentation());
}
QListIterator<MemberList> mli(gd->getMemberLists());
diff --git a/templates/html/search.css b/templates/html/search.css
index 254b5e7..830a23b 100644
--- a/templates/html/search.css
+++ b/templates/html/search.css
@@ -204,12 +204,14 @@ a.SRScope:focus, a.SRScope:active {
span.SRScope {
padding-left: 4px;
+ font-family: Arial, Verdana, sans-serif;
}
.SRPage .SRStatus {
padding: 2px 5px;
font-size: 8pt;
font-style: italic;
+ font-family: Arial, Verdana, sans-serif;
}
.SRResult {