summaryrefslogtreecommitdiff
path: root/src/context.cpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-15 11:13:31 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-15 11:13:31 +0900
commit6034e81193d784e8af78fa8ab56438ab1e0d7839 (patch)
tree27f894681430b733eb8711442a4c9312b7cc3535 /src/context.cpp
parent3b6ea7abb3d529f7805ed54071d597f01b578740 (diff)
downloaddoxygen-6034e81193d784e8af78fa8ab56438ab1e0d7839.tar.gz
doxygen-6034e81193d784e8af78fa8ab56438ab1e0d7839.tar.bz2
doxygen-6034e81193d784e8af78fa8ab56438ab1e0d7839.zip
Imported Upstream version 1.8.18upstream/1.8.18
Diffstat (limited to 'src/context.cpp')
-rw-r--r--src/context.cpp173
1 files changed, 76 insertions, 97 deletions
diff --git a/src/context.cpp b/src/context.cpp
index 5ee89cd..0577531 100644
--- a/src/context.cpp
+++ b/src/context.cpp
@@ -180,14 +180,14 @@ class GenericNodeListContext : public TemplateListIntf
}
// TemplateListIntf methods
- int count() const
+ uint count() const
{
- return (int)m_children.count();
+ return m_children.count();
}
- TemplateVariant at(int index) const
+ TemplateVariant at(uint index) const
{
TemplateVariant result;
- if (index>=0 && index<count())
+ if (index<count())
{
result = *m_children.at(index);
}
@@ -380,7 +380,7 @@ class DoxygenContext::Private
public:
TemplateVariant version() const
{
- return getVersion();
+ return getDoxygenVersion();
}
TemplateVariant date() const
{
@@ -1397,6 +1397,7 @@ class DefinitionContext
{
assert(d!=0);
}
+ virtual ~DefinitionContext() {}
void addBaseProperties(PropertyMapper<T> &inst)
{
//%% string name: the name of the symbol
@@ -1544,7 +1545,6 @@ class DefinitionContext
case SrcLangExt_VHDL: result="vhdl"; break;
case SrcLangExt_XML: result="xml"; break;
case SrcLangExt_SQL: result="sql"; break;
- case SrcLangExt_Tcl: result="tcl"; break;
case SrcLangExt_Markdown: result="markdown"; break;
case SrcLangExt_Slice: result="slice"; break;
}
@@ -1794,12 +1794,12 @@ IncludeInfoListContext::~IncludeInfoListContext()
}
// TemplateListIntf
-int IncludeInfoListContext::count() const
+uint IncludeInfoListContext::count() const
{
return p->count();
}
-TemplateVariant IncludeInfoListContext::at(int index) const
+TemplateVariant IncludeInfoListContext::at(uint index) const
{
return p->at(index);
}
@@ -2007,7 +2007,6 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
{
case ContextOutputFormat_Html:
{
- QGString result;
FTextStream tt(&result);
QCString name = convertToHtml(m_classDef->displayName());
@@ -2136,7 +2135,7 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
return cache.inheritedByList.get();
}
TemplateVariant getMemberList(SharedPtr<MemberListInfoContext> &list,
- MemberListType type,const char *title,bool detailed=FALSE) const
+ MemberListType type,const char *title,bool=FALSE) const
{
if (!list)
{
@@ -2834,7 +2833,7 @@ class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Pri
return cache.constantgroups.get();
}
TemplateVariant getMemberList(SharedPtr<MemberListInfoContext> &list,
- MemberListType type,const char *title,bool detailed=FALSE) const
+ MemberListType type,const char *title,bool=FALSE) const
{
if (!list)
{
@@ -3293,7 +3292,7 @@ class FileContext::Private : public DefinitionContext<FileContext::Private>
return cache.constantgroups.get();
}
TemplateVariant getMemberList(SharedPtr<MemberListInfoContext> &list,
- MemberListType type,const char *title,bool detailed=FALSE) const
+ MemberListType type,const char *title,bool=FALSE) const
{
if (!list)
{
@@ -5564,7 +5563,7 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private>
}
TemplateVariant getMemberList(SharedPtr<MemberListInfoContext> &list,
- MemberListType type,const char *title,bool detailed=FALSE) const
+ MemberListType type,const char *title,bool=FALSE) const
{
if (!list)
{
@@ -5852,12 +5851,12 @@ ClassListContext::~ClassListContext()
}
// TemplateListIntf
-int ClassListContext::count() const
+uint ClassListContext::count() const
{
return p->count();
}
-TemplateVariant ClassListContext::at(int index) const
+TemplateVariant ClassListContext::at(uint index) const
{
return p->at(index);
}
@@ -6608,19 +6607,15 @@ class NestingContext::Private : public GenericNodeListContext
m_index++;
}
}
- void addFiles(const FileNameList &fnList)
+ void addFiles(const FileNameLinkedMap &fnList)
{
- FileNameListIterator fnli(fnList);
- FileName *fn;
- for (fnli.toFirst();(fn=fnli.current());++fnli)
+ for (const FileNameLinkedMap::Ptr &fn : fnList)
{
- FileNameIterator fni(*fn);
- const FileDef *fd;
- for (;(fd=fni.current());++fni)
+ for (const auto &fd : *fn)
{
if (fd->getDirDef()==0) // top level file
{
- append(NestingNodeContext::alloc(m_parent,fd,m_index,m_level,FALSE,FALSE,FALSE));
+ append(NestingNodeContext::alloc(m_parent,fd.get(),m_index,m_level,FALSE,FALSE,FALSE));
m_index++;
}
}
@@ -6760,12 +6755,12 @@ NestingContext::~NestingContext()
}
// TemplateListIntf
-int NestingContext::count() const
+uint NestingContext::count() const
{
return p->count();
}
-TemplateVariant NestingContext::at(int index) const
+TemplateVariant NestingContext::at(uint index) const
{
return p->at(index);
}
@@ -6795,7 +6790,7 @@ void NestingContext::addDirs(const DirList &dirs)
p->addDirs(dirs);
}
-void NestingContext::addFiles(const FileNameList &files)
+void NestingContext::addFiles(const FileNameLinkedMap &files)
{
p->addFiles(files);
}
@@ -6987,12 +6982,12 @@ NamespaceListContext::~NamespaceListContext()
}
// TemplateListIntf
-int NamespaceListContext::count() const
+uint NamespaceListContext::count() const
{
return p->count();
}
-TemplateVariant NamespaceListContext::at(int index) const
+TemplateVariant NamespaceListContext::at(uint index) const
{
return p->at(index);
}
@@ -7131,23 +7126,19 @@ TemplateVariant NamespaceTreeContext::get(const char *name) const
class FileListContext::Private : public GenericNodeListContext
{
public:
- void addFiles(const FileNameList &fnList)
+ void addFiles(const FileNameLinkedMap &fnMap)
{
// TODO: if FULL_PATH_NAMES is enabled, the ordering should be dir+file
- FileNameListIterator fnli(fnList);
- FileName *fn;
- for (fnli.toFirst();(fn=fnli.current());++fnli)
+ for (const auto &fn : fnMap)
{
- FileNameIterator fni(*fn);
- const FileDef *fd;
- for (fni.toFirst();(fd=fni.current());++fni)
+ for (const auto &fd : *fn)
{
bool doc = fd->isLinkableInProject();
bool src = fd->generateSourceFile();
bool nameOk = !fd->isDocumentationFile();
if (nameOk && (doc || src) && !fd->isReference())
{
- append(FileContext::alloc(fd));
+ append(FileContext::alloc(fd.get()));
}
}
}
@@ -7157,7 +7148,7 @@ class FileListContext::Private : public GenericNodeListContext
FileListContext::FileListContext() : RefCountedContext("FileListContext")
{
p = new Private;
- if (Doxygen::inputNameList) p->addFiles(*Doxygen::inputNameList);
+ if (Doxygen::inputNameLinkedMap) p->addFiles(*Doxygen::inputNameLinkedMap);
}
FileListContext::~FileListContext()
@@ -7166,12 +7157,12 @@ FileListContext::~FileListContext()
}
// TemplateListIntf
-int FileListContext::count() const
+uint FileListContext::count() const
{
return p->count();
}
-TemplateVariant FileListContext::at(int index) const
+TemplateVariant FileListContext::at(uint index) const
{
return p->at(index);
}
@@ -7209,12 +7200,12 @@ DirListContext::~DirListContext()
}
// TemplateListIntf
-int DirListContext::count() const
+uint DirListContext::count() const
{
return p->count();
}
-TemplateVariant DirListContext::at(int index) const
+TemplateVariant DirListContext::at(uint index) const
{
return p->at(index);
}
@@ -7257,12 +7248,12 @@ UsedFilesContext::~UsedFilesContext()
}
// TemplateListIntf
-int UsedFilesContext::count() const
+uint UsedFilesContext::count() const
{
return p->count();
}
-TemplateVariant UsedFilesContext::at(int index) const
+TemplateVariant UsedFilesContext::at(uint index) const
{
return p->at(index);
}
@@ -7292,9 +7283,9 @@ class FileTreeContext::Private
{
m_dirFileTree->addDirs(*Doxygen::directories);
}
- if (Doxygen::inputNameList)
+ if (Doxygen::inputNameLinkedMap)
{
- m_dirFileTree->addFiles(*Doxygen::inputNameList);
+ m_dirFileTree->addFiles(*Doxygen::inputNameLinkedMap);
}
//%% DirFile tree:
static bool init=FALSE;
@@ -7532,12 +7523,12 @@ PageListContext::~PageListContext()
}
// TemplateListIntf
-int PageListContext::count() const
+uint PageListContext::count() const
{
return p->count();
}
-TemplateVariant PageListContext::at(int index) const
+TemplateVariant PageListContext::at(uint index) const
{
return p->at(index);
}
@@ -7581,12 +7572,12 @@ ExampleListContext::~ExampleListContext()
}
// TemplateListIntf
-int ExampleListContext::count() const
+uint ExampleListContext::count() const
{
return p->count();
}
-TemplateVariant ExampleListContext::at(int index) const
+TemplateVariant ExampleListContext::at(uint index) const
{
return p->at(index);
}
@@ -7628,12 +7619,12 @@ ModuleListContext::~ModuleListContext()
}
// TemplateListIntf
-int ModuleListContext::count() const
+uint ModuleListContext::count() const
{
return p->count();
}
-TemplateVariant ModuleListContext::at(int index) const
+TemplateVariant ModuleListContext::at(uint index) const
{
return p->at(index);
}
@@ -7997,21 +7988,17 @@ class GlobalsIndexContext::Private
if (!listRef)
{
TemplateList *list = TemplateList::alloc();
- MemberName *mn;
- MemberNameSDict::Iterator fnli(*Doxygen::functionNameSDict);
- for (fnli.toFirst();(mn=fnli.current());++fnli)
+ for (const auto &mn : *Doxygen::functionNameLinkedMap)
{
- MemberDef *md;
- MemberNameIterator mni(*mn);
- for (mni.toFirst();(md=mni.current());++mni)
+ for (const auto &md : *mn)
{
const FileDef *fd=md->getFileDef();
if (fd && fd->isLinkableInProject() &&
!md->name().isEmpty() && !md->getNamespaceDef() && md->isLinkableInProject())
{
- if (filter==0 || (md->*filter)())
+ if (filter==0 || (md.get()->*filter)())
{
- list->append(MemberContext::alloc(md));
+ list->append(MemberContext::alloc(md.get()));
}
}
}
@@ -8154,21 +8141,17 @@ class ClassMembersIndexContext::Private
if (!listRef)
{
TemplateList *list = TemplateList::alloc();
- MemberName *mn;
- MemberNameSDict::Iterator mnli(*Doxygen::memberNameSDict);
- for (mnli.toFirst();(mn=mnli.current());++mnli)
+ for (const auto &mn : *Doxygen::memberNameLinkedMap)
{
- MemberDef *md;
- MemberNameIterator mni(*mn);
- for (mni.toFirst();(md=mni.current());++mni)
+ for (const auto &md : *mn)
{
const ClassDef *cd = md->getClassDef();
if (cd && cd->isLinkableInProject() && cd->templateMaster()==0 &&
md->isLinkableInProject() && !md->name().isEmpty())
{
- if (filter==0 || (md->*filter)())
+ if (filter==0 || (md.get()->*filter)())
{
- list->append(MemberContext::alloc(md));
+ list->append(MemberContext::alloc(md.get()));
}
}
}
@@ -8313,21 +8296,17 @@ class NamespaceMembersIndexContext::Private
if (!listRef)
{
TemplateList *list = TemplateList::alloc();
- MemberName *mn;
- MemberNameSDict::Iterator fnli(*Doxygen::functionNameSDict);
- for (fnli.toFirst();(mn=fnli.current());++fnli)
+ for (const auto &mn : *Doxygen::functionNameLinkedMap)
{
- MemberDef *md;
- MemberNameIterator mni(*mn);
- for (mni.toFirst();(md=mni.current());++mni)
+ for (const auto &md : *mn)
{
const NamespaceDef *nd=md->getNamespaceDef();
if (nd && nd->isLinkableInProject() &&
!md->name().isEmpty() && md->isLinkableInProject())
{
- if (filter==0 || (md->*filter)())
+ if (filter==0 || (md.get()->*filter)())
{
- list->append(MemberContext::alloc(md));
+ list->append(MemberContext::alloc(md.get()));
}
}
}
@@ -8594,12 +8573,12 @@ InheritanceListContext::~InheritanceListContext()
}
// TemplateListIntf
-int InheritanceListContext::count() const
+uint InheritanceListContext::count() const
{
return p->count();
}
-TemplateVariant InheritanceListContext::at(int index) const
+TemplateVariant InheritanceListContext::at(uint index) const
{
return p->at(index);
}
@@ -8670,12 +8649,12 @@ MemberListContext::~MemberListContext()
}
// TemplateListIntf
-int MemberListContext::count() const
+uint MemberListContext::count() const
{
return p->count();
}
-TemplateVariant MemberListContext::at(int index) const
+TemplateVariant MemberListContext::at(uint index) const
{
return p->at(index);
}
@@ -8831,12 +8810,12 @@ AllMembersListContext::~AllMembersListContext()
}
// TemplateListIntf
-int AllMembersListContext::count() const
+uint AllMembersListContext::count() const
{
return p->count();
}
-TemplateVariant AllMembersListContext::at(int index) const
+TemplateVariant AllMembersListContext::at(uint index) const
{
return p->at(index);
}
@@ -9013,12 +8992,12 @@ MemberGroupListContext::~MemberGroupListContext()
}
// TemplateListIntf
-int MemberGroupListContext::count() const
+uint MemberGroupListContext::count() const
{
return p->count();
}
-TemplateVariant MemberGroupListContext::at(int index) const
+TemplateVariant MemberGroupListContext::at(uint index) const
{
return p->at(index);
}
@@ -9376,12 +9355,12 @@ InheritedMemberInfoListContext::~InheritedMemberInfoListContext()
}
// TemplateListIntf
-int InheritedMemberInfoListContext::count() const
+uint InheritedMemberInfoListContext::count() const
{
return p->count();
}
-TemplateVariant InheritedMemberInfoListContext::at(int index) const
+TemplateVariant InheritedMemberInfoListContext::at(uint index) const
{
return p->at(index);
}
@@ -9458,7 +9437,7 @@ class ArgumentContext::Private
TemplateVariant namePart() const
{
QCString result = m_argument.attrib;
- int l = result.length();
+ uint l = result.length();
if (l>2 && result.at(0)=='[' && result.at(l-1)==']')
{
result = result.mid(1,l-2);
@@ -9529,12 +9508,12 @@ ArgumentListContext::~ArgumentListContext()
}
// TemplateListIntf
-int ArgumentListContext::count() const
+uint ArgumentListContext::count() const
{
return p->count();
}
-TemplateVariant ArgumentListContext::at(int index) const
+TemplateVariant ArgumentListContext::at(uint index) const
{
return p->at(index);
}
@@ -9723,12 +9702,12 @@ SymbolListContext::~SymbolListContext()
}
// TemplateListIntf
-int SymbolListContext::count() const
+uint SymbolListContext::count() const
{
return p->count();
}
-TemplateVariant SymbolListContext::at(int index) const
+TemplateVariant SymbolListContext::at(uint index) const
{
return p->at(index);
}
@@ -9822,7 +9801,7 @@ class SymbolGroupListContext::Private : public GenericNodeListContext
}
};
-SymbolGroupListContext::SymbolGroupListContext(const SearchIndexList *sil)
+SymbolGroupListContext::SymbolGroupListContext(const SearchIndexList *sil)
: RefCountedContext("SymbolGroupListContext")
{
p = new Private(sil);
@@ -9834,12 +9813,12 @@ SymbolGroupListContext::~SymbolGroupListContext()
}
// TemplateListIntf
-int SymbolGroupListContext::count() const
+uint SymbolGroupListContext::count() const
{
return p->count();
}
-TemplateVariant SymbolGroupListContext::at(int index) const
+TemplateVariant SymbolGroupListContext::at(uint index) const
{
return p->at(index);
}
@@ -9946,12 +9925,12 @@ SymbolIndicesContext::~SymbolIndicesContext()
}
// TemplateListIntf
-int SymbolIndicesContext::count() const
+uint SymbolIndicesContext::count() const
{
return p->count();
}
-TemplateVariant SymbolIndicesContext::at(int index) const
+TemplateVariant SymbolIndicesContext::at(uint index) const
{
return p->at(index);
}
@@ -10055,12 +10034,12 @@ SearchIndicesContext::~SearchIndicesContext()
}
// TemplateListIntf
-int SearchIndicesContext::count() const
+uint SearchIndicesContext::count() const
{
return p->count();
}
-TemplateVariant SearchIndicesContext::at(int index) const
+TemplateVariant SearchIndicesContext::at(uint index) const
{
return p->at(index);
}