summaryrefslogtreecommitdiffstats
path: root/src/memberdef.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2013-12-30 17:55:14 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2013-12-30 17:55:14 (GMT)
commit6e51abf63021dc9fe32c05f003232fe68a08591d (patch)
treee9fe6f526e4a2b22b1a55659331c15750969a019 /src/memberdef.cpp
parent744d1ca52e25dfa9e3d656056d87ed7cb6320585 (diff)
downloadDoxygen-6e51abf63021dc9fe32c05f003232fe68a08591d.zip
Doxygen-6e51abf63021dc9fe32c05f003232fe68a08591d.tar.gz
Doxygen-6e51abf63021dc9fe32c05f003232fe68a08591d.tar.bz2
Reduced and improved functionality of QList
- operations on current index and node (next(), prev(), last(), first()) have been removed. - access to internal nodes has been removed. - old QList has been renamed to QInternalList for use inside qtools only. - added type safe compare, new, and delete operations (compareValues(), newValue(), deleteValue()). - add compareValues also to QDict for consistency. - changed doxygen's implementation to comply with the new QList and QDict interface.
Diffstat (limited to 'src/memberdef.cpp')
-rw-r--r--src/memberdef.cpp38
1 files changed, 22 insertions, 16 deletions
diff --git a/src/memberdef.cpp b/src/memberdef.cpp
index d2964d4..f26e453 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -133,13 +133,14 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd,
if (md->getLanguage()==SrcLangExt_Tcl)
{
if (defArgList->count()==0) return FALSE;
- Argument *a=defArgList->first();
+ ArgumentListIterator ali(*defArgList);
+ Argument *a;
ol.endMemberDocName();
ol.startParameterList(FALSE);
ol.startParameterType(TRUE,0);
ol.endParameterType();
ol.startParameterName(FALSE);
- while (a)
+ for (;(a=ali.current());++ali)
{
if (a->defval.isEmpty())
{
@@ -149,7 +150,6 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd,
{
ol.docify("?"+a->name+"? ");
}
- a=defArgList->next();
}
ol.endParameterName(TRUE,FALSE,FALSE);
return TRUE;
@@ -181,7 +181,6 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd,
ol.popGeneratorState();
//printf("===> name=%s isDefine=%d\n",md->name().data(),md->isDefine());
- Argument *a=defArgList->first();
QCString cName;
if (cd)
{
@@ -208,6 +207,8 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd,
bool first=TRUE;
bool paramTypeStarted=FALSE;
bool isDefine = md->isDefine();
+ ArgumentListIterator ali(*defArgList);
+ Argument *a=ali.current();
while (a)
{
if (isDefine || first)
@@ -302,7 +303,8 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd,
ol.endTypewriter();
}
- a=defArgList->next();
+ ++ali;
+ a=ali.current();
if (a)
{
if (!md->isObjCMethod()) ol.docify(", "); // there are more arguments
@@ -432,7 +434,8 @@ static void writeExceptionList(OutputList &ol, ClassDef *cd, MemberDef *md)
static void writeTemplatePrefix(OutputList &ol,ArgumentList *al)
{
ol.docify("template<");
- Argument *a=al->first();
+ ArgumentListIterator ali(*al);
+ Argument *a = ali.current();
while (a)
{
ol.docify(a->type);
@@ -443,7 +446,8 @@ static void writeTemplatePrefix(OutputList &ol,ArgumentList *al)
ol.docify(" = ");
ol.docify(a->defval);
}
- a=al->next();
+ ++ali;
+ a=ali.current();
if (a) ol.docify(", ");
}
ol.docify("> ");
@@ -1348,7 +1352,7 @@ bool MemberDef::isBriefSectionVisible() const
bool visibleIfNotDefaultCDTor = !(cOrDTor &&
m_impl->defArgList &&
(m_impl->defArgList->isEmpty() ||
- m_impl->defArgList->first()->type == "void"
+ m_impl->defArgList->getFirst()->type == "void"
) &&
!hasDocs
);
@@ -2286,8 +2290,9 @@ void MemberDef::_writeEnumValues(OutputList &ol,Definition *container,
//printf("** %s: enum values=%d\n",name().data(),fmdl!=0 ? fmdl->count() : 0);
if (fmdl)
{
- MemberDef *fmd=fmdl->first();
- while (fmd)
+ MemberListIterator it(*fmdl);
+ MemberDef *fmd;
+ for (;(fmd=it.current());++it)
{
//printf("Enum %p: isLinkable()=%d\n",fmd,fmd->isLinkable());
if (fmd->isLinkable())
@@ -2349,7 +2354,6 @@ void MemberDef::_writeEnumValues(OutputList &ol,Definition *container,
}
ol.endDescTableData();
}
- fmd=fmdl->next();
}
}
if (!first)
@@ -3713,11 +3717,11 @@ void MemberDef::writeEnumDeclaration(OutputList &typeDecl,
uint numVisibleEnumValues=0;
if (fmdl)
{
- MemberDef *fmd=fmdl->first();
- while (fmd)
+ MemberListIterator mli(*fmdl);
+ MemberDef *fmd;
+ for (mli.toFirst();(fmd=mli.current());++mli)
{
if (fmd->isBriefSectionVisible()) numVisibleEnumValues++;
- fmd=fmdl->next();
}
}
if (numVisibleEnumValues==0 && !isBriefSectionVisible())
@@ -3757,7 +3761,8 @@ void MemberDef::writeEnumDeclaration(OutputList &typeDecl,
typeDecl.docify("{ ");
if (fmdl)
{
- MemberDef *fmd=fmdl->first();
+ MemberListIterator mli(*fmdl);
+ MemberDef *fmd=mli.current();
bool fmdVisible = fmd->isBriefSectionVisible();
while (fmd)
{
@@ -3797,7 +3802,8 @@ void MemberDef::writeEnumDeclaration(OutputList &typeDecl,
}
bool prevVisible = fmdVisible;
- fmd=fmdl->next();
+ ++mli;
+ fmd=mli.current();
if (fmd && (fmdVisible=fmd->isBriefSectionVisible()))
{
typeDecl.writeString(", ");