diff options
Diffstat (limited to 'src')
47 files changed, 7000 insertions, 2575 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp index 5450b46..e484748 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -55,23 +55,12 @@ ClassDef::ClassDef( } else { - m_fileName=compoundName+m_name; + m_fileName=compoundName+name(); } - if (lref) - { - m_exampleSDict = 0; - } - else - { - m_exampleSDict = new ExampleSDict(17); - } - m_memListFileName=convertNameToFile(compoundName+m_name+"-members"); - m_inherits = new BaseClassList; - m_inherits->setAutoDelete(TRUE); - m_inheritedBy = new BaseClassList; - m_inheritedBy->setAutoDelete(TRUE); - m_allMemberNameInfoSDict = new MemberNameInfoSDict(257); - m_allMemberNameInfoSDict->setAutoDelete(TRUE); + m_exampleSDict = 0; + m_inherits = 0; + m_inheritedBy = 0; + m_allMemberNameInfoSDict = 0; visited=FALSE; setReference(lref); m_incInfo=0; @@ -82,9 +71,8 @@ ClassDef::ClassDef( m_usesImplClassDict=0; m_usedByImplClassDict=0; m_usesIntfClassDict=0; - memberGroupSDict = new MemberGroupSDict; - memberGroupSDict->setAutoDelete(TRUE); - m_innerClasses = new ClassSDict(17); + memberGroupSDict = 0; + m_innerClasses = 0; m_subGrouping=Config_getBool("SUBGROUPING"); m_templateInstances = 0; m_variableInstances = 0; @@ -97,7 +85,7 @@ ClassDef::ClassDef( m_membersMerged = FALSE; m_categoryOf = 0; QCString ns; - extractNamespaceName(m_name,m_className,ns); + extractNamespaceName(name(),m_className,ns); //printf("m_name=%s m_className=%s ns=%s\n",m_name.data(),m_className.data(),ns.data()); if (((QCString)defFileName).right(5)!=".java" && @@ -109,6 +97,47 @@ ClassDef::ClassDef( { m_isLocal=FALSE; } + + pubMethods=0; + proMethods=0; + pacMethods=0; + priMethods=0; + pubStaticMethods=0; + proStaticMethods=0; + pacStaticMethods=0; + priStaticMethods=0; + pubSlots=0; + proSlots=0; + priSlots=0; + pubAttribs=0; + proAttribs=0; + pacAttribs=0; + priAttribs=0; + pubStaticAttribs=0; + proStaticAttribs=0; + pacStaticAttribs=0; + priStaticAttribs=0; + pubTypes=0; + proTypes=0; + pacTypes=0; + priTypes=0; + related=0; + signals=0; + friends=0; + dcopMethods=0; + properties=0; + events=0; + + constructors=0; + typedefMembers=0; + enumMembers=0; + enumValMembers=0; + functionMembers=0; + relatedMembers=0; + variableMembers=0; + propertyMembers=0; + eventMembers=0; + } // destroy the class definition @@ -130,6 +159,11 @@ ClassDef::~ClassDef() delete m_tempArgs; } +QCString ClassDef::getMemberListFileName() const +{ + return convertNameToFile(compoundTypeString()+name()+"-members"); +} + QCString ClassDef::displayName() const { static bool hideScopeNames = Config_getBool("HIDE_SCOPE_NAMES"); @@ -160,6 +194,11 @@ void ClassDef::insertBaseClass(ClassDef *cd,const char *n,Protection p, { //printf("*** insert base class %s into %s\n",cd->name().data(),name().data()); //inherits->inSort(new BaseClassDef(cd,p,s,t)); + if (m_inherits==0) + { + m_inherits = new BaseClassList; + m_inherits->setAutoDelete(TRUE); + } m_inherits->append(new BaseClassDef(cd,n,p,s,t)); } @@ -168,50 +207,58 @@ void ClassDef::insertSubClass(ClassDef *cd,Protection p, Specifier s,const char *t) { //printf("*** insert sub class %s into %s\n",cd->name().data(),name().data()); + if (m_inheritedBy==0) + { + m_inheritedBy = new BaseClassList; + m_inheritedBy->setAutoDelete(TRUE); + } m_inheritedBy->inSort(new BaseClassDef(cd,0,p,s,t)); } void ClassDef::addMembersToMemberGroup() { - ::addMembersToMemberGroup(&pubTypes,memberGroupSDict,this); - ::addMembersToMemberGroup(&pubMethods,memberGroupSDict,this); - ::addMembersToMemberGroup(&pubAttribs,memberGroupSDict,this); - ::addMembersToMemberGroup(&pubSlots,memberGroupSDict,this); - ::addMembersToMemberGroup(&signals,memberGroupSDict,this); - ::addMembersToMemberGroup(&dcopMethods,memberGroupSDict,this); - ::addMembersToMemberGroup(&pubStaticMethods,memberGroupSDict,this); - ::addMembersToMemberGroup(&pubStaticAttribs,memberGroupSDict,this); - ::addMembersToMemberGroup(&pacTypes,memberGroupSDict,this); - ::addMembersToMemberGroup(&pacMethods,memberGroupSDict,this); - ::addMembersToMemberGroup(&pacAttribs,memberGroupSDict,this); - ::addMembersToMemberGroup(&pacStaticMethods,memberGroupSDict,this); - ::addMembersToMemberGroup(&pacStaticAttribs,memberGroupSDict,this); - ::addMembersToMemberGroup(&proTypes,memberGroupSDict,this); - ::addMembersToMemberGroup(&proMethods,memberGroupSDict,this); - ::addMembersToMemberGroup(&proAttribs,memberGroupSDict,this); - ::addMembersToMemberGroup(&proSlots,memberGroupSDict,this); - ::addMembersToMemberGroup(&proStaticMethods,memberGroupSDict,this); - ::addMembersToMemberGroup(&proStaticAttribs,memberGroupSDict,this); - ::addMembersToMemberGroup(&priTypes,memberGroupSDict,this); - ::addMembersToMemberGroup(&priMethods,memberGroupSDict,this); - ::addMembersToMemberGroup(&priAttribs,memberGroupSDict,this); - ::addMembersToMemberGroup(&priSlots,memberGroupSDict,this); - ::addMembersToMemberGroup(&priStaticMethods,memberGroupSDict,this); - ::addMembersToMemberGroup(&priStaticAttribs,memberGroupSDict,this); - ::addMembersToMemberGroup(&friends,memberGroupSDict,this); - ::addMembersToMemberGroup(&related,memberGroupSDict,this); - ::addMembersToMemberGroup(&properties,memberGroupSDict,this); - ::addMembersToMemberGroup(&events,memberGroupSDict,this); + ::addMembersToMemberGroup(pubTypes,&memberGroupSDict,this); + ::addMembersToMemberGroup(pubMethods,&memberGroupSDict,this); + ::addMembersToMemberGroup(pubAttribs,&memberGroupSDict,this); + ::addMembersToMemberGroup(pubSlots,&memberGroupSDict,this); + ::addMembersToMemberGroup(signals,&memberGroupSDict,this); + ::addMembersToMemberGroup(dcopMethods,&memberGroupSDict,this); + ::addMembersToMemberGroup(pubStaticMethods,&memberGroupSDict,this); + ::addMembersToMemberGroup(pubStaticAttribs,&memberGroupSDict,this); + ::addMembersToMemberGroup(pacTypes,&memberGroupSDict,this); + ::addMembersToMemberGroup(pacMethods,&memberGroupSDict,this); + ::addMembersToMemberGroup(pacAttribs,&memberGroupSDict,this); + ::addMembersToMemberGroup(pacStaticMethods,&memberGroupSDict,this); + ::addMembersToMemberGroup(pacStaticAttribs,&memberGroupSDict,this); + ::addMembersToMemberGroup(proTypes,&memberGroupSDict,this); + ::addMembersToMemberGroup(proMethods,&memberGroupSDict,this); + ::addMembersToMemberGroup(proAttribs,&memberGroupSDict,this); + ::addMembersToMemberGroup(proSlots,&memberGroupSDict,this); + ::addMembersToMemberGroup(proStaticMethods,&memberGroupSDict,this); + ::addMembersToMemberGroup(proStaticAttribs,&memberGroupSDict,this); + ::addMembersToMemberGroup(priTypes,&memberGroupSDict,this); + ::addMembersToMemberGroup(priMethods,&memberGroupSDict,this); + ::addMembersToMemberGroup(priAttribs,&memberGroupSDict,this); + ::addMembersToMemberGroup(priSlots,&memberGroupSDict,this); + ::addMembersToMemberGroup(priStaticMethods,&memberGroupSDict,this); + ::addMembersToMemberGroup(priStaticAttribs,&memberGroupSDict,this); + ::addMembersToMemberGroup(friends,&memberGroupSDict,this); + ::addMembersToMemberGroup(related,&memberGroupSDict,this); + ::addMembersToMemberGroup(properties,&memberGroupSDict,this); + ::addMembersToMemberGroup(events,&memberGroupSDict,this); // add members inside sections to their groups - MemberGroupSDict::Iterator mgli(*memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) + if (memberGroupSDict) { - if (mg->allMembersInSameSection() && m_subGrouping) + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) { - //printf("addToDeclarationSection(%s)\n",mg->header().data()); - mg->addToDeclarationSection(); + if (mg->allMembersInSameSection() && m_subGrouping) + { + //printf("addToDeclarationSection(%s)\n",mg->header().data()); + mg->addToDeclarationSection(); + } } } } @@ -232,77 +279,86 @@ void ClassDef::internalInsertMember(MemberDef *md, if (md->isRelated() && (Config_getBool("EXTRACT_PRIVATE") || prot!=Private)) { + if (related==0) related = new MemberList; if (sortBriefDocs) - related.inSort(md); + related->inSort(md); else - related.append(md); - md->setSectionList(this,&related); + related->append(md); + md->setSectionList(this,related); } else if (md->isFriend()) { + if (friends==0) friends = new MemberList; if (sortBriefDocs) - friends.inSort(md); + friends->inSort(md); else - friends.append(md); - md->setSectionList(this,&friends); + friends->append(md); + md->setSectionList(this,friends); } else { switch (md->memberType()) { case MemberDef::Signal: // Qt specific + if (signals==0) signals = new MemberList; if (sortBriefDocs) - signals.inSort(md); + signals->inSort(md); else - signals.append(md); - md->setSectionList(this,&signals); + signals->append(md); + md->setSectionList(this,signals); break; case MemberDef::DCOP: // KDE2 specific + if (dcopMethods==0) dcopMethods = new MemberList; if (sortBriefDocs) - dcopMethods.inSort(md); + dcopMethods->inSort(md); else - dcopMethods.append(md); - md->setSectionList(this,&dcopMethods); + dcopMethods->append(md); + md->setSectionList(this,dcopMethods); break; case MemberDef::Property: + if (properties==0) properties = new MemberList; if (sortBriefDocs) - properties.inSort(md); + properties->inSort(md); else - properties.append(md); - md->setSectionList(this,&properties); + properties->append(md); + md->setSectionList(this,properties); break; case MemberDef::Event: + if (events==0) events = new MemberList; if (sortBriefDocs) - events.inSort(md); + events->inSort(md); else - events.append(md); - md->setSectionList(this,&events); + events->append(md); + md->setSectionList(this,events); break; case MemberDef::Slot: // Qt specific switch (prot) { case Protected: case Package: // slots in packages are not possible! + if (proSlots==0) proSlots = new MemberList; if (sortBriefDocs) - proSlots.inSort(md); + proSlots->inSort(md); else - proSlots.append(md); - md->setSectionList(this,&proSlots); + proSlots->append(md); + md->setSectionList(this,proSlots); break; break; case Public: + if (pubSlots==0) pubSlots = new MemberList; if (sortBriefDocs) - pubSlots.inSort(md); + pubSlots->inSort(md); else - pubSlots.append(md); - md->setSectionList(this,&pubSlots); + pubSlots->append(md); + md->setSectionList(this,pubSlots); break; case Private: + if (priSlots==0) priSlots = new MemberList; if (sortBriefDocs) - priSlots.inSort(md); + priSlots->inSort(md); else - priSlots.append(md); - md->setSectionList(this,&priSlots); + priSlots->append(md); + md->setSectionList(this,priSlots); break; } break; @@ -314,32 +370,36 @@ void ClassDef::internalInsertMember(MemberDef *md, switch (prot) { case Protected: + if (proStaticAttribs==0) proStaticAttribs= new MemberList; if (sortBriefDocs) - proStaticAttribs.inSort(md); + proStaticAttribs->inSort(md); else - proStaticAttribs.append(md); - md->setSectionList(this,&proStaticAttribs); + proStaticAttribs->append(md); + md->setSectionList(this,proStaticAttribs); break; case Package: + if (pacStaticAttribs==0) pacStaticAttribs= new MemberList; if (sortBriefDocs) - pacStaticAttribs.inSort(md); + pacStaticAttribs->inSort(md); else - pacStaticAttribs.append(md); - md->setSectionList(this,&pacStaticAttribs); + pacStaticAttribs->append(md); + md->setSectionList(this,pacStaticAttribs); break; case Public: + if (pubStaticAttribs==0) pubStaticAttribs= new MemberList; if (sortBriefDocs) - pubStaticAttribs.inSort(md); + pubStaticAttribs->inSort(md); else - pubStaticAttribs.append(md); - md->setSectionList(this,&pubStaticAttribs); + pubStaticAttribs->append(md); + md->setSectionList(this,pubStaticAttribs); break; case Private: + if (priStaticAttribs==0) priStaticAttribs= new MemberList; if (sortBriefDocs) - priStaticAttribs.inSort(md); + priStaticAttribs->inSort(md); else - priStaticAttribs.append(md); - md->setSectionList(this,&priStaticAttribs); + priStaticAttribs->append(md); + md->setSectionList(this,priStaticAttribs); break; } } @@ -348,32 +408,36 @@ void ClassDef::internalInsertMember(MemberDef *md, switch (prot) { case Protected: + if (proStaticMethods==0) proStaticMethods = new MemberList; if (sortBriefDocs) - proStaticMethods.inSort(md); + proStaticMethods->inSort(md); else - proStaticMethods.append(md); - md->setSectionList(this,&proStaticMethods); + proStaticMethods->append(md); + md->setSectionList(this,proStaticMethods); break; case Package: + if (pacStaticMethods==0) pacStaticMethods = new MemberList; if (sortBriefDocs) - pacStaticMethods.inSort(md); + pacStaticMethods->inSort(md); else - pacStaticMethods.append(md); - md->setSectionList(this,&pacStaticMethods); + pacStaticMethods->append(md); + md->setSectionList(this,pacStaticMethods); break; case Public: + if (pubStaticMethods==0) pubStaticMethods = new MemberList; if (sortBriefDocs) - pubStaticMethods.inSort(md); + pubStaticMethods->inSort(md); else - pubStaticMethods.append(md); - md->setSectionList(this,&pubStaticMethods); + pubStaticMethods->append(md); + md->setSectionList(this,pubStaticMethods); break; case Private: + if (priStaticMethods==0) priStaticMethods = new MemberList; if (sortBriefDocs) - priStaticMethods.inSort(md); + priStaticMethods->inSort(md); else - priStaticMethods.append(md); - md->setSectionList(this,&priStaticMethods); + priStaticMethods->append(md); + md->setSectionList(this,priStaticMethods); break; } } @@ -385,32 +449,36 @@ void ClassDef::internalInsertMember(MemberDef *md, switch (prot) { case Protected: + if (proAttribs==0) proAttribs = new MemberList; if (sortBriefDocs) - proAttribs.inSort(md); + proAttribs->inSort(md); else - proAttribs.append(md); - md->setSectionList(this,&proAttribs); + proAttribs->append(md); + md->setSectionList(this,proAttribs); break; case Package: + if (pacAttribs==0) pacAttribs = new MemberList; if (sortBriefDocs) - pacAttribs.inSort(md); + pacAttribs->inSort(md); else - pacAttribs.append(md); - md->setSectionList(this,&pacAttribs); + pacAttribs->append(md); + md->setSectionList(this,pacAttribs); break; case Public: + if (pubAttribs==0) pubAttribs = new MemberList; if (sortBriefDocs) - pubAttribs.inSort(md); + pubAttribs->inSort(md); else - pubAttribs.append(md); - md->setSectionList(this,&pubAttribs); + pubAttribs->append(md); + md->setSectionList(this,pubAttribs); break; case Private: + if (priAttribs==0) priAttribs = new MemberList; if (sortBriefDocs) - priAttribs.inSort(md); + priAttribs->inSort(md); else - priAttribs.append(md); - md->setSectionList(this,&priAttribs); + priAttribs->append(md); + md->setSectionList(this,priAttribs); break; } } @@ -419,32 +487,36 @@ void ClassDef::internalInsertMember(MemberDef *md, switch (prot) { case Protected: + if (proTypes==0) proTypes = new MemberList; if (sortBriefDocs) - proTypes.inSort(md); + proTypes->inSort(md); else - proTypes.append(md); - md->setSectionList(this,&proTypes); + proTypes->append(md); + md->setSectionList(this,proTypes); break; case Package: + if (pacTypes==0) pacTypes = new MemberList; if (sortBriefDocs) - pacTypes.inSort(md); + pacTypes->inSort(md); else - pacTypes.append(md); - md->setSectionList(this,&pacTypes); + pacTypes->append(md); + md->setSectionList(this,pacTypes); break; case Public: + if (pubTypes==0) pubTypes = new MemberList; if (sortBriefDocs) - pubTypes.inSort(md); + pubTypes->inSort(md); else - pubTypes.append(md); - md->setSectionList(this,&pubTypes); + pubTypes->append(md); + md->setSectionList(this,pubTypes); break; case Private: + if (priTypes==0) priTypes = new MemberList; if (sortBriefDocs) - priTypes.inSort(md); + priTypes->inSort(md); else - priTypes.append(md); - md->setSectionList(this,&priTypes); + priTypes->append(md); + md->setSectionList(this,priTypes); break; } } @@ -453,32 +525,36 @@ void ClassDef::internalInsertMember(MemberDef *md, switch (prot) { case Protected: + if (proMethods==0) proMethods = new MemberList; if (sortBriefDocs) - proMethods.inSort(md); + proMethods->inSort(md); else - proMethods.append(md); - md->setSectionList(this,&proMethods); + proMethods->append(md); + md->setSectionList(this,proMethods); break; case Package: + if (pacMethods==0) pacMethods = new MemberList; if (sortBriefDocs) - pacMethods.inSort(md); + pacMethods->inSort(md); else - pacMethods.append(md); - md->setSectionList(this,&pacMethods); + pacMethods->append(md); + md->setSectionList(this,pacMethods); break; case Public: + if (pubMethods==0) pubMethods = new MemberList; if (sortBriefDocs) - pubMethods.inSort(md); + pubMethods->inSort(md); else - pubMethods.append(md); - md->setSectionList(this,&pubMethods); + pubMethods->append(md); + md->setSectionList(this,pubMethods); break; case Private: + if (priMethods==0) priMethods = new MemberList; if (sortBriefDocs) - priMethods.inSort(md); + priMethods->inSort(md); else - priMethods.append(md); - md->setSectionList(this,&priMethods); + priMethods->append(md); + md->setSectionList(this,priMethods); break; } } @@ -495,33 +571,37 @@ void ClassDef::internalInsertMember(MemberDef *md, ) || md->isFriend() ) { + if (relatedMembers==0) relatedMembers = new MemberList; if (Config_getBool("SORT_MEMBER_DOCS")) - relatedMembers.inSort(md); + relatedMembers->inSort(md); else - relatedMembers.append(md); + relatedMembers->append(md); } else { switch (md->memberType()) { case MemberDef::Property: + if (propertyMembers==0) propertyMembers = new MemberList; if (Config_getBool("SORT_MEMBER_DOCS")) - propertyMembers.inSort(md); + propertyMembers->inSort(md); else - propertyMembers.append(md); + propertyMembers->append(md); break; case MemberDef::Event: + if (eventMembers==0) eventMembers = new MemberList; if (Config_getBool("SORT_MEMBER_DOCS")) - eventMembers.inSort(md); + eventMembers->inSort(md); else - eventMembers.append(md); + eventMembers->append(md); break; case MemberDef::Signal: // fall through case MemberDef::DCOP: + if (functionMembers==0) functionMembers = new MemberList; if (Config_getBool("SORT_MEMBER_DOCS")) - functionMembers.inSort(md); + functionMembers->inSort(md); else - functionMembers.append(md); + functionMembers->append(md); break; case MemberDef::Slot: switch (prot) @@ -529,18 +609,20 @@ void ClassDef::internalInsertMember(MemberDef *md, case Protected: case Package: case Public: + if (functionMembers==0) functionMembers = new MemberList; if (Config_getBool("SORT_MEMBER_DOCS")) - functionMembers.inSort(md); + functionMembers->inSort(md); else - functionMembers.append(md); + functionMembers->append(md); break; case Private: + if (functionMembers==0) functionMembers = new MemberList; if (Config_getBool("EXTRACT_PRIVATE")) { if (Config_getBool("SORT_MEMBER_DOCS")) - functionMembers.inSort(md); + functionMembers->inSort(md); else - functionMembers.append(md); + functionMembers->append(md); } break; } @@ -551,41 +633,47 @@ void ClassDef::internalInsertMember(MemberDef *md, switch (md->memberType()) { case MemberDef::Typedef: + if (typedefMembers==0) typedefMembers = new MemberList; if (Config_getBool("SORT_MEMBER_DOCS")) - typedefMembers.inSort(md); + typedefMembers->inSort(md); else - typedefMembers.append(md); + typedefMembers->append(md); break; case MemberDef::Enumeration: + if (enumMembers==0) enumMembers = new MemberList; if (Config_getBool("SORT_MEMBER_DOCS")) - enumMembers.inSort(md); + enumMembers->inSort(md); else - enumMembers.append(md); + enumMembers->append(md); break; case MemberDef::EnumValue: + if (enumValMembers==0) enumValMembers = new MemberList; if (Config_getBool("SORT_MEMBER_DOCS")) - enumValMembers.inSort(md); + enumValMembers->inSort(md); else - enumValMembers.append(md); + enumValMembers->append(md); break; case MemberDef::Function: if (md->isConstructor() || md->isDestructor()) { - constructors.append(md); + if (constructors==0) constructors = new MemberList; + constructors->append(md); } else { + if (functionMembers==0) functionMembers = new MemberList; if (Config_getBool("SORT_MEMBER_DOCS")) - functionMembers.inSort(md); + functionMembers->inSort(md); else - functionMembers.append(md); + functionMembers->append(md); } break; case MemberDef::Variable: + if (variableMembers==0) variableMembers = new MemberList; if (Config_getBool("SORT_MEMBER_DOCS")) - variableMembers.inSort(md); + variableMembers->inSort(md); else - variableMembers.append(md); + variableMembers->append(md); break; default: err("Unexpected member type %d found!\n",md->memberType()); @@ -620,6 +708,11 @@ void ClassDef::internalInsertMember(MemberDef *md, MemberInfo *mi = new MemberInfo((MemberDef *)md, prot,md->virtualness(),FALSE); MemberNameInfo *mni=0; + if (m_allMemberNameInfoSDict==0) + { + m_allMemberNameInfoSDict = new MemberNameInfoSDict(17); + m_allMemberNameInfoSDict->setAutoDelete(TRUE); + } if ((mni=m_allMemberNameInfoSDict->find(md->name()))) { mni->append(mi); @@ -642,90 +735,99 @@ void ClassDef::insertMember(MemberDef *md) void ClassDef::computeAnchors() { ClassDef *context = Config_getBool("INLINE_INHERITED_MEMB") ? this : 0; - setAnchors(context,'a',&pubMethods); - setAnchors(context,'b',&proMethods); - setAnchors(context,'c',&pacMethods); - setAnchors(context,'d',&priMethods); - setAnchors(context,'e',&pubStaticMethods); - setAnchors(context,'f',&proStaticMethods); - setAnchors(context,'g',&pacStaticMethods); - setAnchors(context,'h',&priStaticMethods); - setAnchors(context,'i',&pubSlots); - setAnchors(context,'j',&proSlots); - setAnchors(context,'k',&priSlots); - setAnchors(context,'l',&signals); - setAnchors(context,'m',&related); - setAnchors(context,'n',&friends); - setAnchors(context,'o',&pubAttribs); - setAnchors(context,'p',&proAttribs); - setAnchors(context,'q',&pacAttribs); - setAnchors(context,'r',&priAttribs); - setAnchors(context,'s',&pubStaticAttribs); - setAnchors(context,'t',&proStaticAttribs); - setAnchors(context,'u',&pacStaticAttribs); - setAnchors(context,'v',&priStaticAttribs); - setAnchors(context,'w',&pubTypes); - setAnchors(context,'x',&proTypes); - setAnchors(context,'y',&priTypes); - setAnchors(context,'z',&dcopMethods); - setAnchors(context,'0',&properties); - setAnchors(context,'1',&events); - MemberGroupSDict::Iterator mgli(*memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - mg->setAnchors(context); + setAnchors(context,'a',pubMethods); + setAnchors(context,'b',proMethods); + setAnchors(context,'c',pacMethods); + setAnchors(context,'d',priMethods); + setAnchors(context,'e',pubStaticMethods); + setAnchors(context,'f',proStaticMethods); + setAnchors(context,'g',pacStaticMethods); + setAnchors(context,'h',priStaticMethods); + setAnchors(context,'i',pubSlots); + setAnchors(context,'j',proSlots); + setAnchors(context,'k',priSlots); + setAnchors(context,'l',signals); + setAnchors(context,'m',related); + setAnchors(context,'n',friends); + setAnchors(context,'o',pubAttribs); + setAnchors(context,'p',proAttribs); + setAnchors(context,'q',pacAttribs); + setAnchors(context,'r',priAttribs); + setAnchors(context,'s',pubStaticAttribs); + setAnchors(context,'t',proStaticAttribs); + setAnchors(context,'u',pacStaticAttribs); + setAnchors(context,'v',priStaticAttribs); + setAnchors(context,'w',pubTypes); + setAnchors(context,'x',proTypes); + setAnchors(context,'y',priTypes); + setAnchors(context,'z',dcopMethods); + setAnchors(context,'0',properties); + setAnchors(context,'1',events); + if (memberGroupSDict) + { + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->setAnchors(context); + } } } void ClassDef::distributeMemberGroupDocumentation() { - MemberGroupSDict::Iterator mgli(*memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) + if (memberGroupSDict) { - mg->distributeMemberGroupDocumentation(); + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->distributeMemberGroupDocumentation(); + } } } void ClassDef::findSectionsInDocumentation() { docFindSections(documentation(),this,0,docFile()); - MemberGroupSDict::Iterator mgli(*memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - mg->findSectionsInDocumentation(); - } - pubTypes.findSectionsInDocumentation(); - pubMethods.findSectionsInDocumentation(); - pubAttribs.findSectionsInDocumentation(); - pubSlots.findSectionsInDocumentation(); - signals.findSectionsInDocumentation(); - dcopMethods.findSectionsInDocumentation(); - pubStaticMethods.findSectionsInDocumentation(); - pubStaticAttribs.findSectionsInDocumentation(); - pacTypes.findSectionsInDocumentation(); - pacMethods.findSectionsInDocumentation(); - pacAttribs.findSectionsInDocumentation(); - pacStaticMethods.findSectionsInDocumentation(); - pacStaticAttribs.findSectionsInDocumentation(); - proTypes.findSectionsInDocumentation(); - proMethods.findSectionsInDocumentation(); - proAttribs.findSectionsInDocumentation(); - proSlots.findSectionsInDocumentation(); - proStaticMethods.findSectionsInDocumentation(); - proStaticAttribs.findSectionsInDocumentation(); - priTypes.findSectionsInDocumentation(); - priMethods.findSectionsInDocumentation(); - priAttribs.findSectionsInDocumentation(); - priSlots.findSectionsInDocumentation(); - priStaticMethods.findSectionsInDocumentation(); - priStaticAttribs.findSectionsInDocumentation(); - friends.findSectionsInDocumentation(); - related.findSectionsInDocumentation(); - properties.findSectionsInDocumentation(); - events.findSectionsInDocumentation(); + if (memberGroupSDict) + { + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->findSectionsInDocumentation(); + } + } + if (pubTypes) pubTypes->findSectionsInDocumentation(); + if (pubMethods) pubMethods->findSectionsInDocumentation(); + if (pubAttribs) pubAttribs->findSectionsInDocumentation(); + if (pubSlots) pubSlots->findSectionsInDocumentation(); + if (signals) signals->findSectionsInDocumentation(); + if (dcopMethods) dcopMethods->findSectionsInDocumentation(); + if (pubStaticMethods) pubStaticMethods->findSectionsInDocumentation(); + if (pubStaticAttribs) pubStaticAttribs->findSectionsInDocumentation(); + if (pacTypes) pacTypes->findSectionsInDocumentation(); + if (pacMethods) pacMethods->findSectionsInDocumentation(); + if (pacAttribs) pacAttribs->findSectionsInDocumentation(); + if (pacStaticMethods) pacStaticMethods->findSectionsInDocumentation(); + if (pacStaticAttribs) pacStaticAttribs->findSectionsInDocumentation(); + if (proTypes) proTypes->findSectionsInDocumentation(); + if (proMethods) proMethods->findSectionsInDocumentation(); + if (proAttribs) proAttribs->findSectionsInDocumentation(); + if (proSlots) proSlots->findSectionsInDocumentation(); + if (proStaticMethods) proStaticMethods->findSectionsInDocumentation(); + if (proStaticAttribs) proStaticAttribs->findSectionsInDocumentation(); + if (priTypes) priTypes->findSectionsInDocumentation(); + if (priMethods) priMethods->findSectionsInDocumentation(); + if (priAttribs) priAttribs->findSectionsInDocumentation(); + if (priSlots) priSlots->findSectionsInDocumentation(); + if (priStaticMethods) priStaticMethods->findSectionsInDocumentation(); + if (priStaticAttribs) priStaticAttribs->findSectionsInDocumentation(); + if (friends) friends->findSectionsInDocumentation(); + if (related) related->findSectionsInDocumentation(); + if (properties) properties->findSectionsInDocumentation(); + if (events) events->findSectionsInDocumentation(); } @@ -920,7 +1022,7 @@ void ClassDef::writeDetailedDescription(OutputList &ol, const QCString &pageType ol.parseDoc(docFile(),docLine(),this,0,documentation()+"\n",TRUE,FALSE); } // write examples - if (exampleFlag) + if (exampleFlag && m_exampleSDict) { ol.startSimpleSect(BaseOutputDocInterface::Examples,0,0,theTranslator->trExamples()+": "); ol.writeDescItem(); @@ -1042,7 +1144,7 @@ void ClassDef::writeDocumentation(OutputList &ol) ol.writeString("<!-- doxytag: class=\""); ol.docify(name()); ol.writeString("\" -->"); - if (m_inherits->count()>0) + if (m_inherits && m_inherits->count()>0) { BaseClassListIterator bli(*m_inherits); ol.writeString("<!-- doxytag: inherits=\""); @@ -1180,7 +1282,7 @@ void ClassDef::writeDocumentation(OutputList &ol) // write super classes int count; - if ((count=m_inherits->count())>0) + if (m_inherits && (count=m_inherits->count())>0) { //parseText(ol,theTranslator->trInherits()+" "); @@ -1234,7 +1336,7 @@ void ClassDef::writeDocumentation(OutputList &ol) } // write subclasses - if ((count=m_inheritedBy->count())>0) + if (m_inheritedBy && (count=m_inheritedBy->count())>0) { QCString inheritLine = theTranslator->trInheritedByList(m_inheritedBy->count()); QRegExp marker("@[0-9]+"); @@ -1270,19 +1372,25 @@ void ClassDef::writeDocumentation(OutputList &ol) count=0; BaseClassDef *ibcd; - ibcd=m_inheritedBy->first(); - while (ibcd) + if (m_inheritedBy) { - ClassDef *icd=ibcd->classDef; - if ( icd->isVisibleInHierarchy()) count++; - ibcd=m_inheritedBy->next(); + ibcd=m_inheritedBy->first(); + while (ibcd) + { + ClassDef *icd=ibcd->classDef; + if ( icd->isVisibleInHierarchy()) count++; + ibcd=m_inheritedBy->next(); + } } - ibcd=m_inherits->first(); - while (ibcd) + if (m_inherits) { - ClassDef *icd=ibcd->classDef; - if ( icd->isVisibleInHierarchy()) count++; - ibcd=m_inherits->next(); + ibcd=m_inherits->first(); + while (ibcd) + { + ClassDef *icd=ibcd->classDef; + if ( icd->isVisibleInHierarchy()) count++; + ibcd=m_inherits->next(); + } } @@ -1346,13 +1454,13 @@ void ClassDef::writeDocumentation(OutputList &ol) } // write link to list of all members (HTML only) - if (m_allMemberNameInfoSDict->count()>0 && + if (m_allMemberNameInfoSDict && !Config_getBool("OPTIMIZE_OUTPUT_FOR_C") ) { ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); - ol.startTextLink(m_memListFileName,0); + ol.startTextLink(getMemberListFileName(),0); ol.parseText(theTranslator->trListOfAllMembers()); ol.endTextLink(); ol.enableAll(); @@ -1375,90 +1483,93 @@ void ClassDef::writeDocumentation(OutputList &ol) ol.startMemberSections(); // write user defined member groups - MemberGroupSDict::Iterator mgli(*memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) + if (memberGroupSDict) { - if (!mg->allMembersInSameSection() || !m_subGrouping) // group is in its own section - { - mg->writeDeclarations(ol,this,0,0,0); - } - else // add this group to the corresponding member section + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) { - //printf("addToDeclarationSection(%s)\n",mg->header().data()); - //mg->addToDeclarationSection(); + if (!mg->allMembersInSameSection() || !m_subGrouping) // group is in its own section + { + mg->writeDeclarations(ol,this,0,0,0); + } + else // add this group to the corresponding member section + { + //printf("addToDeclarationSection(%s)\n",mg->header().data()); + //mg->addToDeclarationSection(); + } } } // public types - pubTypes.writeDeclarations(ol,this,0,0,0,theTranslator->trPublicTypes(),0); + if (pubTypes) pubTypes->writeDeclarations(ol,this,0,0,0,theTranslator->trPublicTypes(),0); // public methods - pubSlots.writeDeclarations(ol,this,0,0,0,theTranslator->trPublicSlots(),0); - signals.writeDeclarations(ol,this,0,0,0,theTranslator->trSignals(),0); - dcopMethods.writeDeclarations(ol,this,0,0,0,theTranslator->trDCOPMethods(),0); - pubMethods.writeDeclarations(ol,this,0,0,0,theTranslator->trPublicMembers(),0); - pubStaticMethods.writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPublicMembers(),0); + if (pubSlots) pubSlots->writeDeclarations(ol,this,0,0,0,theTranslator->trPublicSlots(),0); + if (signals) signals->writeDeclarations(ol,this,0,0,0,theTranslator->trSignals(),0); + if (dcopMethods) dcopMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trDCOPMethods(),0); + if (pubMethods) pubMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trPublicMembers(),0); + if (pubStaticMethods) pubStaticMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPublicMembers(),0); // public attribs - pubAttribs.writeDeclarations(ol,this,0,0,0,theTranslator->trPublicAttribs(),0); - pubStaticAttribs.writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPublicAttribs(),0); + if (pubAttribs) pubAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trPublicAttribs(),0); + if (pubStaticAttribs) pubStaticAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPublicAttribs(),0); // protected types - proTypes.writeDeclarations(ol,this,0,0,0,theTranslator->trProtectedTypes(),0); + if (proTypes) proTypes->writeDeclarations(ol,this,0,0,0,theTranslator->trProtectedTypes(),0); // protected methods - proSlots.writeDeclarations(ol,this,0,0,0,theTranslator->trProtectedSlots(),0); - proMethods.writeDeclarations(ol,this,0,0,0,theTranslator->trProtectedMembers(),0); - proStaticMethods.writeDeclarations(ol,this,0,0,0,theTranslator->trStaticProtectedMembers(),0); + if (proSlots) proSlots->writeDeclarations(ol,this,0,0,0,theTranslator->trProtectedSlots(),0); + if (proMethods) proMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trProtectedMembers(),0); + if (proStaticMethods) proStaticMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticProtectedMembers(),0); // protected attribs - proAttribs.writeDeclarations(ol,this,0,0,0,theTranslator->trProtectedAttribs(),0); - proStaticAttribs.writeDeclarations(ol,this,0,0,0,theTranslator->trStaticProtectedAttribs(),0); + if (proAttribs) proAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trProtectedAttribs(),0); + if (proStaticAttribs) proStaticAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticProtectedAttribs(),0); // package types - pacTypes.writeDeclarations(ol,this,0,0,0,theTranslator->trPackageTypes(),0); + if (pacTypes) pacTypes->writeDeclarations(ol,this,0,0,0,theTranslator->trPackageTypes(),0); // package methods - pacMethods.writeDeclarations(ol,this,0,0,0,theTranslator->trPackageMembers(),0); - pacStaticMethods.writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPackageMembers(),0); + if (pacMethods) pacMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trPackageMembers(),0); + if (pacStaticMethods) pacStaticMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPackageMembers(),0); // package attribs - pacAttribs.writeDeclarations(ol,this,0,0,0,theTranslator->trPackageAttribs(),0); - pacStaticAttribs.writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPackageAttribs(),0); + if (pacAttribs) pacAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trPackageAttribs(),0); + if (pacStaticAttribs) pacStaticAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPackageAttribs(),0); // package - properties.writeDeclarations(ol,this,0,0,0,theTranslator->trProperties(),0); + if (properties) properties->writeDeclarations(ol,this,0,0,0,theTranslator->trProperties(),0); // events - events.writeDeclarations(ol,this,0,0,0,theTranslator->trEvents(),0); + if (events) events->writeDeclarations(ol,this,0,0,0,theTranslator->trEvents(),0); if (Config_getBool("EXTRACT_PRIVATE")) { // private types - priTypes.writeDeclarations(ol,this,0,0,0,theTranslator->trPrivateTypes(),0); + if (priTypes) priTypes->writeDeclarations(ol,this,0,0,0,theTranslator->trPrivateTypes(),0); // private members - priSlots.writeDeclarations(ol,this,0,0,0,theTranslator->trPrivateSlots(),0); - priMethods.writeDeclarations(ol,this,0,0,0,theTranslator->trPrivateMembers(),0); - priStaticMethods.writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPrivateMembers(),0); + if (priSlots) priSlots->writeDeclarations(ol,this,0,0,0,theTranslator->trPrivateSlots(),0); + if (priMethods) priMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trPrivateMembers(),0); + if (priStaticMethods) priStaticMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPrivateMembers(),0); // private attribs - priAttribs.writeDeclarations(ol,this,0,0,0,theTranslator->trPrivateAttribs(),0); - priStaticAttribs.writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPrivateAttribs(),0); + if (priAttribs) priAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trPrivateAttribs(),0); + if (priStaticAttribs) priStaticAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPrivateAttribs(),0); } // friends - friends.writeDeclarations(ol,this,0,0,0,theTranslator->trFriends(),0); + if (friends) friends->writeDeclarations(ol,this,0,0,0,theTranslator->trFriends(),0); // related functions - related.writeDeclarations(ol,this,0,0,0, + if (related) related->writeDeclarations(ol,this,0,0,0, theTranslator->trRelatedFunctions(), theTranslator->trRelatedSubscript() ); // nested classes - m_innerClasses->writeDeclaration(ol,0,0,TRUE); + if (m_innerClasses) m_innerClasses->writeDeclaration(ol,0,0,TRUE); ol.endMemberSections(); @@ -1517,28 +1628,28 @@ void ClassDef::writeMemberDocumentation(OutputList &ol) Doxygen::suppressDocWarnings = TRUE; } - typedefMembers.writeDocumentation(ol,name(),this, + if (typedefMembers) typedefMembers->writeDocumentation(ol,name(),this, theTranslator->trMemberTypedefDocumentation()); - enumMembers.writeDocumentation(ol,name(),this, + if (enumMembers) enumMembers->writeDocumentation(ol,name(),this, theTranslator->trMemberEnumerationDocumentation()); - constructors.writeDocumentation(ol,name(),this, + if (constructors) constructors->writeDocumentation(ol,name(),this, theTranslator->trConstructorDocumentation()); - functionMembers.writeDocumentation(ol,name(),this, + if (functionMembers) functionMembers->writeDocumentation(ol,name(),this, theTranslator->trMemberFunctionDocumentation()); - relatedMembers.writeDocumentation(ol,name(),this, + if (relatedMembers) relatedMembers->writeDocumentation(ol,name(),this, theTranslator->trRelatedFunctionDocumentation()); - variableMembers.writeDocumentation(ol,name(),this, + if (variableMembers) variableMembers->writeDocumentation(ol,name(),this, theTranslator->trMemberDataDocumentation()); - propertyMembers.writeDocumentation(ol,name(),this, + if (propertyMembers) propertyMembers->writeDocumentation(ol,name(),this, theTranslator->trPropertyDocumentation()); - eventMembers.writeDocumentation(ol,name(),this, + if (eventMembers) eventMembers->writeDocumentation(ol,name(),this, theTranslator->trEventDocumentation()); if (Config_getBool("SEPARATE_MEMBER_PAGES")) @@ -1557,14 +1668,14 @@ void ClassDef::writeMemberPages(OutputList &ol) ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); - typedefMembers.writeDocumentationPage(ol,name(),this); - enumMembers.writeDocumentationPage(ol,name(),this); - constructors.writeDocumentationPage(ol,name(),this); - functionMembers.writeDocumentationPage(ol,name(),this); - relatedMembers.writeDocumentationPage(ol,name(),this); - variableMembers.writeDocumentationPage(ol,name(),this); - propertyMembers.writeDocumentationPage(ol,name(),this); - eventMembers.writeDocumentationPage(ol,name(),this); + if (typedefMembers) typedefMembers->writeDocumentationPage(ol,name(),this); + if (enumMembers) enumMembers->writeDocumentationPage(ol,name(),this); + if (constructors) constructors->writeDocumentationPage(ol,name(),this); + if (functionMembers) functionMembers->writeDocumentationPage(ol,name(),this); + if (relatedMembers) relatedMembers->writeDocumentationPage(ol,name(),this); + if (variableMembers) variableMembers->writeDocumentationPage(ol,name(),this); + if (propertyMembers) propertyMembers->writeDocumentationPage(ol,name(),this); + if (eventMembers) eventMembers->writeDocumentationPage(ol,name(),this); ol.popGeneratorState(); } @@ -1576,36 +1687,39 @@ void ClassDef::writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const ol.writeString(" <div class=\"navtab\">\n"); ol.writeString(" <table>\n"); - MemberNameInfoSDict::Iterator mnili(*m_allMemberNameInfoSDict); - MemberNameInfo *mni; - for (;(mni=mnili.current());++mnili) + if (m_allMemberNameInfoSDict) { - MemberNameInfoIterator mnii(*mni); - MemberInfo *mi; - for (mnii.toFirst();(mi=mnii.current());++mnii) + MemberNameInfoSDict::Iterator mnili(*m_allMemberNameInfoSDict); + MemberNameInfo *mni; + for (;(mni=mnili.current());++mnili) { - MemberDef *md=mi->memberDef; - if (md->getClassDef()==this && md->isLinkable()) + MemberNameInfoIterator mnii(*mni); + MemberInfo *mi; + for (mnii.toFirst();(mi=mnii.current());++mnii) { - ol.writeString(" <tr><td class=\"navtab\">"); - if (md->isLinkableInProject()) + MemberDef *md=mi->memberDef; + if (md->getClassDef()==this && md->isLinkable()) { - if (md==currentMd) // selected item => highlight + ol.writeString(" <tr><td class=\"navtab\">"); + if (md->isLinkableInProject()) { - ol.writeString("<a class=\"qindexHL\" "); - } - else - { - ol.writeString("<a class=\"qindex\" "); + if (md==currentMd) // selected item => highlight + { + ol.writeString("<a class=\"qindexHL\" "); + } + else + { + ol.writeString("<a class=\"qindex\" "); + } + ol.writeString("href=\""); + if (createSubDirs) ol.writeString("../../"); + ol.writeString(md->getOutputFileBase()+Doxygen::htmlFileExtension+"#"+md->anchor()); + ol.writeString("\">"); + ol.writeString(md->name()); + ol.writeString("</a>"); } - ol.writeString("href=\""); - if (createSubDirs) ol.writeString("../../"); - ol.writeString(md->getOutputFileBase()+Doxygen::htmlFileExtension+"#"+md->anchor()); - ol.writeString("\">"); - ol.writeString(md->name()); - ol.writeString("</a>"); + ol.writeString("</td></tr>\n"); } - ol.writeString("</td></tr>\n"); } } } @@ -1642,13 +1756,14 @@ void ClassDef::writeDocumentationForInnerClasses(OutputList &ol) // write the list of all (inherited) members for this class void ClassDef::writeMemberList(OutputList &ol) { - if (m_allMemberNameInfoSDict->count()==0 || + if (m_allMemberNameInfoSDict==0 || Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) return; // only for HTML ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); - startFile(ol,m_memListFileName,m_memListFileName, + QCString memListFile = getMemberListFileName(); + startFile(ol,memListFile,memListFile, theTranslator->trMemberList(),HLI_ClassVisible); startTitle(ol,0); ol.parseText(displayName()+" "+theTranslator->trMemberList()); @@ -1847,7 +1962,12 @@ void ClassDef::writeMemberList(OutputList &ol) bool ClassDef::addExample(const char *anchor,const char *nameStr, const char *file) { - if (m_exampleSDict && !m_exampleSDict->find(nameStr)) + if (m_exampleSDict==0) + { + m_exampleSDict = new ExampleSDict; + m_exampleSDict->setAutoDelete(TRUE); + } + if (!m_exampleSDict->find(nameStr)) { Example *e=new Example; e->anchor=anchor; @@ -1892,23 +2012,26 @@ bool ClassDef::hasNonReferenceSuperClass() { return TRUE; // we're done if this class is not a reference } - BaseClassListIterator bcli(*m_inheritedBy); - for ( ; bcli.current() && !found ; ++bcli ) // for each super class + if (m_inheritedBy) { - ClassDef *bcd=bcli.current()->classDef; - // recurse into the super class branch - found = found || bcd->hasNonReferenceSuperClass(); - if (!found) + BaseClassListIterator bcli(*m_inheritedBy); + for ( ; bcli.current() && !found ; ++bcli ) // for each super class { - // look for template instances that might have non-reference super classes - QDict<ClassDef> *cil = bcd->getTemplateInstances(); - if (cil) + ClassDef *bcd=bcli.current()->classDef; + // recurse into the super class branch + found = found || bcd->hasNonReferenceSuperClass(); + if (!found) { - QDictIterator<ClassDef> tidi(*cil); - for ( ; tidi.current() && !found ; ++tidi) // for each template instance + // look for template instances that might have non-reference super classes + QDict<ClassDef> *cil = bcd->getTemplateInstances(); + if (cil) { - // recurse into the template instance branch - found = found || tidi.current()->hasNonReferenceSuperClass(); + QDictIterator<ClassDef> tidi(*cil); + for ( ; tidi.current() && !found ; ++tidi) // for each template instance + { + // recurse into the template instance branch + found = found || tidi.current()->hasNonReferenceSuperClass(); + } } } } @@ -1948,75 +2071,78 @@ void ClassDef::writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup) ol.endMemberItem(); // write user defined member groups - MemberGroupSDict::Iterator mgli(*memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - mg->setInGroup(inGroup); - mg->writePlainDeclarations(ol,this,0,0,0); - } - - pubTypes.setInGroup(inGroup); - pubTypes.writePlainDeclarations(ol,this,0,0,0); - pubMethods.setInGroup(inGroup); - pubMethods.writePlainDeclarations(ol,this,0,0,0); - pubAttribs.setInGroup(inGroup); - pubAttribs.writePlainDeclarations(ol,this,0,0,0); - pubSlots.setInGroup(inGroup); - pubSlots.writePlainDeclarations(ol,this,0,0,0); - signals.setInGroup(inGroup); - signals.writePlainDeclarations(ol,this,0,0,0); - dcopMethods.setInGroup(inGroup); - dcopMethods.writePlainDeclarations(ol,this,0,0,0); - properties.setInGroup(inGroup); - properties.writePlainDeclarations(ol,this,0,0,0); - events.setInGroup(inGroup); - events.writePlainDeclarations(ol,this,0,0,0); - pubStaticMethods.setInGroup(inGroup); - pubStaticMethods.writePlainDeclarations(ol,this,0,0,0); - pubStaticAttribs.setInGroup(inGroup); - pubStaticAttribs.writePlainDeclarations(ol,this,0,0,0); - proTypes.setInGroup(inGroup); - proTypes.writePlainDeclarations(ol,this,0,0,0); - proMethods.setInGroup(inGroup); - proMethods.writePlainDeclarations(ol,this,0,0,0); - proAttribs.setInGroup(inGroup); - proAttribs.writePlainDeclarations(ol,this,0,0,0); - proSlots.setInGroup(inGroup); - proSlots.writePlainDeclarations(ol,this,0,0,0); - proStaticMethods.setInGroup(inGroup); - proStaticMethods.writePlainDeclarations(ol,this,0,0,0); - proStaticAttribs.setInGroup(inGroup); - proStaticAttribs.writePlainDeclarations(ol,this,0,0,0); - pacTypes.setInGroup(inGroup); - pacTypes.writePlainDeclarations(ol,this,0,0,0); - pacMethods.setInGroup(inGroup); - pacMethods.writePlainDeclarations(ol,this,0,0,0); - pacAttribs.setInGroup(inGroup); - pacAttribs.writePlainDeclarations(ol,this,0,0,0); - pacStaticMethods.setInGroup(inGroup); - pacStaticMethods.writePlainDeclarations(ol,this,0,0,0); - pacStaticAttribs.setInGroup(inGroup); - pacStaticAttribs.writePlainDeclarations(ol,this,0,0,0); + if (memberGroupSDict) + { + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->setInGroup(inGroup); + mg->writePlainDeclarations(ol,this,0,0,0); + } + } + + if (pubTypes) pubTypes->setInGroup(inGroup); + if (pubTypes) pubTypes->writePlainDeclarations(ol,this,0,0,0); + if (pubMethods) pubMethods->setInGroup(inGroup); + if (pubMethods) pubMethods->writePlainDeclarations(ol,this,0,0,0); + if (pubAttribs) pubAttribs->setInGroup(inGroup); + if (pubAttribs) pubAttribs->writePlainDeclarations(ol,this,0,0,0); + if (pubSlots) pubSlots->setInGroup(inGroup); + if (pubSlots) pubSlots->writePlainDeclarations(ol,this,0,0,0); + if (signals) signals->setInGroup(inGroup); + if (signals) signals->writePlainDeclarations(ol,this,0,0,0); + if (dcopMethods) dcopMethods->setInGroup(inGroup); + if (dcopMethods) dcopMethods->writePlainDeclarations(ol,this,0,0,0); + if (properties) properties->setInGroup(inGroup); + if (properties) properties->writePlainDeclarations(ol,this,0,0,0); + if (events) events->setInGroup(inGroup); + if (events) events->writePlainDeclarations(ol,this,0,0,0); + if (pubStaticMethods) pubStaticMethods->setInGroup(inGroup); + if (pubStaticMethods) pubStaticMethods->writePlainDeclarations(ol,this,0,0,0); + if (pubStaticAttribs) pubStaticAttribs->setInGroup(inGroup); + if (pubStaticAttribs) pubStaticAttribs->writePlainDeclarations(ol,this,0,0,0); + if (proTypes) proTypes->setInGroup(inGroup); + if (proTypes) proTypes->writePlainDeclarations(ol,this,0,0,0); + if (proMethods) proMethods->setInGroup(inGroup); + if (proMethods) proMethods->writePlainDeclarations(ol,this,0,0,0); + if (proAttribs) proAttribs->setInGroup(inGroup); + if (proAttribs) proAttribs->writePlainDeclarations(ol,this,0,0,0); + if (proSlots) proSlots->setInGroup(inGroup); + if (proSlots) proSlots->writePlainDeclarations(ol,this,0,0,0); + if (proStaticMethods) proStaticMethods->setInGroup(inGroup); + if (proStaticMethods) proStaticMethods->writePlainDeclarations(ol,this,0,0,0); + if (proStaticAttribs) proStaticAttribs->setInGroup(inGroup); + if (proStaticAttribs) proStaticAttribs->writePlainDeclarations(ol,this,0,0,0); + if (pacTypes) pacTypes->setInGroup(inGroup); + if (pacTypes) pacTypes->writePlainDeclarations(ol,this,0,0,0); + if (pacMethods) pacMethods->setInGroup(inGroup); + if (pacMethods) pacMethods->writePlainDeclarations(ol,this,0,0,0); + if (pacAttribs) pacAttribs->setInGroup(inGroup); + if (pacAttribs) pacAttribs->writePlainDeclarations(ol,this,0,0,0); + if (pacStaticMethods) pacStaticMethods->setInGroup(inGroup); + if (pacStaticMethods) pacStaticMethods->writePlainDeclarations(ol,this,0,0,0); + if (pacStaticAttribs) pacStaticAttribs->setInGroup(inGroup); + if (pacStaticAttribs) pacStaticAttribs->writePlainDeclarations(ol,this,0,0,0); if (Config_getBool("EXTRACT_PRIVATE")) { - priTypes.setInGroup(inGroup); - priTypes.writePlainDeclarations(ol,this,0,0,0); - priMethods.setInGroup(inGroup); - priMethods.writePlainDeclarations(ol,this,0,0,0); - priAttribs.setInGroup(inGroup); - priAttribs.writePlainDeclarations(ol,this,0,0,0); - priSlots.setInGroup(inGroup); - priSlots.writePlainDeclarations(ol,this,0,0,0); - priStaticMethods.setInGroup(inGroup); - priStaticMethods.writePlainDeclarations(ol,this,0,0,0); - priStaticAttribs.setInGroup(inGroup); - priStaticAttribs.writePlainDeclarations(ol,this,0,0,0); - } - friends.setInGroup(inGroup); - friends.writePlainDeclarations(ol,this,0,0,0); - related.setInGroup(inGroup); - related.writePlainDeclarations(ol,this,0,0,0); + if (priTypes) priTypes->setInGroup(inGroup); + if (priTypes) priTypes->writePlainDeclarations(ol,this,0,0,0); + if (priMethods) priMethods->setInGroup(inGroup); + if (priMethods) priMethods->writePlainDeclarations(ol,this,0,0,0); + if (priAttribs) priAttribs->setInGroup(inGroup); + if (priAttribs) priAttribs->writePlainDeclarations(ol,this,0,0,0); + if (priSlots) priSlots->setInGroup(inGroup); + if (priSlots) priSlots->writePlainDeclarations(ol,this,0,0,0); + if (priStaticMethods) priStaticMethods->setInGroup(inGroup); + if (priStaticMethods) priStaticMethods->writePlainDeclarations(ol,this,0,0,0); + if (priStaticAttribs) priStaticAttribs->setInGroup(inGroup); + if (priStaticAttribs) priStaticAttribs->writePlainDeclarations(ol,this,0,0,0); + } + if (friends) friends->setInGroup(inGroup); + if (friends) friends->writePlainDeclarations(ol,this,0,0,0); + if (related) related->setInGroup(inGroup); + if (related) related->writePlainDeclarations(ol,this,0,0,0); } /*! a link to this class is possible within this project */ @@ -2097,16 +2223,19 @@ bool ClassDef::isBaseClass(ClassDef *bcd, bool followInstances,int level) err("Possible recursive class relation while inside %s and looking for %s\n",name().data(),bcd->name().data()); return FALSE; } - BaseClassListIterator bcli(*baseClasses()); - for ( ; bcli.current() && !found ; ++bcli) + if (baseClasses()) { - ClassDef *ccd=bcli.current()->classDef; - if (!followInstances && ccd->templateMaster()) ccd=ccd->templateMaster(); - //printf("isBaseClass() baseclass %s\n",ccd->name().data()); - if (ccd==bcd) - found=TRUE; - else - found=ccd->isBaseClass(bcd,followInstances,level+1); + BaseClassListIterator bcli(*baseClasses()); + for ( ; bcli.current() && !found ; ++bcli) + { + ClassDef *ccd=bcli.current()->classDef; + if (!followInstances && ccd->templateMaster()) ccd=ccd->templateMaster(); + //printf("isBaseClass() baseclass %s\n",ccd->name().data()); + if (ccd==bcd) + found=TRUE; + else + found=ccd->isBaseClass(bcd,followInstances,level+1); + } } return found; } @@ -2132,216 +2261,222 @@ void ClassDef::mergeMembers() m_membersMerged=TRUE; //printf(" mergeMembers for %s\n",name().data()); bool inlineInheritedMembers = Config_getBool("INLINE_INHERITED_MEMB" ); - BaseClassListIterator bcli(*baseClasses()); - BaseClassDef *bcd; - for ( ; (bcd=bcli.current()) ; ++bcli ) + if (baseClasses()) { - ClassDef *bClass=bcd->classDef; + BaseClassListIterator bcli(*baseClasses()); + BaseClassDef *bcd; + for ( ; (bcd=bcli.current()) ; ++bcli ) + { + ClassDef *bClass=bcd->classDef; - // merge the members in the base class of this inheritance branch first - bClass->mergeMembers(); + // merge the members in the base class of this inheritance branch first + bClass->mergeMembers(); - MemberNameInfoSDict *srcMnd = bClass->m_allMemberNameInfoSDict; - MemberNameInfoSDict *dstMnd = m_allMemberNameInfoSDict; + MemberNameInfoSDict *srcMnd = bClass->m_allMemberNameInfoSDict; + MemberNameInfoSDict *dstMnd = m_allMemberNameInfoSDict; - MemberNameInfoSDict::Iterator srcMnili(*srcMnd); - MemberNameInfo *srcMni; - for ( ; (srcMni=srcMnili.current()) ; ++srcMnili) - { - //printf("Base member name %s\n",srcMni->memberName()); - MemberNameInfo *dstMni; - if ((dstMni=dstMnd->find(srcMni->memberName()))) - // a member with that name is already in the class. - // the member may hide or reimplement the one in the sub class - // or there may be another path to the base class that is already - // visited via another branch in the class hierarchy. + if (srcMnd && dstMnd) { - MemberNameInfoIterator srcMnii(*srcMni); - MemberInfo *srcMi; - for ( ; (srcMi=srcMnii.current()) ; ++srcMnii ) + MemberNameInfoSDict::Iterator srcMnili(*srcMnd); + MemberNameInfo *srcMni; + for ( ; (srcMni=srcMnili.current()) ; ++srcMnili) { - MemberDef *srcMd = srcMi->memberDef; - bool found=FALSE; - bool ambigue=FALSE; - bool hidden=FALSE; - MemberNameInfoIterator dstMnii(*dstMni); - MemberInfo *dstMi; - ClassDef *srcCd = srcMd->getClassDef(); - for ( ; (dstMi=dstMnii.current()) && !found; ++dstMnii ) + //printf("Base member name %s\n",srcMni->memberName()); + MemberNameInfo *dstMni; + if ((dstMni=dstMnd->find(srcMni->memberName()))) + // a member with that name is already in the class. + // the member may hide or reimplement the one in the sub class + // or there may be another path to the base class that is already + // visited via another branch in the class hierarchy. { - MemberDef *dstMd = dstMi->memberDef; - if (srcMd!=dstMd) // different members - { - ClassDef *dstCd = dstMd->getClassDef(); - //printf(" Is %s a base class of %s?\n",srcCd->name().data(),dstCd->name().data()); - if (srcCd==dstCd || dstCd->isBaseClass(srcCd,TRUE)) - // member is in the same or a base class - { - found=matchArguments2( - srcMd->getOuterScope(),srcMd->getFileDef(),srcMd->argumentList(), - dstMd->getOuterScope(),dstMd->getFileDef(),dstMd->argumentList(), - TRUE - ); - //printf(" Yes, matching (%s<->%s): %d\n", - // argListToString(srcMd->argumentList()).data(), - // argListToString(dstMd->argumentList()).data(), - // found); - hidden = hidden || !found; - } - else // member is in a non base class => multiple inheritance - // using the same base class. - { - //printf("$$ Existing member %s %s add scope %s\n", - // dstMi->ambiguityResolutionScope.data(), - // dstMd->name().data(), - // dstMi->scopePath.left(dstMi->scopePath.find("::")+2).data()); - - QCString scope=dstMi->scopePath.left(dstMi->scopePath.find("::")+2); - if (scope!=dstMi->ambiguityResolutionScope.left(scope.length())) - dstMi->ambiguityResolutionScope.prepend(scope); - ambigue=TRUE; - } - } - else // same members + MemberNameInfoIterator srcMnii(*srcMni); + MemberInfo *srcMi; + for ( ; (srcMi=srcMnii.current()) ; ++srcMnii ) { - // do not add if base class is virtual or - // if scope paths are equal or - // if base class is an interface (and thus implicitly virtual). - //printf("same member found srcMi->virt=%d dstMi->virt=%d\n",srcMi->virt,dstMi->virt); - if ((srcMi->virt!=Normal && dstMi->virt!=Normal) || - bClass->name()+"::"+srcMi->scopePath == dstMi->scopePath || - dstMd->getClassDef()->compoundType()==Interface - ) + MemberDef *srcMd = srcMi->memberDef; + bool found=FALSE; + bool ambigue=FALSE; + bool hidden=FALSE; + MemberNameInfoIterator dstMnii(*dstMni); + MemberInfo *dstMi; + ClassDef *srcCd = srcMd->getClassDef(); + for ( ; (dstMi=dstMnii.current()) && !found; ++dstMnii ) { - found=TRUE; + MemberDef *dstMd = dstMi->memberDef; + if (srcMd!=dstMd) // different members + { + ClassDef *dstCd = dstMd->getClassDef(); + //printf(" Is %s a base class of %s?\n",srcCd->name().data(),dstCd->name().data()); + if (srcCd==dstCd || dstCd->isBaseClass(srcCd,TRUE)) + // member is in the same or a base class + { + found=matchArguments2( + srcMd->getOuterScope(),srcMd->getFileDef(),srcMd->argumentList(), + dstMd->getOuterScope(),dstMd->getFileDef(),dstMd->argumentList(), + TRUE + ); + //printf(" Yes, matching (%s<->%s): %d\n", + // argListToString(srcMd->argumentList()).data(), + // argListToString(dstMd->argumentList()).data(), + // found); + hidden = hidden || !found; + } + else // member is in a non base class => multiple inheritance + // using the same base class. + { + //printf("$$ Existing member %s %s add scope %s\n", + // dstMi->ambiguityResolutionScope.data(), + // dstMd->name().data(), + // dstMi->scopePath.left(dstMi->scopePath.find("::")+2).data()); + + QCString scope=dstMi->scopePath.left(dstMi->scopePath.find("::")+2); + if (scope!=dstMi->ambiguityResolutionScope.left(scope.length())) + dstMi->ambiguityResolutionScope.prepend(scope); + ambigue=TRUE; + } + } + else // same members + { + // do not add if base class is virtual or + // if scope paths are equal or + // if base class is an interface (and thus implicitly virtual). + //printf("same member found srcMi->virt=%d dstMi->virt=%d\n",srcMi->virt,dstMi->virt); + if ((srcMi->virt!=Normal && dstMi->virt!=Normal) || + bClass->name()+"::"+srcMi->scopePath == dstMi->scopePath || + dstMd->getClassDef()->compoundType()==Interface + ) + { + found=TRUE; + } + else // member can be reached via multiple paths in the + // inheritance tree + { + //printf("$$ Existing member %s %s add scope %s\n", + // dstMi->ambiguityResolutionScope.data(), + // dstMd->name().data(), + // dstMi->scopePath.left(dstMi->scopePath.find("::")+2).data()); + + QCString scope=dstMi->scopePath.left(dstMi->scopePath.find("::")+2); + if (scope!=dstMi->ambiguityResolutionScope.left(scope.length())) + { + dstMi->ambiguityResolutionScope.prepend(scope); + } + ambigue=TRUE; + } + } } - else // member can be reached via multiple paths in the - // inheritance tree + //printf("member %s::%s hidden %d ambigue %d srcMi->ambigClass=%p\n", + // srcCd->name().data(),srcMd->name().data(),hidden,ambigue,srcMi->ambigClass); + + // TODO: fix the case where a member is hidden by inheritance + // of a member with the same name but with another prototype, + // while there is more than one path to the member in the + // base class due to multiple inheritance. In this case + // it seems that the member is not reachable by prefixing a + // scope name either (according to my compiler). Currently, + // this case is shown anyway. + if (!found && srcMd->protection()!=Private) { - //printf("$$ Existing member %s %s add scope %s\n", - // dstMi->ambiguityResolutionScope.data(), - // dstMd->name().data(), - // dstMi->scopePath.left(dstMi->scopePath.find("::")+2).data()); + Protection prot=srcMd->protection(); + if (bcd->prot==Protected && prot==Public) prot=bcd->prot; + else if (bcd->prot==Private) prot=bcd->prot; - QCString scope=dstMi->scopePath.left(dstMi->scopePath.find("::")+2); - if (scope!=dstMi->ambiguityResolutionScope.left(scope.length())) + if (inlineInheritedMembers) { - dstMi->ambiguityResolutionScope.prepend(scope); + if (!isStandardFunc(srcMd)) + { + //printf(" insertMember `%s'\n",srcMd->name().data()); + internalInsertMember(srcMd,prot,FALSE); + } } - ambigue=TRUE; - } - } - } - //printf("member %s::%s hidden %d ambigue %d srcMi->ambigClass=%p\n", - // srcCd->name().data(),srcMd->name().data(),hidden,ambigue,srcMi->ambigClass); - - // TODO: fix the case where a member is hidden by inheritance - // of a member with the same name but with another prototype, - // while there is more than one path to the member in the - // base class due to multiple inheritance. In this case - // it seems that the member is not reachable by prefixing a - // scope name either (according to my compiler). Currently, - // this case is shown anyway. - if (!found && srcMd->protection()!=Private) - { - Protection prot=srcMd->protection(); - if (bcd->prot==Protected && prot==Public) prot=bcd->prot; - else if (bcd->prot==Private) prot=bcd->prot; - - if (inlineInheritedMembers) - { - if (!isStandardFunc(srcMd)) - { - //printf(" insertMember `%s'\n",srcMd->name().data()); - internalInsertMember(srcMd,prot,FALSE); - } - } - Specifier virt=srcMi->virt; - if (srcMi->virt==Normal && bcd->virt!=Normal) virt=bcd->virt; - - MemberInfo *newMi = new MemberInfo(srcMd,prot,virt,TRUE); - newMi->scopePath=bClass->name()+"::"+srcMi->scopePath; - if (ambigue) - { - //printf("$$ New member %s %s add scope %s::\n", - // srcMi->ambiguityResolutionScope.data(), - // srcMd->name().data(), - // bClass->name().data()); + Specifier virt=srcMi->virt; + if (srcMi->virt==Normal && bcd->virt!=Normal) virt=bcd->virt; - QCString scope=bClass->name()+"::"; - if (scope!=srcMi->ambiguityResolutionScope.left(scope.length())) - { - newMi->ambiguityResolutionScope= - scope+srcMi->ambiguityResolutionScope.copy(); + MemberInfo *newMi = new MemberInfo(srcMd,prot,virt,TRUE); + newMi->scopePath=bClass->name()+"::"+srcMi->scopePath; + if (ambigue) + { + //printf("$$ New member %s %s add scope %s::\n", + // srcMi->ambiguityResolutionScope.data(), + // srcMd->name().data(), + // bClass->name().data()); + + QCString scope=bClass->name()+"::"; + if (scope!=srcMi->ambiguityResolutionScope.left(scope.length())) + { + newMi->ambiguityResolutionScope= + scope+srcMi->ambiguityResolutionScope.copy(); + } + } + if (hidden) + { + if (srcMi->ambigClass==0) + { + newMi->ambigClass=bClass; + newMi->ambiguityResolutionScope=bClass->name()+"::"; + } + else + { + newMi->ambigClass=srcMi->ambigClass; + newMi->ambiguityResolutionScope=srcMi->ambigClass->name()+"::"; + } + } + dstMni->append(newMi); } } - if (hidden) + } + else // base class has a member that is not in the sub class => copy + { + // create a deep copy of the list (only the MemberInfo's will be + // copied, not the actual MemberDef's) + MemberNameInfo *newMni = 0; + newMni = new MemberNameInfo(srcMni->memberName()); + + // copy the member(s) from the base to the sub class + MemberNameInfoIterator mnii(*srcMni); + MemberInfo *mi; + for (;(mi=mnii.current());++mnii) { - if (srcMi->ambigClass==0) + Protection prot = mi->prot; + if (bcd->prot==Protected) { - newMi->ambigClass=bClass; - newMi->ambiguityResolutionScope=bClass->name()+"::"; + if (prot==Public) prot=Protected; } - else + else if (bcd->prot==Private) { - newMi->ambigClass=srcMi->ambigClass; - newMi->ambiguityResolutionScope=srcMi->ambigClass->name()+"::"; + prot=Private; } - } - dstMni->append(newMi); - } - } - } - else // base class has a member that is not in the sub class => copy - { - // create a deep copy of the list (only the MemberInfo's will be - // copied, not the actual MemberDef's) - MemberNameInfo *newMni = 0; - newMni = new MemberNameInfo(srcMni->memberName()); - - // copy the member(s) from the base to the sub class - MemberNameInfoIterator mnii(*srcMni); - MemberInfo *mi; - for (;(mi=mnii.current());++mnii) - { - Protection prot = mi->prot; - if (bcd->prot==Protected) - { - if (prot==Public) prot=Protected; - } - else if (bcd->prot==Private) - { - prot=Private; - } - //printf("%s::%s: prot=%d bcd->prot=%d result=%d\n", - // name().data(),mi->memberDef->name().data(),mi->prot, - // bcd->prot,prot); - - if (mi->prot!=Private) - { - Specifier virt=mi->virt; - if (mi->virt==Normal && bcd->virt!=Normal) virt=bcd->virt; + //printf("%s::%s: prot=%d bcd->prot=%d result=%d\n", + // name().data(),mi->memberDef->name().data(),mi->prot, + // bcd->prot,prot); - if (inlineInheritedMembers) - { - if (!isStandardFunc(mi->memberDef)) + if (mi->prot!=Private) { - //printf(" insertMember `%s'\n",mi->memberDef->name().data()); - internalInsertMember(mi->memberDef,prot,FALSE); + Specifier virt=mi->virt; + if (mi->virt==Normal && bcd->virt!=Normal) virt=bcd->virt; + + if (inlineInheritedMembers) + { + if (!isStandardFunc(mi->memberDef)) + { + //printf(" insertMember `%s'\n",mi->memberDef->name().data()); + internalInsertMember(mi->memberDef,prot,FALSE); + } + } + //printf("Adding!\n"); + MemberInfo *newMi=new MemberInfo(mi->memberDef,prot,virt,TRUE); + newMi->scopePath=bClass->name()+"::"+mi->scopePath; + newMi->ambigClass=mi->ambigClass; + newMi->ambiguityResolutionScope=mi->ambiguityResolutionScope.copy(); + newMni->append(newMi); } } - //printf("Adding!\n"); - MemberInfo *newMi=new MemberInfo(mi->memberDef,prot,virt,TRUE); - newMi->scopePath=bClass->name()+"::"+mi->scopePath; - newMi->ambigClass=mi->ambigClass; - newMi->ambiguityResolutionScope=mi->ambiguityResolutionScope.copy(); - newMni->append(newMi); + + // add it to the dictionary + dstMnd->append(newMni->memberName(),newMni); } } - - // add it to the dictionary - dstMnd->append(newMni->memberName(),newMni); } } } @@ -2359,37 +2494,40 @@ void ClassDef::mergeCategory(ClassDef *category) MemberNameInfoSDict *srcMnd = category->m_allMemberNameInfoSDict; MemberNameInfoSDict *dstMnd = m_allMemberNameInfoSDict; - MemberNameInfoSDict::Iterator srcMnili(*srcMnd); - MemberNameInfo *srcMni; - for ( ; (srcMni=srcMnili.current()) ; ++srcMnili) + if (srcMnd && dstMnd) { - MemberNameInfo *dstMni=dstMnd->find(srcMni->memberName()); - if (dstMni) // method is already defined in the class - { - // TODO: we should remove the other member and insert this one. - } - else // new method name + MemberNameInfoSDict::Iterator srcMnili(*srcMnd); + MemberNameInfo *srcMni; + for ( ; (srcMni=srcMnili.current()) ; ++srcMnili) { - // create a deep copy of the list (only the MemberInfo's will be - // copied, not the actual MemberDef's) - MemberNameInfo *newMni = 0; - newMni = new MemberNameInfo(srcMni->memberName()); - - // copy the member(s) from the category to this class - MemberNameInfoIterator mnii(*srcMni); - MemberInfo *mi; - for (;(mi=mnii.current());++mnii) + MemberNameInfo *dstMni=dstMnd->find(srcMni->memberName()); + if (dstMni) // method is already defined in the class { - //printf("Adding!\n"); - MemberInfo *newMi=new MemberInfo(mi->memberDef,mi->prot,mi->virt,mi->inherited); - newMi->scopePath=mi->scopePath; - newMi->ambigClass=mi->ambigClass; - newMi->ambiguityResolutionScope=mi->ambiguityResolutionScope.copy(); - newMni->append(newMi); + // TODO: we should remove the other member and insert this one. } + else // new method name + { + // create a deep copy of the list (only the MemberInfo's will be + // copied, not the actual MemberDef's) + MemberNameInfo *newMni = 0; + newMni = new MemberNameInfo(srcMni->memberName()); - // add it to the dictionary - dstMnd->append(newMni->memberName(),newMni); + // copy the member(s) from the category to this class + MemberNameInfoIterator mnii(*srcMni); + MemberInfo *mi; + for (;(mi=mnii.current());++mnii) + { + //printf("Adding!\n"); + MemberInfo *newMi=new MemberInfo(mi->memberDef,mi->prot,mi->virt,mi->inherited); + newMi->scopePath=mi->scopePath; + newMi->ambigClass=mi->ambigClass; + newMi->ambiguityResolutionScope=mi->ambiguityResolutionScope.copy(); + newMni->append(newMi); + } + + // add it to the dictionary + dstMnd->append(newMni->memberName(),newMni); + } } } } @@ -2703,6 +2841,7 @@ void ClassDef::setGroupDefForAllMembers(GroupDef *gd,Grouping::GroupPri_t pri,co { gd->addClass(this); //printf("ClassDef::setGroupDefForAllMembers(%s)\n",gd->name().data()); + if (m_allMemberNameInfoSDict==0) return; MemberNameInfoSDict::Iterator mnili(*m_allMemberNameInfoSDict); MemberNameInfo *mni; for (;(mni=mnili.current());++mnili) @@ -2725,13 +2864,17 @@ void ClassDef::addInnerCompound(Definition *d) if (d->definitionType()==Definition::TypeClass) // only classes can be // nested in classes. { + if (m_innerClasses==0) + { + m_innerClasses = new ClassSDict(17); + } m_innerClasses->inSort(d->localName(),(ClassDef *)d); } } Definition *ClassDef::findInnerCompound(const char *name) { - if (name==0) return 0; + if (name==0 || m_innerClasses==0) return 0; return m_innerClasses->find(name); } @@ -2845,6 +2988,7 @@ QDict<int> *ClassDef::getTemplateBaseClassNames() const void ClassDef::addMembersToTemplateInstance(ClassDef *cd,const char *templSpec) { //printf("%s::addMembersToTemplateInstance(%s,%s)\n",name().data(),cd->name().data(),templSpec); + if (cd->m_allMemberNameInfoSDict==0) return; MemberNameInfoSDict::Iterator mnili(*cd->m_allMemberNameInfoSDict); MemberNameInfo *mni; for (;(mni=mnili.current());++mnili) @@ -2989,43 +3133,49 @@ void ClassDef::addListReferences() theTranslator->trClass(TRUE,TRUE), getOutputFileBase(),displayName() ); - MemberGroupSDict::Iterator mgli(*memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - mg->addListReferences(this); - } - constructors.addListReferences(this); - typedefMembers.addListReferences(this); - enumMembers.addListReferences(this); - enumValMembers.addListReferences(this); - functionMembers.addListReferences(this); - relatedMembers.addListReferences(this); - variableMembers.addListReferences(this); - propertyMembers.addListReferences(this); - eventMembers.addListReferences(this); + if (memberGroupSDict) + { + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->addListReferences(this); + } + } + if (constructors) constructors->addListReferences(this); + if (typedefMembers) typedefMembers->addListReferences(this); + if (enumMembers) enumMembers->addListReferences(this); + if (enumValMembers) enumValMembers->addListReferences(this); + if (functionMembers) functionMembers->addListReferences(this); + if (relatedMembers) relatedMembers->addListReferences(this); + if (variableMembers) variableMembers->addListReferences(this); + if (propertyMembers) propertyMembers->addListReferences(this); + if (eventMembers) eventMembers->addListReferences(this); } MemberDef *ClassDef::getMemberByName(const QCString &name) { MemberDef *xmd = 0; - MemberNameInfo *mni = m_allMemberNameInfoSDict->find(name); - if (mni) + if (m_allMemberNameInfoSDict) { - const int maxInheritanceDepth = 100000; - int mdist=maxInheritanceDepth; - MemberNameInfoIterator mnii(*mni); - MemberInfo *mi; - for (mnii.toFirst();(mi=mnii.current());++mnii) + MemberNameInfo *mni = m_allMemberNameInfoSDict->find(name); + if (mni) { - ClassDef *mcd=mi->memberDef->getClassDef(); - int m=minClassDistance(this,mcd); - //printf("found member in %s linkable=%d m=%d\n", - // mcd->name().data(),mcd->isLinkable(),m); - if (m<mdist && mcd->isLinkable()) + const int maxInheritanceDepth = 100000; + int mdist=maxInheritanceDepth; + MemberNameInfoIterator mnii(*mni); + MemberInfo *mi; + for (mnii.toFirst();(mi=mnii.current());++mnii) { - mdist=m; - xmd=mi->memberDef; + ClassDef *mcd=mi->memberDef->getClassDef(); + int m=minClassDistance(this,mcd); + //printf("found member in %s linkable=%d m=%d\n", + // mcd->name().data(),mcd->isLinkable(),m); + if (m<mdist && mcd->isLinkable()) + { + mdist=m; + xmd=mi->memberDef; + } } } } diff --git a/src/classdef.h b/src/classdef.h index f01e15c..ca486dd 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -227,46 +227,46 @@ class ClassDef : public Definition QCString className() const; /* member lists by protection */ - MemberList pubMethods; - MemberList proMethods; - MemberList pacMethods; - MemberList priMethods; - MemberList pubStaticMethods; - MemberList proStaticMethods; - MemberList pacStaticMethods; - MemberList priStaticMethods; - MemberList pubSlots; - MemberList proSlots; - MemberList priSlots; - MemberList pubAttribs; - MemberList proAttribs; - MemberList pacAttribs; - MemberList priAttribs; - MemberList pubStaticAttribs; - MemberList proStaticAttribs; - MemberList pacStaticAttribs; - MemberList priStaticAttribs; - MemberList pubTypes; - MemberList proTypes; - MemberList pacTypes; - MemberList priTypes; - MemberList related; - MemberList signals; - MemberList friends; - MemberList dcopMethods; - MemberList properties; - MemberList events; + MemberList *pubMethods; + MemberList *proMethods; + MemberList *pacMethods; + MemberList *priMethods; + MemberList *pubStaticMethods; + MemberList *proStaticMethods; + MemberList *pacStaticMethods; + MemberList *priStaticMethods; + MemberList *pubSlots; + MemberList *proSlots; + MemberList *priSlots; + MemberList *pubAttribs; + MemberList *proAttribs; + MemberList *pacAttribs; + MemberList *priAttribs; + MemberList *pubStaticAttribs; + MemberList *proStaticAttribs; + MemberList *pacStaticAttribs; + MemberList *priStaticAttribs; + MemberList *pubTypes; + MemberList *proTypes; + MemberList *pacTypes; + MemberList *priTypes; + MemberList *related; + MemberList *signals; + MemberList *friends; + MemberList *dcopMethods; + MemberList *properties; + MemberList *events; /* member list by types */ - MemberList constructors; - MemberList typedefMembers; - MemberList enumMembers; - MemberList enumValMembers; - MemberList functionMembers; - MemberList relatedMembers; - MemberList variableMembers; - MemberList propertyMembers; - MemberList eventMembers; + MemberList *constructors; + MemberList *typedefMembers; + MemberList *enumMembers; + MemberList *enumValMembers; + MemberList *functionMembers; + MemberList *relatedMembers; + MemberList *variableMembers; + MemberList *propertyMembers; + MemberList *eventMembers; /* user defined member groups */ MemberGroupSDict *memberGroupSDict; @@ -354,6 +354,7 @@ class ClassDef : public Definition private: void internalInsertMember(MemberDef *md,Protection prot,bool addToAllList); + QCString getMemberListFileName() const; /*! file name that forms the base for the output file containing the * class documentation. For compatibility with Qt (e.g. links via tag @@ -369,7 +370,7 @@ class ClassDef : public Definition /*! file name that forms the base for the "list of members" for this * class. */ - QCString m_memListFileName; + //QCString m_memListFileName; /*! Bare name of the class without any scoping prefixes * (like for nested classes and classes inside namespaces) @@ -414,12 +415,6 @@ class ClassDef : public Definition */ Protection m_prot; - /*! Does this class group its user-grouped members - * as a sub-section of the normal (public/protected/..) - * groups? - */ - bool m_subGrouping; - /*! The inner classes contained in this class. Will be 0 if there are * no inner classes. */ @@ -447,6 +442,14 @@ class ClassDef : public Definition /*! The class this class is an instance of. */ ClassDef *m_templateMaster; + /*! class name with outer class scope, but without namespace scope. */ + QCString m_className; + + /*! If this class is a Objective-C category, then this points to the + * class which is extended. + */ + ClassDef *m_categoryOf; + /*! Indicated whether this class exists because it is used by * some other class only (TRUE) or if some class inherits from * it (FALSE). This is need to remove used-only classes from @@ -469,15 +472,14 @@ class ClassDef : public Definition /*! TRUE if the class is defined in a source file rather than a header file. */ bool m_isLocal; - /*! class name with outer class scope, but without namespace scope. */ - QCString m_className; + bool m_isTemplArg; - /*! If this class is a Objective-C category, then this points to the - * class which is extended. + /*! Does this class group its user-grouped members + * as a sub-section of the normal (public/protected/..) + * groups? */ - ClassDef *m_categoryOf; + bool m_subGrouping; - bool m_isTemplArg; }; /*! \brief Class that contains information about a usage relation. diff --git a/src/cmdmapper.cpp b/src/cmdmapper.cpp index bba11e2..12b1432 100644 --- a/src/cmdmapper.cpp +++ b/src/cmdmapper.cpp @@ -132,8 +132,8 @@ CommandMap htmlTagMap[] = { "ol", HTML_OL }, { "ul", HTML_UL }, { "li", HTML_LI }, - { "tt", HTML_CODE }, - { "kbd", HTML_CODE }, + { "tt", XML_C /*HTML_CODE*/ }, + { "kbd", XML_C /*HTML_CODE*/ }, { "em", HTML_EMPHASIS }, { "hr", HTML_HR }, { "dl", HTML_DL }, @@ -1076,13 +1076,16 @@ static void generateMemberLink(CodeOutputInterface &ol,const QCString &varName, //printf("Found result!\n"); return; } - BaseClassListIterator bcli(*vcd->baseClasses()); - for ( ; bcli.current() ; ++bcli) + if (vcd->baseClasses()) { - if (getLink(bcli.current()->classDef->name(),memName,ol)) + BaseClassListIterator bcli(*vcd->baseClasses()); + for ( ; bcli.current() ; ++bcli) { - //printf("Found result!\n"); - return; + if (getLink(bcli.current()->classDef->name(),memName,ol)) + { + //printf("Found result!\n"); + return; + } } } } @@ -1176,12 +1179,15 @@ static void generateFunctionLink(CodeOutputInterface &ol,char *funcName) if (!locScope.isEmpty() && (ccd=g_codeClassSDict[locScope])) { //printf("using classScope %s\n",g_classScope.data()); - BaseClassListIterator bcli(*ccd->baseClasses()); - for ( ; bcli.current() ; ++bcli) + if (ccd->baseClasses()) { - if (getLink(bcli.current()->classDef->name(),locFunc,ol,funcName)) + BaseClassListIterator bcli(*ccd->baseClasses()); + for ( ; bcli.current() ; ++bcli) { - return; + if (getLink(bcli.current()->classDef->name(),locFunc,ol,funcName)) + { + return; + } } } } diff --git a/src/commentcnv.l b/src/commentcnv.l index a64d66a..c26334e 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -370,7 +370,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) BEGIN(g_lastCommentContext); } } -<VerbatimCode>^"//"[\!\/]? { /* skip leading comments */ +<VerbatimCode>^[ \t]*"//"[\!\/]? { /* skip leading comments */ if (!g_inSpecialComment) { copyToOutput(yytext,yyleng); diff --git a/src/commentscan.l b/src/commentscan.l index 35f2566..59c7d53 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -2326,10 +2326,11 @@ void groupLeaveCompound(const char *,int,const char *) void openGroup(Entry *e,const char *,int) { - //printf("==> openGroup(name=%s,sec=%x)\n",e->name.data(),e->section); if (e->section==Entry::GROUPDOC_SEC) // auto group { g_autoGroupStack.push(new Grouping(e->name,e->groupingPri())); + printf("==> openGroup(name=%s,sec=%x) g_autoGroupStack=%d\n", + e->name.data(),e->section,g_autoGroupStack.count()); } else // start of a member group { @@ -2346,18 +2347,13 @@ void openGroup(Entry *e,const char *,int) g_memberGroupRelates = e->relates; e->mGrpId = g_memberGroupId; } - //else - //{ - // warn(fileName,line,"Warning: member groups cannot be nested. Ending current group!\n"); - // closeGroup(e,fileName,line); - //} } } void closeGroup(Entry *e,const char *fileName,int) { - //printf("==> closeGroup(name=%s,sec=%x) g_autoGroupStack=%d\n", - // e->name.data(),e->section,g_autoGroupStack.count()); + printf("==> closeGroup(name=%s,sec=%x) g_autoGroupStack=%d\n", + e->name.data(),e->section,g_autoGroupStack.count()); if (g_memberGroupId!=DOX_NOGROUP) // end of member group { MemberGroupInfo *info=Doxygen::memGrpInfoDict.find(g_memberGroupId); @@ -2376,6 +2372,7 @@ void closeGroup(Entry *e,const char *fileName,int) { Grouping *grp = g_autoGroupStack.pop(); e->groups->removeLast(); + printf("Removing %s\n",grp->groupname.data()); delete grp; initGroupInfo(e); } @@ -2389,7 +2386,9 @@ void initGroupInfo(Entry *e) e->relates = g_memberGroupRelates; if (!g_autoGroupStack.isEmpty()) { - //printf("Appending group %s to %s\n",g_autoGroupStack.top()->groupname.data(),e->name.data()); + printf("Appending group %s to %s: count=%d entry=%p\n", + g_autoGroupStack.top()->groupname.data(), + e->name.data(),e->groups->count(),e); e->groups->append(new Grouping(*g_autoGroupStack.top())); } } diff --git a/src/config.l b/src/config.l index 9ec2b75..40ce84b 100644 --- a/src/config.l +++ b/src/config.l @@ -1145,7 +1145,7 @@ void Config::check() #undef PUTENV #undef SEP -#if defined(_WIN32) && !defined(__GNUC__) && (__BORLANDC__ < 0x0550) +#if defined(_WIN32) && (__BORLANDC__ < 0x0550) #define PUTENV _putenv #define SEP ";" #else @@ -1260,13 +1260,19 @@ void Config::create() "documentation generated by doxygen is written. Doxygen will use this \n" "information to generate all constant output in the proper language. \n" "The default language is English, other supported languages are: \n" - "Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, \n" - "Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, \n" - "Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, \n" - "Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, \n" - "Swedish, and Ukrainian.\n", + "Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, \n" + "Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, \n" + "Italian, Japanese, Japanese-en (Japanese with English messages), Korean, \n" + "Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, \n" + "Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.\n", "English" ); +#ifdef LANG_ZA + ce->addValue("Afrikaans"); +#endif +#ifdef LANG_AR + ce->addValue("Arabic"); +#endif #ifdef LANG_BR ce->addValue("Brazilian"); #endif @@ -1318,9 +1324,15 @@ void Config::create() ce->addValue("Korean"); ce->addValue("Korean-en"); #endif +#ifdef LANG_LI + ce->addValue("Lithuanian"); +#endif #ifdef LANG_NO ce->addValue("Norwegian"); #endif +#ifdef LANG_FA + ce->addValue("Persian"); +#endif #ifdef LANG_PL ce->addValue("Polish"); #endif diff --git a/src/defgen.cpp b/src/defgen.cpp index 4a7b1d5..e5944fc 100644 --- a/src/defgen.cpp +++ b/src/defgen.cpp @@ -313,7 +313,7 @@ void generateDEFClassSection(ClassDef *cd, MemberList *ml, const char *kind) { - if (ml->count()>0) + if (cd && ml->count()>0) { t << " cp-section = {" << endl; t << " sec-kind = '" << kind << "';" << endl; @@ -352,7 +352,7 @@ void generateDEFForClass(ClassDef *cd,QTextStream &t) t << " cp-id = '" << cd->getOutputFileBase() << "';" << endl; t << " cp-name = '" << cd->name() << "';" << endl; - if (cd->baseClasses()->count()>0) + if (cd->baseClasses()) { BaseClassListIterator bcli(*cd->baseClasses()); BaseClassDef *bcd; @@ -380,7 +380,7 @@ void generateDEFForClass(ClassDef *cd,QTextStream &t) } } - if (cd->subClasses()->count()>0) + if (cd->subClasses()) { BaseClassListIterator bcli(*cd->subClasses()); BaseClassDef *bcd; @@ -409,39 +409,53 @@ void generateDEFForClass(ClassDef *cd,QTextStream &t) } int numMembers = - cd->pubTypes.count()+cd->pubMethods.count()+cd->pubAttribs.count()+ - cd->pubSlots.count()+cd->signals.count()+cd->dcopMethods.count()+ - cd->pubStaticMethods.count()+ - cd->pubStaticAttribs.count()+cd->proTypes.count()+cd->proMethods.count()+ - cd->proAttribs.count()+cd->proSlots.count()+cd->proStaticMethods.count()+ - cd->proStaticAttribs.count()+cd->priTypes.count()+cd->priMethods.count()+ - cd->priAttribs.count()+cd->priSlots.count()+cd->priStaticMethods.count()+ - cd->priStaticAttribs.count()+cd->friends.count()+cd->related.count(); + (cd->pubTypes ? cd->pubTypes->count() : 0)+ + (cd->pubMethods ? cd->pubMethods->count() : 0)+ + (cd->pubAttribs ? cd->pubAttribs->count() : 0)+ + (cd->pubSlots ? cd->pubSlots->count() : 0)+ + (cd->signals ? cd->signals->count() : 0)+ + (cd->dcopMethods ? cd->dcopMethods->count() : 0)+ + (cd->pubStaticMethods ? cd->pubStaticMethods->count() : 0)+ + (cd->pubStaticAttribs ? cd->pubStaticAttribs->count() : 0)+ + (cd->proTypes ? cd->proTypes->count() : 0)+ + (cd->proMethods ? cd->proMethods->count() : 0)+ + (cd->proAttribs ? cd->proAttribs->count() : 0)+ + (cd->proSlots ? cd->proSlots->count() : 0)+ + (cd->proStaticMethods ? cd->proStaticMethods->count() : 0)+ + (cd->proStaticAttribs ? cd->proStaticAttribs->count() : 0)+ + (cd->priTypes ? cd->priTypes->count() : 0)+ + (cd->priMethods ? cd->priMethods->count() : 0)+ + (cd->priAttribs ? cd->priAttribs->count() : 0)+ + (cd->priSlots ? cd->priSlots->count() : 0)+ + (cd->priStaticMethods ? cd->priStaticMethods->count() : 0)+ + (cd->priStaticAttribs ? cd->priStaticAttribs->count() : 0)+ + (cd->friends ? cd->friends->count() : 0)+ + (cd->related ? cd->related->count() : 0); if (numMembers>0) { - generateDEFClassSection(cd,t,&cd->pubTypes,"public-type"); - generateDEFClassSection(cd,t,&cd->pubMethods,"public-func"); - generateDEFClassSection(cd,t,&cd->pubAttribs,"public-attrib"); - generateDEFClassSection(cd,t,&cd->pubSlots,"public-slot"); - generateDEFClassSection(cd,t,&cd->signals,"signal"); - generateDEFClassSection(cd,t,&cd->dcopMethods,"dcop-func"); - generateDEFClassSection(cd,t,&cd->properties,"property"); - generateDEFClassSection(cd,t,&cd->pubStaticMethods,"public-static-func"); - generateDEFClassSection(cd,t,&cd->pubStaticAttribs,"public-static-attrib"); - generateDEFClassSection(cd,t,&cd->proTypes,"protected-type"); - generateDEFClassSection(cd,t,&cd->proMethods,"protected-func"); - generateDEFClassSection(cd,t,&cd->proAttribs,"protected-attrib"); - generateDEFClassSection(cd,t,&cd->proSlots,"protected-slot"); - generateDEFClassSection(cd,t,&cd->proStaticMethods,"protected-static-func"); - generateDEFClassSection(cd,t,&cd->proStaticAttribs,"protected-static-attrib"); - generateDEFClassSection(cd,t,&cd->priTypes,"private-type"); - generateDEFClassSection(cd,t,&cd->priMethods,"private-func"); - generateDEFClassSection(cd,t,&cd->priAttribs,"private-attrib"); - generateDEFClassSection(cd,t,&cd->priSlots,"private-slot"); - generateDEFClassSection(cd,t,&cd->priStaticMethods,"private-static-func"); - generateDEFClassSection(cd,t,&cd->priStaticAttribs,"private-static-attrib"); - generateDEFClassSection(cd,t,&cd->friends,"signal"); - generateDEFClassSection(cd,t,&cd->related,"related"); + generateDEFClassSection(cd,t,cd->pubTypes,"public-type"); + generateDEFClassSection(cd,t,cd->pubMethods,"public-func"); + generateDEFClassSection(cd,t,cd->pubAttribs,"public-attrib"); + generateDEFClassSection(cd,t,cd->pubSlots,"public-slot"); + generateDEFClassSection(cd,t,cd->signals,"signal"); + generateDEFClassSection(cd,t,cd->dcopMethods,"dcop-func"); + generateDEFClassSection(cd,t,cd->properties,"property"); + generateDEFClassSection(cd,t,cd->pubStaticMethods,"public-static-func"); + generateDEFClassSection(cd,t,cd->pubStaticAttribs,"public-static-attrib"); + generateDEFClassSection(cd,t,cd->proTypes,"protected-type"); + generateDEFClassSection(cd,t,cd->proMethods,"protected-func"); + generateDEFClassSection(cd,t,cd->proAttribs,"protected-attrib"); + generateDEFClassSection(cd,t,cd->proSlots,"protected-slot"); + generateDEFClassSection(cd,t,cd->proStaticMethods,"protected-static-func"); + generateDEFClassSection(cd,t,cd->proStaticAttribs,"protected-static-attrib"); + generateDEFClassSection(cd,t,cd->priTypes,"private-type"); + generateDEFClassSection(cd,t,cd->priMethods,"private-func"); + generateDEFClassSection(cd,t,cd->priAttribs,"private-attrib"); + generateDEFClassSection(cd,t,cd->priSlots,"private-slot"); + generateDEFClassSection(cd,t,cd->priStaticMethods,"private-static-func"); + generateDEFClassSection(cd,t,cd->priStaticAttribs,"private-static-attrib"); + generateDEFClassSection(cd,t,cd->friends,"signal"); + generateDEFClassSection(cd,t,cd->related,"related"); } t << " cp-filename = '" << cd->getDefFileName() << "';" << endl; @@ -525,12 +539,12 @@ void generateDEFForFile(FileDef *fd,QTextStream &t) writeDEFString(t,fd->name()); t << ';' << endl; - generateDEFSection(fd,t,&fd->decDefineMembers,"define"); - generateDEFSection(fd,t,&fd->decProtoMembers,"prototype"); - generateDEFSection(fd,t,&fd->decTypedefMembers,"typedef"); - generateDEFSection(fd,t,&fd->decEnumMembers,"enum"); - generateDEFSection(fd,t,&fd->decFuncMembers,"func"); - generateDEFSection(fd,t,&fd->decVarMembers,"var"); + generateDEFSection(fd,t,fd->decDefineMembers,"define"); + generateDEFSection(fd,t,fd->decProtoMembers,"prototype"); + generateDEFSection(fd,t,fd->decTypedefMembers,"typedef"); + generateDEFSection(fd,t,fd->decEnumMembers,"enum"); + generateDEFSection(fd,t,fd->decFuncMembers,"func"); + generateDEFSection(fd,t,fd->decVarMembers,"var"); t << " file-full-name = '" << fd->getDefFileName() << "';" << endl; t << " file-first-line = '" << fd->getDefLine() << "';" << endl; diff --git a/src/definition.cpp b/src/definition.cpp index d9d57f2..61c2590 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -100,24 +100,33 @@ Definition::Definition(const char *df,int dl, m_localName=name; } //printf("m_localName=%s\n",m_localName.data()); - m_brief=b; - m_doc=d; - m_sectionDict=0, - m_startBodyLine=m_endBodyLine=-1, - m_bodyDef=0; + + if (b) + { + m_brief = new DocInfo; + m_brief->doc = b; + } + else + { + m_brief = 0; + } + + if (d) + { + m_details = new DocInfo; + m_details->doc = d; + } + else + { + m_details = 0; + } + m_body = 0; m_sourceRefByDict=0; m_sourceRefsDict=0; - m_todoId=0; - m_testId=0; - m_bugId=0; - m_deprecatedId=0; + m_sectionDict=0, m_outerScope=Doxygen::globalScope; m_partOfGroups=0; m_xrefListItems=0; - m_briefLine=1; - m_briefFile=(QCString)"<"+name+">"; - m_docLine=1; - m_docFile=(QCString)"<"+name+">"; m_isSymbol = isSymbol; m_hidden = FALSE; if (m_isSymbol) addToMap(name,this); @@ -131,6 +140,9 @@ Definition::~Definition() delete m_sourceRefsDict; delete m_partOfGroups; delete m_xrefListItems; + delete m_brief; + delete m_details; + delete m_body; } void Definition::addSectionsToDefinition(QList<SectionInfo> *anchorList) @@ -219,9 +231,13 @@ void Definition::setDocumentation(const char *d,const char *docFile,int docLine, doc=d; } //printf("setting docs for %s: `%s'\n",name().data(),m_doc.data()); - m_doc=doc; - m_docFile = docFile; - m_docLine = docLine; + if (m_details==0) + { + m_details = new DocInfo; + } + m_details->doc = doc; + m_details->file = docFile; + m_details->line = docLine; } #define uni_isupper(c) (QChar(c).category()==QChar::Letter_Uppercase) @@ -235,20 +251,24 @@ void Definition::setBriefDescription(const char *b,const char *briefFile,int bri outputLanguage!="Korean"; //fprintf(stderr,"Definition::setBriefDescription(%s,%s,%d)\n",b,briefFile,briefLine); - m_brief=QCString(b).stripWhiteSpace(); - int bl=m_brief.length(); + if (m_brief==0) + { + m_brief = new DocInfo; + } + m_brief->doc=QCString(b).stripWhiteSpace(); + int bl=m_brief->doc.length(); if (bl>0 && needsDot) // add punctuation if needed { - switch(m_brief.at(bl-1)) + switch(m_brief->doc.at(bl-1)) { case '.': case '!': case '?': break; default: - if (uni_isupper(m_brief.at(0))) m_brief+='.'; + if (uni_isupper(m_brief->doc.at(0))) m_brief->doc+='.'; break; } } - m_briefFile = briefFile; - m_briefLine = briefLine; + m_brief->file = briefFile; + m_brief->line = briefLine; } /*! Reads a fragment of code from file \a fileName starting at @@ -373,7 +393,8 @@ void Definition::writeSourceDef(OutputList &ol,const char *) { ol.pushGeneratorState(); //printf("Definition::writeSourceRef %d %p\n",bodyLine,bodyDef); - if (Config_getBool("SOURCE_BROWSER") && m_startBodyLine!=-1 && m_bodyDef) + if (Config_getBool("SOURCE_BROWSER") && + m_body && m_body->startLine!=-1 && m_body->fileDef) { QCString refText = theTranslator->trDefinedAtLineInSourceFile(); int lineMarkerPos = refText.find("@0"); @@ -381,8 +402,8 @@ void Definition::writeSourceDef(OutputList &ol,const char *) if (lineMarkerPos!=-1 && fileMarkerPos!=-1) // should always pass this. { QCString lineStr,anchorStr; - lineStr.sprintf("%d",m_startBodyLine); - anchorStr.sprintf(Htags::useHtags ? "L%d" : "l%05d",m_startBodyLine); + lineStr.sprintf("%d",m_body->startLine); + anchorStr.sprintf(Htags::useHtags ? "L%d" : "l%05d",m_body->startLine); ol.newParagraph(); if (lineMarkerPos<fileMarkerPos) // line marker before file marker { @@ -390,7 +411,7 @@ void Definition::writeSourceDef(OutputList &ol,const char *) ol.parseText(refText.left(lineMarkerPos)); ol.disableAllBut(OutputGenerator::Html); // write line link (HTML only) - ol.writeObjectLink(0,m_bodyDef->getSourceFileBase(), + ol.writeObjectLink(0,m_body->fileDef->getSourceFileBase(), anchorStr,lineStr); ol.enableAll(); ol.disable(OutputGenerator::Html); @@ -404,12 +425,12 @@ void Definition::writeSourceDef(OutputList &ol,const char *) ol.disableAllBut(OutputGenerator::Html); // write file link (HTML only) - ol.writeObjectLink(0,m_bodyDef->getSourceFileBase(), - 0,m_bodyDef->name()); + ol.writeObjectLink(0,m_body->fileDef->getSourceFileBase(), + 0,m_body->fileDef->name()); ol.enableAll(); ol.disable(OutputGenerator::Html); // write normal text (Latex/Man only) - ol.docify(m_bodyDef->name()); + ol.docify(m_body->fileDef->name()); ol.enableAll(); // write text right from file marker @@ -422,12 +443,12 @@ void Definition::writeSourceDef(OutputList &ol,const char *) ol.parseText(refText.left(fileMarkerPos)); ol.disableAllBut(OutputGenerator::Html); // write file link (HTML only) - ol.writeObjectLink(0,m_bodyDef->getSourceFileBase(), - 0,m_bodyDef->name()); + ol.writeObjectLink(0,m_body->fileDef->getSourceFileBase(), + 0,m_body->fileDef->name()); ol.enableAll(); ol.disable(OutputGenerator::Html); // write normal text (Latex/Man only) - ol.docify(m_bodyDef->name()); + ol.docify(m_body->fileDef->name()); ol.enableAll(); // write text between markers @@ -436,7 +457,7 @@ void Definition::writeSourceDef(OutputList &ol,const char *) ol.disableAllBut(OutputGenerator::Html); // write line link (HTML only) - ol.writeObjectLink(0,m_bodyDef->getSourceFileBase(), + ol.writeObjectLink(0,m_body->fileDef->getSourceFileBase(), anchorStr,lineStr); ol.enableAll(); ol.disable(OutputGenerator::Html); @@ -457,18 +478,33 @@ void Definition::writeSourceDef(OutputList &ol,const char *) ol.popGeneratorState(); } +void Definition::setBodySegment(int bls,int ble) +{ + //printf("setBodySegment(%d,%d) for %s\n",bls,ble,name().data()); + if (m_body==0) m_body = new BodyInfo; + m_body->startLine=bls; + m_body->endLine=ble; +} + +void Definition::setBodyDef(FileDef *fd) +{ + if (m_body==0) m_body = new BodyInfo; + m_body->fileDef=fd; +} + /*! Write code of this definition into the documentation */ void Definition::writeInlineCode(OutputList &ol,const char *scopeName) { ol.pushGeneratorState(); //printf("Source Fragment %s: %d-%d bodyDef=%p\n",name().data(), // m_startBodyLine,m_endBodyLine,m_bodyDef); - if (Config_getBool("INLINE_SOURCES") && m_startBodyLine!=-1 && - m_endBodyLine>=m_startBodyLine && m_bodyDef) + if (Config_getBool("INLINE_SOURCES") && + m_body && m_body->startLine!=-1 && + m_body->endLine>=m_body->startLine && m_body->fileDef) { QCString codeFragment; - int actualStart=m_startBodyLine,actualEnd=m_endBodyLine; - if (readCodeFragment(m_bodyDef->absFilePath(), + int actualStart=m_body->startLine,actualEnd=m_body->endLine; + if (readCodeFragment(m_body->fileDef->absFilePath(), actualStart,actualEnd,codeFragment) ) { @@ -478,16 +514,16 @@ void Definition::writeInlineCode(OutputList &ol,const char *scopeName) MemberDef *thisMd = 0; if (definitionType()==TypeMember) thisMd = (MemberDef *)this; ol.startCodeFragment(); - pIntf->parseCode(ol, // codeOutIntf - scopeName, // scope - codeFragment, // input - FALSE, // isExample - 0, // exampleName - m_bodyDef, // fileDef - actualStart, // startLine - actualEnd, // endLine - TRUE, // inlineFragment - thisMd // memberDef + pIntf->parseCode(ol, // codeOutIntf + scopeName, // scope + codeFragment, // input + FALSE, // isExample + 0, // exampleName + m_body->fileDef, // fileDef + actualStart, // startLine + actualEnd, // endLine + TRUE, // inlineFragment + thisMd // memberDef ); ol.endCodeFragment(); ol.newParagraph(); @@ -611,18 +647,19 @@ bool Definition::hasDocumentation() const static bool extractAll = Config_getBool("EXTRACT_ALL"); static bool sourceBrowser = Config_getBool("SOURCE_BROWSER"); bool hasDocs = - !m_doc.isEmpty() || // has detailed docs - !m_brief.isEmpty() || // has brief description + (m_details && !m_details->doc.isEmpty()) || // has detailed docs + (m_brief && !m_brief->doc.isEmpty()) || // has brief description extractAll || // extract everything - (sourceBrowser && m_startBodyLine!=-1 && m_bodyDef); // link to definition + (sourceBrowser && m_body && + m_body->startLine!=-1 && m_body->fileDef); // link to definition return hasDocs; } bool Definition::hasUserDocumentation() const { bool hasDocs = - !m_doc.isEmpty() || - !m_brief.isEmpty(); + (m_details && !m_details->doc.isEmpty()) || + (m_brief && !m_brief->doc.isEmpty()); return hasDocs; } @@ -720,13 +757,6 @@ QCString Definition::localName() const return m_localName; } -void Definition::setBodySegment(int bls,int ble) -{ - //printf("setBodySegment(%d,%d) for %s\n",bls,ble,name().data()); - m_startBodyLine=bls; - m_endBodyLine=ble; -} - void Definition::makePartOfGroup(GroupDef *gd) { if (m_partOfGroups==0) m_partOfGroups = new GroupList; diff --git a/src/definition.h b/src/definition.h index e6495d4..8110c96 100644 --- a/src/definition.h +++ b/src/definition.h @@ -40,6 +40,20 @@ struct ReachableDefinition int distance; }; +struct DocInfo +{ + QCString doc; + int line; + QCString file; +}; + +struct BodyInfo +{ + int startLine; // line number of the start of the definition + int endLine; // line number of the end of the definition + FileDef *fileDef; // file definition containing the function body +}; + /*! The common base class of all entity definitions found in the sources. */ class Definition { @@ -82,10 +96,10 @@ class Definition virtual QCString getSourceFileBase() const { ASSERT(0); return "NULL"; } /*! Returns the detailed description of this definition */ - const QCString& documentation() const { return m_doc; } + QCString documentation() const { return m_details ? m_details->doc : QCString(""); } /*! Returns the brief description of this definition */ - const QCString& briefDescription() const { return m_brief; } + QCString briefDescription() const { return m_brief ? m_brief->doc : QCString(""); } /*! Sets a new \a name for the definition */ void setName(const char *name) { m_name=name; } @@ -94,12 +108,12 @@ class Definition void setDocumentation(const char *d,const char *docFile,int docLine,bool stripWhiteSpace=TRUE); /*! Returns the line number at which the detailed documentation was found. */ - int docLine() const { return m_docLine; } + int docLine() const { return m_details ? m_details->line : 1; } /*! Returns the file in which the detailed documentation block was found. * This can differ from getDefFileName(). */ - QCString docFile() const { return m_docFile; } + QCString docFile() const { return m_details ? m_details->file : QCString("<"+m_name+">"); } /*! Sets the brief description of this definition to \a b. * A dot is added to the sentence if not available. @@ -107,12 +121,12 @@ class Definition void setBriefDescription(const char *b,const char *briefFile,int briefLine); /*! Returns the line number at which the brief description was found. */ - int briefLine() const { return m_briefLine; } + int briefLine() const { return m_brief ? m_brief->line : 1; } /*! Returns the file in which the brief description was found. * This can differ from getDefFileName(). */ - QCString briefFile() const { return m_briefFile; } + QCString briefFile() const { return m_brief ? m_brief->file : QCString("<"+m_name+">"); } /*! returns the file in which this definition was found */ QCString getDefFileName() const { return m_defFileName; } @@ -132,7 +146,6 @@ class Definition /*! Returns TRUE iff the definition is documented by the user. */ virtual bool hasUserDocumentation() const; - /*! Returns TRUE iff it is possible to link to this item within this * project. */ @@ -188,10 +201,10 @@ class Definition // source references void setBodySegment(int bls,int ble); - void setBodyDef(FileDef *fd) { m_bodyDef=fd; } - int getStartBodyLine() const { return m_startBodyLine; } - int getEndBodyLine() const { return m_endBodyLine; } - FileDef *getBodyDef() { return m_bodyDef; } + void setBodyDef(FileDef *fd); + int getStartBodyLine() const { return m_body ? m_body->startLine : -1; } + int getEndBodyLine() const { return m_body ? m_body->endLine : -1; } + FileDef *getBodyDef() { return m_body ? m_body->fileDef : 0; } void writeSourceDef(OutputList &ol,const char *scopeName); void writeInlineCode(OutputList &ol,const char *scopeName); void writeSourceRefs(OutputList &ol,const char *scopeName); @@ -224,50 +237,38 @@ class Definition protected: void setLocalName(const QCString name) { m_localName=name; } - int m_startBodyLine; // line number of the start of the definition - int m_endBodyLine; // line number of the end of the definition - FileDef *m_bodyDef; // file definition containing the function body - - // where the item was found - QCString m_defFileName; - int m_defLine; - QCString m_defFileExt; - - /*! The class, namespace in which this class is located - */ - Definition *m_outerScope; - QCString m_name; // name of the definition - QCString m_localName; // local (unqualified) name of the definition - // in the future m_name should become m_localName - /*! List of groups this definition is part of */ - GroupList *m_partOfGroups; - private: int getXRefListId(const char *listName) const; void writeSourceRefList(OutputList &ol,const char *scopeName, const QCString &text,MemberSDict *members,bool); - //QCString m_qualifiedName; // name of the definition - QCString m_brief; // brief description - QCString m_doc; // detailed description - QCString m_ref; // reference to external documentation SectionDict *m_sectionDict; // dictionary of all sections MemberSDict *m_sourceRefByDict; MemberSDict *m_sourceRefsDict; - int m_testId; // id for test list item - int m_todoId; // id for todo list item - int m_bugId; // id for bug list item - int m_deprecatedId; // id for deprecated list item - int m_docLine; - QCString m_docFile; - int m_briefLine; - QCString m_briefFile; - QList<ListItemInfo> *m_xrefListItems; + + DocInfo *m_details; + DocInfo *m_brief; + BodyInfo *m_body; + + /*! The class, namespace in which this class is located + */ + QCString m_name; // name of the definition + QCString m_localName; // local (unqualified) name of the definition + // in the future m_name should become m_localName QCString m_symbolName; + QCString m_qualifiedName; + QCString m_ref; // reference to external documentation + + QList<ListItemInfo> *m_xrefListItems; bool m_isSymbol; bool m_hidden; - - QCString m_qualifiedName; + Definition *m_outerScope; + GroupList *m_partOfGroups; + + // where the item was found + QCString m_defFileName; + int m_defLine; + QCString m_defFileExt; }; class DefinitionList : public QList<Definition> diff --git a/src/diagram.cpp b/src/diagram.cpp index e15149b..b09cf2b 100644 --- a/src/diagram.cpp +++ b/src/diagram.cpp @@ -258,14 +258,17 @@ void DiagramRow::insertClass(DiagramItem *parent,ClassDef *cd,bool doBases, di->move(count()*gridWidth,level*gridHeight); append(di); BaseClassList *bcl=doBases ? cd->baseClasses() : cd->subClasses(); - /* there are base/sub classes */ int count=0; - BaseClassDef *bcd=bcl->first(); - while (bcd) + if (bcl) { - ClassDef *ccd=bcd->classDef; - if (ccd && ccd->isVisibleInHierarchy() /*&& !ccd->visited*/) count++; - bcd=bcl->next(); + /* there are base/sub classes */ + BaseClassDef *bcd=bcl->first(); + while (bcd) + { + ClassDef *ccd=bcd->classDef; + if (ccd && ccd->isVisibleInHierarchy() /*&& !ccd->visited*/) count++; + bcd=bcl->next(); + } } if (count>0 && (prot!=Private || !doBases)) { diff --git a/src/docparser.cpp b/src/docparser.cpp index d2d4a79..0b9cb3c 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -1169,6 +1169,7 @@ reparsetoken: } break; case HTML_CODE: + case XML_C: if (!g_token->endTag) { handleStyleEnter(parent,children,DocStyleChange::Code,&g_token->attribs); @@ -4697,8 +4698,9 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag QString paramName; if (findAttribute(tagHtmlAttribs,"name",¶mName)) { + //printf("paramName=%s\n",paramName.data()); m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,TRUE)); - retval=handleStyleArgument(this,m_children,paramName); + m_children.append(new DocWord(this,paramName)); m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,FALSE)); if (retval!=TK_WORD) m_children.append(new DocWhiteSpace(this," ")); } diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 100dd11..5b46523 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -560,9 +560,9 @@ REFWORD ("#"|"::")?({ID}("."|"#"|"::"|"-"|"/"))*({ID}(":")?){FUNCARG}? <St_XmlCode>{WS}*"</code>" { return RetVal_OK; } -<St_Code,St_XmlCode>[^\\@\n]+ | -<St_Code,St_XmlCode>\n | -<St_Code,St_XmlCode>. { +<St_Code,St_XmlCode>[^\\@\n<]+ | +<St_Code,St_XmlCode>\n | +<St_Code,St_XmlCode>. { g_token->verb+=yytext; } <St_HtmlOnly>{CMD}"endhtmlonly" { diff --git a/src/dot.cpp b/src/dot.cpp index d283759..c216864 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -579,30 +579,33 @@ static QCString convertLabel(const QCString &l) return result; } -static void writeBoxMemberList(QTextStream &t,char prot,MemberList &ml,ClassDef *scope) +static void writeBoxMemberList(QTextStream &t,char prot,MemberList *ml,ClassDef *scope) { - MemberListIterator mlia(ml); - MemberDef *mma; - for (mlia.toFirst();(mma = mlia.current());++mlia) + if (ml) { - if (mma->getClassDef() == scope) + MemberListIterator mlia(*ml); + MemberDef *mma; + for (mlia.toFirst();(mma = mlia.current());++mlia) { - t << prot << " " << convertLabel(mma->name()); - if (!mma->isObjCMethod() && mma->isFunction()) t << "()"; - t << "\\l"; + if (mma->getClassDef() == scope) + { + t << prot << " " << convertLabel(mma->name()); + if (!mma->isObjCMethod() && mma->isFunction()) t << "()"; + t << "\\l"; + } } - } - // write member groups within the memberlist - MemberGroupList *mgl = ml.getMemberGroupList(); - if (mgl) - { - MemberGroupListIterator mgli(*mgl); - MemberGroup *mg; - for (mgli.toFirst();(mg=mgli.current());++mgli) + // write member groups within the memberlist + MemberGroupList *mgl = ml->getMemberGroupList(); + if (mgl) { - if (mg->members()) + MemberGroupListIterator mgli(*mgl); + MemberGroup *mg; + for (mgli.toFirst();(mg=mgli.current());++mgli) { - writeBoxMemberList(t,prot,*mg->members(),scope); + if (mg->members()) + { + writeBoxMemberList(t,prot,mg->members(),scope); + } } } } @@ -654,7 +657,7 @@ void DotNode::writeBox(QTextStream &t, { if (mg->members()) { - writeBoxMemberList(t,'*',*mg->members(),m_classDef); + writeBoxMemberList(t,'*',mg->members(),m_classDef); } } } @@ -1149,62 +1152,65 @@ void DotGfxHierarchyTable::writeGraph(QTextStream &out,const char *path) void DotGfxHierarchyTable::addHierarchy(DotNode *n,ClassDef *cd,bool hideSuper) { //printf("addHierarchy `%s' baseClasses=%d\n",cd->name().data(),cd->baseClasses()->count()); - BaseClassListIterator bcli(*cd->subClasses()); - BaseClassDef *bcd; - for ( ; (bcd=bcli.current()) ; ++bcli ) + if (cd->subClasses()) { - ClassDef *bClass=bcd->classDef; - //printf(" Trying sub class=`%s' usedNodes=%d\n",bClass->name().data(),m_usedNodes->count()); - if (bClass->isVisibleInHierarchy() && hasVisibleRoot(bClass->baseClasses())) + BaseClassListIterator bcli(*cd->subClasses()); + BaseClassDef *bcd; + for ( ; (bcd=bcli.current()) ; ++bcli ) { - DotNode *bn; - //printf(" Node `%s' Found visible class=`%s'\n",n->m_label.data(), - // bClass->name().data()); - if ((bn=m_usedNodes->find(bClass->name()))) // node already present + ClassDef *bClass=bcd->classDef; + //printf(" Trying sub class=`%s' usedNodes=%d\n",bClass->name().data(),m_usedNodes->count()); + if (bClass->isVisibleInHierarchy() && hasVisibleRoot(bClass->baseClasses())) { - if (n->m_children==0 || n->m_children->findRef(bn)==-1) // no arrow yet + DotNode *bn; + //printf(" Node `%s' Found visible class=`%s'\n",n->m_label.data(), + // bClass->name().data()); + if ((bn=m_usedNodes->find(bClass->name()))) // node already present + { + if (n->m_children==0 || n->m_children->findRef(bn)==-1) // no arrow yet + { + n->addChild(bn,bcd->prot); + bn->addParent(n); + //printf(" Adding node %s to existing base node %s (c=%d,p=%d)\n", + // n->m_label.data(), + // bn->m_label.data(), + // bn->m_children ? bn->m_children->count() : 0, + // bn->m_parents ? bn->m_parents->count() : 0 + // ); + } + //else + //{ + // printf(" Class already has an arrow!\n"); + //} + } + else { + QCString tmp_url=""; + if (bClass->isLinkable() && !bClass->isHidden()) + { + tmp_url=bClass->getReference()+"$"+bClass->getOutputFileBase(); + } + bn = new DotNode(m_curNodeNumber++, + bClass->displayName(), + tmp_url.data() + ); n->addChild(bn,bcd->prot); bn->addParent(n); - //printf(" Adding node %s to existing base node %s (c=%d,p=%d)\n", - // n->m_label.data(), - // bn->m_label.data(), - // bn->m_children ? bn->m_children->count() : 0, - // bn->m_parents ? bn->m_parents->count() : 0 - // ); + //printf(" Adding node %s to new base node %s (c=%d,p=%d)\n", + // n->m_label.data(), + // bn->m_label.data(), + // bn->m_children ? bn->m_children->count() : 0, + // bn->m_parents ? bn->m_parents->count() : 0 + // ); + //printf(" inserting %s (%p)\n",bClass->name().data(),bn); + m_usedNodes->insert(bClass->name(),bn); // add node to the used list } - //else - //{ - // printf(" Class already has an arrow!\n"); - //} - } - else - { - QCString tmp_url=""; - if (bClass->isLinkable() && !bClass->isHidden()) + if (!bClass->visited && !hideSuper && bClass->subClasses()) { - tmp_url=bClass->getReference()+"$"+bClass->getOutputFileBase(); + bool wasVisited=bClass->visited; + bClass->visited=TRUE; + addHierarchy(bn,bClass,wasVisited); } - bn = new DotNode(m_curNodeNumber++, - bClass->displayName(), - tmp_url.data() - ); - n->addChild(bn,bcd->prot); - bn->addParent(n); - //printf(" Adding node %s to new base node %s (c=%d,p=%d)\n", - // n->m_label.data(), - // bn->m_label.data(), - // bn->m_children ? bn->m_children->count() : 0, - // bn->m_parents ? bn->m_parents->count() : 0 - // ); - //printf(" inserting %s (%p)\n",bClass->name().data(),bn); - m_usedNodes->insert(bClass->name(),bn); // add node to the used list - } - if (!bClass->visited && !hideSuper && bClass->subClasses()->count()>0) - { - bool wasVisited=bClass->visited; - bClass->visited=TRUE; - addHierarchy(bn,bClass,wasVisited); } } } @@ -1235,7 +1241,7 @@ void DotGfxHierarchyTable::addClassList(ClassSDict *cl) //m_usedNodes->clear(); m_usedNodes->insert(cd->name(),n); m_rootNodes->insert(0,n); - if (!cd->visited && cd->subClasses()->count()>0) + if (!cd->visited && cd->subClasses()) { addHierarchy(n,cd,cd->visited); cd->visited=TRUE; @@ -1400,14 +1406,18 @@ void DotClassGraph::buildGraph(ClassDef *cd,DotNode *n,int distance,bool base) if (m_graphType == DotNode::Inheritance || m_graphType==DotNode::Collaboration) { - BaseClassListIterator bcli(base ? *cd->baseClasses() : *cd->subClasses()); - BaseClassDef *bcd; - for ( ; (bcd=bcli.current()) ; ++bcli ) + BaseClassList *bcl = base ? cd->baseClasses() : cd->subClasses(); + if (bcl) { - //printf("-------- inheritance relation %s->%s templ=`%s'\n", - // cd->name().data(),bcd->classDef->name().data(),bcd->templSpecifiers.data()); - addClass(bcd->classDef,n,bcd->prot,0,distance,bcd->usedName, - bcd->templSpecifiers,base); + BaseClassListIterator bcli(*bcl); + BaseClassDef *bcd; + for ( ; (bcd=bcli.current()) ; ++bcli ) + { + //printf("-------- inheritance relation %s->%s templ=`%s'\n", + // cd->name().data(),bcd->classDef->name().data(),bcd->templSpecifiers.data()); + addClass(bcd->classDef,n,bcd->prot,0,distance,bcd->usedName, + bcd->templSpecifiers,base); + } } } if (m_graphType == DotNode::Collaboration) @@ -1948,53 +1958,56 @@ void DotInclDepGraph::buildGraph(DotNode *n,FileDef *fd,int distance) { QList<IncludeInfo> *includeFiles = m_inverse ? fd->includedByFileList() : fd->includeFileList(); - QListIterator<IncludeInfo> ili(*includeFiles); - IncludeInfo *ii; - for (;(ii=ili.current());++ili) + if (includeFiles) { - FileDef *bfd = ii->fileDef; - QCString in = ii->includeName; - //printf(">>>> in=`%s' bfd=%p\n",ii->includeName.data(),bfd); - bool doc=TRUE,src=FALSE; - if (bfd) - { - in = bfd->absFilePath(); - doc = bfd->isLinkable() && !bfd->isHidden(); - src = bfd->generateSourceFile(); - } - if (doc || src || !Config_getBool("HIDE_UNDOC_RELATIONS")) + QListIterator<IncludeInfo> ili(*includeFiles); + IncludeInfo *ii; + for (;(ii=ili.current());++ili) { - QCString url=""; - if (bfd) url=bfd->getOutputFileBase().copy(); - if (!doc && src) + FileDef *bfd = ii->fileDef; + QCString in = ii->includeName; + //printf(">>>> in=`%s' bfd=%p\n",ii->includeName.data(),bfd); + bool doc=TRUE,src=FALSE; + if (bfd) { - url=bfd->getSourceFileBase(); + in = bfd->absFilePath(); + doc = bfd->isLinkable() && !bfd->isHidden(); + src = bfd->generateSourceFile(); } - DotNode *bn = m_usedNodes->find(in); - if (bn) // file is already a node in the graph + if (doc || src || !Config_getBool("HIDE_UNDOC_RELATIONS")) { - n->addChild(bn,0,0,0); - bn->addParent(n); - bn->setDistance(distance); - } - else - { - QCString tmp_url; - if (bfd) tmp_url=doc || src ? bfd->getReference()+"$"+url : QCString(); - bn = new DotNode( - m_curNodeNumber++, - ii->includeName, - tmp_url, - distance - ); - if (distance>m_maxDistance) m_maxDistance=distance; - n->addChild(bn,0,0,0); - bn->addParent(n); - m_usedNodes->insert(in,bn); + QCString url=""; + if (bfd) url=bfd->getOutputFileBase().copy(); + if (!doc && src) + { + url=bfd->getSourceFileBase(); + } + DotNode *bn = m_usedNodes->find(in); + if (bn) // file is already a node in the graph + { + n->addChild(bn,0,0,0); + bn->addParent(n); + bn->setDistance(distance); + } + else + { + QCString tmp_url; + if (bfd) tmp_url=doc || src ? bfd->getReference()+"$"+url : QCString(); + bn = new DotNode( + m_curNodeNumber++, + ii->includeName, + tmp_url, + distance + ); + if (distance>m_maxDistance) m_maxDistance=distance; + n->addChild(bn,0,0,0); + bn->addParent(n); + m_usedNodes->insert(in,bn); - // we use <=, i.s.o < to cause one more level than intended which is used to - // detect truncated nodes - if (bfd && distance<=m_recDepth) buildGraph(bn,bfd,distance+1); + // we use <=, i.s.o < to cause one more level than intended which is used to + // detect truncated nodes + if (bfd && distance<=m_recDepth) buildGraph(bn,bfd,distance+1); + } } } } @@ -2531,8 +2544,6 @@ QCString DotDirDeps::writeGraph(QTextStream &out, QDir::setCurrent(oldDir); return baseName; - - } bool DotDirDeps::isTrivial() const diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 6932f1d..cf2215c 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -67,6 +67,14 @@ #include "htags.h" #include "pyscanner.h" + +#define RECURSE_ENTRYTREE(func,var) \ + do { if (var->children()) { \ + EntryNavListIterator eli(*var->children()); \ + for (;eli.current();++eli) func(eli.current()); \ + } } while(0) + + #if defined(_MSC_VER) || defined(__BORLANDC__) #define popen _popen #define pclose _pclose @@ -128,7 +136,7 @@ QCString Doxygen::htmlFileExtension; bool Doxygen::suppressDocWarnings = FALSE; // locally accessible globals -static QDict<Entry> classEntries(1009); +static QDict<EntryNav> classEntries(1009); static StringList inputFiles; static StringDict excludeNameDict(1009); // sections static QDict<void> compoundKeywordDict(7); // keywords recognised as compounds @@ -136,6 +144,8 @@ static OutputList *outputList = 0; // list of output generating obje static QDict<FileDef> g_usingDeclarations(1009); // used classes static const char idMask[] = "[A-Za-z_][A-Za-z_0-9]*"; +QFile g_storage; + QCString spaces; @@ -199,9 +209,9 @@ void statistics() -static void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl, +static void addMemberDocs(EntryNav *rootNav,MemberDef *md, const char *funcDecl, ArgumentList *al,bool over_load,NamespaceSDict *nl=0); -static void findMember(Entry *root, +static void findMember(EntryNav *rootNav, QCString funcDecl, bool overloaded, bool isFunc @@ -289,7 +299,7 @@ static STLInfo g_stlinfo[] = { 0, 0, 0, 0, 0, 0, 0, FALSE, FALSE } }; -static void addSTLMember(Entry *root,const char *type,const char *name) +static void addSTLMember(EntryNav *rootNav,const char *type,const char *name) { Entry *memEntry = new Entry; memEntry->name = name; @@ -298,20 +308,27 @@ static void addSTLMember(Entry *root,const char *type,const char *name) memEntry->section = Entry::VARIABLE_SEC; memEntry->brief = "STL member"; memEntry->hidden = TRUE; - root->addSubEntry(memEntry); + //memEntry->parent = root; + //root->addSubEntry(memEntry); + EntryNav *memEntryNav = new EntryNav(rootNav,memEntry); + memEntryNav->setEntry(memEntry); + rootNav->addChild(memEntryNav); } -static void addSTLClasses(Entry *root) +static void addSTLClasses(EntryNav *rootNav) { Entry *namespaceEntry = new Entry; namespaceEntry->fileName = "[STL]"; namespaceEntry->startLine = 1; - namespaceEntry->parent = root; + //namespaceEntry->parent = rootNav->entry(); namespaceEntry->name = "std"; namespaceEntry->section = Entry::NAMESPACE_SEC; namespaceEntry->brief = "STL namespace"; namespaceEntry->hidden = TRUE; - root->addSubEntry(namespaceEntry); + //root->addSubEntry(namespaceEntry); + EntryNav *namespaceEntryNav = new EntryNav(rootNav,namespaceEntry); + namespaceEntryNav->setEntry(namespaceEntry); + rootNav->addChild(namespaceEntryNav); STLInfo *info = g_stlinfo; while (info->className) @@ -325,11 +342,14 @@ static void addSTLClasses(Entry *root) classEntry->fileName = "[STL]"; classEntry->startLine = 1; classEntry->name = fullName; - classEntry->parent = namespaceEntry; + //classEntry->parent = namespaceEntry; classEntry->section = Entry::CLASS_SEC; classEntry->brief = "STL class"; classEntry->hidden = TRUE; - namespaceEntry->addSubEntry(classEntry); + //namespaceEntry->addSubEntry(classEntry); + EntryNav *classEntryNav = new EntryNav(namespaceEntryNav,classEntry); + classEntryNav->setEntry(classEntry); + namespaceEntryNav->addChild(classEntryNav); // add template arguments to class if (info->templType1) @@ -353,11 +373,11 @@ static void addSTLClasses(Entry *root) // add member variables if (info->templName1) { - addSTLMember(classEntry,info->templType1,info->templName1); + addSTLMember(classEntryNav,info->templType1,info->templName1); } if (info->templName2) { - addSTLMember(classEntry,info->templType2,info->templName2); + addSTLMember(classEntryNav,info->templType2,info->templName2); } if (info->baseClass1) { @@ -376,12 +396,12 @@ static void addSTLClasses(Entry *root) static Definition *findScopeFromQualifiedName(Definition *startScope,const QCString &n, FileDef *fileScope=0); -static void addPageToContext(PageDef *pd,Entry *root) +static void addPageToContext(PageDef *pd,EntryNav *rootNav) { - if (root->parent) // add the page to it's scope + if (rootNav->parent()) // add the page to it's scope { - QCString scope = root->parent->name; - if (root->parent->section==Entry::PACKAGEDOC_SEC) + QCString scope = rootNav->parent()->name(); + if (rootNav->parent()->section()==Entry::PACKAGEDOC_SEC) { scope=substitute(scope,".","::"); } @@ -395,8 +415,9 @@ static void addPageToContext(PageDef *pd,Entry *root) } } -static void addRelatedPage(Entry *root) +static void addRelatedPage(EntryNav *rootNav) { + Entry *root = rootNav->entry(); GroupDef *gd=0; QListIterator<Grouping> gli(*root->groups); Grouping *g; @@ -417,21 +438,24 @@ static void addRelatedPage(Entry *root) PageDef *pd = addRelatedPage(root->name,root->args,doc,root->anchors, root->fileName,root->startLine, root->sli, - gd,root->tagInfo + gd,rootNav->tagInfo() ); if (pd) { pd->addSectionsToDefinition(root->anchors); - addPageToContext(pd,root); + addPageToContext(pd,rootNav); } } -static void buildGroupListFiltered(Entry *root,bool additional) +static void buildGroupListFiltered(EntryNav *rootNav,bool additional) { - if (root->section==Entry::GROUPDOC_SEC && !root->name.isEmpty()) + if (rootNav->section()==Entry::GROUPDOC_SEC && !rootNav->name().isEmpty()) { //printf("Found group %s title=`%s type=%d'\n", // root->name.data(),root->type.data(),root->groupDocType); + + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); if ((root->groupDocType==Entry::GROUPDOC_NORMAL && !additional) || (root->groupDocType!=Entry::GROUPDOC_NORMAL && additional)) @@ -468,10 +492,10 @@ static void buildGroupListFiltered(Entry *root,bool additional) } else { - if (root->tagInfo) + if (rootNav->tagInfo()) { - gd = new GroupDef(root->fileName,root->startLine,root->name,root->type,root->tagInfo->fileName); - gd->setReference(root->tagInfo->tagName); + gd = new GroupDef(root->fileName,root->startLine,root->name,root->type,rootNav->tagInfo()->fileName); + gd->setReference(rootNav->tagInfo()->tagName); } else { @@ -484,33 +508,38 @@ static void buildGroupListFiltered(Entry *root,bool additional) gd->setRefItems(root->sli); } } + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) + if (rootNav->children()) { - buildGroupListFiltered(e,additional); + EntryNavListIterator eli(*rootNav->children()); + EntryNav *e; + for (;(e=eli.current());++eli) + { + buildGroupListFiltered(e,additional); + } } } -static void buildGroupList(Entry *root) +static void buildGroupList(EntryNav *rootNav) { // first process the @defgroups blocks - buildGroupListFiltered(root,FALSE); + buildGroupListFiltered(rootNav,FALSE); // then process the @addtogroup, @weakgroup blocks - buildGroupListFiltered(root,TRUE); + buildGroupListFiltered(rootNav,TRUE); } -static void findGroupScope(Entry *root) +static void findGroupScope(EntryNav *rootNav) { - if (root->section==Entry::GROUPDOC_SEC && !root->name.isEmpty() && - root->parent && !root->parent->name.isEmpty()) + if (rootNav->section()==Entry::GROUPDOC_SEC && !rootNav->name().isEmpty() && + rootNav->parent() && !rootNav->parent()->name().isEmpty()) { GroupDef *gd; - if ((gd=Doxygen::groupSDict[root->name])) + if ((gd=Doxygen::groupSDict[rootNav->name()])) { - QCString scope = root->parent->name; - if (root->parent->section==Entry::PACKAGEDOC_SEC) + QCString scope = rootNav->parent()->name(); + if (rootNav->parent()->section()==Entry::PACKAGEDOC_SEC) { scope=substitute(scope,".","::"); } @@ -523,18 +552,16 @@ static void findGroupScope(Entry *root) } } } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - findGroupScope(e); - } + RECURSE_ENTRYTREE(findGroupScope,rootNav); } -static void organizeSubGroupsFiltered(Entry *root,bool additional) +static void organizeSubGroupsFiltered(EntryNav *rootNav,bool additional) { - if (root->section==Entry::GROUPDOC_SEC && !root->name.isEmpty()) + if (rootNav->section()==Entry::GROUPDOC_SEC && !rootNav->name().isEmpty()) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + if ((root->groupDocType==Entry::GROUPDOC_NORMAL && !additional) || (root->groupDocType!=Entry::GROUPDOC_NORMAL && additional)) { @@ -545,34 +572,42 @@ static void organizeSubGroupsFiltered(Entry *root,bool additional) addGroupToGroups(root,gd); } } + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) + if (rootNav->children()) { - organizeSubGroupsFiltered(e,additional); + EntryNavListIterator eli(*rootNav->children()); + EntryNav *e; + for (;(e=eli.current());++eli) + { + organizeSubGroupsFiltered(e,additional); + } } } -static void organizeSubGroups(Entry *root) +static void organizeSubGroups(EntryNav *rootNav) { //printf("Defining groups\n"); // first process the @defgroups blocks - organizeSubGroupsFiltered(root,FALSE); + organizeSubGroupsFiltered(rootNav,FALSE); //printf("Additional groups\n"); // then process the @addtogroup, @weakgroup blocks - organizeSubGroupsFiltered(root,TRUE); + organizeSubGroupsFiltered(rootNav,TRUE); } //---------------------------------------------------------------------- -static void buildFileList(Entry *root) +static void buildFileList(EntryNav *rootNav) { - if (((root->section==Entry::FILEDOC_SEC) || - ((root->section & Entry::FILE_MASK) && Config_getBool("EXTRACT_ALL"))) && - !root->name.isEmpty() && !root->tagInfo // skip any file coming from tag files + if (((rootNav->section()==Entry::FILEDOC_SEC) || + ((rootNav->section() & Entry::FILE_MASK) && Config_getBool("EXTRACT_ALL"))) && + !rootNav->name().isEmpty() && !rootNav->tagInfo() // skip any file coming from tag files ) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + bool ambig; FileDef *fd=findFileDef(Doxygen::inputNameDict,root->name,ambig); //printf("**************** root->name=%s fd=%p\n",root->name.data(),fd); @@ -632,13 +667,10 @@ static void buildFileList(Entry *root) } warn(fn,root->startLine,text); } + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - buildFileList(e); - } + RECURSE_ENTRYTREE(buildFileList,rootNav); } static void addIncludeFile(ClassDef *cd,FileDef *ifd,Entry *root) @@ -662,7 +694,7 @@ static void addIncludeFile(ClassDef *cd,FileDef *ifd,Entry *root) { // explicit request QCString text; text.sprintf("Warning: the name `%s' supplied as " - "the second argument in the \\class statement ", + "the second argument in the \\class, \\struct, or \\union statement ", root->includeFile.data() ); if (ambig) // name is ambigious @@ -750,6 +782,7 @@ static bool addNamespace(Entry *root,ClassDef *cd) } #endif +#if 0 static Definition *findScope(Entry *root,int level=0) { if (root==0) return 0; @@ -775,6 +808,7 @@ static Definition *findScope(Entry *root,int level=0) // level,result==0 ? "<none>" : result->name().data()); return result; } +#endif /*! returns the Definition object belonging to the first \a level levels of * full qualified name \a name. Creates an artificial scope if the scope is @@ -964,17 +998,19 @@ static ClassDef::CompoundType convertToCompoundType(int section) } -static void addClassToContext(Entry *root) +static void addClassToContext(EntryNav *rootNav) { - bool ambig; + //printf("Loading entry for rootNav=%p name=%s\n",rootNav,rootNav->name().data()); + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); //NamespaceDef *nd = 0; - FileDef *fd = findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd = rootNav->fileDef(); QCString scName; - if (root->parent->section&Entry::SCOPE_MASK) + if (rootNav->parent()->section()&Entry::SCOPE_MASK) { - scName=root->parent->name; + scName=rootNav->parent()->name(); } // name without parent's scope QCString fullName = root->name; @@ -1064,10 +1100,10 @@ static void addClassToContext(Entry *root) QCString tagName; QCString refFileName; - if (root->tagInfo) + if (rootNav->tagInfo()) { - tagName = root->tagInfo->tagName; - refFileName = root->tagInfo->fileName; + tagName = rootNav->tagInfo()->tagName; + refFileName = rootNav->tagInfo()->fileName; } cd=new ClassDef(root->fileName,root->startLine,fullName,sec, tagName,refFileName); @@ -1121,42 +1157,34 @@ static void addClassToContext(Entry *root) } addClassToGroups(root,cd); cd->setRefItems(root->sli); + + rootNav->releaseEntry(); } //---------------------------------------------------------------------- // build a list of all classes mentioned in the documentation // and all classes that have a documentation block before their definition. -static void buildClassList(Entry *root) +static void buildClassList(EntryNav *rootNav) { if ( - ((root->section & Entry::COMPOUND_MASK) || - root->section==Entry::OBJCIMPL_SEC) && !root->name.isEmpty() + ((rootNav->section() & Entry::COMPOUND_MASK) || + rootNav->section()==Entry::OBJCIMPL_SEC) && !rootNav->name().isEmpty() ) { - addClassToContext(root); - } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - buildClassList(e); + addClassToContext(rootNav); } + RECURSE_ENTRYTREE(buildClassList,rootNav); } -static void buildClassDocList(Entry *root) +static void buildClassDocList(EntryNav *rootNav) { if ( - (root->section & Entry::COMPOUNDDOC_MASK) && !root->name.isEmpty() + (rootNav->section() & Entry::COMPOUNDDOC_MASK) && !rootNav->name().isEmpty() ) { - addClassToContext(root); - } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - buildClassDocList(e); + addClassToContext(rootNav); } + RECURSE_ENTRYTREE(buildClassDocList,rootNav); } static void resolveClassNestingRelations() @@ -1216,16 +1244,19 @@ static void resolveClassNestingRelations() //---------------------------------------------------------------------- // build a list of all namespaces mentioned in the documentation // and all namespaces that have a documentation block before their definition. -static void buildNamespaceList(Entry *root) +static void buildNamespaceList(EntryNav *rootNav) { if ( - (root->section==Entry::NAMESPACE_SEC || - root->section==Entry::NAMESPACEDOC_SEC || - root->section==Entry::PACKAGEDOC_SEC + (rootNav->section()==Entry::NAMESPACE_SEC || + rootNav->section()==Entry::NAMESPACEDOC_SEC || + rootNav->section()==Entry::PACKAGEDOC_SEC ) && - !root->name.isEmpty() + !rootNav->name().isEmpty() ) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + QCString fullName = root->name; if (root->section==Entry::PACKAGEDOC_SEC) { @@ -1271,9 +1302,8 @@ static void buildNamespaceList(Entry *root) } } - bool ambig; // file definition containing the namespace nd - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); // insert the namespace in the file definition if (fd) fd->insertNamespace(nd); addNamespaceToGroups(root,nd); @@ -1283,10 +1313,10 @@ static void buildNamespaceList(Entry *root) { QCString tagName; QCString tagFileName; - if (root->tagInfo) + if (rootNav->tagInfo()) { - tagName=root->tagInfo->tagName; - tagFileName=root->tagInfo->fileName; + tagName=rootNav->tagInfo()->tagName; + tagFileName=rootNav->tagInfo()->fileName; } NamespaceDef *nd=new NamespaceDef(root->fileName,root->startLine,fullName,tagName,tagFileName); nd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition @@ -1298,9 +1328,8 @@ static void buildNamespaceList(Entry *root) addNamespaceToGroups(root,nd); nd->setRefItems(root->sli); - bool ambig; // file definition containing the namespace nd - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); // insert the namespace in the file definition if (fd) fd->insertNamespace(nd); @@ -1331,13 +1360,10 @@ static void buildNamespaceList(Entry *root) } } } + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - buildNamespaceList(e); - } + RECURSE_ENTRYTREE(buildNamespaceList,rootNav); } //---------------------------------------------------------------------- @@ -1361,26 +1387,28 @@ static NamespaceDef *findUsedNamespace(const NamespaceSDict *unl, return usingNd; } -static void findUsingDirectives(Entry *root) +static void findUsingDirectives(EntryNav *rootNav) { - if (root->section==Entry::USINGDIR_SEC) + if (rootNav->section()==Entry::USINGDIR_SEC) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + //printf("Found using directive %s at line %d of %s\n", // root->name.data(),root->startLine,root->fileName.data()); QCString name=substitute(root->name,".","::"); - bool ambig; if (!name.isEmpty()) { NamespaceDef *usingNd = 0; NamespaceDef *nd = 0; - FileDef *fd = findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd = rootNav->fileDef(); QCString nsName; // see if the using statement was found inside a namespace or inside // the global file scope. - if (root->parent->section == Entry::NAMESPACE_SEC) + if (rootNav->parent() && rootNav->parent()->section() == Entry::NAMESPACE_SEC) { - nsName=stripAnonymousNamespaceScope(root->parent->name); + nsName=stripAnonymousNamespaceScope(rootNav->parent()->name()); if (!nsName.isEmpty()) { nd = getResolvedNamespace(nsName); @@ -1484,65 +1512,63 @@ static void findUsingDirectives(Entry *root) nd->setRefItems(root->sli); } } + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - findUsingDirectives(e); - } + RECURSE_ENTRYTREE(findUsingDirectives,rootNav); } //---------------------------------------------------------------------- -static void buildListOfUsingDecls(Entry *root) +static void buildListOfUsingDecls(EntryNav *rootNav) { - if (root->section==Entry::USINGDECL_SEC && - !(root->parent->section&Entry::COMPOUND_MASK) // not a class/struct member + if (rootNav->section()==Entry::USINGDECL_SEC && + !(rootNav->parent()->section()&Entry::COMPOUND_MASK) // not a class/struct member ) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + QCString name = substitute(root->name,".","::"); if (g_usingDeclarations.find(name)==0) { - bool ambig; - FileDef *fd = findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd = rootNav->fileDef(); if (fd) { g_usingDeclarations.insert(name,fd); } } + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - buildListOfUsingDecls(e); - } + RECURSE_ENTRYTREE(buildListOfUsingDecls,rootNav); } -static void findUsingDeclarations(Entry *root) +static void findUsingDeclarations(EntryNav *rootNav) { - if (root->section==Entry::USINGDECL_SEC && - !(root->parent->section&Entry::COMPOUND_MASK) // not a class/struct member + if (rootNav->section()==Entry::USINGDECL_SEC && + !(rootNav->parent()->section()&Entry::COMPOUND_MASK) // not a class/struct member ) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + //printf("Found using declaration %s at line %d of %s inside section %x\n", // root->name.data(),root->startLine,root->fileName.data(), // root->parent->section); - bool ambig; if (!root->name.isEmpty()) { ClassDef *usingCd = 0; NamespaceDef *nd = 0; - FileDef *fd = findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd = rootNav->fileDef(); QCString scName; // see if the using statement was found inside a namespace or inside // the global file scope. - if (root->parent->section == Entry::NAMESPACE_SEC) + if (rootNav->parent()->section() == Entry::NAMESPACE_SEC) { - scName=root->parent->name.copy(); + scName=rootNav->parent()->name(); if (!scName.isEmpty()) { nd = getResolvedNamespace(scName); @@ -1603,99 +1629,101 @@ static void findUsingDeclarations(Entry *root) } } } + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - findUsingDeclarations(e); - } + RECURSE_ENTRYTREE(findUsingDeclarations,rootNav); } //---------------------------------------------------------------------- -static void findUsingDeclImports(Entry *root) +static void findUsingDeclImports(EntryNav *rootNav) { - if (root->section==Entry::USINGDECL_SEC && - (root->parent->section&Entry::COMPOUND_MASK) // in a class/struct member + if (rootNav->section()==Entry::USINGDECL_SEC && + (rootNav->parent()->section()&Entry::COMPOUND_MASK) // in a class/struct member ) { //printf("Found using declaration %s at line %d of %s inside section %x\n", // root->name.data(),root->startLine,root->fileName.data(), // root->parent->section); - QCString fullName=removeRedundantWhiteSpace(root->parent->name); + QCString fullName=removeRedundantWhiteSpace(rootNav->parent()->name()); fullName=stripAnonymousNamespaceScope(fullName); fullName=stripTemplateSpecifiersFromScope(fullName); ClassDef *cd = getClass(fullName); if (cd) { //printf("found class %s\n",cd->name().data()); - int i=root->name.find("::"); + int i=rootNav->name().find("::"); if (i!=-1) { - QCString scope=root->name.left(i); - QCString memName=root->name.right(root->name.length()-i-2); + QCString scope=rootNav->name().left(i); + QCString memName=rootNav->name().right(rootNav->name().length()-i-2); ClassDef *bcd = getResolvedClass(cd,0,scope); // todo: file in fileScope parameter if (bcd) { //printf("found class %s\n",bcd->name().data()); MemberNameInfoSDict *mndict=bcd->memberNameInfoSDict(); - MemberNameInfo *mni = mndict->find(memName); - if (mni) + if (mndict) { - MemberNameInfoIterator mnii(*mni); - MemberInfo *mi; - for ( ; (mi=mnii.current()) ; ++mnii ) + MemberNameInfo *mni = mndict->find(memName); + if (mni) { - MemberDef *md = mi->memberDef; - if (md && md->protection()!=Private) + MemberNameInfoIterator mnii(*mni); + MemberInfo *mi; + for ( ; (mi=mnii.current()) ; ++mnii ) { - //printf("found member %s\n",mni->memberName()); - MemberDef *newMd = new MemberDef( - root->fileName,root->startLine, - md->typeString(),memName,md->argsString(), - md->excpString(),root->protection,root->virt, - md->isStatic(),FALSE,md->memberType(), - md->templateArguments(),md->argumentList() - ); - cd->insertMember(newMd); - newMd->setMemberClass(cd); - if (!root->doc.isEmpty() || !root->brief.isEmpty()) - { - newMd->setDocumentation(root->doc,root->docFile,root->docLine); - newMd->setBriefDescription(root->brief,root->briefFile,root->briefLine); - newMd->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine); - } - else + MemberDef *md = mi->memberDef; + if (md && md->protection()!=Private) { - newMd->setDocumentation(md->documentation(),md->docFile(),md->docLine()); - newMd->setBriefDescription(md->briefDescription(),md->briefFile(),md->briefLine()); - newMd->setInbodyDocumentation(md->inbodyDocumentation(),md->inbodyFile(),md->inbodyLine()); + + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + + //printf("found member %s\n",mni->memberName()); + MemberDef *newMd = new MemberDef( + root->fileName,root->startLine, + md->typeString(),memName,md->argsString(), + md->excpString(),root->protection,root->virt, + md->isStatic(),FALSE,md->memberType(), + md->templateArguments(),md->argumentList() + ); + cd->insertMember(newMd); + newMd->setMemberClass(cd); + if (!root->doc.isEmpty() || !root->brief.isEmpty()) + { + newMd->setDocumentation(root->doc,root->docFile,root->docLine); + newMd->setBriefDescription(root->brief,root->briefFile,root->briefLine); + newMd->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine); + } + else + { + newMd->setDocumentation(md->documentation(),md->docFile(),md->docLine()); + newMd->setBriefDescription(md->briefDescription(),md->briefFile(),md->briefLine()); + newMd->setInbodyDocumentation(md->inbodyDocumentation(),md->inbodyFile(),md->inbodyLine()); + } + newMd->setDefinition(md->definition()); + newMd->enableCallGraph(root->callGraph); + newMd->enableCallerGraph(root->callerGraph); + newMd->setBitfields(md->bitfieldString()); + newMd->addSectionsToDefinition(root->anchors); + newMd->setBodySegment(md->getStartBodyLine(),md->getEndBodyLine()); + newMd->setBodyDef(md->getBodyDef()); + newMd->setInitializer(md->initializer()); + newMd->setMaxInitLines(md->initializerLines()); + newMd->setMemberGroupId(root->mGrpId); + newMd->setMemberSpecifiers(md->getMemberSpecifiers()); + + rootNav->releaseEntry(); } - newMd->setDefinition(md->definition()); - newMd->enableCallGraph(root->callGraph); - newMd->enableCallerGraph(root->callerGraph); - newMd->setBitfields(md->bitfieldString()); - newMd->addSectionsToDefinition(root->anchors); - newMd->setBodySegment(md->getStartBodyLine(),md->getEndBodyLine()); - newMd->setBodyDef(md->getBodyDef()); - newMd->setInitializer(md->initializer()); - newMd->setMaxInitLines(md->initializerLines()); - newMd->setMemberGroupId(root->mGrpId); - newMd->setMemberSpecifiers(md->getMemberSpecifiers()); } } } } } } + } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - findUsingDeclImports(e); - } + RECURSE_ENTRYTREE(findUsingDeclImports,rootNav); } //---------------------------------------------------------------------- @@ -1734,7 +1762,7 @@ static void findIncludedUsingDirectives() //---------------------------------------------------------------------- static MemberDef *addVariableToClass( - Entry *root, + EntryNav *rootNav, ClassDef *cd, MemberDef::MemberType mtype, const QCString &name, @@ -1743,6 +1771,8 @@ static MemberDef *addVariableToClass( Protection prot, bool related) { + Entry *root = rootNav->entry(); + QCString qualScope = cd->qualifiedNameWithTemplateParameters(); QCString scopeSeparator="::"; if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) @@ -1800,7 +1830,7 @@ static MemberDef *addVariableToClass( if (md->getClassDef()==cd && root->type==md->typeString()) // member already in the scope { - addMemberDocs(root,md,def,0,FALSE); + addMemberDocs(rootNav,md,def,0,FALSE); return md; } } @@ -1811,7 +1841,7 @@ static MemberDef *addVariableToClass( root->type,name,root->args,0, prot,Normal,root->stat,related, mtype,0,0); - md->setTagInfo(root->tagInfo); + md->setTagInfo(rootNav->tagInfo()); md->setMemberClass(cd); // also sets outer scope (i.e. getOuterScope()) //md->setDefFile(root->fileName); //md->setDefLine(root->startLine); @@ -1840,8 +1870,7 @@ static MemberDef *addVariableToClass( // printf("memberdef %s in memberGroup %d\n",name.data(),root->mGrpId); // md->setMemberGroup(memberGroupDict[root->mGrpId]); // - bool ambig; - md->setBodyDef(findFileDef(Doxygen::inputNameDict,root->fileName,ambig)); + md->setBodyDef(rootNav->fileDef()); //printf("Adding member=%s\n",md->name().data()); // add the member to the global list @@ -1864,14 +1893,14 @@ static MemberDef *addVariableToClass( //TODO: insert FileDef instead of filename strings. cd->insertUsedFile(root->fileName); - root->section = Entry::EMPTY_SEC; + rootNav->changeSection(Entry::EMPTY_SEC); return md; } //---------------------------------------------------------------------- static MemberDef *addVariableToFile( - Entry *root, + EntryNav *rootNav, MemberDef::MemberType mtype, const QCString &scope, const QCString &name, @@ -1879,6 +1908,7 @@ static MemberDef *addVariableToFile( /*int indentDepth,*/ MemberDef *fromAnnMemb) { + Entry *root = rootNav->entry(); Debug::print(Debug::Variables,0, " global variable:\n" " type=`%s' scope=`%s' name=`%s' args=`%s' prot=`%d mtype=%d\n", @@ -1890,8 +1920,7 @@ static MemberDef *addVariableToFile( mtype ); - bool ambig; - FileDef *fd = findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd = rootNav->fileDef(); // see if the function is inside a namespace NamespaceDef *nd = 0; @@ -1974,7 +2003,7 @@ static MemberDef *addVariableToFile( Debug::print(Debug::Variables,0, " variable already found: scope=%s\n",md->getOuterScope()->name().data()); - addMemberDocs(root,md,def,0,FALSE); + addMemberDocs(rootNav,md,def,0,FALSE); md->setRefItems(root->sli); return md; } @@ -1989,7 +2018,7 @@ static MemberDef *addVariableToFile( root->type,name,root->args,0, Public, Normal,root->stat,FALSE, mtype,0,0); - md->setTagInfo(root->tagInfo); + md->setTagInfo(rootNav->tagInfo()); md->setDocumentation(root->doc,root->docFile,root->docLine); md->setBriefDescription(root->brief,root->briefFile,root->briefLine); md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine); @@ -2037,7 +2066,7 @@ static MemberDef *addVariableToFile( mn->append(md); Doxygen::functionNameSDict.append(name,mn); } - root->section = Entry::EMPTY_SEC; + rootNav->changeSection(Entry::EMPTY_SEC); return md; } @@ -2068,7 +2097,7 @@ static int findFunctionPtr(const QCString &type,int *pLength=0) /*! Returns TRUE iff \a type is a class within scope \a context. * Used to detect variable declarations that look like function prototypes. */ -static bool isVarWithConstructor(Entry *root) +static bool isVarWithConstructor(EntryNav *rootNav) { static QRegExp initChars("[0-9\"'&*!^]+"); static QRegExp idChars("[a-z_A-Z][a-z_A-Z0-9]*"); @@ -2077,15 +2106,18 @@ static bool isVarWithConstructor(Entry *root) QCString type; Definition *ctx = 0; FileDef *fd = 0; - bool ambig; int ti; - if (root->parent && root->parent->section&Entry::COMPOUND_MASK) + //printf("isVarWithConstructor(%s)\n",rootNav->name().data()); + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + + if (rootNav->parent()->section() & Entry::COMPOUND_MASK) { // inside a class result=FALSE; goto done; } - else if ((fd = findFileDef(Doxygen::inputNameDict,root->fileName,ambig)) && + else if ((fd = rootNav->fileDef()) && fd->name().right(2)==".c" ) { // inside a .c file @@ -2097,7 +2129,10 @@ static bool isVarWithConstructor(Entry *root) result=FALSE; goto done; } - if (root->parent->name) ctx=Doxygen::namespaceSDict.find(root->parent->name); + if (!rootNav->parent()->name().isEmpty()) + { + ctx=Doxygen::namespaceSDict.find(rootNav->parent()->name()); + } type = root->type; // remove qualifiers findAndRemoveWord(type,"const"); @@ -2177,7 +2212,9 @@ static bool isVarWithConstructor(Entry *root) } result=TRUE; } + done: + rootNav->releaseEntry(); //printf("isVarWithConstructor(%s,%s)=%d\n",root->parent->name.data(), // root->type.data(),result); return result; @@ -2187,23 +2224,26 @@ done: // Searches the Entry tree for Variable documentation sections. // If found they are stored in their class or in the global list. -static void buildVarList(Entry *root) +static void buildVarList(EntryNav *rootNav) { int isFuncPtr=-1; - if (!root->name.isEmpty() && - (root->type.isEmpty() || compoundKeywordDict.find(root->type)==0) && + if (!rootNav->name().isEmpty() && + (rootNav->type().isEmpty() || compoundKeywordDict.find(rootNav->type())==0) && ( - (root->section==Entry::VARIABLE_SEC // it's a variable + (rootNav->section()==Entry::VARIABLE_SEC // it's a variable ) || - (root->section==Entry::FUNCTION_SEC && // or maybe a function pointer variable - (isFuncPtr=findFunctionPtr(root->type))!=-1 + (rootNav->section()==Entry::FUNCTION_SEC && // or maybe a function pointer variable + (isFuncPtr=findFunctionPtr(rootNav->type()))!=-1 ) || - (root->section==Entry::FUNCTION_SEC && // class variable initialized by constructor - isVarWithConstructor(root) + (rootNav->section()==Entry::FUNCTION_SEC && // class variable initialized by constructor + isVarWithConstructor(rootNav) ) ) ) // documented variable { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + Debug::print(Debug::Variables,0, "VARIABLE_SEC: \n" " type=`%s' name=`%s' args=`%s' bodyLine=`%d' mGrpId=%d\n", @@ -2259,21 +2299,26 @@ static void buildVarList(Entry *root) QCString scope,name=removeRedundantWhiteSpace(root->name); // find the scope of this variable - Entry *p = root->parent; - while ((p->section & Entry::SCOPE_MASK)) + EntryNav *p = rootNav->parent(); + while ((p->section() & Entry::SCOPE_MASK)) { - QCString scopeName = p->name.copy(); + QCString scopeName = p->name(); if (!scopeName.isEmpty()) { scope.prepend(scopeName); break; } - p=p->parent; + p=p->parent(); } MemberDef::MemberType mtype; QCString type=root->type.stripWhiteSpace(); ClassDef *cd=0; + bool isRelated=FALSE; + + QCString classScope=stripAnonymousNamespaceScope(scope); + classScope=stripTemplateSpecifiersFromScope(classScope,FALSE); + QCString annScopePrefix=scope.left(scope.length()-classScope.length()); if (root->name.findRev("::")!=-1) { @@ -2283,7 +2328,7 @@ static void buildVarList(Entry *root) cd=getClass(scope); if (cd) { - addVariableToClass(root, // entry + addVariableToClass(rootNav, // entry cd, // class to add member to MemberDef::Friend, // type of member name, // name of the member @@ -2316,18 +2361,14 @@ static void buildVarList(Entry *root) else mtype=MemberDef::Variable; - QCString classScope=stripAnonymousNamespaceScope(scope); - classScope=stripTemplateSpecifiersFromScope(classScope,FALSE); - QCString annScopePrefix=scope.left(scope.length()-classScope.length()); - bool isRelated=FALSE; if (!root->relates.isEmpty()) // related variable { isRelated=TRUE; if (getClass(root->relates)==0 && !scope.isEmpty()) scope=mergeScopes(scope,root->relates); else - scope=root->relates.copy(); + scope=root->relates; } // note: changed from scope to classScope on 2-10-2005 @@ -2356,7 +2397,7 @@ static void buildVarList(Entry *root) { if (!pScope.isEmpty() && (pcd=getClass(pScope))) { - md=addVariableToClass(root, // entry + md=addVariableToClass(rootNav, // entry pcd, // class to add member to mtype, // member type name, // member name @@ -2371,7 +2412,7 @@ static void buildVarList(Entry *root) { if (mtype==MemberDef::Variable) { - md=addVariableToFile(root,mtype,pScope,name,TRUE,0); + md=addVariableToFile(rootNav,mtype,pScope,name,TRUE,0); } added=TRUE; } @@ -2382,7 +2423,7 @@ static void buildVarList(Entry *root) // scope.right(scope.length()-si).data(), // indentDepth, // anonyScopes); - addVariableToClass(root, // entry + addVariableToClass(rootNav, // entry cd, // class to add member to mtype, // member type name, // name of the member @@ -2394,15 +2435,20 @@ static void buildVarList(Entry *root) else if (!name.isEmpty()) // global variable { //printf("Inserting member in global scope %s!\n",scope.data()); - addVariableToFile(root,mtype,scope,name,FALSE,/*0,*/0); + addVariableToFile(rootNav,mtype,scope,name,FALSE,/*0,*/0); } - } nextMember: - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) + + rootNav->releaseEntry(); + } + if (rootNav->children()) { - if (e->section!=Entry::ENUM_SEC) buildVarList(e); + EntryNavListIterator eli(*rootNav->children()); + EntryNav *e; + for (;(e=eli.current());++eli) + { + if (e->section()!=Entry::ENUM_SEC) buildVarList(e); + } } } @@ -2410,9 +2456,11 @@ nextMember: // Searches the Entry tree for Function sections. // If found they are stored in their class or in the global list. -static void addMethodToClass(Entry *root,ClassDef *cd, +static void addMethodToClass(EntryNav *rootNav,ClassDef *cd, const QCString &rname,bool isFriend) { + Entry *root = rootNav->entry(); + int l,i; static QRegExp re("([a-z_A-Z0-9: ]*[ *]*[ ]*"); @@ -2448,7 +2496,7 @@ static void addMethodToClass(Entry *root,ClassDef *cd, root->type,name,root->args,root->exception, root->protection,root->virt,root->stat,!root->relates.isEmpty(), mtype,root->tArgLists ? root->tArgLists->last() : 0,root->argList); - md->setTagInfo(root->tagInfo); + md->setTagInfo(rootNav->tagInfo()); md->setMemberClass(cd); md->setDocumentation(root->doc,root->docFile,root->docLine); md->setDocsForDefinition(!root->proto); @@ -2457,8 +2505,7 @@ static void addMethodToClass(Entry *root,ClassDef *cd, md->setBodySegment(root->bodyLine,root->endBodyLine); md->setMemberSpecifiers(root->memSpec); md->setMemberGroupId(root->mGrpId); - bool ambig; - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); md->setBodyDef(fd); md->setFileDef(fd); //md->setScopeTemplateArguments(root->tArgList); @@ -2558,20 +2605,23 @@ static void addMethodToClass(Entry *root,ClassDef *cd, cd->insertUsedFile(root->fileName); addMemberToGroups(root,md); - root->section = Entry::EMPTY_SEC; + rootNav->changeSection(Entry::EMPTY_SEC); md->setRefItems(root->sli); } -static void buildFunctionList(Entry *root) +static void buildFunctionList(EntryNav *rootNav) { - if (root->section==Entry::FUNCTION_SEC) + if (rootNav->section()==Entry::FUNCTION_SEC) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + Debug::print(Debug::Functions,0, "FUNCTION_SEC:\n" " `%s' `%s'::`%s' `%s' relates=`%s' relatesDup=`%d' file=`%s' line=`%d' bodyLine=`%d' #tArgLists=%d mGrpId=%d memSpec=%d proto=%d docFile=%s\n", root->type.data(), - root->parent->name.data(), + rootNav->parent()->name().data(), root->name.data(), root->args.data(), root->relates.data(), @@ -2599,11 +2649,10 @@ static void buildFunctionList(Entry *root) //printf("root->parent=`%s' %x cd=%p root->type.find(re,0)=%d\n", // root->parent->name.data(),root->parent->section,getClass(root->parent->name), // root->type.find(re,0)); - QCString scope=root->parent->name; //stripAnonymousNamespaceScope(root->parent->name); + QCString scope=rootNav->parent()->name(); //stripAnonymousNamespaceScope(root->parent->name); scope=stripTemplateSpecifiersFromScope(scope,FALSE); - bool ambig; - FileDef *rfd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *rfd=rootNav->fileDef(); int memIndex=rname.findRev("::"); @@ -2611,9 +2660,8 @@ static void buildFunctionList(Entry *root) if (cd && scope+"::"==rname.left(scope.length()+2)) // found A::f inside A { // strip scope from name - rname=rname.right(rname.length()-root->parent->name.length()-2); + rname=rname.right(rname.length()-rootNav->parent()->name().length()-2); } - NamespaceDef *nd = 0; bool isMember=FALSE; @@ -2639,9 +2687,8 @@ static void buildFunctionList(Entry *root) } - if (root->parent && - !root->parent->name.isEmpty() && - (root->parent->section & Entry::COMPOUND_MASK) && + if (!rootNav->parent()->name().isEmpty() && + (rootNav->parent()->section() & Entry::COMPOUND_MASK) && cd && // do some fuzzy things to exclude function pointers (root->type.isEmpty() || root->type.find(re,0)==-1 || @@ -2651,11 +2698,10 @@ static void buildFunctionList(Entry *root) { Debug::print(Debug::Functions,0," --> member %s of class %s!\n", rname.data(),cd->name().data()); - addMethodToClass(root,cd,rname,isFriend); + addMethodToClass(rootNav,cd,rname,isFriend); } - else if (root->parent && - !((root->parent->section & Entry::COMPOUND_MASK) - || root->parent->section==Entry::OBJCIMPL_SEC + else if (!((rootNav->parent()->section() & Entry::COMPOUND_MASK) + || rootNav->parent()->section()==Entry::OBJCIMPL_SEC ) && !isMember && (root->relates.isEmpty() || root->relatesDup) && @@ -2678,9 +2724,9 @@ static void buildFunctionList(Entry *root) { NamespaceDef *mnd = md->getNamespaceDef(); NamespaceDef *rnd = 0; - if (!root->parent->name.isEmpty()) + if (!rootNav->parent()->name().isEmpty()) { - rnd = getResolvedNamespace(root->parent->name); + rnd = getResolvedNamespace(rootNav->parent()->name()); } FileDef *mfd = md->getFileDef(); QCString nsName,rnsName; @@ -2792,7 +2838,7 @@ static void buildFunctionList(Entry *root) root->protection,root->virt,root->stat,FALSE, MemberDef::Function,tArgList,root->argList); - md->setTagInfo(root->tagInfo); + md->setTagInfo(rootNav->tagInfo()); //md->setDefFile(root->fileName); //md->setDefLine(root->startLine); md->setDocumentation(root->doc,root->docFile,root->docLine); @@ -2802,8 +2848,7 @@ static void buildFunctionList(Entry *root) md->setDocsForDefinition(!root->proto); //md->setBody(root->body); md->setBodySegment(root->bodyLine,root->endBodyLine); - bool ambig; - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); md->setBodyDef(fd); md->addSectionsToDefinition(root->anchors); md->setMemberSpecifiers(root->memSpec); @@ -2811,9 +2856,9 @@ static void buildFunctionList(Entry *root) // see if the function is inside a namespace that was not part of // the name already (in that case nd should be non-zero already) - if (nd==0 && root->parent->section == Entry::NAMESPACE_SEC ) + if (nd==0 && rootNav->parent()->section() == Entry::NAMESPACE_SEC ) { - QCString nscope=removeAnonymousScopes(root->parent->name); + QCString nscope=removeAnonymousScopes(rootNav->parent()->name()); if (!nscope.isEmpty()) { nd = getResolvedNamespace(nscope); @@ -2860,7 +2905,7 @@ static void buildFunctionList(Entry *root) " `%s' `%s'::`%s' `%s' proto=%d\n" " def=`%s'\n", root->type.data(), - root->parent->name.data(), + rootNav->parent()->name().data(), rname.data(), root->args.data(), root->proto, @@ -2906,15 +2951,14 @@ static void buildFunctionList(Entry *root) if (!root->relatesDup) // if this is a relatesalso command, allow find // Member to pick it up { - root->section = Entry::EMPTY_SEC; // Otherwise we have finished - // with this entry. + rootNav->changeSection(Entry::EMPTY_SEC); // Otherwise we have finished + // with this entry. } } else { - bool ambig; - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); if (fd) { // add member to the file (we do this even if we have already @@ -2933,13 +2977,10 @@ static void buildFunctionList(Entry *root) "Warning: Illegal member name found." ); } + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - buildFunctionList(e); - } + RECURSE_ENTRYTREE(buildFunctionList,rootNav); } //---------------------------------------------------------------------- @@ -3404,7 +3445,7 @@ enum FindBaseClassRelation_Mode }; static bool findClassRelation( - Entry *root, + EntryNav *rootNav, Definition *context, ClassDef *cd, BaseInfo *bi, @@ -3415,7 +3456,7 @@ static bool findClassRelation( ); -static void findUsedClassesForClass(Entry *root, +static void findUsedClassesForClass(EntryNav *rootNav, Definition *context, ClassDef *masterCd, ClassDef *instanceCd, @@ -3426,141 +3467,144 @@ static void findUsedClassesForClass(Entry *root, { masterCd->visited=TRUE; ArgumentList *formalArgs = masterCd->templateArguments(); - MemberNameInfoSDict::Iterator mnili(*masterCd->memberNameInfoSDict()); - MemberNameInfo *mni; - for (;(mni=mnili.current());++mnili) - { - MemberNameInfoIterator mnii(*mni); - MemberInfo *mi; - for (mnii.toFirst();(mi=mnii.current());++mnii) - { - MemberDef *md=mi->memberDef; - if (md->isVariable()) // for each member variable in this class - { - //printf(" Found variable %s in class %s\n",md->name().data(),masterCd->name().data()); - QCString type=removeRedundantWhiteSpace(md->typeString()); - int pos=0; - QCString usedClassName; - QCString templSpec; - bool found=FALSE; - // the type can contain template variables, replace them if present - if (actualArgs) - { - type = substituteTemplateArgumentsInString(type,formalArgs,actualArgs); - } - - //printf(" template substitution gives=%s\n",type.data()); - while (!found && extractClassNameFromType(type,pos,usedClassName,templSpec)!=-1) + if (masterCd->memberNameInfoSDict()) + { + MemberNameInfoSDict::Iterator mnili(*masterCd->memberNameInfoSDict()); + MemberNameInfo *mni; + for (;(mni=mnili.current());++mnili) + { + MemberNameInfoIterator mnii(*mni); + MemberInfo *mi; + for (mnii.toFirst();(mi=mnii.current());++mnii) + { + MemberDef *md=mi->memberDef; + if (md->isVariable()) // for each member variable in this class { - // find the type (if any) that matches usedClassName - ClassDef *typeCd = getResolvedClass(masterCd, - masterCd->getFileDef(), - usedClassName, - 0,0, - FALSE,TRUE - ); - //printf("====> usedClassName=%s -> typeCd=%s\n", - // usedClassName.data(),typeCd?typeCd->name().data():"<none>"); - if (typeCd) - { - usedClassName = typeCd->name(); - } - - int sp=usedClassName.find('<'); - if (sp==-1) sp=0; - int si=usedClassName.findRev("::",sp); - if (si!=-1) + //printf(" Found variable %s in class %s\n",md->name().data(),masterCd->name().data()); + QCString type=removeRedundantWhiteSpace(md->typeString()); + int pos=0; + QCString usedClassName; + QCString templSpec; + bool found=FALSE; + // the type can contain template variables, replace them if present + if (actualArgs) { - // replace any namespace aliases - replaceNamespaceAliases(usedClassName,si); + type = substituteTemplateArgumentsInString(type,formalArgs,actualArgs); } - // add any template arguments to the class - QCString usedName = removeRedundantWhiteSpace(usedClassName+templSpec); - //printf(" usedName=%s\n",usedName.data()); - bool delTempNames=FALSE; - if (templateNames==0) + //printf(" template substitution gives=%s\n",type.data()); + while (!found && extractClassNameFromType(type,pos,usedClassName,templSpec)!=-1) { - templateNames = getTemplateArgumentsInName(formalArgs,usedName); - delTempNames=TRUE; - } - BaseInfo bi(usedName,Public,Normal); - findClassRelation(root,context,instanceCd,&bi,templateNames,TemplateInstances,isArtificial); + // find the type (if any) that matches usedClassName + ClassDef *typeCd = getResolvedClass(masterCd, + masterCd->getFileDef(), + usedClassName, + 0,0, + FALSE,TRUE + ); + //printf("====> usedClassName=%s -> typeCd=%s\n", + // usedClassName.data(),typeCd?typeCd->name().data():"<none>"); + if (typeCd) + { + usedClassName = typeCd->name(); + } - if (masterCd->templateArguments()) - { - ArgumentListIterator ali(*masterCd->templateArguments()); - Argument *arg; - int count=0; - for (ali.toFirst();(arg=ali.current());++ali,++count) + int sp=usedClassName.find('<'); + if (sp==-1) sp=0; + int si=usedClassName.findRev("::",sp); + if (si!=-1) + { + // replace any namespace aliases + replaceNamespaceAliases(usedClassName,si); + } + // add any template arguments to the class + QCString usedName = removeRedundantWhiteSpace(usedClassName+templSpec); + //printf(" usedName=%s\n",usedName.data()); + + bool delTempNames=FALSE; + if (templateNames==0) { - if (arg->name==usedName) // type is a template argument + templateNames = getTemplateArgumentsInName(formalArgs,usedName); + delTempNames=TRUE; + } + BaseInfo bi(usedName,Public,Normal); + findClassRelation(rootNav,context,instanceCd,&bi,templateNames,TemplateInstances,isArtificial); + + if (masterCd->templateArguments()) + { + ArgumentListIterator ali(*masterCd->templateArguments()); + Argument *arg; + int count=0; + for (ali.toFirst();(arg=ali.current());++ali,++count) { - found=TRUE; - Debug::print(Debug::Classes,0," New used class `%s'\n", usedName.data()); - - ClassDef *usedCd = Doxygen::hiddenClasses.find(usedName); - if (usedCd==0) - { - usedCd = new ClassDef( - masterCd->getDefFileName(),masterCd->getDefLine(), - usedName,ClassDef::Class); - //printf("making %s a template argument!!!\n",usedCd->name().data()); - usedCd->makeTemplateArgument(); - Doxygen::hiddenClasses.append(usedName,usedCd); - } - if (usedCd) + if (arg->name==usedName) // type is a template argument { - if (isArtificial) usedCd->setClassIsArtificial(); - Debug::print(Debug::Classes,0," Adding used class `%s' (1)\n", usedCd->name().data()); - instanceCd->addUsedClass(usedCd,md->name()); - usedCd->addUsedByClass(instanceCd,md->name()); + found=TRUE; + Debug::print(Debug::Classes,0," New used class `%s'\n", usedName.data()); + + ClassDef *usedCd = Doxygen::hiddenClasses.find(usedName); + if (usedCd==0) + { + usedCd = new ClassDef( + masterCd->getDefFileName(),masterCd->getDefLine(), + usedName,ClassDef::Class); + //printf("making %s a template argument!!!\n",usedCd->name().data()); + usedCd->makeTemplateArgument(); + Doxygen::hiddenClasses.append(usedName,usedCd); + } + if (usedCd) + { + if (isArtificial) usedCd->setClassIsArtificial(); + Debug::print(Debug::Classes,0," Adding used class `%s' (1)\n", usedCd->name().data()); + instanceCd->addUsedClass(usedCd,md->name()); + usedCd->addUsedByClass(instanceCd,md->name()); + } } } } - } - if (!found) - { - ClassDef *usedCd=findClassWithinClassContext(context,masterCd,usedName); - //printf("Looking for used class %s: result=%s master=%s\n", - // usedName.data(),usedCd?usedCd->name().data():"<none>",masterCd?masterCd->name().data():"<none>"); + if (!found) + { + ClassDef *usedCd=findClassWithinClassContext(context,masterCd,usedName); + //printf("Looking for used class %s: result=%s master=%s\n", + // usedName.data(),usedCd?usedCd->name().data():"<none>",masterCd?masterCd->name().data():"<none>"); - if (usedCd) + if (usedCd) + { + found=TRUE; + Debug::print(Debug::Classes,0," Adding used class `%s' (2)\n", usedCd->name().data()); + instanceCd->addUsedClass(usedCd,md->name()); // class exists + usedCd->addUsedByClass(instanceCd,md->name()); + } + } + if (delTempNames) { - found=TRUE; - Debug::print(Debug::Classes,0," Adding used class `%s' (2)\n", usedCd->name().data()); - instanceCd->addUsedClass(usedCd,md->name()); // class exists - usedCd->addUsedByClass(instanceCd,md->name()); + delete templateNames; + templateNames=0; } } - if (delTempNames) - { - delete templateNames; - templateNames=0; - } - } - if (!found && !type.isEmpty()) // used class is not documented in any scope - { - ClassDef *usedCd = Doxygen::hiddenClasses.find(type); - if (usedCd==0 && !Config_getBool("HIDE_UNDOC_RELATIONS")) - { - if (type.right(2)=="(*") // type is a function pointer - { - type+=md->argsString(); - } - Debug::print(Debug::Classes,0," New undocumented used class `%s'\n", type.data()); - usedCd = new ClassDef( - masterCd->getDefFileName(),masterCd->getDefLine(), - type,ClassDef::Class); - Doxygen::hiddenClasses.append(type,usedCd); - } - if (usedCd) + if (!found && !type.isEmpty()) // used class is not documented in any scope { - if (isArtificial) usedCd->setClassIsArtificial(); - Debug::print(Debug::Classes,0," Adding used class `%s' (3)\n", usedCd->name().data()); - instanceCd->addUsedClass(usedCd,md->name()); - usedCd->addUsedByClass(instanceCd,md->name()); + ClassDef *usedCd = Doxygen::hiddenClasses.find(type); + if (usedCd==0 && !Config_getBool("HIDE_UNDOC_RELATIONS")) + { + if (type.right(2)=="(*") // type is a function pointer + { + type+=md->argsString(); + } + Debug::print(Debug::Classes,0," New undocumented used class `%s'\n", type.data()); + usedCd = new ClassDef( + masterCd->getDefFileName(),masterCd->getDefLine(), + type,ClassDef::Class); + Doxygen::hiddenClasses.append(type,usedCd); + } + if (usedCd) + { + if (isArtificial) usedCd->setClassIsArtificial(); + Debug::print(Debug::Classes,0," Adding used class `%s' (3)\n", usedCd->name().data()); + instanceCd->addUsedClass(usedCd,md->name()); + usedCd->addUsedByClass(instanceCd,md->name()); + } } } } @@ -3569,7 +3613,7 @@ static void findUsedClassesForClass(Entry *root, } static void findBaseClassesForClass( - Entry *root, + EntryNav *rootNav, Definition *context, ClassDef *masterCd, ClassDef *instanceCd, @@ -3579,6 +3623,7 @@ static void findBaseClassesForClass( QDict<int> *templateNames=0 ) { + Entry *root = rootNav->entry(); //if (masterCd->visited) return; masterCd->visited=TRUE; // The base class could ofcouse also be a non-nested class @@ -3605,18 +3650,18 @@ static void findBaseClassesForClass( if (mode==DocumentedOnly) { // find a documented base class in the correct scope - if (!findClassRelation(root,context,instanceCd,&tbi,templateNames,DocumentedOnly,isArtificial)) + if (!findClassRelation(rootNav,context,instanceCd,&tbi,templateNames,DocumentedOnly,isArtificial)) { if (!Config_getBool("HIDE_UNDOC_RELATIONS")) { // no documented base class -> try to find an undocumented one - findClassRelation(root,context,instanceCd,&tbi,templateNames,Undocumented,isArtificial); + findClassRelation(rootNav,context,instanceCd,&tbi,templateNames,Undocumented,isArtificial); } } } else if (mode==TemplateInstances) { - findClassRelation(root,context,instanceCd,&tbi,templateNames,TemplateInstances,isArtificial); + findClassRelation(rootNav,context,instanceCd,&tbi,templateNames,TemplateInstances,isArtificial); } if (delTempNames) { @@ -3666,19 +3711,24 @@ static bool findTemplateInstanceRelation(Entry *root, // search for new template instances caused by base classes of // instanceClass - Entry *templateRoot = classEntries.find(templateClass->name()); - if (templateRoot) + EntryNav *templateRootNav = classEntries.find(templateClass->name()); + if (templateRootNav) { + templateRootNav->loadEntry(g_storage); + Entry *templateRoot = templateRootNav->entry(); + Debug::print(Debug::Classes,0," template root found %s templSpec=%s!\n", templateRoot->name.data(),templSpec.data()); ArgumentList *templArgs = new ArgumentList; stringToArgumentList(templSpec,templArgs); - findBaseClassesForClass(templateRoot,context,templateClass,instanceClass, + findBaseClassesForClass(templateRootNav,context,templateClass,instanceClass, TemplateInstances,isArtificial,templArgs,templateNames); - findUsedClassesForClass(templateRoot,context,templateClass,instanceClass, + findUsedClassesForClass(templateRootNav,context,templateClass,instanceClass, isArtificial,templArgs,templateNames); delete templArgs; + + templateRootNav->releaseEntry(); } else { @@ -3788,7 +3838,7 @@ static int findEndOfTemplate(const QCString &s,int startPos) } static bool findClassRelation( - Entry *root, + EntryNav *rootNav, Definition *context, ClassDef *cd, BaseInfo *bi, @@ -3810,6 +3860,8 @@ static bool findClassRelation( //} //printf("\n"); + Entry *root = rootNav->entry(); + QCString biName=bi->name; bool explicitGlobalScope=FALSE; if (biName.left(2)=="::") // explicit global scope @@ -3819,12 +3871,12 @@ static bool findClassRelation( } //printf("biName=`%s'\n",biName.data()); - Entry *parentNode=root->parent; + EntryNav *parentNode=rootNav->parent(); bool lastParent=FALSE; do // for each parent scope, starting with the largest scope // (in case of nested classes) { - QCString scopeName= parentNode ? parentNode->name.data() : ""; + QCString scopeName= parentNode ? parentNode->name().data() : ""; int scopeOffset=explicitGlobalScope ? 0 : scopeName.length(); do // try all parent scope prefixes, starting with the largest scope { @@ -3861,12 +3913,12 @@ static bool findClassRelation( // ) // Check for base class with the same name. // // If found then look in the outer scope for a match // // and prevent recursion. - if (!isRecursiveBaseClass(root->name,baseClassName) || explicitGlobalScope) + if (!isRecursiveBaseClass(rootNav->name(),baseClassName) || explicitGlobalScope) { Debug::print( Debug::Classes,0," class relation %s inherited/used by %s found (%s and %s)\n", baseClassName.data(), - root->name.data(), + rootNav->name().data(), (bi->prot==Private)?"private":((bi->prot==Protected)?"protected":"public"), (bi->virt==Normal)?"normal":"virtual" ); @@ -4037,7 +4089,7 @@ static bool findClassRelation( } else { - parentNode=parentNode->parent; + parentNode=parentNode->parent(); } } while (lastParent); @@ -4047,40 +4099,38 @@ static bool findClassRelation( //---------------------------------------------------------------------- // Computes the base and super classes for each class in the tree -static bool isClassSection(Entry *root) +static bool isClassSection(EntryNav *rootNav) { - return - ( - ( - ( - // is it a compound (class, struct, union, interface ...) - root->section & Entry::COMPOUND_MASK - ) - || - ( + if ( !rootNav->name().isEmpty() ) + { + if (rootNav->section() & Entry::COMPOUND_MASK) + // is it a compound (class, struct, union, interface ...) + { + return TRUE; + } + else if (rootNav->section() & Entry::COMPOUNDDOC_MASK) // is it a documentation block with inheritance info. - (root->section & Entry::COMPOUNDDOC_MASK) && root->extends->count()>0 - ) - ) - && !root->name.isEmpty() // sanity check - ); + { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + bool extends = root->extends->count()>0; + rootNav->releaseEntry(); + if (extends) return TRUE; + } + } + return FALSE; } /*! Builds a dictionary of all entry nodes in the tree starting with \a root */ -static void findClassEntries(Entry *root) +static void findClassEntries(EntryNav *rootNav) { - if (isClassSection(root)) + if (isClassSection(rootNav)) { - classEntries.insert(root->name,root); - } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - findClassEntries(e); + classEntries.insert(rootNav->name(),rootNav); } + RECURSE_ENTRYTREE(findClassEntries,rootNav); } /*! Using the dictionary build by findClassEntries(), this @@ -4092,19 +4142,21 @@ static void findInheritedTemplateInstances() { ClassSDict::Iterator cli(Doxygen::classSDict); for (cli.toFirst();cli.current();++cli) cli.current()->visited=FALSE; - QDictIterator<Entry> edi(classEntries); - Entry *root; - for (;(root=edi.current());++edi) + QDictIterator<EntryNav> edi(classEntries); + EntryNav *rootNav; + for (;(rootNav=edi.current());++edi) { ClassDef *cd; // strip any annonymous scopes first - QCString bName=stripAnonymousNamespaceScope(root->name); + QCString bName=stripAnonymousNamespaceScope(rootNav->name()); bName=stripTemplateSpecifiersFromScope(bName); Debug::print(Debug::Classes,0," Class %s : \n",bName.data()); if ((cd=getClass(bName))) { + rootNav->loadEntry(g_storage); //printf("Class %s %d\n",cd->name().data(),root->extends->count()); - findBaseClassesForClass(root,cd,cd,cd,TemplateInstances,FALSE); + findBaseClassesForClass(rootNav,cd,cd,cd,TemplateInstances,FALSE); + rootNav->releaseEntry(); } } } @@ -4113,18 +4165,20 @@ static void findUsedTemplateInstances() { ClassSDict::Iterator cli(Doxygen::classSDict); for (cli.toFirst();cli.current();++cli) cli.current()->visited=FALSE; - QDictIterator<Entry> edi(classEntries); - Entry *root; - for (;(root=edi.current());++edi) + QDictIterator<EntryNav> edi(classEntries); + EntryNav *rootNav; + for (;(rootNav=edi.current());++edi) { ClassDef *cd; // strip any annonymous scopes first - QCString bName=stripAnonymousNamespaceScope(root->name); + QCString bName=stripAnonymousNamespaceScope(rootNav->name()); bName=stripTemplateSpecifiersFromScope(bName); Debug::print(Debug::Classes,0," Class %s : \n",bName.data()); if ((cd=getClass(bName))) { - findUsedClassesForClass(root,cd,cd,cd,TRUE); + rootNav->loadEntry(g_storage); + findUsedClassesForClass(rootNav,cd,cd,cd,TRUE); + rootNav->releaseEntry(); } } } @@ -4133,19 +4187,22 @@ static void computeClassRelations() { ClassSDict::Iterator cli(Doxygen::classSDict); for (cli.toFirst();cli.current();++cli) cli.current()->visited=FALSE; - QDictIterator<Entry> edi(classEntries); - Entry *root; - for (;(root=edi.current());++edi) + QDictIterator<EntryNav> edi(classEntries); + EntryNav *rootNav; + for (;(rootNav=edi.current());++edi) { ClassDef *cd; + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + // strip any annonymous scopes first - QCString bName=stripAnonymousNamespaceScope(root->name); + QCString bName=stripAnonymousNamespaceScope(rootNav->name()); bName=stripTemplateSpecifiersFromScope(bName); Debug::print(Debug::Classes,0," Class %s : \n",bName.data()); if ((cd=getClass(bName))) { - findBaseClassesForClass(root,cd,cd,cd,DocumentedOnly,FALSE); + findBaseClassesForClass(rootNav,cd,cd,cd,DocumentedOnly,FALSE); } if ((cd==0 || (!cd->hasDocumentation() && !cd->isReference())) && bName.right(2)!="::") @@ -4162,15 +4219,20 @@ static void computeClassRelations() root->name.data() ); } + + rootNav->releaseEntry(); } } static void computeTemplateClassRelations() { - QDictIterator<Entry> edi(classEntries); - Entry *root; - for (;(root=edi.current());++edi) + QDictIterator<EntryNav> edi(classEntries); + EntryNav *rootNav; + for (;(rootNav=edi.current());++edi) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + QCString bName=stripAnonymousNamespaceScope(root->name); bName=stripTemplateSpecifiersFromScope(bName); ClassDef *cd=getClass(bName); @@ -4224,10 +4286,10 @@ static void computeTemplateClassRelations() tbi.name = substituteTemplateArgumentsInString(bi->name,tl,templArgs); // find a documented base class in the correct scope - if (!findClassRelation(root,cd,tcd,&tbi,actualTemplateNames,DocumentedOnly,FALSE)) + if (!findClassRelation(rootNav,cd,tcd,&tbi,actualTemplateNames,DocumentedOnly,FALSE)) { // no documented base class -> try to find an undocumented one - findClassRelation(root,cd,tcd,&tbi,actualTemplateNames,Undocumented,FALSE); + findClassRelation(rootNav,cd,tcd,&tbi,actualTemplateNames,Undocumented,FALSE); } delete actualTemplateNames; } @@ -4236,6 +4298,8 @@ static void computeTemplateClassRelations() delete templArgs; } // class has no base classes } + + rootNav->releaseEntry(); } } @@ -4350,13 +4414,14 @@ static void addListReferences() // set the function declaration of the member to `funcDecl'. If the boolean // over_load is set the standard overload text is added. -static void addMemberDocs(Entry *root, +static void addMemberDocs(EntryNav *rootNav, MemberDef *md, const char *funcDecl, ArgumentList *al, bool over_load, NamespaceSDict * ) { + Entry *root = rootNav->entry(); //printf("addMemberDocs: `%s'::`%s' `%s' funcDecl=`%s' memSpec=%d\n", // root->parent->name.data(),md->name().data(),md->argsString(),funcDecl,root->memSpec); QCString fDecl=funcDecl; @@ -4375,8 +4440,7 @@ static void addMemberDocs(Entry *root, if (!fullName.isEmpty()) fullName+="::"; fullName+=md->name(); - bool ambig; - FileDef *rfd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *rfd=rootNav->fileDef(); // TODO determine scope based on root not md Definition *rscope = md->getOuterScope(); @@ -4419,7 +4483,7 @@ static void addMemberDocs(Entry *root, if ( /* !md->isStatic() && !root->stat && do not replace doc of a static */ ( md->documentation().isEmpty() || /* no docs yet */ - (root->parent->name.isEmpty() && /* or overwrite prototype docs */ + (rootNav->parent()->name().isEmpty() && /* or overwrite prototype docs */ !root->proto && md->isPrototype() /* with member definition docs */ ) ) && !root->doc.isEmpty() @@ -4437,7 +4501,7 @@ static void addMemberDocs(Entry *root, if ( /* !md->isStatic() && !root->stat && do not replace doc of static */ ( md->briefDescription().isEmpty() || /* no docs yet */ - !root->parent->name.isEmpty() /* member of a class */ + !rootNav->parent()->name().isEmpty() /* member of a class */ ) && !root->brief.isEmpty() ) { @@ -4447,7 +4511,7 @@ static void addMemberDocs(Entry *root, if ( (md->inbodyDocumentation().isEmpty() || - !root->parent->name.isEmpty() + !rootNav->parent()->name().isEmpty() ) && !root->inbodyDocs.isEmpty() ) { @@ -4523,13 +4587,14 @@ static ClassDef *findClassDefinition(FileDef *fd,NamespaceDef *nd, // with name `name' and argument list `args' (for overloading) and // function declaration `decl' to the corresponding member definition. -static bool findGlobalMember(Entry *root, +static bool findGlobalMember(EntryNav *rootNav, const QCString &namespaceName, const char *name, const char *tempArg, const char *, const char *decl) { + Entry *root = rootNav->entry(); Debug::print(Debug::FindMembers,0, "2. findGlobalMember(namespace=%s,name=%s,tempArg=%s,decl=%s)\n", namespaceName.data(),name,tempArg,decl); @@ -4550,13 +4615,12 @@ static bool findGlobalMember(Entry *root, bool found=FALSE; for (mni.toFirst();(md=mni.current()) && !found;++mni) { - bool ambig; NamespaceDef *nd=md->getNamespaceDef(); //printf("Namespace namespaceName=%s nd=%s\n", // namespaceName.data(),nd ? nd->name().data() : "<none>"); - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); //printf("File %s\n",fd ? fd->name().data() : "<none>"); NamespaceSDict *nl = fd ? fd->getUsedNamespaces() : 0; //SDict<Definition> *cl = fd ? fd->getUsedClasses() : 0; @@ -4585,6 +4649,10 @@ static bool findGlobalMember(Entry *root, rnd ? rnd : Doxygen::globalScope,fd,root->argList, FALSE); + //printf("%s<->%s\n", + // argListToString(md->argumentList()).data(), + // argListToString(root->argList).data()); + // for static members we also check if the comment block was found in // the same file. This is needed because static members with the same // name can be in different files. Thus it would be wrong to just @@ -4599,7 +4667,7 @@ static bool findGlobalMember(Entry *root, if (matching) // add docs to the member { Debug::print(Debug::FindMembers,0,"5. Match found\n"); - addMemberDocs(root,md,decl,root->argList,FALSE); + addMemberDocs(rootNav,md,decl,root->argList,FALSE); found=TRUE; } } @@ -4627,7 +4695,7 @@ static bool findGlobalMember(Entry *root, root->type!="friend union") { warn(root->fileName,root->startLine, - "Warning: documented function `%s' was not defined.",decl + "Warning: documented function `%s' was not declared or defined.",decl ); } } @@ -4763,12 +4831,14 @@ static void substituteTemplatesInArgList( * The boolean \a isFunc is a hint that indicates that this is a function * instead of a variable or typedef. */ -static void findMember(Entry *root, +static void findMember(EntryNav *rootNav, QCString funcDecl, bool overloaded, bool isFunc ) { + Entry *root = rootNav->entry(); + Debug::print(Debug::FindMembers,0, "findMember(root=%p,funcDecl=`%s',related=`%s',overload=%d," "isFunc=%d mGrpId=%d tArgList=%p (#=%d) " @@ -4872,15 +4942,15 @@ static void findMember(Entry *root, if (getClass(root->relates)==0 && !scopeName.isEmpty()) scopeName= mergeScopes(scopeName,root->relates); else - scopeName = root->relates.copy(); + scopeName = root->relates; } - if (root->relates.isEmpty() && root->parent && - (root->parent->section&Entry::SCOPE_MASK) && - !root->parent->name.isEmpty()) // see if we can combine scopeName + if (root->relates.isEmpty() && rootNav->parent() && + (rootNav->parent()->section()&Entry::SCOPE_MASK) && + !rootNav->parent()->name().isEmpty()) // see if we can combine scopeName // with the scope in which it was found { - QCString joinedName = root->parent->name+"::"+scopeName; + QCString joinedName = rootNav->parent()->name()+"::"+scopeName; if (!scopeName.isEmpty() && (getClass(joinedName) || Doxygen::namespaceSDict[joinedName])) { @@ -4888,13 +4958,12 @@ static void findMember(Entry *root, } else { - scopeName = mergeScopes(root->parent->name,scopeName); + scopeName = mergeScopes(rootNav->parent()->name(),scopeName); } } else // see if we can prefix a namespace or class that is used from the file { - bool ambig; - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); if (fd) { NamespaceSDict *fnl = fd->getUsedNamespaces(); @@ -5095,8 +5164,7 @@ static void findMember(Entry *root, md->argsString(), root->fileName.data()); //printf("Member %s (member scopeName=%s) (this scopeName=%s) classTempList=%s\n",md->name().data(),cd->name().data(),scopeName.data(),classTempList.data()); - bool ambig; - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); NamespaceDef *nd=0; if (!namespaceName.isEmpty()) nd=getResolvedNamespace(namespaceName); @@ -5189,7 +5257,7 @@ static void findMember(Entry *root, // TODO: copy other aspects? root->protection=md->protection(); // copy protection level - addMethodToClass(root,cd,md->name(),isFriend); + addMethodToClass(rootNav,cd,md->name(),isFriend); return; } delete argList; @@ -5197,13 +5265,14 @@ static void findMember(Entry *root, } if (matching) { - addMemberDocs(root,md,funcDecl,0,overloaded,0/* TODO */); + addMemberDocs(rootNav,md,funcDecl,0,overloaded,0/* TODO */); count++; memFound=TRUE; } } } - if (count==0 && root->parent && root->parent->section==Entry::OBJCIMPL_SEC) + if (count==0 && rootNav->parent() && + rootNav->parent()->section()==Entry::OBJCIMPL_SEC) { goto localObjCMethod; } @@ -5222,7 +5291,7 @@ static void findMember(Entry *root, if (root->tArgLists && md->templateArguments() && root->tArgLists->getLast()->count()<=md->templateArguments()->count()) { - addMethodToClass(root,cd,md->name(),isFriend); + addMethodToClass(rootNav,cd,md->name(),isFriend); return; } candidates++; @@ -5285,7 +5354,7 @@ static void findMember(Entry *root, root->protection,root->virt,root->stat,FALSE, mtype,tArgList,root->argList); //printf("new specialized member %s args=`%s'\n",md->name().data(),funcArgs.data()); - md->setTagInfo(root->tagInfo); + md->setTagInfo(rootNav->tagInfo()); md->setMemberClass(cd); md->setTemplateSpecialization(TRUE); md->setDefinition(funcDecl); @@ -5297,8 +5366,7 @@ static void findMember(Entry *root, md->setPrototype(root->proto); md->addSectionsToDefinition(root->anchors); md->setBodySegment(root->bodyLine,root->endBodyLine); - bool ambig; - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); md->setBodyDef(fd); md->setMemberSpecifiers(root->memSpec); md->setMemberGroupId(root->mGrpId); @@ -5347,7 +5415,7 @@ static void findMember(Entry *root, funcType,funcName,funcArgs,exceptions, root->protection,root->virt,root->stat,TRUE, mtype,tArgList,root->argList); - md->setTagInfo(root->tagInfo); + md->setTagInfo(rootNav->tagInfo()); md->setMemberClass(cd); md->setDefinition(funcDecl); md->enableCallGraph(root->callGraph); @@ -5361,8 +5429,7 @@ static void findMember(Entry *root, md->setPrototype(root->proto); md->addSectionsToDefinition(root->anchors); md->setBodySegment(root->bodyLine,root->endBodyLine); - bool ambig; - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); md->setBodyDef(fd); md->setMemberSpecifiers(root->memSpec); md->setMemberGroupId(root->mGrpId); @@ -5374,7 +5441,7 @@ static void findMember(Entry *root, } else // unrelated function with the same name as a member { - if (!findGlobalMember(root,namespaceName,funcName,funcTempList,funcArgs,funcDecl)) + if (!findGlobalMember(rootNav,namespaceName,funcName,funcTempList,funcArgs,funcDecl)) { QCString fullFuncDecl=funcDecl.copy(); if (isFunc) fullFuncDecl+=argListToString(root->argList,TRUE); @@ -5410,8 +5477,7 @@ static void findMember(Entry *root, } } - bool ambig; - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); if ((mn=Doxygen::memberNameSDict[funcName])==0) { @@ -5434,7 +5500,7 @@ static void findMember(Entry *root, { //printf("addMemberDocs for related member %s\n",root->name.data()); //rmd->setMemberDefTemplateArguments(root->mtArgList); - addMemberDocs(root,rmd,funcDecl,0,overloaded); + addMemberDocs(rootNav,rmd,funcDecl,0,overloaded); } } @@ -5463,7 +5529,7 @@ static void findMember(Entry *root, funcType,funcName,funcArgs,exceptions, root->protection,root->virt,root->stat,TRUE, mtype,tArgList,funcArgs.isEmpty() ? 0 : root->argList); - md->setTagInfo(root->tagInfo); + md->setTagInfo(rootNav->tagInfo()); //printf("Related member name=`%s' decl=`%s' bodyLine=`%d'\n", // funcName.data(),funcDecl.data(),root->bodyLine); @@ -5537,7 +5603,7 @@ static void findMember(Entry *root, } if (root->relatesDup) { - if (!findGlobalMember(root,namespaceName,funcName,funcTempList,funcArgs,funcDecl)) + if (!findGlobalMember(rootNav,namespaceName,funcName,funcTempList,funcArgs,funcDecl)) { QCString fullFuncDecl=funcDecl.copy(); if (isFunc) fullFuncDecl+=argListToString(root->argList,TRUE); @@ -5557,21 +5623,20 @@ static void findMember(Entry *root, ); } } - else if (root->parent && root->parent->section==Entry::OBJCIMPL_SEC) + else if (rootNav->parent() && rootNav->parent()->section()==Entry::OBJCIMPL_SEC) { localObjCMethod: ClassDef *cd; //printf("scopeName=`%s' className=`%s'\n",scopeName.data(),className.data()); if (Config_getBool("EXTRACT_LOCAL_METHODS") && (cd=getClass(scopeName))) { - bool ambig; //printf("Local objective C method `%s' of class `%s' found\n",root->name.data(),cd->name().data()); MemberDef *md=new MemberDef( root->fileName,root->startLine, funcType,funcName,funcArgs,exceptions, root->protection,root->virt,root->stat,FALSE, MemberDef::Function,0,root->argList); - md->setTagInfo(root->tagInfo); + md->setTagInfo(rootNav->tagInfo()); md->makeImplementationDetail(); md->setMemberClass(cd); md->setDefinition(funcDecl); @@ -5584,7 +5649,7 @@ localObjCMethod: md->setPrototype(root->proto); md->addSectionsToDefinition(root->anchors); md->setBodySegment(root->bodyLine,root->endBodyLine); - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + FileDef *fd=rootNav->fileDef(); md->setBodyDef(fd); md->setMemberSpecifiers(root->memSpec); md->setMemberGroupId(root->mGrpId); @@ -5609,7 +5674,7 @@ localObjCMethod: } else // unrelated not overloaded member found { - bool globMem = findGlobalMember(root,namespaceName,funcName,funcTempList,funcArgs,funcDecl); + bool globMem = findGlobalMember(rootNav,namespaceName,funcName,funcTempList,funcArgs,funcDecl); if (className.isEmpty() && !globMem) { warn(root->fileName,root->startLine, @@ -5638,23 +5703,24 @@ localObjCMethod: // find the members corresponding to the different documentation blocks // that are extracted from the sources. -static void findMemberDocumentation(Entry *root) +static void filterMemberDocumentation(EntryNav *rootNav) { + Entry *root = rootNav->entry(); int i=-1,l; Debug::print(Debug::FindMembers,0, - "findMemberDocumentation(): root->type=`%s' root->inside=`%s' root->name=`%s' root->args=`%s' section=%x root->memSpec=%d root->mGrpId=%d\n", - root->type.data(),root->inside.data(),root->name.data(),root->args.data(),root->section,root->memSpec,root->mGrpId - ); + "findMemberDocumentation(): root->type=`%s' root->inside=`%s' root->name=`%s' root->args=`%s' section=%x root->memSpec=%d root->mGrpId=%d\n", + root->type.data(),root->inside.data(),root->name.data(),root->args.data(),root->section,root->memSpec,root->mGrpId + ); bool isFunc=TRUE; if (root->relatesDup && !root->relates.isEmpty()) { - QCString tmp = root->relates; - root->relates.resize(0); - findMemberDocumentation(root); - root->relates = tmp; + QCString tmp = root->relates; + root->relates.resize(0); + filterMemberDocumentation(rootNav); + root->relates = tmp; } - + if ( // detect func variable/typedef to func ptr (i=findFunctionPtr(root->type,&l))!=-1 ) @@ -5667,7 +5733,7 @@ static void findMemberDocumentation(Entry *root) isFunc=FALSE; } else if ((root->type.left(8)=="typedef " && root->args.find('(')!=-1)) - // detect function types marked as functions + // detect function types marked as functions { isFunc=FALSE; } @@ -5680,105 +5746,134 @@ static void findMemberDocumentation(Entry *root) //if (root->relates.length()) printf(" Relates %s\n",root->relates.data()); if (root->type.isEmpty()) { - findMember(root,root->name+root->args+root->exception,FALSE,isFunc); + findMember(rootNav,root->name+root->args+root->exception,FALSE,isFunc); } else { - findMember(root,root->type+" "+root->name+root->args+root->exception,FALSE,isFunc); + findMember(rootNav,root->type+" "+root->name+root->args+root->exception,FALSE,isFunc); } } else if (root->section==Entry::OVERLOADDOC_SEC) { //printf("Overloaded member %s found\n",root->name.data()); - findMember(root,root->name,TRUE,isFunc); + findMember(rootNav,root->name,TRUE,isFunc); } else if ((root->section==Entry::FUNCTION_SEC // function || (root->section==Entry::VARIABLE_SEC && // variable - !root->type.isEmpty() && // with a type - compoundKeywordDict.find(root->type)==0 // that is not a keyword - // (to skip forward declaration of class etc.) + !root->type.isEmpty() && // with a type + compoundKeywordDict.find(root->type)==0 // that is not a keyword + // (to skip forward declaration of class etc.) ) ) ) - { - //printf("Documentation for member `%s' found args=`%s' excp=`%s'\n", - // root->name.data(),root->args.data(),root->exception.data()); - //if (root->relates.length()) printf(" Relates %s\n",root->relates.data()); - //printf("Inside=%s\n Relates=%s\n",root->inside.data(),root->relates.data()); - if (root->type=="friend class" || root->type=="friend struct" || - root->type=="friend union") - { - findMember(root, - root->type+" "+ - root->name, - FALSE,FALSE); - - } - else if (!root->type.isEmpty()) - { - findMember(root, - root->type+" "+ - root->inside+ - root->name+ - root->args+ - root->exception, - FALSE,isFunc); - } - else { - findMember(root, - root->inside+ - root->name+ - root->args+ - root->exception, - FALSE,isFunc); + //printf("Documentation for member `%s' found args=`%s' excp=`%s'\n", + // root->name.data(),root->args.data(),root->exception.data()); + //if (root->relates.length()) printf(" Relates %s\n",root->relates.data()); + //printf("Inside=%s\n Relates=%s\n",root->inside.data(),root->relates.data()); + if (root->type=="friend class" || root->type=="friend struct" || + root->type=="friend union") + { + findMember(rootNav, + root->type+" "+ + root->name, + FALSE,FALSE); + + } + else if (!root->type.isEmpty()) + { + findMember(rootNav, + root->type+" "+ + root->inside+ + root->name+ + root->args+ + root->exception, + FALSE,isFunc); + } + else + { + findMember(rootNav, + root->inside+ + root->name+ + root->args+ + root->exception, + FALSE,isFunc); + } } - } else if (root->section==Entry::DEFINE_SEC && !root->relates.isEmpty()) { - findMember(root,root->name+root->args,FALSE,!root->args.isEmpty()); + findMember(rootNav,root->name+root->args,FALSE,!root->args.isEmpty()); } else if (root->section==Entry::VARIABLEDOC_SEC) { //printf("Documentation for variable %s found\n",root->name.data()); //if (!root->relates.isEmpty()) printf(" Relates %s\n",root->relates.data()); - findMember(root,root->name,FALSE,FALSE); + findMember(rootNav,root->name,FALSE,FALSE); } else { // skip section //printf("skip section\n"); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) +} + +static void findMemberDocumentation(EntryNav *rootNav) +{ + if (rootNav->section()==Entry::MEMBERDOC_SEC || + rootNav->section()==Entry::OVERLOADDOC_SEC || + rootNav->section()==Entry::FUNCTION_SEC || + rootNav->section()==Entry::VARIABLE_SEC || + rootNav->section()==Entry::VARIABLEDOC_SEC || + rootNav->section()==Entry::DEFINE_SEC + ) + { + rootNav->loadEntry(g_storage); + + filterMemberDocumentation(rootNav); + + rootNav->releaseEntry(); + } + if (rootNav->children()) { - if (e->section!=Entry::ENUM_SEC) findMemberDocumentation(e); + EntryNavListIterator eli(*rootNav->children()); + EntryNav *e; + for (;(e=eli.current());++eli) + { + if (e->section()!=Entry::ENUM_SEC) findMemberDocumentation(e); + } } } //---------------------------------------------------------------------- -static void findObjCMethodDefinitions(Entry *root) +static void findObjCMethodDefinitions(EntryNav *rootNav) { - EntryListIterator eli(*root->sublist); - Entry *objCImpl; - for (;(objCImpl=eli.current());++eli) + if (rootNav->children()) { - if (objCImpl->section==Entry::OBJCIMPL_SEC) + EntryNavListIterator eli(*rootNav->children()); + EntryNav *objCImplNav; + for (;(objCImplNav=eli.current());++eli) { - //printf("Found ObjC class implementation %s\n",objCImpl->name.data()); - EntryListIterator seli(*objCImpl->sublist); - Entry *objCMethod; - for (;(objCMethod=seli.current());++seli) + if (objCImplNav->section()==Entry::OBJCIMPL_SEC && objCImplNav->children()) { - if (objCMethod->section==Entry::FUNCTION_SEC) + EntryNavListIterator seli(*objCImplNav->children()); + EntryNav *objCMethodNav; + for (;(objCMethodNav=seli.current());++seli) { - //Printf(" Found ObjC method definition %s\n",objCMethod->name.data()); - findMember(objCMethod, objCMethod->type+" "+objCImpl->name+"::"+objCMethod->name+" "+objCMethod->args, FALSE,TRUE); - objCMethod->section=Entry::EMPTY_SEC; + if (objCMethodNav->section()==Entry::FUNCTION_SEC) + { + objCMethodNav->loadEntry(g_storage); + Entry *objCMethod = objCMethodNav->entry(); + + //Printf(" Found ObjC method definition %s\n",objCMethod->name.data()); + findMember(objCMethodNav, objCMethod->type+" "+objCImplNav->name()+"::"+ + objCMethod->name+" "+objCMethod->args, FALSE,TRUE); + objCMethod->section=Entry::EMPTY_SEC; + + objCMethodNav->releaseEntry(); + } } } } @@ -5788,11 +5883,14 @@ static void findObjCMethodDefinitions(Entry *root) //---------------------------------------------------------------------- // find and add the enumeration to their classes, namespaces or files -static void findEnums(Entry *root) +static void findEnums(EntryNav *rootNav) { - if (root->section==Entry::ENUM_SEC) + if (rootNav->section()==Entry::ENUM_SEC) // non anonymous enumeration { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + MemberDef *md=0; ClassDef *cd=0; FileDef *fd=0; @@ -5814,14 +5912,14 @@ static void findEnums(Entry *root) } else // no scope, check the scope in which the docs where found { - if (( root->parent->section & Entry::SCOPE_MASK ) - && !root->parent->name.isEmpty() + if (( rootNav->parent()->section() & Entry::SCOPE_MASK ) + && !rootNav->parent()->name().isEmpty() ) // found enum docs inside a compound { - scope=root->parent->name; + scope=rootNav->parent()->name(); if ((cd=getClass(scope))==0) nd=getResolvedNamespace(scope); } - name=root->name.copy(); + name=root->name; } if (!root->relates.isEmpty()) @@ -5848,8 +5946,7 @@ static void findEnums(Entry *root) } else // found a global enum { - bool ambig; - fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + fd=rootNav->fileDef(); mnsd=&Doxygen::functionNameSDict; isGlobal=TRUE; } @@ -5862,11 +5959,10 @@ static void findEnums(Entry *root) 0,name,0,0, root->protection,Normal,FALSE,isRelated,MemberDef::Enumeration, 0,0); - md->setTagInfo(root->tagInfo); + md->setTagInfo(rootNav->tagInfo()); if (!isGlobal) md->setMemberClass(cd); else md->setFileDef(fd); md->setBodySegment(root->bodyLine,root->endBodyLine); - bool ambig; - md->setBodyDef(findFileDef(Doxygen::inputNameDict,root->fileName,ambig)); + md->setBodyDef(rootNav->fileDef()); //printf("Enum %s definition at line %d of %s: protection=%d\n", // root->name.data(),root->bodyLine,root->fileName.data(),root->protection); md->addSectionsToDefinition(root->anchors); @@ -5898,11 +5994,9 @@ static void findEnums(Entry *root) if (isGlobal) { if (!defSet) md->setDefinition(name); - if (fd==0 && root->parent) + if (fd==0 && rootNav->parent()) { - bool ambig; - QCString filePathName = root->parent->fileName; - fd=findFileDef(Doxygen::inputNameDict,filePathName,ambig); + fd=rootNav->parent()->fileDef(); } if (fd) { @@ -5945,89 +6039,92 @@ static void findEnums(Entry *root) } addMemberToGroups(root,md); - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) + if (rootNav->children()) { - //printf("e->name=%s isRelated=%d\n",e->name.data(),isRelated); - MemberName *fmn=0; - MemberNameSDict *emnsd = isRelated ? &Doxygen::functionNameSDict : mnsd; - if (!e->name.isEmpty() && (fmn=(*emnsd)[e->name])) - // get list of members with the same name as the field + EntryNavListIterator eli(*rootNav->children()); + EntryNav *e; + for (;(e=eli.current());++eli) { - MemberNameIterator fmni(*fmn); - MemberDef *fmd; - for (fmni.toFirst(); (fmd=fmni.current()) ; ++fmni) + //printf("e->name=%s isRelated=%d\n",e->name.data(),isRelated); + MemberName *fmn=0; + MemberNameSDict *emnsd = isRelated ? &Doxygen::functionNameSDict : mnsd; + if (!e->name().isEmpty() && (fmn=(*emnsd)[e->name()])) + // get list of members with the same name as the field { - if (fmd->isEnumValue()) + MemberNameIterator fmni(*fmn); + MemberDef *fmd; + for (fmni.toFirst(); (fmd=fmni.current()) ; ++fmni) { - //printf("found enum value with same name\n"); - if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') + if (fmd->isEnumValue()) { - NamespaceDef *fnd=fmd->getNamespaceDef(); - if (fnd==nd) // enum value is inside a namespace + //printf("found enum value with same name\n"); + if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') { - md->insertEnumField(fmd); - fmd->setEnumScope(md); + NamespaceDef *fnd=fmd->getNamespaceDef(); + if (fnd==nd) // enum value is inside a namespace + { + md->insertEnumField(fmd); + fmd->setEnumScope(md); + } } - } - else if (isGlobal) - { - FileDef *ffd=fmd->getFileDef(); - if (ffd==fd) // enum value has file scope + else if (isGlobal) { - md->insertEnumField(fmd); - fmd->setEnumScope(md); + FileDef *ffd=fmd->getFileDef(); + if (ffd==fd) // enum value has file scope + { + md->insertEnumField(fmd); + fmd->setEnumScope(md); + } } - } - else if (isRelated && cd) // reparent enum value to - // match the enum's scope - { - md->insertEnumField(fmd); // add field def to list - fmd->setEnumScope(md); // cross ref with enum name - fmd->setEnumClassScope(cd); // cross ref with enum name - fmd->setOuterScope(cd); - fmd->makeRelated(); - cd->insertMember(fmd); - } - else - { - ClassDef *fcd=fmd->getClassDef(); - if (fcd==cd) // enum value is inside a class + else if (isRelated && cd) // reparent enum value to + // match the enum's scope { - //printf("Inserting enum field %s in enum scope %s\n", - // fmd->name().data(),md->name().data()); - md->insertEnumField(fmd); // add field def to list - fmd->setEnumScope(md); // cross ref with enum name + md->insertEnumField(fmd); // add field def to list + fmd->setEnumScope(md); // cross ref with enum name + fmd->setEnumClassScope(cd); // cross ref with enum name + fmd->setOuterScope(cd); + fmd->makeRelated(); + cd->insertMember(fmd); } - } - } + else + { + ClassDef *fcd=fmd->getClassDef(); + if (fcd==cd) // enum value is inside a class + { + //printf("Inserting enum field %s in enum scope %s\n", + // fmd->name().data(),md->name().data()); + md->insertEnumField(fmd); // add field def to list + fmd->setEnumScope(md); // cross ref with enum name + } + } + } + } } } } } + + rootNav->releaseEntry(); } else { - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - findEnums(e); - } + RECURSE_ENTRYTREE(findEnums,rootNav); } } //---------------------------------------------------------------------- // find the documentation blocks for the enumerations -static void findEnumDocumentation(Entry *root) +static void findEnumDocumentation(EntryNav *rootNav) { - if (root->section==Entry::ENUMDOC_SEC - && !root->name.isEmpty() - && root->name[0]!='@' // skip anonymous enums + if (rootNav->section()==Entry::ENUMDOC_SEC + && !rootNav->name().isEmpty() + && rootNav->name().at(0)!='@' // skip anonymous enums ) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + //printf("Found docs for enum with name `%s' in context %s\n", // root->name.data(),root->parent->name.data()); int i; @@ -6043,12 +6140,12 @@ static void findEnumDocumentation(Entry *root) { name=root->name; } - if (( root->parent->section & Entry::SCOPE_MASK ) - && !root->parent->name.isEmpty() + if (( rootNav->parent()->section() & Entry::SCOPE_MASK ) + && !rootNav->parent()->name().isEmpty() ) // found enum docs inside a compound { if (!scope.isEmpty()) scope.prepend("::"); - scope.prepend(root->parent->name); + scope.prepend(rootNav->parent()->name()); } ClassDef *cd=getClass(scope); @@ -6070,7 +6167,7 @@ static void findEnumDocumentation(Entry *root) if (cd && cd->name()==className && md->isEnumerate()) { // documentation outside a compound overrides the documentation inside it - if (!md->documentation() || root->parent->name.isEmpty()) + if (!md->documentation() || rootNav->parent()->name().isEmpty()) { md->setDocumentation(root->doc,root->docFile,root->docLine); md->setDocsForDefinition(!root->proto); @@ -6078,12 +6175,12 @@ static void findEnumDocumentation(Entry *root) // brief descriptions inside a compound override the documentation // outside it - if (!md->briefDescription() || !root->parent->name.isEmpty()) + if (!md->briefDescription() || !rootNav->parent()->name().isEmpty()) { md->setBriefDescription(root->brief,root->briefFile,root->briefLine); } - if (!md->inbodyDocumentation() || !root->parent->name.isEmpty()) + if (!md->inbodyDocumentation() || !rootNav->parent()->name().isEmpty()) { md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine); } @@ -6148,13 +6245,10 @@ static void findEnumDocumentation(Entry *root) ); } } + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - findEnumDocumentation(e); - } + RECURSE_ENTRYTREE(findEnumDocumentation,rootNav); } // seach for each enum (member or function) in mnl if it has documented @@ -6328,8 +6422,8 @@ static void buildCompleteMemberLists() for (cli.toFirst();(cd=cli.current());++cli) { if (// !cd->isReference() && // not an external class - cd->subClasses()->count()==0 && // is a root of the hierarchy - cd->baseClasses()->count()>0) // and has at least one base class + cd->subClasses()==0 && // is a root of the hierarchy + cd->baseClasses()) // and has at least one base class { //printf("*** merging members for %s\n",cd->name().data()); cd->mergeMembers(); @@ -6338,7 +6432,7 @@ static void buildCompleteMemberLists() // now sort the member list of all classes. for (cli.toFirst();(cd=cli.current());++cli) { - cd->memberNameInfoSDict()->sort(); + if (cd->memberNameInfoSDict()) cd->memberNameInfoSDict()->sort(); } } @@ -6792,26 +6886,26 @@ static void flushCachedTemplateRelations() //---------------------------------------------------------------------------- -static void findDefineDocumentation(Entry *root) +static void findDefineDocumentation(EntryNav *rootNav) { - if ((root->section==Entry::DEFINEDOC_SEC || - root->section==Entry::DEFINE_SEC) && !root->name.isEmpty() + if ((rootNav->section()==Entry::DEFINEDOC_SEC || + rootNav->section()==Entry::DEFINE_SEC) && !rootNav->name().isEmpty() ) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + //printf("found define `%s' `%s' brief=`%s' doc=`%s'\n", // root->name.data(),root->args.data(),root->brief.data(),root->doc.data()); - if (root->tagInfo && !root->name.isEmpty()) // define read from a tag file + if (rootNav->tagInfo() && !root->name.isEmpty()) // define read from a tag file { MemberDef *md=new MemberDef("<tagfile>",1, "#define",root->name,root->args,0, Public,Normal,FALSE,FALSE,MemberDef::Define,0,0); - md->setTagInfo(root->tagInfo); - bool ambig; - QCString filePathName = root->parent->fileName; - FileDef *fd=findFileDef(Doxygen::inputNameDict,filePathName,ambig); + md->setTagInfo(rootNav->tagInfo()); //printf("Searching for `%s' fd=%p\n",filePathName.data(),fd); - md->setFileDef(fd); + md->setFileDef(rootNav->parent()->fileDef()); //printf("Adding member=%s\n",md->name().data()); MemberName *mn; if ((mn=Doxygen::functionNameSDict[root->name])) @@ -6858,8 +6952,7 @@ static void findDefineDocumentation(Entry *root) md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine); } md->setBodySegment(root->bodyLine,root->endBodyLine); - bool ambig; - md->setBodyDef(findFileDef(Doxygen::inputNameDict,root->fileName,ambig)); + md->setBodyDef(rootNav->fileDef()); md->addSectionsToDefinition(root->anchors); md->setMaxInitLines(root->initLines); md->setRefItems(root->sli); @@ -6901,8 +6994,7 @@ static void findDefineDocumentation(Entry *root) md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine); } md->setBodySegment(root->bodyLine,root->endBodyLine); - bool ambig; - md->setBodyDef(findFileDef(Doxygen::inputNameDict,root->fileName,ambig)); + md->setBodyDef(rootNav->fileDef()); md->addSectionsToDefinition(root->anchors); md->setRefItems(root->sli); if (root->mGrpId!=-1) md->setMemberGroupId(root->mGrpId); @@ -6936,21 +7028,21 @@ static void findDefineDocumentation(Entry *root) ); } } + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - findDefineDocumentation(e); - } + RECURSE_ENTRYTREE(findDefineDocumentation,rootNav); } //---------------------------------------------------------------------------- -static void findDirDocumentation(Entry *root) +static void findDirDocumentation(EntryNav *rootNav) { - if (root->section == Entry::DIRDOC_SEC) + if (rootNav->section() == Entry::DIRDOC_SEC) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + QCString normalizedName = root->name; normalizedName = substitute(normalizedName,"\\","/"); if (normalizedName.at(normalizedName.length()-1)!='/') @@ -6991,50 +7083,54 @@ static void findDirDocumentation(Entry *root) warn(root->fileName,root->startLine,"Warning: No matching " "directory found for command \\dir %s\n",root->name.data()); } + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - findDirDocumentation(e); - } + RECURSE_ENTRYTREE(findDirDocumentation,rootNav); } //---------------------------------------------------------------------------- // create a (sorted) list of separate documentation pages -static void buildPageList(Entry *root) +static void buildPageList(EntryNav *rootNav) { - if (root->section == Entry::PAGEDOC_SEC) + if (rootNav->section() == Entry::PAGEDOC_SEC) { //printf("buildPageList %s\n",root->name.data()); + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + if (!root->name.isEmpty()) { - addRelatedPage(root); + addRelatedPage(rootNav); } + + rootNav->releaseEntry(); } - else if (root->section == Entry::MAINPAGEDOC_SEC) + else if (rootNav->section() == Entry::MAINPAGEDOC_SEC) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + QCString title=root->args.stripWhiteSpace(); if (title.isEmpty()) title=theTranslator->trMainPage(); addRefItem(root->sli,"page", Config_getBool("GENERATE_TREEVIEW")?"main":"index", title ); + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - buildPageList(e); - } + RECURSE_ENTRYTREE(buildPageList,rootNav); } -static void findMainPage(Entry *root) +static void findMainPage(EntryNav *rootNav) { - if (root->section == Entry::MAINPAGEDOC_SEC) + if (rootNav->section() == Entry::MAINPAGEDOC_SEC) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + if (Doxygen::mainPage==0) { //printf("Found main page! \n======\n%s\n=======\n",root->doc.data()); @@ -7044,7 +7140,7 @@ static void findMainPage(Entry *root) indexName, root->brief+root->doc,title); //setFileNameForSections(root->anchors,"index",Doxygen::mainPage); Doxygen::mainPage->setFileName(indexName); - addPageToContext(Doxygen::mainPage,root); + addPageToContext(Doxygen::mainPage,rootNav); // a page name is a label as well! SectionInfo *si=new SectionInfo( @@ -7062,23 +7158,23 @@ static void findMainPage(Entry *root) "block." ); } + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - findMainPage(e); - } + RECURSE_ENTRYTREE(findMainPage,rootNav); } -static void computePageRelations(Entry *root) +static void computePageRelations(EntryNav *rootNav) { - if ((root->section==Entry::PAGEDOC_SEC || - root->section==Entry::MAINPAGEDOC_SEC + if ((rootNav->section()==Entry::PAGEDOC_SEC || + rootNav->section()==Entry::MAINPAGEDOC_SEC ) - && !root->name.isEmpty() + && !rootNav->name().isEmpty() ) { + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + PageDef *pd = root->section==Entry::PAGEDOC_SEC ? Doxygen::pageSDict->find(root->name) : Doxygen::mainPage; @@ -7097,13 +7193,10 @@ static void computePageRelations(Entry *root) } } } + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - computePageRelations(e); - } + RECURSE_ENTRYTREE(computePageRelations,rootNav); } static void checkPageRelations() @@ -7219,40 +7312,37 @@ static void generatePageDocs() //---------------------------------------------------------------------------- // create a (sorted) list & dictionary of example pages -static void buildExampleList(Entry *root) +static void buildExampleList(EntryNav *rootNav) { - if (root->section == Entry::EXAMPLE_SEC) + if (rootNav->section()==Entry::EXAMPLE_SEC && !rootNav->name().isEmpty()) { - if (!root->name.isEmpty()) + rootNav->loadEntry(g_storage); + Entry *root = rootNav->entry(); + + if (Doxygen::exampleSDict->find(root->name)) { - if (Doxygen::exampleSDict->find(root->name)) - { - warn(root->fileName,root->startLine, - "Warning: Example %s was already documented. Ignoring " - "documentation found here.", - root->name.data() - ); - } - else - { - PageDef *pd=new PageDef(root->fileName,root->startLine, - root->name,root->brief+root->doc,root->args); - pd->setFileName(convertNameToFile(pd->name()+"-example")); - pd->addSectionsToDefinition(root->anchors); - //pi->addSections(root->anchors); - - Doxygen::exampleSDict->inSort(root->name,pd); - //we don't add example to groups - //addExampleToGroups(root,pd); - } + warn(root->fileName,root->startLine, + "Warning: Example %s was already documented. Ignoring " + "documentation found here.", + root->name.data() + ); } + else + { + PageDef *pd=new PageDef(root->fileName,root->startLine, + root->name,root->brief+root->doc,root->args); + pd->setFileName(convertNameToFile(pd->name()+"-example")); + pd->addSectionsToDefinition(root->anchors); + //pi->addSections(root->anchors); + + Doxygen::exampleSDict->inSort(root->name,pd); + //we don't add example to groups + //addExampleToGroups(root,pd); + } + + rootNav->releaseEntry(); } - EntryListIterator eli(*root->sublist); - Entry *e; - for (;(e=eli.current());++eli) - { - buildExampleList(e); - } + RECURSE_ENTRYTREE(buildExampleList,rootNav); } //---------------------------------------------------------------------------- @@ -7605,6 +7695,7 @@ static void readTagFile(Entry *root,const char *tl) msg("Reading tag file `%s'...\n",fileName.data()); parseTagFile(root,fi.absFilePath(),fi.fileName()); + } //---------------------------------------------------------------------------- @@ -7739,9 +7830,8 @@ static void copyStyleSheet() } } -static void parseFiles(Entry *root) +static void parseFiles(Entry *root,EntryNav *rootNav) { - QCString *s=inputFiles.first(); while (s) { @@ -7771,16 +7861,26 @@ static void parseFiles(Entry *root) BufStr convBuf(bufPtr->curPos()+1024); + // convert multi-line C++ comments to C style comments convertCppComments(&preBuf,&convBuf,fileName); convBuf.addChar('\0'); + // use language parse to parse the file parser->parseInput(fileName,convBuf.data(),root); + // store the Entry tree in a file and create an index to + // navigate/load entries + bool ambig; + FileDef *fd=findFileDef(Doxygen::inputNameDict,fileName,ambig); + ASSERT(fd!=0); + root->createNavigationIndex(rootNav,g_storage,fd); + s=inputFiles.next(); } } + //---------------------------------------------------------------------------- // Read all files matching at least one pattern in `patList' in the // directory represented by `fi'. @@ -7803,7 +7903,7 @@ static int readDir(QFileInfo *fi, QDir dir((const char *)fi->absFilePath()); dir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden ); int totalSize=0; - //printf("readDir `%s'\n",fi->absFilePath().data()); + msg("Search for files in directory %s\n", fi->absFilePath().data()); //printf("killDict=%p count=%d\n",killDict,killDict->count()); const QFileInfoList *list = dir.entryInfoList(); @@ -8645,8 +8745,10 @@ void parseInput() if (path.at(l-1)=='\\' || path.at(l-1)=='/') path=path.left(l-1); inputSize+=readFileOrDirectory( - path,&Doxygen::inputNameList, - Doxygen::inputNameDict,&excludeNameDict, + path, + &Doxygen::inputNameList, + Doxygen::inputNameDict, + &excludeNameDict, &Config_getList("FILE_PATTERNS"), &Config_getList("EXCLUDE_PATTERNS"), &inputFiles,0, @@ -8673,21 +8775,6 @@ void parseInput() readAliases(); /************************************************************************** - * Handle Tag Files * - **************************************************************************/ - - Entry *root=new Entry; - msg("Reading and parsing tag files\n"); - - QStrList &tagFileList = Config_getList("TAGFILES"); - s=tagFileList.first(); - while (s) - { - readTagFile(root,s); - s=tagFileList.next(); - } - - /************************************************************************** * Check/create output directorties * **************************************************************************/ @@ -8706,7 +8793,6 @@ void parseInput() { err("Error: tag OUTPUT_DIRECTORY: Output directory `%s' does not " "exist and cannot be created\n",outputDirectory.data()); - delete root; cleanUpDoxygen(); exit(1); } @@ -8734,7 +8820,6 @@ void parseInput() if (generateHtml && !htmlDir.exists() && !htmlDir.mkdir(htmlOutput)) { err("Could not create output directory %s\n",htmlOutput.data()); - delete root; cleanUpDoxygen(); exit(1); } @@ -8753,7 +8838,6 @@ void parseInput() if (generateXml && !xmlDir.exists() && !xmlDir.mkdir(xmlOutput)) { err("Could not create output directory %s\n",xmlOutput.data()); - delete root; cleanUpDoxygen(); exit(1); } @@ -8772,7 +8856,6 @@ void parseInput() if (generateLatex && !latexDir.exists() && !latexDir.mkdir(latexOutput)) { err("Could not create output directory %s\n",latexOutput.data()); - delete root; cleanUpDoxygen(); exit(1); } @@ -8791,7 +8874,6 @@ void parseInput() if (generateRtf && !rtfDir.exists() && !rtfDir.mkdir(rtfOutput)) { err("Could not create output directory %s\n",rtfOutput.data()); - delete root; cleanUpDoxygen(); exit(1); } @@ -8810,7 +8892,6 @@ void parseInput() if (generateMan && !manDir.exists() && !manDir.mkdir(manOutput)) { err("Could not create output directory %s\n",manOutput.data()); - delete root; cleanUpDoxygen(); exit(1); } @@ -8822,44 +8903,81 @@ void parseInput() readFormulaRepository(); } - parseFiles(root); + /************************************************************************** + * Handle Tag Files * + **************************************************************************/ + + g_storage.setName(outputDirectory+"/doxygen_entrydb.tmp"); + if (!g_storage.open(IO_WriteOnly)) + { + err("Failed to create temporary storage file %s/doxygen_entrydb.tmp", + outputDirectory.data()); + exit(1); + } + Entry *root=new Entry; + EntryNav *rootNav = new EntryNav(0,root); + rootNav->setEntry(root); + msg("Reading and parsing tag files\n"); + + QStrList &tagFileList = Config_getList("TAGFILES"); + s=tagFileList.first(); + while (s) + { + readTagFile(root,s); + root->createNavigationIndex(rootNav,g_storage,0); + s=tagFileList.next(); + } + + /************************************************************************** + * Parse source files * + **************************************************************************/ + + parseFiles(root,rootNav); + g_storage.close(); + if (!g_storage.open(IO_ReadOnly)) + { + err("Failed to open temporary storage file %s/doxygen_entrydb.tmp for reading", + outputDirectory.data()); + exit(1); + } /************************************************************************** * Gather information * **************************************************************************/ msg("Building group list...\n"); - buildGroupList(root); - organizeSubGroups(root); + buildGroupList(rootNav); + organizeSubGroups(rootNav); msg("Building directory list...\n"); buildDirectories(); - findDirDocumentation(root); - + findDirDocumentation(rootNav); + if (Config_getBool("BUILTIN_STL_SUPPORT")) { - addSTLClasses(root); + addSTLClasses(rootNav); } msg("Building namespace list...\n"); - buildNamespaceList(root); - findUsingDirectives(root); + buildNamespaceList(rootNav); + findUsingDirectives(rootNav); + msg("Building file list...\n"); - buildFileList(root); + buildFileList(rootNav); //generateFileTree(); msg("Searching for included using directives...\n"); findIncludedUsingDirectives(); msg("Building class list...\n"); - buildClassList(root); + buildClassList(rootNav); msg("Associating documentation with classes...\n"); - buildClassDocList(root); + buildClassDocList(rootNav); // build list of using declarations here (global list) - buildListOfUsingDecls(root); + buildListOfUsingDecls(rootNav); msg("Computing nesting relations for classes...\n"); resolveClassNestingRelations(); @@ -8872,27 +8990,26 @@ void parseInput() g_usingDeclarations.clear(); msg("Searching for members imported via using declarations...\n"); - findUsingDeclImports(root); - - findUsingDeclarations(root); + findUsingDeclImports(rootNav); + findUsingDeclarations(rootNav); msg("Building example list...\n"); - buildExampleList(root); + buildExampleList(rootNav); msg("Searching for documented variables...\n"); - buildVarList(root); + buildVarList(rootNav); msg("Building member list...\n"); // using class info only ! - buildFunctionList(root); + buildFunctionList(rootNav); msg("Searching for friends...\n"); findFriends(); msg("Searching for documented defines...\n"); - findDefineDocumentation(root); + findDefineDocumentation(rootNav); msg("Computing template instances...\n"); - findClassEntries(root); + findClassEntries(rootNav); findInheritedTemplateInstances(); findUsedTemplateInstances(); @@ -8908,27 +9025,28 @@ void parseInput() classEntries.clear(); msg("Searching for enumerations...\n"); - findEnums(root); - findEnumDocumentation(root); + findEnums(rootNav); + findEnumDocumentation(rootNav); msg("Searching for member function documentation...\n"); - findObjCMethodDefinitions(root); - findMemberDocumentation(root); // may introduce new members ! + findObjCMethodDefinitions(rootNav); + findMemberDocumentation(rootNav); // may introduce new members ! + transferRelatedFunctionDocumentation(); transferFunctionDocumentation(); msg("Building page list...\n"); - buildPageList(root); + buildPageList(rootNav); msg("Search for main page...\n"); - findMainPage(root); + findMainPage(rootNav); msg("Computing page relations...\n"); - computePageRelations(root); + computePageRelations(rootNav); checkPageRelations(); msg("Determining the scope of groups...\n"); - findGroupScope(root); + findGroupScope(rootNav); msg("Sorting lists...\n"); Doxygen::memberNameSDict.sort(); @@ -8937,7 +9055,11 @@ void parseInput() Doxygen::classSDict.sort(); msg("Freeing entry tree\n"); - delete root; + delete rootNav; + g_storage.close(); + + QDir thisDir; + thisDir.remove(outputDirectory+"/doxygen_entrydb.tmp"); msg("Determining which enums are documented\n"); findDocumentedEnumValues(); diff --git a/src/doxygen.css b/src/doxygen.css index 2691c25..c7db1a8 100644 --- a/src/doxygen.css +++ b/src/doxygen.css @@ -341,6 +341,7 @@ HR { height: 1px; .paramname { color: #602020; font-style: italic; + white-space: nowrap; } /* End Styling for detailed member documentation */ diff --git a/src/doxygen_css.h b/src/doxygen_css.h index b9a0a8b..7679514 100644 --- a/src/doxygen_css.h +++ b/src/doxygen_css.h @@ -341,6 +341,7 @@ ".paramname {\n" " color: #602020;\n" " font-style: italic;\n" +" white-space: nowrap;\n" "}\n" "/* End Styling for detailed member documentation */\n" "\n" @@ -355,4 +356,3 @@ ".directory p { margin: 0px; white-space: nowrap; }\n" ".directory div { display: none; margin: 0px; }\n" ".directory img { vertical-align: -30%; }\n" -"\n" diff --git a/src/entry.cpp b/src/entry.cpp index 66d6d9f..61de661 100644 --- a/src/entry.cpp +++ b/src/entry.cpp @@ -15,6 +15,7 @@ * */ +#include <qfile.h> #include "entry.h" #include "util.h" #include "section.h" @@ -24,10 +25,10 @@ int Entry::num=0; Entry::Entry() { num++; - parent=0; + m_parent=0; section = EMPTY_SEC; - sublist = new QList<Entry>; - sublist->setAutoDelete(TRUE); + m_sublist = new QList<Entry>; + m_sublist->setAutoDelete(TRUE); extends = new QList<BaseInfo>; extends->setAutoDelete(TRUE); groups = new QList<Grouping>; @@ -55,7 +56,7 @@ Entry::Entry(const Entry &e) stat = e.stat; explicitExternal = e.explicitExternal; virt = e.virt; - parent = e.parent; + m_parent = e.m_parent; type = e.type.copy(); name = e.name.copy(); args = e.args.copy(); @@ -91,8 +92,8 @@ Entry::Entry(const Entry &e) objc = e.objc; tagInfo = e.tagInfo; hidden = e.hidden; - sublist = new QList<Entry>; - sublist->setAutoDelete(TRUE); + m_sublist = new QList<Entry>; + m_sublist->setAutoDelete(TRUE); extends = new QList<BaseInfo>; extends->setAutoDelete(TRUE); groups = new QList<Grouping>; @@ -104,11 +105,11 @@ Entry::Entry(const Entry &e) groupDocType = e.groupDocType; // deep copy of the child entry list - QListIterator<Entry> eli(*e.sublist); + QListIterator<Entry> eli(*e.m_sublist); Entry *cur; for (;(cur=eli.current());++eli) { - sublist->append(new Entry(*cur)); + m_sublist->append(new Entry(*cur)); } // deep copy base class list @@ -172,7 +173,9 @@ Entry::~Entry() { //printf("Deleting entry %d name %s type %x children %d\n", // num,name.data(),section,sublist->count()); - delete sublist; + + //delete sublist; // each element is now own by a EntryNav so we do no longer own + // our children. delete extends; delete groups; delete anchors; @@ -191,8 +194,8 @@ void Entry::addSubEntry(Entry *current) // name.data(),section); //printf("Entry::addSubEntry(%s:%p) to %s\n",current->name.data(), // current,name.data()); - current->parent=this; - sublist->append(current); + current->m_parent=this; + m_sublist->append(current); } void Entry::reset() @@ -238,7 +241,7 @@ void Entry::reset() subGrouping = TRUE; protection = Public; groupDocType = GROUPDOC_NORMAL; - sublist->clear(); + m_sublist->clear(); extends->clear(); groups->clear(); anchors->clear(); @@ -255,6 +258,45 @@ int Entry::getSize() return sizeof(Entry); } +void Entry::createSubtreeIndex(EntryNav *nav,QFile &storage,FileDef *fd) +{ + EntryNav *childNav = new EntryNav(nav,this); + nav->addChild(childNav); + childNav->setFileDef(fd); + childNav->saveEntry(this,storage); + if (m_sublist) + { + //printf("saveEntry: %d children\n",node->sublist->count()); + QListIterator<Entry> eli(*m_sublist); + Entry *childNode; + for (eli.toFirst();(childNode=eli.current());++eli) + { + childNode->createSubtreeIndex(childNav,storage,fd); + } + m_sublist->clear(); + } +} + +void Entry::createNavigationIndex(EntryNav *rootNav,QFile &storage,FileDef *fd) +{ + if (m_sublist) + { + //printf("saveEntries: %d children\n",root->sublist->count()); + // store all child entries of root, but keep the navigation info (=index) + QListIterator<Entry> eli(*m_sublist); + Entry *e; + for (eli.toFirst();(e=eli.current());++eli) + { + createSubtreeIndex(rootNav,storage,fd); + } + // remove all entries from root + m_sublist->clear(); + } +} + + + + /*! the argument list is documented if one of its * arguments is documented */ @@ -283,3 +325,524 @@ void Entry::addSpecialListItem(const char *listName,int itemId) sli->append(ili); } +//------------------------------------------------------------------ + +#define NULL_LIST 0xffffffff + +void marshalInt(QFile &f,int v) +{ + uchar b[4]; + b[0]=((uint)v)>>24; + b[1]=(((uint)v)>>16)&0xff; + b[2]=(((uint)v)>>8)&0xff; + b[3]=v&0xff; + f.writeBlock((const char *)b,4); +} + +void marshalUInt(QFile &f,uint v) +{ + uchar b[4]; + b[0]=v>>24; + b[1]=(v>>16)&0xff; + b[2]=(v>>8)&0xff; + b[3]=v&0xff; + f.writeBlock((const char *)b,4); +} + +void marshalBool(QFile &f,bool b) +{ + char c = b; + f.writeBlock(&c,sizeof(char)); +} + +void marshalQCString(QFile &f,const QCString &s) +{ + uint l=s.length(); + marshalUInt(f,l); + if (l>0) f.writeBlock(s.data(),l); +} + +void marshalArgumentList(QFile &f,ArgumentList *argList) +{ + if (argList==0) + { + marshalUInt(f,NULL_LIST); // null pointer representation + } + else + { + marshalUInt(f,argList->count()); + ArgumentListIterator ali(*argList); + Argument *a; + for (ali.toFirst();(a=ali.current());++ali) + { + marshalQCString(f,a->attrib); + marshalQCString(f,a->type); + marshalQCString(f,a->canType); + marshalQCString(f,a->name); + marshalQCString(f,a->array); + marshalQCString(f,a->defval); + marshalQCString(f,a->docs); + } + marshalBool(f,argList->constSpecifier); + marshalBool(f,argList->volatileSpecifier); + marshalBool(f,argList->pureSpecifier); + } +} + +void marshalArgumentLists(QFile &f,QList<ArgumentList> *argLists) +{ + if (argLists==0) + { + marshalUInt(f,NULL_LIST); // null pointer representation + } + else + { + marshalUInt(f,argLists->count()); + QListIterator<ArgumentList> ali(*argLists); + ArgumentList *al; + for (ali.toFirst();(al=ali.current());++ali) + { + marshalArgumentList(f,al); + } + } +} + +void marshalBaseInfoList(QFile &f, QList<BaseInfo> *baseList) +{ + if (baseList==0) + { + marshalUInt(f,NULL_LIST); // null pointer representation + } + else + { + marshalUInt(f,baseList->count()); + QListIterator<BaseInfo> bli(*baseList); + BaseInfo *bi; + for (bli.toFirst();(bi=bli.current());++bli) + { + marshalQCString(f,bi->name); + marshalInt(f,(int)bi->prot); + marshalInt(f,(int)bi->virt); + } + } +} + +void marshalGroupingList(QFile &f, QList<Grouping> *groups) +{ + if (groups==0) + { + marshalUInt(f,NULL_LIST); // null pointer representation + } + else + { + marshalUInt(f,groups->count()); + QListIterator<Grouping> gli(*groups); + Grouping *g; + for (gli.toFirst();(g=gli.current());++gli) + { + marshalQCString(f,g->groupname); + marshalInt(f,(int)g->pri); + } + } +} + +void marshalSectionInfoList(QFile &f, QList<SectionInfo> *anchors) +{ + if (anchors==0) + { + marshalUInt(f,NULL_LIST); // null pointer representation + } + else + { + marshalUInt(f,anchors->count()); + QListIterator<SectionInfo> sli(*anchors); + SectionInfo *si; + for (sli.toFirst();(si=sli.current());++sli) + { + marshalQCString(f,si->label); + marshalQCString(f,si->title); + marshalQCString(f,si->ref); + marshalInt(f,(int)si->type); + marshalQCString(f,si->fileName); + } + } +} + +void marshalItemInfoList(QFile &f, QList<ListItemInfo> *sli) +{ + if (sli==0) + { + marshalUInt(f,NULL_LIST); // null pointer representation + } + else + { + marshalUInt(f,sli->count()); + QListIterator<ListItemInfo> liii(*sli); + ListItemInfo *lii; + for (liii.toFirst();(lii=liii.current());++liii) + { + marshalQCString(f,lii->type); + marshalInt(f,lii->itemId); + } + } +} + +//------------------------------------------------------------------ + +int unmarshalInt(QFile &f) +{ + uchar b[4]; + f.readBlock((char *)b,4); + int result=(int)((((uint)b[0])<<24)+((uint)b[1]<<16)+((uint)b[2]<<8)+(uint)b[3]); + //printf("unmarshalInt: %x %x %x %x: %x offset=%llx\n",b[0],b[1],b[2],b[3],result,f.pos()); + return result; +} + +uint unmarshalUInt(QFile &f) +{ + uchar b[4]; + f.readBlock((char *)b,4); + uint result=(((uint)b[0])<<24)+((uint)b[1]<<16)+((uint)b[2]<<8)+(uint)b[3]; + //printf("unmarshalUInt: %x %x %x %x: %x offset=%llx\n",b[0],b[1],b[2],b[3],result,f.pos()); + return result; +} + +bool unmarshalBool(QFile &f) +{ + char result; + f.readBlock(&result,sizeof(result)); + //printf("unmarshalBool: %x offset=%llx\n",result,f.pos()); + return result; +} + +QCString unmarshalQCString(QFile &f) +{ + uint len = unmarshalUInt(f); + //printf("unmarshalQCString: len=%d offset=%llx\n",len,f.pos()); + QCString result(len+1); + result.at(len)='\0'; + if (len>0) + { + f.readBlock(result.data(),len); + } + //printf("unmarshalQCString: result=%s\n",result.data()); + return result; +} + +ArgumentList *unmarshalArgumentList(QFile &f) +{ + uint i; + uint count = unmarshalUInt(f); + if (count==NULL_LIST) return 0; // null list + ArgumentList *result = new ArgumentList; + //printf("unmarshalArgumentList: %d\n",count); + for (i=0;i<count;i++) + { + Argument *a = new Argument; + a->attrib = unmarshalQCString(f); + a->type = unmarshalQCString(f); + a->canType = unmarshalQCString(f); + a->name = unmarshalQCString(f); + a->array = unmarshalQCString(f); + a->defval = unmarshalQCString(f); + a->docs = unmarshalQCString(f); + result->append(a); + } + result->constSpecifier = unmarshalBool(f); + result->volatileSpecifier = unmarshalBool(f); + result->pureSpecifier = unmarshalBool(f); + return result; +} + +QList<ArgumentList> *unmarshalArgumentLists(QFile &f) +{ + uint i; + uint count = unmarshalUInt(f); + if (count==NULL_LIST) return 0; // null list + QList<ArgumentList> *result = new QList<ArgumentList>; + //printf("unmarshalArgumentLists: %d\n",count); + for (i=0;i<count;i++) + { + result->append(unmarshalArgumentList(f)); + } + return result; +} + +QList<BaseInfo> *unmarshalBaseInfoList(QFile &f) +{ + uint i; + uint count = unmarshalUInt(f); + if (count==NULL_LIST) return 0; // null list + QList<BaseInfo> *result = new QList<BaseInfo>; + for (i=0;i<count;i++) + { + QCString name = unmarshalQCString(f); + Protection prot = (Protection)unmarshalInt(f); + Specifier virt = (Specifier)unmarshalInt(f); + result->append(new BaseInfo(name,prot,virt)); + } + return result; +} + +QList<Grouping> *unmarshalGroupingList(QFile &f) +{ + uint i; + uint count = unmarshalUInt(f); + if (count==NULL_LIST) return 0; // null list + QList<Grouping> *result = new QList<Grouping>; + for (i=0;i<count;i++) + { + QCString name = unmarshalQCString(f); + Grouping::GroupPri_t prio = (Grouping::GroupPri_t)unmarshalInt(f); + result->append(new Grouping(name,prio)); + } + return result; +} + +QList<SectionInfo> *unmarshalSectionInfoList(QFile &f) +{ + uint i; + uint count = unmarshalUInt(f); + if (count==NULL_LIST) return 0; // null list + QList<SectionInfo> *result = new QList<SectionInfo>; + for (i=0;i<count;i++) + { + QCString label = unmarshalQCString(f); + QCString title = unmarshalQCString(f); + QCString ref = unmarshalQCString(f); + SectionInfo::SectionType type = (SectionInfo::SectionType)unmarshalInt(f); + QCString fileName = unmarshalQCString(f); + result->append(new SectionInfo(fileName,label,title,type,ref)); + } + return result; +} + +QList<ListItemInfo> *unmarshalItemInfoList(QFile &f) +{ + uint i; + uint count = unmarshalUInt(f); + if (count==NULL_LIST) return 0; // null list + QList<ListItemInfo> *result = new QList<ListItemInfo>; + for (i=0;i<count;i++) + { + ListItemInfo *lii = new ListItemInfo; + lii->type = unmarshalQCString(f); + lii->itemId = unmarshalInt(f); + result->append(lii); + } + return result; +} + +//------------------------------------------------------------------ + +#define HEADER ('D'<<24)+('O'<<16)+('X'<<8)+'!' + +bool saveEntry(Entry *e,QFile &f) +{ + marshalUInt(f,HEADER); + marshalInt(f,(int)e->protection); + marshalInt(f,(int)e->mtype); + marshalInt(f,e->memSpec); + marshalInt(f,e->initLines); + marshalBool(f,e->stat); + marshalBool(f,e->explicitExternal); + marshalBool(f,e->proto); + marshalBool(f,e->subGrouping); + marshalBool(f,e->callGraph); + marshalBool(f,e->callerGraph); + marshalInt(f,(int)e->virt); + marshalQCString(f,e->args); + marshalQCString(f,e->bitfields); + marshalArgumentList(f,e->argList); + marshalArgumentLists(f,e->tArgLists); + marshalQCString(f,e->program); + marshalQCString(f,e->initializer); + marshalQCString(f,e->includeFile); + marshalQCString(f,e->includeName); + marshalQCString(f,e->doc); + marshalInt(f,e->docLine); + marshalQCString(f,e->docFile); + marshalQCString(f,e->brief); + marshalInt(f,e->briefLine); + marshalQCString(f,e->briefFile); + marshalQCString(f,e->inbodyDocs); + marshalInt(f,e->inbodyLine); + marshalQCString(f,e->inbodyFile); + marshalQCString(f,e->relates); + marshalBool(f,e->relatesDup); + marshalQCString(f,e->read); + marshalQCString(f,e->write); + marshalQCString(f,e->inside); + marshalQCString(f,e->exception); + marshalInt(f,e->bodyLine); + marshalInt(f,e->endBodyLine); + marshalInt(f,e->mGrpId); + marshalBaseInfoList(f,e->extends); + marshalGroupingList(f,e->groups); + marshalSectionInfoList(f,e->anchors); + marshalQCString(f,e->fileName); + marshalInt(f,e->startLine); + marshalItemInfoList(f,e->sli); + marshalBool(f,e->objc); + marshalBool(f,e->hidden); + marshalInt(f,(int)e->groupDocType); + return TRUE; +} + +bool loadEntry(Entry *e,QFile &f) +{ + uint header=unmarshalUInt(f); + if (header!=HEADER) + { + printf("Internal error: Invalid header for entry in storage file: %x. Disk full?\n",header); + exit(1); + } + e->protection = (Protection)unmarshalInt(f); + e->mtype = (MethodTypes)unmarshalInt(f); + e->memSpec = unmarshalInt(f); + e->initLines = unmarshalInt(f); + e->stat = unmarshalBool(f); + e->explicitExternal = unmarshalBool(f); + e->proto = unmarshalBool(f); + e->subGrouping = unmarshalBool(f); + e->callGraph = unmarshalBool(f); + e->callerGraph = unmarshalBool(f); + e->virt = (Specifier)unmarshalInt(f); + e->args = unmarshalQCString(f); + e->bitfields = unmarshalQCString(f); + e->argList = unmarshalArgumentList(f); + e->tArgLists = unmarshalArgumentLists(f); + e->program = unmarshalQCString(f); + e->initializer = unmarshalQCString(f); + e->includeFile = unmarshalQCString(f); + e->includeName = unmarshalQCString(f); + e->doc = unmarshalQCString(f); + e->docLine = unmarshalInt(f); + e->docFile = unmarshalQCString(f); + e->brief = unmarshalQCString(f); + e->briefLine = unmarshalInt(f); + e->briefFile = unmarshalQCString(f); + e->inbodyDocs = unmarshalQCString(f); + e->inbodyLine = unmarshalInt(f); + e->inbodyFile = unmarshalQCString(f); + e->relates = unmarshalQCString(f); + e->relatesDup = unmarshalBool(f); + e->read = unmarshalQCString(f); + e->write = unmarshalQCString(f); + e->inside = unmarshalQCString(f); + e->exception = unmarshalQCString(f); + e->bodyLine = unmarshalInt(f); + e->endBodyLine = unmarshalInt(f); + e->mGrpId = unmarshalInt(f); + e->extends = unmarshalBaseInfoList(f); + e->groups = unmarshalGroupingList(f); + e->anchors = unmarshalSectionInfoList(f); + e->fileName = unmarshalQCString(f); + e->startLine = unmarshalInt(f); + e->sli = unmarshalItemInfoList(f); + e->objc = unmarshalBool(f); + e->hidden = unmarshalBool(f); + e->groupDocType = (Entry::GroupDocType)unmarshalInt(f); + return TRUE; +} + +EntryNav::EntryNav(EntryNav *parent, Entry *e) + : m_parent(parent), m_subList(0), m_section(e->section), m_type(e->type), + m_name(e->name), m_fileDef(0), m_info(0), m_offset(-1), + m_noLoad(FALSE) +{ + if (e->tagInfo) + { + m_tagInfo = new TagInfo; + m_tagInfo->tagName = e->tagInfo->tagName; + m_tagInfo->fileName = e->tagInfo->fileName; + m_tagInfo->anchor = e->tagInfo->anchor; + if (e->tagInfo) + { + //printf("tagInfo %p: tagName=%s fileName=%s anchor=%s\n", + // e->tagInfo, + // e->tagInfo->tagName.data(), + // e->tagInfo->fileName.data(), + // e->tagInfo->anchor.data()); + } + } + else + { + m_tagInfo = 0; + } +} + +EntryNav::~EntryNav() +{ + delete m_subList; + delete m_info; + delete m_tagInfo; +} + +void EntryNav::addChild(EntryNav *e) +{ + if (m_subList==0) + { + m_subList = new QList<EntryNav>; + m_subList->setAutoDelete(TRUE); + } + m_subList->append(e); +} + +bool EntryNav::loadEntry(QFile &storage) +{ + if (m_noLoad) + { + return TRUE; + } + if (m_offset==-1) + { + //printf("offset not set!\n"); + return FALSE; + } + //delete m_info; + if (m_info==0) m_info = new Entry; + //printf("EntryNav::loadEntry: new entry %p: %s\n",m_info,m_name.data()); + m_info->name = m_name; + m_info->type = m_type; + m_info->section = m_section; + //m_info->tagInfo = m_tagInfo; + //if (m_parent) + //{ + // m_info->parent = m_parent->m_info; + //} + //m_info->parent = 0; + //printf("load entry: seek to %llx\n",m_offset); + if (!storage.seek(m_offset)) + { + //printf("seek failed!\n"); + return FALSE; + } + return ::loadEntry(m_info,storage); +} + +bool EntryNav::saveEntry(Entry *e,QFile &storage) +{ + m_offset = storage.pos(); + //printf("EntryNav::saveEntry offset=%llx\n",m_offset); + return ::saveEntry(e,storage); +} + +void EntryNav::releaseEntry() +{ + if (!m_noLoad) + { + delete m_info; + //printf("EntryNav::releaseEntry %p\n",m_info); + m_info=0; + } +} + +void EntryNav::setEntry(Entry *e) +{ + delete m_info; + m_info = e; + //printf("EntryNav::setEntry %p\n",e); + m_noLoad=TRUE; +} + diff --git a/src/entry.h b/src/entry.h index c8c6dfd..7cf6615 100644 --- a/src/entry.h +++ b/src/entry.h @@ -22,6 +22,9 @@ #include <qlist.h> struct SectionInfo; +class QFile; +class EntryNav; +class FileDef; enum Protection { Public, Protected, Private, Package } ; enum Specifier { Normal, Virtual, Pure } ; @@ -246,35 +249,53 @@ class Entry Final = 0x0080, Abstract = 0x0100, }; + enum GroupDocType + { + GROUPDOC_NORMAL, //!< defgroup + GROUPDOC_ADD, //!< addgroup + GROUPDOC_WEAK //!< weakgroup + }; //!< kind of group + Entry(); Entry(const Entry &); ~Entry(); int getSize(); void addSpecialListItem(const char *listName,int index); + void createNavigationIndex(EntryNav *rootNav,QFile &storage,FileDef *fd); + + // while parsing a file these function can be used to navigate/build the tree + void setParent(Entry *parent) { m_parent = parent; } + Entry *parent() const { return m_parent; } + const QList<Entry> *children() const { return m_sublist; } /*! Adds entry \e as a child to this entry */ void addSubEntry (Entry* e) ; /*! Restore the state of this Entry to the default value it has * at construction time. */ - void reset(); + void reset(); + + public: + + // identification + int section; //!< entry type (see Sections); + QCString type; //!< member type + QCString name; //!< member name + TagInfo *tagInfo; //!< tag file info - int section; //!< entry type (see Sections); + // content Protection protection; //!< class protection MethodTypes mtype; //!< signal, slot, (dcop) method, or property? + int memSpec; //!< member specifiers + int initLines; //!< define/variable initializer lines to show bool stat; //!< static ? bool explicitExternal; //!< explicitly defined as external? bool proto; //!< prototype ? - int memSpec; //!< member specifiers - int initLines; //!< define/variable initializer lines to show bool subGrouping; //!< automatically group class members? bool callGraph; //!< do we need to draw the call graph? bool callerGraph; //!< do we need to draw the caller graph? Specifier virt; //!< virtualness of the entry - Entry *parent; //!< parent node in the tree - QCString type; //!< member type - QCString name; //!< member name QCString args; //!< member argument string QCString bitfields; //!< member's bit fields ArgumentList *argList; //!< member arguments as a list @@ -301,23 +322,18 @@ class Entry int bodyLine; //!< line number of the definition in the source int endBodyLine; //!< line number where the definition ends int mGrpId; //!< member group id - QList<Entry> *sublist; //!< entries that are children of this one QList<BaseInfo> *extends; //!< list of base classes QList<Grouping> *groups; //!< list of groups this entry belongs to QList<SectionInfo> *anchors; //!< list of anchors defined in this entry QCString fileName; //!< file this entry was extracted from int startLine; //!< start line of entry in the source QList<ListItemInfo> *sli; //!< special lists (test/todo/bug/deprecated/..) this entry is in - TagInfo *tagInfo; //!< tag file info - static int num; //!< counts the total number of entries bool objc; //!< Objective-C construct - bool hidden; //!< does this represent an entity this is hidden from the output - enum - { - GROUPDOC_NORMAL, //!< defgroup - GROUPDOC_ADD, //!< addgroup - GROUPDOC_WEAK //!< weakgroup - } groupDocType; //!< kind of group + bool hidden; //!< does this represent an entity that is hidden from the output + GroupDocType groupDocType; + + static int num; //!< counts the total number of entries + /// return the command name used to define GROUPDOC_SEC const char *groupDocCmd() const { @@ -343,11 +359,59 @@ class Entry default: return Grouping::GROUPING_LOWEST; } } - private: + + private: + void createSubtreeIndex(EntryNav *nav,QFile &storage,FileDef *fd); + Entry *m_parent; //!< parent node in the tree + QList<Entry> *m_sublist; //!< entries that are children of this one Entry &operator=(const Entry &); -} ; +}; + +class EntryNav +{ + public: + EntryNav(EntryNav *parent,Entry *e); + ~EntryNav(); + void addChild(EntryNav *); + bool loadEntry(QFile &storage); + bool saveEntry(Entry *e,QFile &storage); + void setEntry(Entry *e); + void releaseEntry(); + void changeSection(int section) { m_section = section; } + void setFileDef(FileDef *fd) { m_fileDef = fd; } + + Entry *entry() const { return m_info; } + int section() const { return m_section; } + const QCString &type() const { return m_type; } + const QCString &name() const { return m_name; } + TagInfo *tagInfo() const { return m_tagInfo; } + const QList<EntryNav> *children() const { return m_subList; } + EntryNav *parent() const { return m_parent; } + FileDef *fileDef() const { return m_fileDef; } + + private: + + // navigation + EntryNav *m_parent; //!< parent node in the tree + QList<EntryNav> *m_subList; //!< entries that are children of this one + + // identification + int m_section; //!< entry type (see Sections); + QCString m_type; //!< member type + QCString m_name; //!< member name + TagInfo *m_tagInfo; //!< tag file info + FileDef *m_fileDef; + + Entry *m_info; + int64 m_offset; + bool m_noLoad; +}; + typedef QList<Entry> EntryList; typedef QListIterator<Entry> EntryListIterator; +typedef QList<EntryNav> EntryNavList; +typedef QListIterator<EntryNav> EntryNavListIterator; + #endif diff --git a/src/filedef.cpp b/src/filedef.cpp index ebc0b16..a830fba 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -73,39 +73,39 @@ FileDef::FileDef(const char *p,const char *nm, diskname=dn; if (diskname.isEmpty()) diskname=nm; setReference(lref); - //printf("new FileDef(path=%s,name=%s,ref=%s)\n",p,nm,lref); - classSDict = new ClassSDict(17); - includeList = new QList<IncludeInfo>; - includeList->setAutoDelete(TRUE); - includeDict = new QDict<IncludeInfo>(61); - includedByList = new QList<IncludeInfo>; - includedByList->setAutoDelete(TRUE); - includedByDict = new QDict<IncludeInfo>(61); - namespaceSDict = new NamespaceSDict; - srcDefDict = 0; - srcMemberDict = 0; - usingDirList = 0; - usingDeclList = 0; - package = 0; - isSource = FALSE; - docname = nm; - dir = 0; + classSDict = 0; + includeList = 0; + includeDict = 0; + includedByList = 0; + includedByDict = 0; + namespaceSDict = 0; + srcDefDict = 0; + srcMemberDict = 0; + usingDirList = 0; + usingDeclList = 0; + allMemberList = 0; + decDefineMembers = 0; + decProtoMembers = 0; + decTypedefMembers = 0; + decEnumMembers = 0; + decFuncMembers = 0; + decVarMembers = 0; + docDefineMembers = 0; + docProtoMembers = 0; + docTypedefMembers = 0; + docEnumMembers = 0; + docFuncMembers = 0; + docVarMembers = 0; + package = 0; + isSource = FALSE; + docname = nm; + dir = 0; if (Config_getBool("FULL_PATH_NAMES")) { docname.prepend(stripFromPath(path.copy())); } - memberGroupSDict = new MemberGroupSDict; - memberGroupSDict->setAutoDelete(TRUE); + memberGroupSDict = 0; acquireFileVersion(); - - // members in the detailed part of the documentation - docDefineMembers.setInFile(TRUE); - docProtoMembers.setInFile(TRUE); - docTypedefMembers.setInFile(TRUE); - docEnumMembers.setInFile(TRUE); - docFuncMembers.setInFile(TRUE); - docVarMembers.setInFile(TRUE); - } /*! destroy the file definition */ @@ -122,40 +122,59 @@ FileDef::~FileDef() delete usingDirList; delete usingDeclList; delete memberGroupSDict; + delete allMemberList; + delete decDefineMembers; + delete decProtoMembers; + delete decTypedefMembers; + delete decEnumMembers; + delete decFuncMembers; + delete decVarMembers; + delete docDefineMembers; + delete docProtoMembers; + delete docTypedefMembers; + delete docEnumMembers; + delete docFuncMembers; + delete docVarMembers; } /*! Compute the HTML anchor names for all members in the class */ void FileDef::computeAnchors() { - setAnchors(0,'a',&allMemberList); + if (allMemberList) setAnchors(0,'a',allMemberList); } void FileDef::distributeMemberGroupDocumentation() { //printf("FileDef::distributeMemberGroupDocumentation()\n"); - MemberGroupSDict::Iterator mgli(*memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) + if (memberGroupSDict) { - mg->distributeMemberGroupDocumentation(); + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->distributeMemberGroupDocumentation(); + } } } void FileDef::findSectionsInDocumentation() { docFindSections(documentation(),this,0,docFile()); - MemberGroupSDict::Iterator mgli(*memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - mg->findSectionsInDocumentation(); - } - decDefineMembers.findSectionsInDocumentation(); - decProtoMembers.findSectionsInDocumentation(); - decTypedefMembers.findSectionsInDocumentation(); - decEnumMembers.findSectionsInDocumentation(); - decFuncMembers.findSectionsInDocumentation(); - decVarMembers.findSectionsInDocumentation(); + if (memberGroupSDict) + { + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->findSectionsInDocumentation(); + } + } + if (decDefineMembers) decDefineMembers->findSectionsInDocumentation(); + if (decProtoMembers) decProtoMembers->findSectionsInDocumentation(); + if (decTypedefMembers) decTypedefMembers->findSectionsInDocumentation(); + if (decEnumMembers) decEnumMembers->findSectionsInDocumentation(); + if (decFuncMembers) decFuncMembers->findSectionsInDocumentation(); + if (decVarMembers) decVarMembers->findSectionsInDocumentation(); } void FileDef::writeDetailedDocumentation(OutputList &ol) @@ -313,7 +332,8 @@ void FileDef::writeDocumentation(OutputList &ol) } ol.writeSynopsis(); - if (Config_getBool("SHOW_INCLUDE_FILES") && includeList->count()>0) + if (Config_getBool("SHOW_INCLUDE_FILES") && includeList && + includeList->count()>0) { ol.startTextBlock(TRUE); QListIterator<IncludeInfo> ili(*includeList); @@ -439,7 +459,7 @@ void FileDef::writeDocumentation(OutputList &ol) ol.startMemberSections(); - if (namespaceSDict->count()>0) + if (namespaceSDict && namespaceSDict->count()>0) { NamespaceSDict::Iterator ndi(*namespaceSDict); NamespaceDef *nd; @@ -483,26 +503,29 @@ void FileDef::writeDocumentation(OutputList &ol) if (found) ol.endMemberList(); } - classSDict->writeDeclaration(ol); + if (classSDict) classSDict->writeDeclaration(ol); /* write user defined member groups */ - MemberGroupSDict::Iterator mgli(*memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) + if (memberGroupSDict) { - if (mg->header()!="[NOHEADER]") + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) { - mg->writeDeclarations(ol,0,0,this,0); + if (mg->header()!="[NOHEADER]") + { + mg->writeDeclarations(ol,0,0,this,0); + } } } //allMemberList.writeDeclarations(ol,0,0,this,0,0,0); - decDefineMembers.writeDeclarations(ol,0,0,this,0,theTranslator->trDefines(),0); - decProtoMembers.writeDeclarations(ol,0,0,this,0,theTranslator->trFuncProtos(),0); - decTypedefMembers.writeDeclarations(ol,0,0,this,0,theTranslator->trTypedefs(),0); - decEnumMembers.writeDeclarations(ol,0,0,this,0,theTranslator->trEnumerations(),0); - decFuncMembers.writeDeclarations(ol,0,0,this,0,theTranslator->trFunctions(),0); - decVarMembers.writeDeclarations(ol,0,0,this,0,theTranslator->trVariables(),0); + if (decDefineMembers) decDefineMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trDefines(),0); + if (decProtoMembers) decProtoMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trFuncProtos(),0); + if (decTypedefMembers) decTypedefMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trTypedefs(),0); + if (decEnumMembers) decEnumMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trEnumerations(),0); + if (decFuncMembers) decFuncMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trFunctions(),0); + if (decVarMembers) decVarMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trVariables(),0); ol.endMemberSections(); if (!Config_getBool("DETAILS_AT_TOP")) @@ -530,7 +553,7 @@ void FileDef::writeDocumentation(OutputList &ol) if (Config_getBool("SEPARATE_MEMBER_PAGES")) { - allMemberList.sort(); + if (allMemberList) allMemberList->sort(); writeMemberPages(ol); } } @@ -541,24 +564,42 @@ void FileDef::writeMemberDocumentation(OutputList &ol) { ol.disable(OutputGenerator::Html); } - - docDefineMembers.writeDocumentation(ol,name(),this, - theTranslator->trDefineDocumentation()); - - docProtoMembers.writeDocumentation(ol,name(),this, - theTranslator->trFunctionPrototypeDocumentation()); - docTypedefMembers.writeDocumentation(ol,name(),this, - theTranslator->trTypedefDocumentation()); - - docEnumMembers.writeDocumentation(ol,name(),this, - theTranslator->trEnumerationTypeDocumentation()); + if (docDefineMembers) + { + docDefineMembers->writeDocumentation(ol,name(),this, + theTranslator->trDefineDocumentation()); + } - docFuncMembers.writeDocumentation(ol,name(),this, - theTranslator->trFunctionDocumentation()); - - docVarMembers.writeDocumentation(ol,name(),this, - theTranslator->trVariableDocumentation()); + if (docProtoMembers) + { + docProtoMembers->writeDocumentation(ol,name(),this, + theTranslator->trFunctionPrototypeDocumentation()); + } + + if (docTypedefMembers) + { + docTypedefMembers->writeDocumentation(ol,name(),this, + theTranslator->trTypedefDocumentation()); + } + + if (docEnumMembers) + { + docEnumMembers->writeDocumentation(ol,name(),this, + theTranslator->trEnumerationTypeDocumentation()); + } + + if (docFuncMembers) + { + docFuncMembers->writeDocumentation(ol,name(),this, + theTranslator->trFunctionDocumentation()); + } + + if (docVarMembers) + { + docVarMembers->writeDocumentation(ol,name(),this, + theTranslator->trVariableDocumentation()); + } if (Config_getBool("SEPARATE_MEMBER_PAGES")) { @@ -571,12 +612,12 @@ void FileDef::writeMemberPages(OutputList &ol) ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); - docDefineMembers.writeDocumentationPage(ol,name(),this); - docProtoMembers.writeDocumentationPage(ol,name(),this); - docTypedefMembers.writeDocumentationPage(ol,name(),this); - docEnumMembers.writeDocumentationPage(ol,name(),this); - docFuncMembers.writeDocumentationPage(ol,name(),this); - docVarMembers.writeDocumentationPage(ol,name(),this); + if (docDefineMembers) docDefineMembers->writeDocumentationPage(ol,name(),this); + if (docProtoMembers) docProtoMembers->writeDocumentationPage(ol,name(),this); + if (docTypedefMembers) docTypedefMembers->writeDocumentationPage(ol,name(),this); + if (docEnumMembers) docEnumMembers->writeDocumentationPage(ol,name(),this); + if (docFuncMembers) docFuncMembers->writeDocumentationPage(ol,name(),this); + if (docVarMembers) docVarMembers->writeDocumentationPage(ol,name(),this); ol.popGeneratorState(); } @@ -588,31 +629,34 @@ void FileDef::writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const ol.writeString(" <div class=\"navtab\">\n"); ol.writeString(" <table>\n"); - MemberListIterator mli(allMemberList); - MemberDef *md; - for (mli.toFirst();(md=mli.current());++mli) + if (allMemberList) { - if (md->getFileDef()==this && md->getNamespaceDef()==0 && md->isLinkable()) + MemberListIterator mli(*allMemberList); + MemberDef *md; + for (mli.toFirst();(md=mli.current());++mli) { - ol.writeString(" <tr><td class=\"navtab\">"); - if (md->isLinkableInProject()) + if (md->getFileDef()==this && md->getNamespaceDef()==0 && md->isLinkable()) { - if (md==currentMd) // selected item => highlight - { - ol.writeString("<a class=\"qindexHL\" "); - } - else + ol.writeString(" <tr><td class=\"navtab\">"); + if (md->isLinkableInProject()) { - ol.writeString("<a class=\"qindex\" "); + if (md==currentMd) // selected item => highlight + { + ol.writeString("<a class=\"qindexHL\" "); + } + else + { + ol.writeString("<a class=\"qindex\" "); + } + ol.writeString("href=\""); + if (createSubDirs) ol.writeString("../../"); + ol.writeString(md->getOutputFileBase()+Doxygen::htmlFileExtension+"#"+md->anchor()); + ol.writeString("\">"); + ol.writeString(md->localName()); + ol.writeString("</a>"); } - ol.writeString("href=\""); - if (createSubDirs) ol.writeString("../../"); - ol.writeString(md->getOutputFileBase()+Doxygen::htmlFileExtension+"#"+md->anchor()); - ol.writeString("\">"); - ol.writeString(md->localName()); - ol.writeString("</a>"); + ol.writeString("</td></tr>\n"); } - ol.writeString("</td></tr>\n"); } } @@ -681,12 +725,12 @@ void FileDef::parseSource() void FileDef::addMembersToMemberGroup() { - ::addMembersToMemberGroup(&decDefineMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decProtoMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decTypedefMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decEnumMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decFuncMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decVarMembers,memberGroupSDict,this); + ::addMembersToMemberGroup(decDefineMembers, &memberGroupSDict,this); + ::addMembersToMemberGroup(decProtoMembers, &memberGroupSDict,this); + ::addMembersToMemberGroup(decTypedefMembers, &memberGroupSDict,this); + ::addMembersToMemberGroup(decEnumMembers, &memberGroupSDict,this); + ::addMembersToMemberGroup(decFuncMembers, &memberGroupSDict,this); + ::addMembersToMemberGroup(decVarMembers, &memberGroupSDict,this); } /*! Adds member definition \a md to the list of all members of this file */ @@ -694,42 +738,64 @@ void FileDef::insertMember(MemberDef *md) { //printf("%s:FileDef::insertMember(%s (=%p) list has %d elements)\n", // name().data(),md->name().data(),md,allMemberList.count()); - if (allMemberList.findRef(md)!=-1) + if (allMemberList && allMemberList->findRef(md)!=-1) { return; } - allMemberList.append(md); + if (allMemberList==0) + { + allMemberList = new MemberList; + } + allMemberList->append(md); bool sortBriefDocs = Config_getBool("SORT_BRIEF_DOCS"); bool sortMemberDocs = Config_getBool("SORT_MEMBER_DOCS"); switch (md->memberType()) { case MemberDef::Variable: case MemberDef::Property: - if (sortBriefDocs) decVarMembers.inSort(md); else decVarMembers.append(md); - if (sortMemberDocs) docVarMembers.inSort(md); else docVarMembers.append(md); + if (decVarMembers==0) decVarMembers = new MemberList; + if (sortBriefDocs) decVarMembers->inSort(md); else decVarMembers->append(md); + if (docVarMembers==0) docVarMembers = new MemberList; + if (sortMemberDocs) docVarMembers->inSort(md); else docVarMembers->append(md); + docVarMembers->setInFile(TRUE); break; case MemberDef::Function: - if (sortBriefDocs) decFuncMembers.inSort(md); else decFuncMembers.append(md); - if (sortMemberDocs) docFuncMembers.inSort(md); else docFuncMembers.append(md); + if (decFuncMembers==0) decFuncMembers = new MemberList; + if (sortBriefDocs) decFuncMembers->inSort(md); else decFuncMembers->append(md); + if (docFuncMembers==0) docFuncMembers = new MemberList; + if (sortMemberDocs) docFuncMembers->inSort(md); else docFuncMembers->append(md); + docFuncMembers->setInFile(TRUE); break; case MemberDef::Typedef: - if (sortBriefDocs) decTypedefMembers.inSort(md); else decTypedefMembers.append(md); - if (sortMemberDocs) docTypedefMembers.inSort(md); else docTypedefMembers.append(md); + if (decTypedefMembers==0) decTypedefMembers = new MemberList; + if (sortBriefDocs) decTypedefMembers->inSort(md); else decTypedefMembers->append(md); + if (docTypedefMembers==0) docTypedefMembers = new MemberList; + if (sortMemberDocs) docTypedefMembers->inSort(md); else docTypedefMembers->append(md); + docTypedefMembers->setInFile(TRUE); break; case MemberDef::Enumeration: - if (sortBriefDocs) decEnumMembers.inSort(md); else decEnumMembers.append(md); - if (sortMemberDocs) docEnumMembers.inSort(md); else docEnumMembers.append(md); + if (decEnumMembers==0) decEnumMembers = new MemberList; + if (sortBriefDocs) decEnumMembers->inSort(md); else decEnumMembers->append(md); + if (docEnumMembers==0) docEnumMembers = new MemberList; + if (sortMemberDocs) docEnumMembers->inSort(md); else docEnumMembers->append(md); + docEnumMembers->setInFile(TRUE); break; case MemberDef::EnumValue: // enum values are shown inside their enums break; case MemberDef::Prototype: - if (sortBriefDocs) decProtoMembers.inSort(md); else decProtoMembers.append(md); - if (sortMemberDocs) docProtoMembers.inSort(md); else docProtoMembers.append(md); + if (decProtoMembers==0) decProtoMembers = new MemberList; + if (sortBriefDocs) decProtoMembers->inSort(md); else decProtoMembers->append(md); + if (docProtoMembers==0) docProtoMembers = new MemberList; + if (sortMemberDocs) docProtoMembers->inSort(md); else docProtoMembers->append(md); + docProtoMembers->setInFile(TRUE); break; case MemberDef::Define: - if (sortBriefDocs) decDefineMembers.inSort(md); else decDefineMembers.append(md); - if (sortMemberDocs) docDefineMembers.inSort(md); else docDefineMembers.append(md); + if (decDefineMembers==0) decDefineMembers = new MemberList; + if (sortBriefDocs) decDefineMembers->inSort(md); else decDefineMembers->append(md); + if (docDefineMembers==0) docDefineMembers = new MemberList; + if (sortMemberDocs) docDefineMembers->inSort(md); else docDefineMembers->append(md); + docDefineMembers->setInFile(TRUE); break; default: err("FileDef::insertMembers(): " @@ -744,6 +810,10 @@ void FileDef::insertMember(MemberDef *md) /*! Adds compound definition \a cd to the list of all compounds of this file */ void FileDef::insertClass(ClassDef *cd) { + if (classSDict==0) + { + classSDict = new ClassSDict(17); + } if (Config_getBool("SORT_BRIEF_DOCS")) classSDict->inSort(cd->name(),cd); else @@ -753,8 +823,13 @@ void FileDef::insertClass(ClassDef *cd) /*! Adds namespace definition \a nd to the list of all compounds of this file */ void FileDef::insertNamespace(NamespaceDef *nd) { - if (!nd->name().isEmpty() && namespaceSDict->find(nd->name())==0) + if (!nd->name().isEmpty() && + (namespaceSDict==0 || namespaceSDict->find(nd->name())==0)) { + if (namespaceSDict==0) + { + namespaceSDict = new NamespaceSDict; + } if (Config_getBool("SORT_BRIEF_DOCS")) namespaceSDict->inSort(nd->name(),nd); else @@ -826,8 +901,14 @@ void FileDef::addIncludeDependency(FileDef *fd,const char *incName,bool local, { //printf("FileDef::addIncludeDependency(%p,%s,%d)\n",fd,incName,local); QCString iName = fd ? fd->absFilePath().data() : incName; - if (!iName.isEmpty() && includeDict->find(iName)==0) + if (!iName.isEmpty() && (!includeDict || includeDict->find(iName)==0)) { + if (includeDict==0) + { + includeDict = new QDict<IncludeInfo>(61); + includeList = new QList<IncludeInfo>; + includeList->setAutoDelete(TRUE); + } IncludeInfo *ii = new IncludeInfo; ii->fileDef = fd; ii->includeName = incName; @@ -894,8 +975,14 @@ void FileDef::addIncludedByDependency(FileDef *fd,const char *incName, { //printf("FileDef::addIncludedByDependency(%p,%s,%d)\n",fd,incName,local); QCString iName = fd ? fd->absFilePath().data() : incName; - if (!iName.isEmpty() && includedByDict->find(iName)==0) + if (!iName.isEmpty() && (includedByDict==0 || includedByDict->find(iName)==0)) { + if (includedByDict==0) + { + includedByDict = new QDict<IncludeInfo>(61); + includedByList = new QList<IncludeInfo>; + includedByList->setAutoDelete(TRUE); + } IncludeInfo *ii = new IncludeInfo; ii->fileDef = fd; ii->includeName = incName; @@ -909,7 +996,7 @@ void FileDef::addIncludedByDependency(FileDef *fd,const char *incName, bool FileDef::isIncluded(const QCString &name) const { if (name.isEmpty()) return FALSE; - return includeDict->find(name)!=0; + return includeDict!=0 && includeDict->find(name)!=0; } bool FileDef::generateSourceFile() const @@ -929,18 +1016,21 @@ void FileDef::addListReferences() theTranslator->trFile(TRUE,TRUE), getOutputFileBase(),name() ); - MemberGroupSDict::Iterator mgli(*memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - mg->addListReferences(this); - } - docDefineMembers.addListReferences(this); - docProtoMembers.addListReferences(this); - docTypedefMembers.addListReferences(this); - docEnumMembers.addListReferences(this); - docFuncMembers.addListReferences(this); - docVarMembers.addListReferences(this); + if (memberGroupSDict) + { + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->addListReferences(this); + } + } + if (docDefineMembers) docDefineMembers->addListReferences(this); + if (docProtoMembers) docProtoMembers->addListReferences(this); + if (docTypedefMembers) docTypedefMembers->addListReferences(this); + if (docEnumMembers) docEnumMembers->addListReferences(this); + if (docFuncMembers) docFuncMembers->addListReferences(this); + if (docVarMembers) docVarMembers->addListReferences(this); } //------------------------------------------------------------------- diff --git a/src/filedef.h b/src/filedef.h index 8c5cf33..831c0f9 100644 --- a/src/filedef.h +++ b/src/filedef.h @@ -79,6 +79,11 @@ class FileDef : public Definition else return Definition::name(); } + + QCString fileName() const + { + return filename; + } QCString getOutputFileBase() const { return convertNameToFile(diskname); } @@ -166,23 +171,23 @@ class FileDef : public Definition //void generateXML(QTextStream &t); //void generateXMLSection(QTextStream &t,MemberList *ml,const char *type); - MemberList allMemberList; + MemberList *allMemberList; // members in the declaration part of the documentation - MemberList decDefineMembers; - MemberList decProtoMembers; - MemberList decTypedefMembers; - MemberList decEnumMembers; - MemberList decFuncMembers; - MemberList decVarMembers; + MemberList *decDefineMembers; + MemberList *decProtoMembers; + MemberList *decTypedefMembers; + MemberList *decEnumMembers; + MemberList *decFuncMembers; + MemberList *decVarMembers; // members in the detailed part of the documentation - MemberList docDefineMembers; - MemberList docProtoMembers; - MemberList docTypedefMembers; - MemberList docEnumMembers; - MemberList docFuncMembers; - MemberList docVarMembers; + MemberList *docDefineMembers; + MemberList *docProtoMembers; + MemberList *docTypedefMembers; + MemberList *docEnumMembers; + MemberList *docFuncMembers; + MemberList *docVarMembers; /* user defined member groups */ MemberGroupSDict *memberGroupSDict; @@ -198,27 +203,24 @@ class FileDef : public Definition */ void acquireFileVersion(); - private: - - QDict<IncludeInfo> *includeDict; - QList<IncludeInfo> *includeList; - QDict<IncludeInfo> *includedByDict; - QList<IncludeInfo> *includedByList; - NamespaceSDict *usingDirList; - SDict<Definition> *usingDeclList; - QCString path; - QCString filepath; - QCString diskname; - QCString filename; - QCString docname; + QDict<IncludeInfo> *includeDict; + QList<IncludeInfo> *includeList; + QDict<IncludeInfo> *includedByDict; + QList<IncludeInfo> *includedByList; + NamespaceSDict *usingDirList; + SDict<Definition> *usingDeclList; + QCString path; + QCString filepath; + QCString diskname; + QCString filename; + QCString docname; QIntDict<Definition> *srcDefDict; - QIntDict<MemberDef> *srcMemberDict; - bool isSource; - QCString fileVersion; - - PackageDef *package; - DirDef *dir; + QIntDict<MemberDef> *srcMemberDict; + bool isSource; + QCString fileVersion; + PackageDef *package; + DirDef *dir; }; @@ -283,6 +285,7 @@ class DirEntry protected: DirEntry *m_parent; QCString m_name; + private: EntryKind m_kind; FileDef *m_fd; diff --git a/src/groupdef.cpp b/src/groupdef.cpp index d0ce1cc..7aee5c0 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -183,13 +183,13 @@ void GroupDef::addExample(const PageDef *def) void GroupDef::addMembersToMemberGroup() { - ::addMembersToMemberGroup(&decDefineMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decProtoMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decTypedefMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decEnumMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decEnumValMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decFuncMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decVarMembers,memberGroupSDict,this); + ::addMembersToMemberGroup(&decDefineMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decProtoMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decTypedefMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decEnumMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decEnumValMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decFuncMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decVarMembers,&memberGroupSDict,this); //printf("GroupDef::addMembersToMemberGroup() memberGroupList=%d\n",memberGroupList->count()); MemberGroupSDict::Iterator mgli(*memberGroupSDict); @@ -413,12 +413,12 @@ void GroupDef::removeMember(MemberDef *md) bool GroupDef::containsGroup(const GroupDef *def) { - return groupList->find(def) >= 0; + return this==def || groupList->find(def) >= 0; } void GroupDef::addGroup(const GroupDef *def) { - //printf("adding group `%s' to group `%s'\n",def->name().data(),name().data()); + printf("adding group `%s' to group `%s'\n",def->name().data(),name().data()); //if (Config_getBool("SORT_MEMBER_DOCS")) // groupList->inSort(def); //else @@ -427,7 +427,7 @@ void GroupDef::addGroup(const GroupDef *def) bool GroupDef::isASubGroup() const { - return m_partOfGroups && m_partOfGroups->count()!=0; + return partOfGroups() && partOfGroups()->count()!=0; } int GroupDef::countMembers() const @@ -872,6 +872,8 @@ void addDirToGroups(Entry *root,DirDef *dd) void addGroupToGroups(Entry *root,GroupDef *subGroup) { + printf("addGroupToGroups for %s groups=%d\n",root->name.data(), + root->groups?root->groups->count():-1); QListIterator<Grouping> gli(*root->groups); Grouping *g; for (;(g=gli.current());++gli) diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 8e9b723..7907c94 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -1558,20 +1558,14 @@ void HtmlGenerator::printDoc(DocNode *n,const char *langExt) delete visitor; } +//---------------- helpers for index generation ----------------------------- + static void startQuickIndexList(QTextStream &t,bool compact) { - bool fancyTabs=TRUE; if (compact) { - if (fancyTabs) - { - t << "<div class=\"tabs\">\n"; - t << " <ul>\n"; - } - else - { - t << "<div class=\"qindex\">"; - } + t << "<div class=\"tabs\">\n"; + t << " <ul>\n"; } else { @@ -1581,13 +1575,9 @@ static void startQuickIndexList(QTextStream &t,bool compact) static void endQuickIndexList(QTextStream &t,bool compact) { - bool fancyTabs=TRUE; if (compact) { - if (fancyTabs) - { - t << " </ul>"; - } + t << " </ul>"; t << "</div>\n"; } else @@ -1597,71 +1587,134 @@ static void endQuickIndexList(QTextStream &t,bool compact) } static void startQuickIndexItem(QTextStream &t,const char *l, - bool hl,bool compact,bool &first, + bool hl,bool /*compact*/, const QCString &relPath) { - bool fancyTabs=TRUE; - if (!first && compact && !fancyTabs) t << " | "; - first=FALSE; - if (fancyTabs) - { - t << " <li"; if (hl) t << " id=\"current\""; - t << "><a "; - } - else + t << " <li"; if (hl) t << " id=\"current\""; + t << "><a "; + t << "href=\"" << relPath << l << "\">"; + t << "<span>"; +} + +static void endQuickIndexItem(QTextStream &t) +{ + t << "</span>"; + t << "</a>"; + t << "</li>\n"; +} + +static QCString fixSpaces(const QCString &s) +{ + return substitute(s," "," "); +} + +static void writeNamespaceSubIndex(QTextStream &t,bool compact, + HighlightedItem hli,const QCString &relPath + ) +{ + startQuickIndexList(t,compact); + if (documentedNamespaces>0) { - if (!compact) t << "<li>"; - if (hl && compact) + startQuickIndexItem(t,"namespaces"+Doxygen::htmlFileExtension, + hli==HLI_Namespaces,compact,relPath); + if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) { - t << "<a class=\"qindexHL\" "; + t << fixSpaces(theTranslator->trPackages()); } else { - t << "<a class=\"qindex\" "; + t << theTranslator->trNamespaceList(); } + endQuickIndexItem(t); } - t << "href=\"" << relPath << l << "\">"; - if (fancyTabs) + if (documentedNamespaceMembers[NMHL_All]>0) { - t << "<span>"; + startQuickIndexItem(t,"namespacemembers"+Doxygen::htmlFileExtension, + hli==HLI_NamespaceMembers,compact,relPath); + if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) + { + t << fixSpaces(theTranslator->trPackageMembers()); + } + else + { + t << fixSpaces(theTranslator->trNamespaceMembers()); + } + endQuickIndexItem(t); } + endQuickIndexList(t,compact); } -static void endQuickIndexItem(QTextStream &t) +static void writeClassSubIndex(QTextStream &t,bool compact, + HighlightedItem hli,const QCString &relPath + ) { - bool fancyTabs=TRUE; - if (fancyTabs) t << "</span>"; - t << "</a>"; - if (fancyTabs) t << "</li>\n"; + startQuickIndexList(t,compact); + if (annotatedClasses>0) + { + if (Config_getBool("ALPHABETICAL_INDEX")) + { + startQuickIndexItem(t,"classes"+Doxygen::htmlFileExtension, + hli==HLI_Classes,compact,relPath); + t << fixSpaces(theTranslator->trAlphabeticalList()); + endQuickIndexItem(t); + } + startQuickIndexItem(t,"annotated"+Doxygen::htmlFileExtension, + hli==HLI_Annotated,compact,relPath); + t << fixSpaces(theTranslator->trCompoundList()); + endQuickIndexItem(t); + } + if (hierarchyClasses>0) + { + startQuickIndexItem(t,"hierarchy"+Doxygen::htmlFileExtension, + hli==HLI_Hierarchy,compact,relPath); + t << fixSpaces(theTranslator->trClassHierarchy()); + endQuickIndexItem(t); + } + if (documentedClassMembers[CMHL_All]>0) + { + startQuickIndexItem(t,"functions"+Doxygen::htmlFileExtension, + hli==HLI_Functions,compact,relPath); + t << fixSpaces(theTranslator->trCompoundMembers()); + endQuickIndexItem(t); + } + endQuickIndexList(t,compact); } -static QCString fixSpaces(const QCString &s) +static void writeFileSubIndex(QTextStream &t,bool compact, + HighlightedItem hli,const QCString &relPath) { - return substitute(s," "," "); + startQuickIndexList(t,compact); + if (documentedHtmlFiles>0) + { + startQuickIndexItem(t,"files"+Doxygen::htmlFileExtension, + hli==HLI_Files,compact,relPath); + t << fixSpaces(theTranslator->trFileList()); + endQuickIndexItem(t); + } + if (documentedFileMembers[FMHL_All]>0) + { + startQuickIndexItem(t,"globals"+Doxygen::htmlFileExtension, + hli==HLI_Globals,compact,relPath); + t << fixSpaces(theTranslator->trFileMembers()); + endQuickIndexItem(t); + } + endQuickIndexList(t,compact); } static void writeDefaultQuickLinks(QTextStream &t,bool compact, HighlightedItem hli,const QCString &relPath) { - bool first=TRUE; - bool fancyTabs=TRUE; startQuickIndexList(t,compact); - if (Config_getBool("SEARCHENGINE") && !fancyTabs) - { - t << " <form class=\"search\" action=\"" << relPath - << "search.php\" method=\"get\">\n"; - } - if (Config_getBool("GENERATE_TREEVIEW")) { startQuickIndexItem(t,"main"+Doxygen::htmlFileExtension, - hli==HLI_Main,compact,first,relPath); + hli==HLI_Main,compact,relPath); } else { startQuickIndexItem(t,"index"+Doxygen::htmlFileExtension, - hli==HLI_Main,compact,first,relPath); + hli==HLI_Main,compact,relPath); } t << fixSpaces(theTranslator->trMainPage()); endQuickIndexItem(t); @@ -1669,7 +1722,7 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, if (documentedGroups>0) { startQuickIndexItem(t,"modules"+Doxygen::htmlFileExtension, - hli==HLI_Modules,compact,first,relPath); + hli==HLI_Modules,compact,relPath); t << fixSpaces(theTranslator->trModules()); endQuickIndexItem(t); } @@ -1680,7 +1733,7 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, { startQuickIndexItem(t,"namespaces"+Doxygen::htmlFileExtension, hli==HLI_Namespaces || hli==HLI_NamespaceMembers || hli==HLI_NamespaceVisible, - compact,first,relPath); + compact,relPath); if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) { t << fixSpaces(theTranslator->trPackages()); @@ -1690,6 +1743,10 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, t << theTranslator->trNamespaces(); } endQuickIndexItem(t); + if (!compact) + { + writeNamespaceSubIndex(t,compact,hli,relPath); + } } @@ -1702,10 +1759,14 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, startQuickIndexItem(t,QCString(alphaIndex?"classes":"annotated")+Doxygen::htmlFileExtension, hli==HLI_Hierarchy || hli==HLI_Classes || hli==HLI_Annotated || hli==HLI_Functions || hli==HLI_ClassVisible, - compact,first,relPath); + compact,relPath); } t << fixSpaces(theTranslator->trClasses()); endQuickIndexItem(t); + if (!compact) + { + writeClassSubIndex(t,compact,hli,relPath); + } } @@ -1715,72 +1776,63 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, { startQuickIndexItem(t,"files"+Doxygen::htmlFileExtension, hli==HLI_Files || hli==HLI_Globals || hli==HLI_FileVisible, - compact,first,relPath); + compact,relPath); t << fixSpaces(theTranslator->trFile(TRUE,FALSE)); endQuickIndexItem(t); + if (!compact) + { + writeFileSubIndex(t,compact,hli,relPath); + } } - // ------------------------------------------------ + // -------------- Directories if (Config_getBool("SHOW_DIRECTORIES") && documentedDirs>0) { startQuickIndexItem(t,"dirs"+Doxygen::htmlFileExtension, - hli==HLI_Directories,compact,first,relPath); + hli==HLI_Directories,compact,relPath); t << fixSpaces(theTranslator->trDirectories()); endQuickIndexItem(t); } + + // -------------- Related pages + if (indexedPages>0) { startQuickIndexItem(t,"pages"+Doxygen::htmlFileExtension, - hli==HLI_Pages,compact,first,relPath); + hli==HLI_Pages,compact,relPath); t << fixSpaces(theTranslator->trRelatedPages()); endQuickIndexItem(t); } + + // -------------- Examples + if (Doxygen::exampleSDict->count()>0) { startQuickIndexItem(t,"examples"+Doxygen::htmlFileExtension, - hli==HLI_Examples,compact,first,relPath); + hli==HLI_Examples,compact,relPath); t << fixSpaces(theTranslator->trExamples()); endQuickIndexItem(t); } + + // -------------- Search field + if (Config_getBool("SEARCHENGINE")) { QCString searchFor = fixSpaces(theTranslator->trSearchForIndex()); if (searchFor.at(0)=='S') searchFor="<u>S</u>"+searchFor.mid(1); - if (fancyTabs) - { - t << " <li>\n"; - t << " <form action=\"search.php\" method=\"get\">\n"; - t << " <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n"; - t << " <tr>\n"; - t << " <td><label> " << searchFor << " </label></td>\n"; - if (hli!=HLI_Search) - { - t << " <td><input type=\"text\" name=\"query\" value=\"\" size=\"20\" accesskey=\"s\"/></td>\n"; - t << " </tr>\n"; - t << " </table>\n"; - t << " </form>\n"; - t << " </li>\n"; - } - } - else + t << " <li>\n"; + t << " <form action=\"search.php\" method=\"get\">\n"; + t << " <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n"; + t << " <tr>\n"; + t << " <td><label> " << searchFor << " </label></td>\n"; + if (hli!=HLI_Search) { - if (compact) - { - t << " | "; - } - else - { - t << "<li>"; - } - t << "<span class=\"search"; - if (hli==HLI_Search) t << "HL"; - t << "\">" << searchFor << " "; - if (hli!=HLI_Search) - { - t << "<input class=\"search\" type=\"text\" name=\"query\" value=\"\" size=\"20\" accesskey=\"s\"/>" - "</span></form>"; - } + t << " <td><input type=\"text\" name=\"query\" value=\"\" size=\"20\" accesskey=\"s\"/></td>\n"; + t << " </tr>\n"; + t << " </table>\n"; + t << " </form>\n"; + t << " </li>\n"; } } if (hli!=HLI_Search) // on the search page the page will be ended by the @@ -1790,7 +1842,7 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, } //------------------------------------------------------------------------- - // write sub indices + // write sub indices in compact mode if ((hli==HLI_Namespaces || hli==HLI_NamespaceMembers || hli==HLI_NamespaceVisible @@ -1798,94 +1850,22 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, documentedNamespaces>0 && documentedNamespaceMembers[NMHL_All]>0) { - startQuickIndexList(t,compact); - if (documentedNamespaces>0) - { - startQuickIndexItem(t,"namespaces"+Doxygen::htmlFileExtension, - hli==HLI_Namespaces,compact,first,relPath); - if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) - { - t << fixSpaces(theTranslator->trPackages()); - } - else - { - t << theTranslator->trNamespaceList(); - } - endQuickIndexItem(t); - } - if (documentedNamespaceMembers[NMHL_All]>0) - { - startQuickIndexItem(t,"namespacemembers"+Doxygen::htmlFileExtension, - hli==HLI_NamespaceMembers,compact,first,relPath); - if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) - { - t << fixSpaces(theTranslator->trPackageMembers()); - } - else - { - t << fixSpaces(theTranslator->trNamespaceMembers()); - } - endQuickIndexItem(t); - } - endQuickIndexList(t,compact); + writeNamespaceSubIndex(t,compact,hli,relPath); } else if ((hli==HLI_Hierarchy || hli==HLI_Classes || hli==HLI_Annotated || hli==HLI_Functions || - hli==HLI_ClassVisible + hli==HLI_ClassVisible || !compact ) && annotatedClasses>0 ) { - startQuickIndexList(t,compact); - if (annotatedClasses>0) - { - if (Config_getBool("ALPHABETICAL_INDEX")) - { - startQuickIndexItem(t,"classes"+Doxygen::htmlFileExtension, - hli==HLI_Classes,compact,first,relPath); - t << fixSpaces(theTranslator->trAlphabeticalList()); - endQuickIndexItem(t); - } - startQuickIndexItem(t,"annotated"+Doxygen::htmlFileExtension, - hli==HLI_Annotated,compact,first,relPath); - t << fixSpaces(theTranslator->trCompoundList()); - endQuickIndexItem(t); - } - if (hierarchyClasses>0) - { - startQuickIndexItem(t,"hierarchy"+Doxygen::htmlFileExtension, - hli==HLI_Hierarchy,compact,first,relPath); - t << fixSpaces(theTranslator->trClassHierarchy()); - endQuickIndexItem(t); - } - if (documentedClassMembers[CMHL_All]>0) - { - startQuickIndexItem(t,"functions"+Doxygen::htmlFileExtension, - hli==HLI_Functions,compact,first,relPath); - t << fixSpaces(theTranslator->trCompoundMembers()); - endQuickIndexItem(t); - } - endQuickIndexList(t,compact); + writeClassSubIndex(t,compact,hli,relPath); } - else if ((hli==HLI_Files || hli==HLI_Globals || hli==HLI_FileVisible) && - documentedHtmlFiles>0 && documentedFileMembers[FMHL_All]>0 + else if ((hli==HLI_Files || hli==HLI_Globals || + hli==HLI_FileVisible || !compact + ) && documentedHtmlFiles>0 && documentedFileMembers[FMHL_All]>0 ) { - startQuickIndexList(t,compact); - if (documentedHtmlFiles>0) - { - startQuickIndexItem(t,"files"+Doxygen::htmlFileExtension, - hli==HLI_Files,compact,first,relPath); - t << fixSpaces(theTranslator->trFileList()); - endQuickIndexItem(t); - } - if (documentedFileMembers[FMHL_All]>0) - { - startQuickIndexItem(t,"globals"+Doxygen::htmlFileExtension, - hli==HLI_Globals,compact,first,relPath); - t << fixSpaces(theTranslator->trFileMembers()); - endQuickIndexItem(t); - } - endQuickIndexList(t,compact); + writeFileSubIndex(t,compact,hli,relPath); } } diff --git a/src/index.cpp b/src/index.cpp index 0c8394c..324b42b 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -280,7 +280,7 @@ void endFile(OutputList &ol,bool) static bool classHasVisibleChildren(ClassDef *cd) { - if (cd->subClasses()->count()==0) return FALSE; + if (cd->subClasses()==0) return FALSE; BaseClassList *bcl=cd->subClasses(); BaseClassListIterator bcli(*bcl); for ( ; bcli.current() ; ++bcli) @@ -295,6 +295,7 @@ static bool classHasVisibleChildren(ClassDef *cd) void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int level) { + if (bcl==0) return; HtmlHelp *htmlHelp=0; FTVHelp *ftvHelp=0; bool &generateHtml = Config_getBool("GENERATE_HTML") ; @@ -379,6 +380,7 @@ void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int level) void writeClassTree(BaseClassList *cl,int level) { + if (cl==0) return; HtmlHelp *htmlHelp=0; FTVHelp *ftvHelp=0; bool &generateHtml = Config_getBool("GENERATE_HTML") ; @@ -468,6 +470,7 @@ void writeClassTreeNode(ClassDef *cd,bool hasHtmlHelp,bool hasFtvHelp,bool &star void writeClassTree(ClassList *cl,int level) { + if (cl==0) return; bool &generateHtml = Config_getBool("GENERATE_HTML") ; bool hasHtmlHelp = generateHtml && Config_getBool("GENERATE_HTMLHELP"); bool hasFtvHelp = generateHtml && Config_getBool("GENERATE_TREEVIEW"); @@ -485,6 +488,7 @@ void writeClassTree(ClassList *cl,int level) void writeClassTree(ClassSDict *d,int level) { + if (d==0) return; bool &generateHtml = Config_getBool("GENERATE_HTML") ; bool hasHtmlHelp = generateHtml && Config_getBool("GENERATE_HTMLHELP"); bool hasFtvHelp = generateHtml && Config_getBool("GENERATE_TREEVIEW"); @@ -625,7 +629,7 @@ static int countClassesInTreeList(const ClassSDict &cl) { if (cd->isVisibleInHierarchy()) // should it be visible { - if (cd->subClasses()->count()>0) // should have sub classes + if (cd->subClasses()) // should have sub classes { count++; } diff --git a/src/lang_cfg.h b/src/lang_cfg.h index d99d747..8b6efc6 100644 --- a/src/lang_cfg.h +++ b/src/lang_cfg.h @@ -30,3 +30,5 @@ #define LANG_CA #define LANG_LT #define LANG_ZA +#define LANG_AR +#define LANG_FA diff --git a/src/language.cpp b/src/language.cpp index fad615d..58655d8 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -121,7 +121,13 @@ #ifdef LANG_ZA #include "translator_za.h" #endif +#ifdef LANG_AR +#include "translator_ar.h" #endif +#ifdef LANG_FA +#include "translator_fa.h" +#endif +#endif // !ENGLISH_ONLY #define L_EQUAL(a) !stricmp(langName,a) @@ -338,6 +344,18 @@ bool setTranslator(const char *langName) theTranslator=new TranslatorAfrikaans; } #endif +#ifdef LANG_AR + else if (L_EQUAL("arabic")) + { + theTranslator=new TranslatorArabic; + } +#endif +#ifdef LANG_FA + else if (L_EQUAL("persian")) + { + theTranslator=new TranslatorPersian; + } +#endif #endif // ENGLISH_ONLY else // use the default language (i.e. english) { diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index 318b18d..f2d086b 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -232,7 +232,7 @@ void LatexDocVisitor::visit(DocStyleChange *s) if (s->enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} "; break; case DocStyleChange::Small: - if (s->enable()) m_t << "\\footnotesize "; else m_t << "\\normalsize "; + if (s->enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize "; break; case DocStyleChange::Preformatted: if (s->enable()) @@ -243,7 +243,7 @@ void LatexDocVisitor::visit(DocStyleChange *s) else { m_insidePre=FALSE; - m_t << "\\end{alltt}\\normalsize " << endl; + m_t << "\\end{alltt}\n\\normalsize " << endl; } break; case DocStyleChange::Div: /* HTML only */ break; diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 753e353..a34aa67 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -431,7 +431,7 @@ MemberDef::MemberDef(const char *df,int dl, m_hasDocumentedParams = FALSE; m_hasDocumentedReturnType = FALSE; m_docProvider = 0; - m_isDMember = m_defFileName.right(2).lower()==".d"; + m_isDMember = getDefFileName().right(2).lower()==".d"; } /*! Destroys the member definition. */ @@ -541,7 +541,7 @@ QCString MemberDef::getOutputFileBase() const if (baseName.isEmpty()) { - warn(m_defFileName,m_defLine, + warn(getDefFileName(),getDefLine(), "Warning: Internal inconsistency: member %s does not belong to any" " container!",name().data() ); @@ -874,6 +874,10 @@ void MemberDef::writeDeclaration(OutputList &ol, { //printf("%s MemberDef::writeDeclaration() inGroup=%d\n",name().data(),inGroup); + // hide enum value, since they appear already as part of the enum, unless they + // are explicitly grouped. + if (!inGroup && mtype==EnumValue) return; + // hide members whose brief section should not be visible //if (!isBriefSectionVisible()) return; @@ -2040,7 +2044,7 @@ void MemberDef::warnIfUndocumented() (prot!=Private || Config_getBool("EXTRACT_PRIVATE")) ) { - warn_undoc(m_defFileName,m_defLine,"Warning: Member %s%s (%s) of %s %s is not documented.", + warn_undoc(getDefFileName(),getDefLine(),"Warning: Member %s%s (%s) of %s %s is not documented.", name().data(),argsString()?argsString():"",memberTypeName().data(),t,d->name().data()); } } diff --git a/src/memberdef.h b/src/memberdef.h index d7da3db..819671f 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -314,85 +314,75 @@ class MemberDef : public Definition bool visited; private: + // disable copying of member defs + MemberDef(const MemberDef &); + MemberDef &operator=(const MemberDef &); + void writeLink(OutputList &ol, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, bool onlyText=FALSE); - ClassDef *classDef; // member of or related to - FileDef *fileDef; // member of file definition + ClassDef *classDef; // member of or related to + FileDef *fileDef; // member of file definition + NamespaceDef *nspace; // the namespace this member is in. + MemberDef *enumScope; // the enclosing scope, if this is an enum field MemberDef *annEnumType; // the annonymous enum that is the type of this member + MemberList *enumFields; // enumeration fields + OutputList *enumDeclList; // stored piece of documentation for enumeration. + MemberDef *redefines; // the members that this member redefines MemberList *redefinedBy; // the list of members that redefine this one + MemberDef *memDef; // member definition for this declaration MemberDef *memDec; // member declaration for this definition ClassDef *m_relatedAlso; // points to class marked by relatedAlso ExampleSDict *exampleSDict; // a dictionary of all examples for quick access - MemberList *enumFields; // enumeration fields - OutputList *enumDeclList; // stored piece of documentation for enumeration. - NamespaceDef *nspace; // the namespace this member is in. QCString type; // return type QCString args; // function arguments/variable array specifiers + QCString def; // member definition in code (fully qualified name) + QCString anc; // HTML anchor name + Specifier virt; // normal/virtual/pure virtual + Protection prot; // protection type [Public/Protected/Private] + QCString decl; // member declaration in class: TODO: can be generated + QCString bitfields; // struct member bitfields QCString read; // property read accessor QCString write; // property write accessor QCString exception; // exceptions that can be thrown QCString init; // initializer int initLines; // number of lines in the initializer - QCString decl; // member declaration in class - QCString def; // member definition in code (fully qualified name) - QCString anc; // HTML anchor name - MemberDef *groupAlias; // Member containing the definition - Specifier virt; // normal/virtual/pure virtual - Protection prot; // protection type [Public/Protected/Private] + int memSpec; // The specifiers present for this member MemberType mtype; // returns the kind of member - bool related; // is this a member that is only related to a class - bool stat; // is it a static function? - bool proto; // is it a prototype; - bool docEnumValues; // is an enum with documented enum values. - bool annScope; // member is part of an annoymous scope - bool annUsed; - bool annShown; - bool m_hasCallGraph; - bool m_hasCallerGraph; int maxInitLines; // when the initializer will be displayed int userInitLines; // result of explicit \hideinitializer or \showinitializer MemberList *section; // declation list containing this member MemberDef *annMemb; + ArgumentList *defArgList; // argument list of this member definition ArgumentList *declArgList; // argument list of this member declaration + ArgumentList *tArgList; // template argument list of function template + MemberDef *m_templateMaster; QList<ArgumentList> *m_defTmpArgLists; - int grpId; // group id - MemberGroup *memberGroup; // group's member definition - - GroupDef *group; // group in which this member is in - bool explExt; // member was explicitly declared external - bool tspec; // member is a template specialization ClassDef *cachedAnonymousType; // if the member has an anonymous compound // as its type then this is computed by // getClassDefOfAnonymousType() and // cached here. + SDict<MemberList> *classSectionSDict; + + MemberDef *groupAlias; // Member containing the definition + int grpId; // group id + MemberGroup *memberGroup; // group's member definition + GroupDef *group; // group in which this member is in Grouping::GroupPri_t grouppri; // priority of this definition QCString groupFileName; // file where this grouping was defined int groupStartLine; // line " " " " " - bool groupHasDocs; // true if the entry that caused the grouping was documented MemberDef *groupMember; - MemberDef *m_templateMaster; - SDict<MemberList> *classSectionSDict; - bool docsForDefinition; // TRUE => documentation block is put before - // definition. - // FALSE => block is put before declaration. - - - // disable copying of member defs - MemberDef(const MemberDef &); - MemberDef &operator=(const MemberDef &); - static int s_indentLevel; bool m_isTypedefValCached; ClassDef *m_cachedTypedefValue; @@ -403,20 +393,36 @@ class MemberDef : public Definition QCString m_inbodyFile; QCString m_inbodyDocs; - // objective-c - bool m_implOnly; // function found in implementation but not - // in the interface - - bool m_hasDocumentedParams; - bool m_hasDocumentedReturnType; - // documentation inheritance MemberDef *m_docProvider; // to store the output file base from tag files QCString explicitOutputFileBase; + // objective-c + bool m_implOnly; // function found in implementation but not + // in the interface + bool m_hasDocumentedParams; + bool m_hasDocumentedReturnType; bool m_isDMember; + bool related; // is this a member that is only related to a class + bool stat; // is it a static function? + bool proto; // is it a prototype; + bool docEnumValues; // is an enum with documented enum values. + bool annScope; // member is part of an annoymous scope + bool annUsed; + bool annShown; + bool m_hasCallGraph; + bool m_hasCallerGraph; + bool explExt; // member was explicitly declared external + bool tspec; // member is a template specialization + bool groupHasDocs; // true if the entry that caused the grouping was documented + bool docsForDefinition; // TRUE => documentation block is put before + // definition. + // FALSE => block is put before declaration. + + static int s_indentLevel; + }; #endif diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index 4a1297b..3ead6af 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -139,12 +139,12 @@ void NamespaceDef::insertNamespace(NamespaceDef *nd) void NamespaceDef::addMembersToMemberGroup() { - ::addMembersToMemberGroup(&decDefineMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decProtoMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decTypedefMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decEnumMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decFuncMembers,memberGroupSDict,this); - ::addMembersToMemberGroup(&decVarMembers,memberGroupSDict,this); + ::addMembersToMemberGroup(&decDefineMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decProtoMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decTypedefMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decEnumMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decFuncMembers,&memberGroupSDict,this); + ::addMembersToMemberGroup(&decVarMembers,&memberGroupSDict,this); } void NamespaceDef::insertMember(MemberDef *md) diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index 23e1766..c9c8962 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -1552,7 +1552,7 @@ void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *) void PerlModGenerator::generatePerlModSection(Definition *d, MemberList *ml,const char *name,const char *header) { - if (ml->count()==0) return; // empty list + if (ml==0) return; // empty list m_output.openHash(name); @@ -1573,29 +1573,32 @@ void PerlModGenerator::generatePerlModSection(Definition *d, void PerlModGenerator::addListOfAllMembers(ClassDef *cd) { m_output.openList("all_members"); - MemberNameInfoSDict::Iterator mnii(*cd->memberNameInfoSDict()); - MemberNameInfo *mni; - for (mnii.toFirst();(mni=mnii.current());++mnii) + if (cd->memberNameInfoSDict()) { - MemberNameInfoIterator mii(*mni); - MemberInfo *mi; - for (mii.toFirst();(mi=mii.current());++mii) + MemberNameInfoSDict::Iterator mnii(*cd->memberNameInfoSDict()); + MemberNameInfo *mni; + for (mnii.toFirst();(mni=mnii.current());++mnii) { - MemberDef *md=mi->memberDef; - ClassDef *cd=md->getClassDef(); - Definition *d=md->getGroupDef(); - if (d==0) d = cd; + MemberNameInfoIterator mii(*mni); + MemberInfo *mi; + for (mii.toFirst();(mi=mii.current());++mii) + { + MemberDef *md=mi->memberDef; + ClassDef *cd=md->getClassDef(); + Definition *d=md->getGroupDef(); + if (d==0) d = cd; - m_output.openHash() - .addFieldQuotedString("name", md->name()) - .addFieldQuotedString("virtualness", getVirtualnessName(md->virtualness())) - .addFieldQuotedString("protection", getProtectionName(mi->prot)); + m_output.openHash() + .addFieldQuotedString("name", md->name()) + .addFieldQuotedString("virtualness", getVirtualnessName(md->virtualness())) + .addFieldQuotedString("protection", getProtectionName(mi->prot)); - if (!mi->ambiguityResolutionScope.isEmpty()) - m_output.addFieldQuotedString("ambiguity_scope", mi->ambiguityResolutionScope); + if (!mi->ambiguityResolutionScope.isEmpty()) + m_output.addFieldQuotedString("ambiguity_scope", mi->ambiguityResolutionScope); - m_output.addFieldQuotedString("scope", cd->name()) - .closeHash(); + m_output.addFieldQuotedString("scope", cd->name()) + .closeHash(); + } } } m_output.closeList(); @@ -1626,7 +1629,7 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd) m_output.openHash() .addFieldQuotedString("name", cd->name()); - if (cd->baseClasses()->count()>0) + if (cd->baseClasses()) { m_output.openList("base"); BaseClassListIterator bcli(*cd->baseClasses()); @@ -1640,10 +1643,10 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd) m_output.closeList(); } - if (cd->subClasses()->count()>0) + if (cd->subClasses()) { m_output.openList("derived"); - BaseClassListIterator bcli(*cd->baseClasses()); + BaseClassListIterator bcli(*cd->subClasses()); BaseClassDef *bcd; for (bcli.toFirst();(bcd=bcli.current());++bcli) m_output.openHash() @@ -1692,29 +1695,29 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd) for (;(mg=mgli.current());++mgli) generatePerlModSection(cd,mg->members(),"user_defined",mg->header()); - generatePerlModSection(cd,&cd->pubTypes,"public_typedefs"); - generatePerlModSection(cd,&cd->pubMethods,"public_methods"); - generatePerlModSection(cd,&cd->pubAttribs,"public_members"); - generatePerlModSection(cd,&cd->pubSlots,"public_slots"); - generatePerlModSection(cd,&cd->signals,"signals"); - generatePerlModSection(cd,&cd->dcopMethods,"dcop_methods"); - generatePerlModSection(cd,&cd->properties,"properties"); - generatePerlModSection(cd,&cd->pubStaticMethods,"public_static_methods"); - generatePerlModSection(cd,&cd->pubStaticAttribs,"public_static_members"); - generatePerlModSection(cd,&cd->proTypes,"protected_typedefs"); - generatePerlModSection(cd,&cd->proMethods,"protected_methods"); - generatePerlModSection(cd,&cd->proAttribs,"protected_members"); - generatePerlModSection(cd,&cd->proSlots,"protected_slots"); - generatePerlModSection(cd,&cd->proStaticMethods,"protected_static_methods"); - generatePerlModSection(cd,&cd->proStaticAttribs,"protected_static_members"); - generatePerlModSection(cd,&cd->priTypes,"private_typedefs"); - generatePerlModSection(cd,&cd->priMethods,"private_methods"); - generatePerlModSection(cd,&cd->priAttribs,"private_members"); - generatePerlModSection(cd,&cd->priSlots,"private_slots"); - generatePerlModSection(cd,&cd->priStaticMethods,"private_static_methods"); - generatePerlModSection(cd,&cd->priStaticAttribs,"private_static_members"); - generatePerlModSection(cd,&cd->friends,"friend_methods"); - generatePerlModSection(cd,&cd->related,"related_methods"); + generatePerlModSection(cd,cd->pubTypes,"public_typedefs"); + generatePerlModSection(cd,cd->pubMethods,"public_methods"); + generatePerlModSection(cd,cd->pubAttribs,"public_members"); + generatePerlModSection(cd,cd->pubSlots,"public_slots"); + generatePerlModSection(cd,cd->signals,"signals"); + generatePerlModSection(cd,cd->dcopMethods,"dcop_methods"); + generatePerlModSection(cd,cd->properties,"properties"); + generatePerlModSection(cd,cd->pubStaticMethods,"public_static_methods"); + generatePerlModSection(cd,cd->pubStaticAttribs,"public_static_members"); + generatePerlModSection(cd,cd->proTypes,"protected_typedefs"); + generatePerlModSection(cd,cd->proMethods,"protected_methods"); + generatePerlModSection(cd,cd->proAttribs,"protected_members"); + generatePerlModSection(cd,cd->proSlots,"protected_slots"); + generatePerlModSection(cd,cd->proStaticMethods,"protected_static_methods"); + generatePerlModSection(cd,cd->proStaticAttribs,"protected_static_members"); + generatePerlModSection(cd,cd->priTypes,"private_typedefs"); + generatePerlModSection(cd,cd->priMethods,"private_methods"); + generatePerlModSection(cd,cd->priAttribs,"private_members"); + generatePerlModSection(cd,cd->priSlots,"private_slots"); + generatePerlModSection(cd,cd->priStaticMethods,"private_static_methods"); + generatePerlModSection(cd,cd->priStaticAttribs,"private_static_members"); + generatePerlModSection(cd,cd->friends,"friend_methods"); + generatePerlModSection(cd,cd->related,"related_methods"); addPerlModDocBlock(m_output,"brief",cd->getDefFileName(),cd->getDefLine(),cd,0,cd->briefDescription()); addPerlModDocBlock(m_output,"detailed",cd->getDefFileName(),cd->getDefLine(),cd,0,cd->documentation()); @@ -1829,41 +1832,47 @@ void PerlModGenerator::generatePerlModForFile(FileDef *fd) m_output.openHash() .addFieldQuotedString("name", fd->name()); - QListIterator<IncludeInfo> ili1(*fd->includeFileList()); IncludeInfo *inc; m_output.openList("includes"); - for (ili1.toFirst();(inc=ili1.current());++ili1) + if (fd->includeFileList()) { - m_output.openHash() - .addFieldQuotedString("name", inc->includeName); - if (inc->fileDef && !inc->fileDef->isReference()) + QListIterator<IncludeInfo> ili1(*fd->includeFileList()); + for (ili1.toFirst();(inc=ili1.current());++ili1) { - m_output.addFieldQuotedString("ref", inc->fileDef->getOutputFileBase()); + m_output.openHash() + .addFieldQuotedString("name", inc->includeName); + if (inc->fileDef && !inc->fileDef->isReference()) + { + m_output.addFieldQuotedString("ref", inc->fileDef->getOutputFileBase()); + } + m_output.closeHash(); } - m_output.closeHash(); } m_output.closeList(); - QListIterator<IncludeInfo> ili2(*fd->includedByFileList()); m_output.openList("included_by"); - for (ili2.toFirst();(inc=ili2.current());++ili2) + if (fd->includedByFileList()) { - m_output.openHash() - .addFieldQuotedString("name", inc->includeName); - if (inc->fileDef && !inc->fileDef->isReference()) + QListIterator<IncludeInfo> ili2(*fd->includedByFileList()); + for (ili2.toFirst();(inc=ili2.current());++ili2) { - m_output.addFieldQuotedString("ref", inc->fileDef->getOutputFileBase()); + m_output.openHash() + .addFieldQuotedString("name", inc->includeName); + if (inc->fileDef && !inc->fileDef->isReference()) + { + m_output.addFieldQuotedString("ref", inc->fileDef->getOutputFileBase()); + } + m_output.closeHash(); } - m_output.closeHash(); } m_output.closeList(); - generatePerlModSection(fd,&fd->decDefineMembers,"defines"); - generatePerlModSection(fd,&fd->decProtoMembers,"prototypes"); - generatePerlModSection(fd,&fd->decTypedefMembers,"typedefs"); - generatePerlModSection(fd,&fd->decEnumMembers,"enums"); - generatePerlModSection(fd,&fd->decFuncMembers,"functions"); - generatePerlModSection(fd,&fd->decVarMembers,"variables"); + generatePerlModSection(fd,fd->decDefineMembers,"defines"); + generatePerlModSection(fd,fd->decProtoMembers,"prototypes"); + generatePerlModSection(fd,fd->decTypedefMembers,"typedefs"); + generatePerlModSection(fd,fd->decEnumMembers,"enums"); + generatePerlModSection(fd,fd->decFuncMembers,"functions"); + generatePerlModSection(fd,fd->decVarMembers,"variables"); addPerlModDocBlock(m_output,"brief",fd->getDefFileName(),fd->getDefLine(),0,0,fd->briefDescription()); addPerlModDocBlock(m_output,"detailed",fd->getDefFileName(),fd->getDefLine(),0,0,fd->documentation()); diff --git a/src/pycode.l b/src/pycode.l index ae3c543..306a042 100644 --- a/src/pycode.l +++ b/src/pycode.l @@ -696,12 +696,15 @@ static void generateFunctionLink(CodeOutputInterface &ol,char *funcName) if (!locScope.isEmpty() && (ccd=g_codeClassSDict[locScope])) { //printf("using classScope %s\n",g_classScope.data()); - BaseClassListIterator bcli(*ccd->baseClasses()); - for ( ; bcli.current() ; ++bcli) + if (ccd->baseClasses()) { - if (getLink(bcli.current()->classDef->name(),locFunc,ol,funcName)) + BaseClassListIterator bcli(*ccd->baseClasses()); + for ( ; bcli.current() ; ++bcli) { - return; + if (getLink(bcli.current()->classDef->name(),locFunc,ol,funcName)) + { + return; + } } } } diff --git a/src/pyscanner.l b/src/pyscanner.l index 6420e40..63d6fd4 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -129,7 +129,7 @@ static void initEntry() current->virt = virt; current->stat = gstat; current->objc = FALSE; //insideObjC; - current->parent = current_root; + current->setParent(current_root); initGroupInfo(current); } @@ -950,6 +950,7 @@ STARTDOCSYMS ^{B}"##"/[^#] [^ \t\n#'"]+ { // non-special stuff current->program+=yytext; g_specialBlock = FALSE; + g_hideClassDocs = FALSE; } {NEWLINE} { current->program+=*yytext; @@ -1059,6 +1060,7 @@ STARTDOCSYMS ^{B}"##"/[^#] <VariableDec>{ "=" { // the assignment operator + printf("====== VariableDec at line %d\n",yyLineNr); } {B} { // spaces } @@ -1128,6 +1130,9 @@ STARTDOCSYMS ^{B}"##"/[^#] "#".* { // comment BEGIN( VariableEnd ); } + {IDENTIFIER} { + current->initializer+=yytext; + } . { current->initializer+=*yytext; } @@ -1378,7 +1383,7 @@ STARTDOCSYMS ^{B}"##"/[^#] static void parseCompounds(Entry *rt) { //printf("parseCompounds(%s)\n",rt->name.data()); - EntryListIterator eli(*rt->sublist); + EntryListIterator eli(*rt->children()); Entry *ce; for (;(ce=eli.current());++eli) { @@ -1395,9 +1400,9 @@ static void parseCompounds(Entry *rt) current_root = ce ; BEGIN( Search ); } - else if (ce->parent) + else if (ce->parent()) { - current_root = ce->parent; + current_root = ce->parent(); //printf("Searching for member variables in %s parent=%s\n", // ce->name.data(),ce->parent->name.data()); BEGIN( SearchMemVars ); diff --git a/src/scanner.l b/src/scanner.l index d16c50f..84f7395 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -63,7 +63,6 @@ static int lastStringContext; static int lastCurlyContext; static int lastRoundContext; static int lastSquareContext; -//static int lastAfterDocContext; static int lastInitializerContext; static int lastClassTemplSpecContext; static int lastPreLineCtrlContext; @@ -92,9 +91,6 @@ static bool removeSlashes; static Specifier virt; static Specifier baseVirt; static QCString msType,msName,msArgs; -//static int memberGroupId = DOX_NOGROUP; -//static QCString memberGroupHeader; -//static QCString memberGroupDocs; static bool isTypedef; static int tmpDocType; static QCString sectionLabel; @@ -181,9 +177,6 @@ static void initParser() sharpCount = 0; roundCount = 0; curlyCount = 0; - //memberGroupId = DOX_NOGROUP; - //memberGroupRelates.resize(0); - //memberGroupInside.resize(0); mtype = Method; gstat = FALSE; virt = Normal; @@ -207,9 +200,6 @@ static void initEntry() current->mtype = mtype; current->virt = virt; current->stat = gstat; - //current->mGrpId = memberGroupId; - //current->relates = memberGroupRelates; - //current->inside = memberGroupInside; current->objc = insideObjC; //if (!autoGroupStack.isEmpty()) //{ @@ -2133,7 +2123,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) *pCopyCurlyString+=*yytext; } <FindMembers>":" { - if (current->type.isEmpty()) // bit pad field + if (current->type.isEmpty()) // anonymous padding field, e.g. "int :7;" { addType(current); current->name.sprintf("__pad%d__",padCount++); @@ -2192,13 +2182,20 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) { current = new Entry ; } + else if (current->groups) + { + current->groups->clear(); + } initEntry(); } BEGIN( FindMembers ) ; } <FindMembers>"[" { - if (current->name.isEmpty() || current->name=="typedef") // IDL function property + if (!insideCS && + current->name.isEmpty() || + current->name=="typedef" + ) // IDL function property { squareCount=1; lastSquareContext = YY_START; @@ -2340,7 +2337,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) current_root->addSubEntry(current); current = new Entry(*current); // add to the scope surrounding the enum (copy!) - current_root->parent->addSubEntry(current); + current_root->parent()->addSubEntry(current); current = new Entry ; initEntry(); } @@ -2588,7 +2585,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) } } //p=p->parent; - if (p==current) p=current_root; else p=p->parent; + if (p==current) p=current_root; else p=p->parent(); } } //printf("msName=%s current->name=%s\n",msName.data(),current->name.data()); @@ -3801,7 +3798,9 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) if (current_root && // not a nested struct inside an @interface section current_root->section!=Entry::INTERFACE_SEC && (current->section==Entry::INTERFACE_SEC || - current->section==Entry::OBJCIMPL_SEC) && + current->section==Entry::OBJCIMPL_SEC || + current->section==Entry::PROTOCOL_SEC || + current->section==Entry::CATEGORY_SEC) && insideObjC ) { // ObjC body that ends with @end @@ -4418,20 +4417,6 @@ static void handleCommentBlock(const QCString &doc,bool brief) int position=0; bool needsEntry=FALSE; if (docBlockInBody && hideInBodyDocs) return; -#if 0 - if (docBlockInBody) - { - if (previous==0) - { - ASSERT(previous!=0); // shouldn't happen - goto exit; - } - if (!previous->doc.isEmpty()) - { // start a new paragraph for the next piece of text found in the body - previous->doc=previous->doc.stripWhiteSpace()+"\n\n"; - } - } -#endif //printf("parseCommentBlock [%s]\n",doc.data()); while (parseCommentBlock( g_thisParser, @@ -4456,9 +4441,6 @@ static void handleCommentBlock(const QCString &doc,bool brief) newEntry(); } -#if 0 -exit: -#endif if (docBlockTerm) { unput(docBlockTerm); @@ -4525,90 +4507,11 @@ static void handleParametersCommentBlocks() //---------------------------------------------------------------------------- -//static void startGroupInDoc() -//{ -// if (current->section==Entry::GROUPDOC_SEC ) /* scope for a non-member group: @defgroup */ -// { -// autoGroupStack.push(new Grouping(current->name, -// current->groupingPri() -// )); -// } -// else /* if (current->section == Entry::MEMBERGRP_SEC) scope for a member group: @name */ -// { -// if (memberGroupId!=DOX_NOGROUP) -// { -// warn(yyFileName,yyLineNr,"Warning: member groups cannot be nested. Ending current group!\n"); -// endGroup(); -// } -// memberGroupId = newMemberGroupId(); -// MemberGroupInfo *info = new MemberGroupInfo; -// if (current->section == Entry::MEMBERGRP_SEC) -// { -// info->header = memberGroupHeader.stripWhiteSpace(); -// } -// Doxygen::memGrpInfoDict.insert(memberGroupId,info); -// memberGroupRelates = current->relates; -// memberGroupInside = current->inside; -// current->mGrpId = memberGroupId; -// } -//} -// -////---------------------------------------------------------------------------- -// -//static void endGroup() -//{ -// if (memberGroupId!=DOX_NOGROUP) // end of member group -// { -// //Doxygen::memberDocDict.insert(memberGroupId, -// // new QCString(memberGroupDocs) -// // ); -// MemberGroupInfo *info=Doxygen::memGrpInfoDict.find(memberGroupId); -// if (info) -// { -// info->doc = memberGroupDocs; -// info->docFile = yyFileName; -// } -// memberGroupId=DOX_NOGROUP; -// memberGroupRelates.resize(0); -// memberGroupInside.resize(0); -// if (YY_START!=ReadInitializer) -// { -// current->mGrpId=DOX_NOGROUP; -// current->relates.resize(0); -// } -// memberGroupDocs.resize(0); -// } -// else if (!autoGroupStack.isEmpty()) // end of group -// { -// Grouping *current = autoGroupStack.pop(); -// Grouping *parent = autoGroupStack.top(); -// if( parent ) { -// setCurrentGroup( &parent->groupname, parent->pri ); -// } else { -// setCurrentGroup( 0, Grouping::GROUPING_LOWEST ); -// } -// delete current; -// } -//} -// -////---------------------------------------------------------------------------- -// -//static void forceEndGroup() -//{ -// while (memberGroupId!=DOX_NOGROUP || !autoGroupStack.isEmpty()) -// { -// //printf("forceEndGroup ends group %d\n",memberGroupId); -// endGroup(); -// } -//} - -//---------------------------------------------------------------------------- - static void parseCompounds(Entry *rt) { //printf("parseCompounds(%s)\n",rt->name.data()); g_inputFromFile = FALSE; - EntryListIterator eli(*rt->sublist); + EntryListIterator eli(*rt->children()); Entry *ce; for (;(ce=eli.current());++eli) { diff --git a/src/translator_ar.h b/src/translator_ar.h new file mode 100644 index 0000000..7ce9c0a --- /dev/null +++ b/src/translator_ar.h @@ -0,0 +1,1615 @@ +/****************************************************************************** + * + * + * + * Copyright (C) 1997-2005 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. + * + */ + +/* + * Arabic translation for Doxygen + * + * Please send your comments on this translation to moazreyad@yahoo.com + * + * Note : consider this file as Beta version for testing Arabic output with Doxygen. + * + * Revision history : + * + * 6/2006 : Created initial version of Arabic translation. + */ + +#ifndef TRANSLATOR_AR_H +#define TRANSLATOR_AR_H + +class TranslatorArabic : public TranslatorAdapter_1_4_6 +{ + protected: + friend class TranslatorAdapterBase; + virtual ~TranslatorArabic() {} + + public: + + // --- Language control methods ------------------- + + /*! Used for identification of the language. The identification + * should not be translated. It should be replaced by the name + * of the language in English using lower-case characters only + * (e.g. "czech", "japanese", "russian", etc.). It should be equal to + * the identification used in language.cpp. + */ + virtual QCString idLanguage() + { return "arabic"; } + + /*! Used to get the LaTeX command(s) for the language support. + * This method should return string with commands that switch + * LaTeX to the desired language. For example + * <pre>"\\usepackage[german]{babel}\n" + * </pre> + * or + * <pre>"\\usepackage{polski}\n" + * "\\usepackage[latin2]{inputenc}\n" + * "\\usepackage[T1]{fontenc}\n" + * </pre> + * + * The English LaTeX does not use such commands. Because of this + * the empty string is returned in this implementation. + */ + virtual QCString latexLanguageSupportCommand() + { + return ""; + } + + /*! return the language charset. This will be used for the HTML output */ + virtual QCString idLanguageCharset() + { + return "cp 1256"; + } + + // --- Language translation methods ------------------- + + /*! used in the compound documentation before a list of related functions. */ + virtual QCString trRelatedFunctions() + { return " "; } + + /*! subscript for the related functions. */ + virtual QCString trRelatedSubscript() + { return "( )"; } + + /*! header that is put before the detailed description of files, classes and namespaces. */ + virtual QCString trDetailedDescription() + { return " "; } + + /*! header that is put before the list of typedefs. */ + virtual QCString trMemberTypedefDocumentation() + { return " "; } + + /*! header that is put before the list of enumerations. */ + virtual QCString trMemberEnumerationDocumentation() + { return " "; } + + /*! header that is put before the list of member functions. */ + virtual QCString trMemberFunctionDocumentation() + { return " "; } + + /*! header that is put before the list of member attributes. */ + virtual QCString trMemberDataDocumentation() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return " "; + } + else + { + return " "; + } + } + + /*! this is the text of a link put after brief descriptions. */ + virtual QCString trMore() + { return " ..."; } + + /*! put in the class documentation */ + virtual QCString trListOfAllMembers() + { return " "; } + + /*! used as the title of the "list of all members" page of a class */ + virtual QCString trMemberList() + { return " "; } + + /*! this is the first part of a sentence that is followed by a class name */ + virtual QCString trThisIsTheListOfAllMembers() + { return " "; } + + /*! this is the remainder of the sentence after the class name */ + virtual QCString trIncludingInheritedMembers() + { return ", "; } + + /*! this is put at the author sections at the bottom of man pages. + * parameter s is name of the project name. + */ + virtual QCString trGeneratedAutomatically(const char *s) + { QCString result=" Doxygen"; + if (s) result+=(QCString)" "+s; + result+=" ."; + return result; + } + + /*! put after an enum name in the list of all members */ + virtual QCString trEnumName() + { return " "; } + + /*! put after an enum value in the list of all members */ + virtual QCString trEnumValue() + { return " "; } + + /*! put after an undocumented member in the list of all members */ + virtual QCString trDefinedIn() + { return " "; } + + // quick reference sections + + /*! This is put above each page as a link to the list of all groups of + * compounds or files (see the \\group command). + */ + virtual QCString trModules() + { return ""; } + + /*! This is put above each page as a link to the class hierarchy */ + virtual QCString trClassHierarchy() + { return " "; } + + /*! This is put above each page as a link to the list of annotated classes */ + virtual QCString trCompoundList() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return " "; + } + else + { + return " "; + } + } + + /*! This is put above each page as a link to the list of documented files */ + virtual QCString trFileList() + { return " "; } + + /*! This is put above each page as a link to the list of all verbatim headers */ + virtual QCString trHeaderFiles() + { return " "; } + + /*! This is put above each page as a link to all members of compounds. */ + virtual QCString trCompoundMembers() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return " "; + } + else + { + return " "; + } + } + + /*! This is put above each page as a link to all members of files. */ + virtual QCString trFileMembers() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return ""; + } + else + { + return " "; + } + } + + /*! This is put above each page as a link to all related pages. */ + virtual QCString trRelatedPages() + { return " "; } + + /*! This is put above each page as a link to all examples. */ + virtual QCString trExamples() + { return ""; } + + /*! This is put above each page as a link to the search engine. */ + virtual QCString trSearch() + { return ""; } + + /*! This is an introduction to the class hierarchy. */ + virtual QCString trClassHierarchyDescription() + { return " " + " :"; + } + + /*! This is an introduction to the list with all files. */ + virtual QCString trFileListDescription(bool extractAll) + { + QCString result=" "; + if (!extractAll) result+=" "; + result+=" :"; + return result; + } + + /*! This is an introduction to the annotated compound list. */ + virtual QCString trCompoundListDescription() + { + + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return " :"; + } + else + { + return " " + " :"; + } + } + + /*! This is an introduction to the page with all class members. */ + virtual QCString trCompoundMembersDescription(bool extractAll) + { + QCString result=" "; + + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+=" "; + } + else + { + result+=" "; + } + if (!extractAll) + { + result+=" "; + } + result+=" "; + if (!extractAll) + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+=" / :"; + } + else + { + result+=" :"; + } + } + else + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="/ :"; + } + else + { + result+=" :"; + } + } + return result; + } + + /*! This is an introduction to the page with all file members. */ + virtual QCString trFileMembersDescription(bool extractAll) + { + QCString result="Here is a list of all "; + if (!extractAll) result+="documented "; + + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="functions, variables, defines, enums, and typedefs"; + } + else + { + result+="file members"; + } + result+=" with links to "; + if (extractAll) + result+="the files they belong to:"; + else + result+="the documentation:"; + return result; + } + + /*! This is an introduction to the page with the list of all header files. */ + virtual QCString trHeaderFilesDescription() + { return "Here are the header files that make up the API:"; } + + /*! This is an introduction to the page with the list of all examples */ + virtual QCString trExamplesDescription() + { return " :"; } + + /*! This is an introduction to the page with the list of related pages */ + virtual QCString trRelatedPagesDescription() + { return " :"; } + + /*! This is an introduction to the page with the list of class/file groups */ + virtual QCString trModulesDescription() + { return " :"; } + + /*! This sentences is used in the annotated class/file lists if no brief + * description is given. + */ + virtual QCString trNoDescriptionAvailable() + { return " "; } + + // index titles (the project name is prepended for these) + + + /*! This is used in HTML as the title of index.html. */ + virtual QCString trDocumentation() + { return ""; } + + /*! This is used in LaTeX as the title of the chapter with the + * index of all groups. + */ + virtual QCString trModuleIndex() + { return " "; } + + /*! This is used in LaTeX as the title of the chapter with the + * class hierarchy. + */ + virtual QCString trHierarchicalIndex() + { return " "; } + + /*! This is used in LaTeX as the title of the chapter with the + * annotated compound index. + */ + virtual QCString trCompoundIndex() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return " "; + } + else + { + return " "; + } + } + + /*! This is used in LaTeX as the title of the chapter with the + * list of all files. + */ + virtual QCString trFileIndex() + { return " "; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all groups. + */ + virtual QCString trModuleDocumentation() + { return " "; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all classes, structs and unions. + */ + virtual QCString trClassDocumentation() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return " "; + } + else + { + return " "; + } + } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all files. + */ + virtual QCString trFileDocumentation() + { return " "; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all examples. + */ + virtual QCString trExampleDocumentation() + { return " "; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all related pages. + */ + virtual QCString trPageDocumentation() + { return " "; } + + /*! This is used in LaTeX as the title of the document */ + virtual QCString trReferenceManual() + { return " "; } + + /*! This is used in the documentation of a file as a header before the + * list of defines + */ + virtual QCString trDefines() + { return ""; } + + /*! This is used in the documentation of a file as a header before the + * list of function prototypes + */ + virtual QCString trFuncProtos() + { return "Function Prototypes"; } + + /*! This is used in the documentation of a file as a header before the + * list of typedefs + */ + virtual QCString trTypedefs() + { return "Typedefs"; } + + /*! This is used in the documentation of a file as a header before the + * list of enumerations + */ + virtual QCString trEnumerations() + { return ""; } + + /*! This is used in the documentation of a file as a header before the + * list of (global) functions + */ + virtual QCString trFunctions() + { return ""; } + + /*! This is used in the documentation of a file as a header before the + * list of (global) variables + */ + virtual QCString trVariables() + { return ""; } + + /*! This is used in the documentation of a file as a header before the + * list of (global) variables + */ + virtual QCString trEnumerationValues() + { return "Enumerator"; } + + /*! This is used in the documentation of a file before the list of + * documentation blocks for defines + */ + virtual QCString trDefineDocumentation() + { return "Define Documentation"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for function prototypes + */ + virtual QCString trFunctionPrototypeDocumentation() + { return "Function Prototype Documentation"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for typedefs + */ + virtual QCString trTypedefDocumentation() + { return "Typedef Documentation"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration types + */ + virtual QCString trEnumerationTypeDocumentation() + { return "Enumeration Type Documentation"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration values + */ + virtual QCString trEnumerationValueDocumentation() + { return "Enumerator Documentation"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for functions + */ + virtual QCString trFunctionDocumentation() + { return " "; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for variables + */ + virtual QCString trVariableDocumentation() + { return " "; } + + /*! This is used in the documentation of a file/namespace/group before + * the list of links to documented compounds + */ + virtual QCString trCompounds() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return " "; + } + else + { + return ""; + } + } + + /*! This is used in the standard footer of each page and indicates when + * the page was generated + */ + virtual QCString trGeneratedAt(const char *date,const char *projName) + { + QCString result=(QCString)"Generated on "+date; + if (projName) result+=(QCString)" for "+projName; + result+=(QCString)" by"; + return result; + } + /*! This is part of the sentence used in the standard footer of each page. + */ + virtual QCString trWrittenBy() + { + return " "; + } + + /*! this text is put before a class diagram */ + virtual QCString trClassDiagram(const char *clName) + { + return (QCString)"Inheritance diagram for "+clName+":"; + } + + /*! this text is generated when the \\internal command is used. */ + virtual QCString trForInternalUseOnly() + { return " ."; } + + /*! this text is generated when the \\reimp command is used. */ + virtual QCString trReimplementedForInternalReasons() + { return "Reimplemented for internal reasons; the API is not affected."; } + + /*! this text is generated when the \\warning command is used. */ + virtual QCString trWarning() + { return ""; } + + /*! this text is generated when the \\bug command is used. */ + virtual QCString trBugsAndLimitations() + { return "Bugs and limitations"; } + + /*! this text is generated when the \\version command is used. */ + virtual QCString trVersion() + { return ""; } + + /*! this text is generated when the \\date command is used. */ + virtual QCString trDate() + { return ""; } + + /*! this text is generated when the \\return command is used. */ + virtual QCString trReturns() + { return "Returns"; } + + /*! this text is generated when the \\sa command is used. */ + virtual QCString trSeeAlso() + { return " "; } + + /*! this text is generated when the \\param command is used. */ + virtual QCString trParameters() + { return "Parameters"; } + + /*! this text is generated when the \\exception command is used. */ + virtual QCString trExceptions() + { return ""; } + + /*! this text is used in the title page of a LaTeX document. */ + virtual QCString trGeneratedBy() + { return " "; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990307 +////////////////////////////////////////////////////////////////////////// + + /*! used as the title of page containing all the index of all namespaces. */ + virtual QCString trNamespaceList() + { return " "; } + + /*! used as an introduction to the namespace list */ + virtual QCString trNamespaceListDescription(bool extractAll) + { + QCString result="Here is a list of all "; + if (!extractAll) result+="documented "; + result+="namespaces with brief descriptions:"; + return result; + } + + /*! used in the class documentation as a header before the list of all + * friends of a class + */ + virtual QCString trFriends() + { return "Friends"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990405 +////////////////////////////////////////////////////////////////////////// + + /*! used in the class documentation as a header before the list of all + * related classes + */ + virtual QCString trRelatedFunctionDocumentation() + { return "Friends And Related Function Documentation"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990425 +////////////////////////////////////////////////////////////////////////// + + /*! used as the title of the HTML page of a class/struct/union */ + virtual QCString trCompoundReference(const char *clName, + ClassDef::CompoundType compType, + bool isTemplate) + { + QCString result=(QCString)clName; + switch(compType) + { + case ClassDef::Class: result+=" Class"; break; + case ClassDef::Struct: result+=" Struct"; break; + case ClassDef::Union: result+=" Union"; break; + case ClassDef::Interface: result+=" Interface"; break; + case ClassDef::Protocol: result+=" Protocol"; break; + case ClassDef::Category: result+=" Category"; break; + case ClassDef::Exception: result+=" Exception"; break; + } + if (isTemplate) result+=" Template"; + result+=" Reference"; + return result; + } + + /*! used as the title of the HTML page of a file */ + virtual QCString trFileReference(const char *fileName) + { + QCString result=fileName; + result+=" File Reference"; + return result; + } + + /*! used as the title of the HTML page of a namespace */ + virtual QCString trNamespaceReference(const char *namespaceName) + { + QCString result=namespaceName; + result+=" Namespace Reference"; + return result; + } + + virtual QCString trPublicMembers() + { return "Public Member Functions"; } + virtual QCString trPublicSlots() + { return "Public Slots"; } + virtual QCString trSignals() + { return "Signals"; } + virtual QCString trStaticPublicMembers() + { return "Static Public Member Functions"; } + virtual QCString trProtectedMembers() + { return "Protected Member Functions"; } + virtual QCString trProtectedSlots() + { return "Protected Slots"; } + virtual QCString trStaticProtectedMembers() + { return "Static Protected Member Functions"; } + virtual QCString trPrivateMembers() + { return "Private Member Functions"; } + virtual QCString trPrivateSlots() + { return "Private Slots"; } + virtual QCString trStaticPrivateMembers() + { return "Static Private Member Functions"; } + + /*! this function is used to produce a comma-separated list of items. + * use generateMarker(i) to indicate where item i should be put. + */ + virtual QCString trWriteList(int numEntries) + { + QCString result; + int i; + // the inherits list contain `numEntries' classes + for (i=0;i<numEntries;i++) + { + // use generateMarker to generate placeholders for the class links! + result+=generateMarker(i); // generate marker for entry i in the list + // (order is left to right) + + if (i!=numEntries-1) // not the last entry, so we need a separator + { + if (i<numEntries-2) // not the fore last entry + result+=", "; + else // the fore last entry + result+=", and "; + } + } + return result; + } + + /*! used in class documentation to produce a list of base classes, + * if class diagrams are disabled. + */ + virtual QCString trInheritsList(int numEntries) + { + return "Inherits "+trWriteList(numEntries)+"."; + } + + /*! used in class documentation to produce a list of super classes, + * if class diagrams are disabled. + */ + virtual QCString trInheritedByList(int numEntries) + { + return "Inherited by "+trWriteList(numEntries)+"."; + } + + /*! used in member documentation blocks to produce a list of + * members that are hidden by this one. + */ + virtual QCString trReimplementedFromList(int numEntries) + { + return "Reimplemented from "+trWriteList(numEntries)+"."; + } + + /*! used in member documentation blocks to produce a list of + * all member that overwrite the implementation of this member. + */ + virtual QCString trReimplementedInList(int numEntries) + { + return "Reimplemented in "+trWriteList(numEntries)+"."; + } + + /*! This is put above each page as a link to all members of namespaces. */ + virtual QCString trNamespaceMembers() + { return "Namespace Members"; } + + /*! This is an introduction to the page with all namespace members */ + virtual QCString trNamespaceMemberDescription(bool extractAll) + { + QCString result="Here is a list of all "; + if (!extractAll) result+="documented "; + result+="namespace members with links to "; + if (extractAll) + result+="the namespace documentation for each member:"; + else + result+="the namespaces they belong to:"; + return result; + } + /*! This is used in LaTeX as the title of the chapter with the + * index of all namespaces. + */ + virtual QCString trNamespaceIndex() + { return " "; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all namespaces. + */ + virtual QCString trNamespaceDocumentation() + { return " "; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990522 +////////////////////////////////////////////////////////////////////////// + + /*! This is used in the documentation before the list of all + * namespaces in a file. + */ + virtual QCString trNamespaces() + { return " "; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990728 +////////////////////////////////////////////////////////////////////////// + + /*! This is put at the bottom of a class documentation page and is + * followed by a list of files that were used to generate the page. + */ + virtual QCString trGeneratedFromFiles(ClassDef::CompoundType compType, + bool single) + { // here s is one of " Class", " Struct" or " Union" + // single is true implies a single file + QCString result=(QCString)" "; + switch(compType) + { + case ClassDef::Class: result+=" "; break; + case ClassDef::Struct: result+=" "; break; + case ClassDef::Union: result+=" "; break; + case ClassDef::Interface: result+=" "; break; + case ClassDef::Protocol: result+=" "; break; + case ClassDef::Category: result+=" "; break; + case ClassDef::Exception: result+=" "; break; + } + result+=" "; + if (single) result+=" :"; else result+=" :"; + return result; + } + + /*! This is in the (quick) index as a link to the alphabetical compound + * list. + */ + virtual QCString trAlphabeticalList() + { return " "; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990901 +////////////////////////////////////////////////////////////////////////// + + /*! This is used as the heading text for the retval command. */ + virtual QCString trReturnValues() + { return " "; } + + /*! This is in the (quick) index as a link to the main page (index.html) + */ + virtual QCString trMainPage() + { return " "; } + + /*! This is used in references to page that are put in the LaTeX + * documentation. It should be an abbreviation of the word page. + */ + virtual QCString trPageAbbreviation() + { return "."; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-991003 +////////////////////////////////////////////////////////////////////////// + + virtual QCString trSources() + { + return ""; + } + virtual QCString trDefinedAtLineInSourceFile() + { + return "Definition at line @0 of file @1."; + } + virtual QCString trDefinedInSourceFile() + { + return "Definition in file @0."; + } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-991205 +////////////////////////////////////////////////////////////////////////// + + virtual QCString trDeprecated() + { + return "Deprecated"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.0.0 +////////////////////////////////////////////////////////////////////////// + + /*! this text is put before a collaboration diagram */ + virtual QCString trCollaborationDiagram(const char *clName) + { + return (QCString)" "+clName+":"; + } + /*! this text is put before an include dependency graph */ + virtual QCString trInclDepGraph(const char *fName) + { + return (QCString)" "+fName+":"; + } + /*! header that is put before the list of constructor/destructors. */ + virtual QCString trConstructorDocumentation() + { + return " "; + } + /*! Used in the file documentation to point to the corresponding sources. */ + virtual QCString trGotoSourceCode() + { + return " ."; + } + /*! Used in the file sources to point to the corresponding documentation. */ + virtual QCString trGotoDocumentation() + { + return " ."; + } + /*! Text for the \\pre command */ + virtual QCString trPrecondition() + { + return " "; + } + /*! Text for the \\post command */ + virtual QCString trPostcondition() + { + return " "; + } + /*! Text for the \\invariant command */ + virtual QCString trInvariant() + { + return ""; + } + /*! Text shown before a multi-line variable/enum initialization */ + virtual QCString trInitialValue() + { + return " :"; + } + /*! Text used the source code in the file index */ + virtual QCString trCode() + { + return ""; + } + virtual QCString trGraphicalHierarchy() + { + return " "; + } + virtual QCString trGotoGraphicalHierarchy() + { + return " "; + } + virtual QCString trGotoTextualHierarchy() + { + return " "; + } + virtual QCString trPageIndex() + { + return " "; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.1.0 +////////////////////////////////////////////////////////////////////////// + + virtual QCString trNote() + { + return ""; + } + virtual QCString trPublicTypes() + { + return " "; + } + virtual QCString trPublicAttribs() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return " "; + } + else + { + return " "; + } + } + virtual QCString trStaticPublicAttribs() + { + return " "; + } + virtual QCString trProtectedTypes() + { + return " "; + } + virtual QCString trProtectedAttribs() + { + return " "; + } + virtual QCString trStaticProtectedAttribs() + { + return " "; + } + virtual QCString trPrivateTypes() + { + return " "; + } + virtual QCString trPrivateAttribs() + { + return " "; + } + virtual QCString trStaticPrivateAttribs() + { + return " "; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.1.3 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a marker that is put before a \\todo item */ + virtual QCString trTodo() + { + return ""; + } + /*! Used as the header of the todo list */ + virtual QCString trTodoList() + { + return " "; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.1.4 +////////////////////////////////////////////////////////////////////////// + + virtual QCString trReferencedBy() + { + return " "; + } + virtual QCString trRemarks() + { + return ""; + } + virtual QCString trAttention() + { + return ""; + } + virtual QCString trInclByDepGraph() + { + return " " + " :"; + } + virtual QCString trSince() + { + return ""; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.1.5 +////////////////////////////////////////////////////////////////////////// + + /*! title of the graph legend page */ + virtual QCString trLegendTitle() + { + return "Graph Legend"; + } + /*! page explaining how the dot graph's should be interpreted + * The %A in the text below are to prevent link to classes called "A". + */ + virtual QCString trLegendDocs() + { + return + "This page explains how to interpret the graphs that are generated " + "by doxygen.<p>\n" + "Consider the following example:\n" + "\\code\n" + "/*! Invisible class because of truncation */\n" + "class Invisible { };\n\n" + "/*! Truncated class, inheritance relation is hidden */\n" + "class Truncated : public Invisible { };\n\n" + "/* Class not documented with doxygen comments */\n" + "class Undocumented { };\n\n" + "/*! Class that is inherited using public inheritance */\n" + "class PublicBase : public Truncated { };\n\n" + "/*! A template class */\n" + "template<class T> class Templ { };\n\n" + "/*! Class that is inherited using protected inheritance */\n" + "class ProtectedBase { };\n\n" + "/*! Class that is inherited using private inheritance */\n" + "class PrivateBase { };\n\n" + "/*! Class that is used by the Inherited class */\n" + "class Used { };\n\n" + "/*! Super class that inherits a number of other classes */\n" + "class Inherited : public PublicBase,\n" + " protected ProtectedBase,\n" + " private PrivateBase,\n" + " public Undocumented\n" + " public Templ<int>\n" + "{\n" + " private:\n" + " Used *m_usedClass;\n" + "};\n" + "\\endcode\n" + "If the \\c MAX_DOT_GRAPH_HEIGHT tag in the configuration file " + "is set to 240 this will result in the following graph:" + "<p><center><img alt=\"\" src=\"graph_legend."+Config_getEnum("DOT_IMAGE_FORMAT")+"\"></center>\n" + "<p>\n" + "The boxes in the above graph have the following meaning:\n" + "<ul>\n" + "<li>%A filled black box represents the struct or class for which the " + "graph is generated.\n" + "<li>%A box with a black border denotes a documented struct or class.\n" + "<li>%A box with a grey border denotes an undocumented struct or class.\n" + "<li>%A box with a red border denotes a documented struct or class for" + "which not all inheritance/containment relations are shown. %A graph is " + "truncated if it does not fit within the specified boundaries.\n" + "</ul>\n" + "The arrows have the following meaning:\n" + "<ul>\n" + "<li>%A dark blue arrow is used to visualize a public inheritance " + "relation between two classes.\n" + "<li>%A dark green arrow is used for protected inheritance.\n" + "<li>%A dark red arrow is used for private inheritance.\n" + "<li>%A purple dashed arrow is used if a class is contained or used " + "by another class. The arrow is labeled with the variable(s) " + "through which the pointed class or struct is accessible.\n" + "<li>%A yellow dashed arrow denotes a relation between a template instance and " + "the template class it was instantiated from. The arrow is labeled with " + "the template parameters of the instance.\n" + "</ul>\n"; + } + /*! text for the link to the legend page */ + virtual QCString trLegend() + { + return "legend"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.0 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a marker that is put before a test item */ + virtual QCString trTest() + { + return ""; + } + /*! Used as the header of the test list */ + virtual QCString trTestList() + { + return " "; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.1 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a section header for KDE-2 IDL methods */ + virtual QCString trDCOPMethods() + { + return "DCOP Member Functions"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.2 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a section header for IDL properties */ + virtual QCString trProperties() + { + return ""; + } + /*! Used as a section header for IDL property documentation */ + virtual QCString trPropertyDocumentation() + { + return " "; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.4 +////////////////////////////////////////////////////////////////////////// + + /*! Used for Java interfaces in the summary section of Java packages */ + virtual QCString trInterfaces() + { + return ""; + } + /*! Used for Java classes in the summary section of Java packages */ + virtual QCString trClasses() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return " "; + } + else + { + return ""; + } + } + /*! Used as the title of a Java package */ + virtual QCString trPackage(const char *name) + { + return (QCString)" "+name; + } + /*! Title of the package index page */ + virtual QCString trPackageList() + { + return " "; + } + /*! The description of the package index page */ + virtual QCString trPackageListDescription() + { + return " ) ( :"; + } + /*! The link name in the Quick links header for each page */ + virtual QCString trPackages() + { + return ""; + } + /*! Used as a chapter title for Latex & RTF output */ + virtual QCString trPackageDocumentation() + { + return " "; + } + /*! Text shown before a multi-line define */ + virtual QCString trDefineValue() + { + return ":"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.5 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a marker that is put before a \\bug item */ + virtual QCString trBug() + { + return ""; + } + /*! Used as the header of the bug list */ + virtual QCString trBugList() + { + return " "; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.6 +////////////////////////////////////////////////////////////////////////// + + /*! Used as ansicpg for RTF file + * + * The following table shows the correlation of Charset name, Charset Value and + * <pre> + * Codepage number: + * Charset Name Charset Value(hex) Codepage number + * ------------------------------------------------------ + * DEFAULT_CHARSET 1 (x01) + * SYMBOL_CHARSET 2 (x02) + * OEM_CHARSET 255 (xFF) + * ANSI_CHARSET 0 (x00) 1252 + * RUSSIAN_CHARSET 204 (xCC) 1251 + * EE_CHARSET 238 (xEE) 1250 + * GREEK_CHARSET 161 (xA1) 1253 + * TURKISH_CHARSET 162 (xA2) 1254 + * BALTIC_CHARSET 186 (xBA) 1257 + * HEBREW_CHARSET 177 (xB1) 1255 + * ARABIC _CHARSET 178 (xB2) 1256 + * SHIFTJIS_CHARSET 128 (x80) 932 + * HANGEUL_CHARSET 129 (x81) 949 + * GB2313_CHARSET 134 (x86) 936 + * CHINESEBIG5_CHARSET 136 (x88) 950 + * </pre> + * + */ + virtual QCString trRTFansicp() + { + return "1256"; + } + + + /*! Used as ansicpg for RTF fcharset + * \see trRTFansicp() for a table of possible values. + */ + virtual QCString trRTFCharSet() + { + return "0"; + } + + /*! Used as header RTF general index */ + virtual QCString trRTFGeneralIndex() + { + return ""; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trClass(bool /*first_capital*/, bool singular) + { + QCString result(""); + if (!singular) result=""; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trFile(bool /*first_capital*/, bool singular) + { + QCString result(""); + if (!singular) result=""; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trNamespace(bool /*first_capital*/, bool singular) + { + QCString result(" "); + if (!singular) result=" "; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trGroup(bool /*first_capital*/, bool singular) + { + QCString result(""); + if (!singular) result=""; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trPage(bool /*first_capital*/, bool singular) + { + QCString result(""); + if (!singular) result=""; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trMember(bool /*first_capital*/, bool singular) + { + QCString result(""); + if (!singular) result=""; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trField(bool /*first_capital*/, bool singular) + { + QCString result(""); + if (!singular) result=""; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trGlobal(bool /*first_capital*/, bool singular) + { + QCString result(""); + if (!singular) result=""; + return result; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.7 +////////////////////////////////////////////////////////////////////////// + + /*! This text is generated when the \\author command is used and + * for the author section in man pages. */ + virtual QCString trAuthor(bool /*first_capital*/, bool singular) + { + QCString result(""); + if (!singular) result=""; + return result; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.11 +////////////////////////////////////////////////////////////////////////// + + /*! This text is put before the list of members referenced by a member + */ + virtual QCString trReferences() + { + return ""; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.13 +////////////////////////////////////////////////////////////////////////// + + /*! used in member documentation blocks to produce a list of + * members that are implemented by this one. + */ + virtual QCString trImplementedFromList(int numEntries) + { + return "Implements "+trWriteList(numEntries)+"."; + } + + /*! used in member documentation blocks to produce a list of + * all members that implement this abstract member. + */ + virtual QCString trImplementedInList(int numEntries) + { + return "Implemented in "+trWriteList(numEntries)+"."; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.16 +////////////////////////////////////////////////////////////////////////// + + /*! used in RTF documentation as a heading for the Table + * of Contents. + */ + virtual QCString trRTFTableOfContents() + { + return " "; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.17 +////////////////////////////////////////////////////////////////////////// + + /*! Used as the header of the list of item that have been + * flagged deprecated + */ + virtual QCString trDeprecatedList() + { + return "Deprecated List"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.18 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a header for declaration section of the events found in + * a C# program + */ + virtual QCString trEvents() + { + return ""; + } + /*! Header used for the documentation section of a class' events. */ + virtual QCString trEventDocumentation() + { + return " "; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.3 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a heading for a list of Java class types with package scope. + */ + virtual QCString trPackageTypes() + { + return " "; + } + /*! Used as a heading for a list of Java class functions with package + * scope. + */ + virtual QCString trPackageMembers() + { + return " "; + } + /*! Used as a heading for a list of static Java class functions with + * package scope. + */ + virtual QCString trStaticPackageMembers() + { + return " "; + } + /*! Used as a heading for a list of Java class variables with package + * scope. + */ + virtual QCString trPackageAttribs() + { + return " "; + } + /*! Used as a heading for a list of static Java class variables with + * package scope. + */ + virtual QCString trStaticPackageAttribs() + { + return " "; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.3.1 +////////////////////////////////////////////////////////////////////////// + + /*! Used in the quick index of a class/file/namespace member list page + * to link to the unfiltered list of all members. + */ + virtual QCString trAll() + { + return ""; + } + /*! Put in front of the call graph for a function. */ + virtual QCString trCallGraph() + { + return " :"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.3.3 +////////////////////////////////////////////////////////////////////////// + + /*! When the search engine is enabled this text is put in the header + * of each page before the field where one can enter the text to search + * for. + */ + virtual QCString trSearchForIndex() + { + return " "; + } + /*! This string is used as the title for the page listing the search + * results. + */ + virtual QCString trSearchResultsTitle() + { + return " "; + } + /*! This string is put just before listing the search results. The + * text can be different depending on the number of documents found. + * Inside the text you can put the special marker $num to insert + * the number representing the actual number of search results. + * The @a numDocuments parameter can be either 0, 1 or 2, where the + * value 2 represents 2 or more matches. HTML markup is allowed inside + * the returned string. + */ + virtual QCString trSearchResults(int numDocuments) + { + if (numDocuments==0) + { + return " ."; + } + else if (numDocuments==1) + { + return " . <b>1</b> ."; + } + else + { + return " <b>$num</b> ." + " ."; + } + } + /*! This string is put before the list of matched words, for each search + * result. What follows is the list of words that matched the query. + */ + virtual QCString trSearchMatches() + { + return " :"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.3.8 +////////////////////////////////////////////////////////////////////////// + + /*! This is used in HTML as the title of page with source code for file filename + */ + virtual QCString trSourceFile(QCString& filename) + { + return " " + filename ; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.3.9 +////////////////////////////////////////////////////////////////////////// + + /*! This is used as the name of the chapter containing the directory + * hierarchy. + */ + virtual QCString trDirIndex() + { return " "; } + + /*! This is used as the name of the chapter containing the documentation + * of the directories. + */ + virtual QCString trDirDocumentation() + { return " "; } + + /*! This is used as the title of the directory index and also in the + * Quick links of an HTML page, to link to the directory hierarchy. + */ + virtual QCString trDirectories() + { return ""; } + + /*! This returns a sentences that introduces the directory hierarchy. + * and the fact that it is sorted alphabetically per level + */ + virtual QCString trDirDescription() + { return " ɡ " + " :"; + } + + /*! This returns the title of a directory page. The name of the + * directory is passed via \a dirName. + */ + virtual QCString trDirReference(const char *dirName) + { QCString result=" "; result+=dirName; return result; } + + /*! This returns the word directory with or without starting capital + * (\a first_capital) and in sigular or plural form (\a singular). + */ + virtual QCString trDir(bool first_capital, bool singular) + { + QCString result((first_capital ? "Director" : "director")); + if (singular) result+="y"; else result+="ies"; + return result; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.4.1 +////////////////////////////////////////////////////////////////////////// + + /*! This text is added to the documentation when the \\overload command + * is used for a overloaded function. + */ + virtual QCString trOverloadText() + { + return " " + " . " + " argument(s) ."; + } +}; + +#endif diff --git a/src/translator_br.h b/src/translator_br.h index 8363795..45cb083 100644 --- a/src/translator_br.h +++ b/src/translator_br.h @@ -12,9 +12,12 @@ * * Brazilian Portuguese version by * Fabio "FJTC" Jun Takada Chino <jun-chino at uol.com.br> - * Version: 1.4.1 (2005/03/20) + * Version: 1.4.6 (2006/06/26) * * History: + * 1.4.6 + * - trCallerGraph() added. + * - trEnumerationValueDocumentation() added. * 1.4.1 * - Method trOverloadText() added. * 1.3.9 @@ -36,7 +39,7 @@ #ifndef TRANSLATOR_BR_H #define TRANSLATOR_BR_H -class TranslatorBrazilian : public TranslatorAdapter_1_4_6 +class TranslatorBrazilian : public Translator { public: @@ -490,12 +493,6 @@ class TranslatorBrazilian : public TranslatorAdapter_1_4_6 { return "Enumeraes"; } /*! This is used in the documentation of a file/namespace before the list - * of documentation blocks for enumeration values - */ - virtual QCString trEnumerationValueDocumentation() - { return "Valores enumerados"; } - - /*! This is used in the documentation of a file/namespace before the list * of documentation blocks for functions */ virtual QCString trFunctionDocumentation() @@ -1612,6 +1609,22 @@ class TranslatorBrazilian : public TranslatorAdapter_1_4_6 "Ele difere do mtodo acima apenas na lista de " "argumentos que devem ser utilizados."; } - + +////////////////////////////////////////////////////////////////////////// +// new since 1.4.6 +////////////////////////////////////////////////////////////////////////// + + /*! This is used to introduce a caller (or called-by) graph */ + virtual QCString trCallerGraph() + { + return "Este o diagrama de chamadas para esta funo:"; + } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration values + */ + virtual QCString trEnumerationValueDocumentation() + { return "Documentao da enumerao"; } + }; #endif diff --git a/src/translator_ca.h b/src/translator_ca.h index 62b4a2b..d2a0be3 100644 --- a/src/translator_ca.h +++ b/src/translator_ca.h @@ -39,7 +39,7 @@ // Translator class (by the local maintainer) when the localized // translator is made up-to-date again. -class TranslatorCatalan : public TranslatorAdapter_1_4_6 +class TranslatorCatalan : public Translator { public: @@ -1557,6 +1557,24 @@ class TranslatorCatalan : public TranslatorAdapter_1_4_6 "proveda per convenincia. Es diferencia de la funci " "anterior noms en els arguments que accepta."; } + +////////////////////////////////////////////////////////////////////////// +// new since 1.4.6 +////////////////////////////////////////////////////////////////////////// + + /*! This is used to introduce a caller (or called-by) graph */ + virtual QCString trCallerGraph() + { + return "Grfic de crides a aquesta funci:"; + } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration values + */ + virtual QCString trEnumerationValueDocumentation() + { return "Documentaci de les Enumeracions"; } + + }; #endif diff --git a/src/translator_cn.h b/src/translator_cn.h index c4f7d8f..3233755 100644 --- a/src/translator_cn.h +++ b/src/translator_cn.h @@ -24,7 +24,7 @@ */ #define CN_SPC -class TranslatorChinese : public TranslatorAdapter_1_4_1 +class TranslatorChinese : public Translator { public: /*! Used for identification of the language. The identification @@ -33,6 +33,7 @@ class TranslatorChinese : public TranslatorAdapter_1_4_1 * (e.g. "czech", "japanese", "russian", etc.). It sould be equal to * the identification used in the language.cpp. */ + virtual QCString idLanguage() { return "chinese"; } @@ -1494,6 +1495,43 @@ class TranslatorChinese : public TranslatorAdapter_1_4_1 return "Ŀ¼"; } +////////////////////////////////////////////////////////////////////////// +// new since 1.4.1 +////////////////////////////////////////////////////////////////////////// + + /*! This text is added to the documentation when the \\overload command + * is used for a overloaded function. + */ + virtual QCString trOverloadText() + { + /* return "This is an overloaded member function, " + "provided for convenience. It differs from the above " + "function only in what argument(s) it accepts."; */ + return "ΪʹöṩһسԱ" + "ĺȣܲͬ͵IJ"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.4.6 +////////////////////////////////////////////////////////////////////////// + + /*! This is used to introduce a caller (or called-by) graph */ + virtual QCString trCallerGraph() + { + /* return "Here is the caller graph for this function:"; */ + return "ĵͼ"; + } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration values + */ + virtual QCString trEnumerationValueDocumentation() + { + /* return "Enumerator Documentation"; */ + return "öٱĵ"; + } + + }; #endif diff --git a/src/translator_cz.h b/src/translator_cz.h index 2221469..348e2b7 100644 --- a/src/translator_cz.h +++ b/src/translator_cz.h @@ -68,6 +68,7 @@ // 2006/05/10 - Update for "new since 1.4.6" -- trCallerGraph(), // modified trCallGraph() to make the meaning unambiguous // and clear in the Czech language. +// 2006/06/13 - translation of the trEnumerationValueDocumentation(). // Todo // ---- @@ -87,7 +88,7 @@ // Windows version. The version which does not call the function is // probably slightly faster. -class TranslatorCzech : public TranslatorAdapter_1_4_6 +class TranslatorCzech : public Translator { private: /*! The decode() inline assumes the source written in the @@ -1634,6 +1635,13 @@ class TranslatorCzech : public TranslatorAdapter_1_4_6 } + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration values + */ + virtual QCString trEnumerationValueDocumentation() + { + return decode("Dokumentace vtovch hodnot"); + } }; #endif // TRANSLATOR_CZ_H diff --git a/src/translator_de.h b/src/translator_de.h index de1b104..2b40e9d 100644 --- a/src/translator_de.h +++ b/src/translator_de.h @@ -108,13 +108,16 @@ // 2005/05/09 Jens Seidel (jensseidel@users.sourceforge.net) // - Updated for "new since 1.4.3" version (removed unused methods) // +// 2006/06/12 Jens Seidel (jensseidel@users.sourceforge.net) +// - Updated for "new since 1.4.6" version +// // Todo: // - see FIXME #ifndef TRANSLATOR_DE_H #define TRANSLATOR_DE_H -class TranslatorGerman : public TranslatorAdapter_1_4_6 +class TranslatorGerman : public Translator { public: @@ -1518,7 +1521,7 @@ class TranslatorGerman : public TranslatorAdapter_1_4_6 /*! Put in front of the call graph for a function. */ virtual QCString trCallGraph() { - return "Hier ist der Graph aller Aufrufe fr diese Funktion:"; + return "Hier ist ein Graph der zeigt, was diese Funktion aufruft:"; } ////////////////////////////////////////////////////////////////////////// @@ -1643,6 +1646,23 @@ class TranslatorGerman : public TranslatorAdapter_1_4_6 "obigen Funktion nur in den Argumenten die sie untersttzt."; } +////////////////////////////////////////////////////////////////////////// +// new since 1.4.6 +////////////////////////////////////////////////////////////////////////// + + /*! This is used to introduce a caller (or called-by) graph */ + virtual QCString trCallerGraph() + { + return "Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:"; + } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration values + */ + virtual QCString trEnumerationValueDocumentation() + { return "Enumerator-Dokumentation"; } + + }; #endif diff --git a/src/translator_fa.h b/src/translator_fa.h new file mode 100644 index 0000000..2a13f61 --- /dev/null +++ b/src/translator_fa.h @@ -0,0 +1,1603 @@ +/****************************************************************************** + * + * + * + * Copyright (C) 1997-2005 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. + * + * + * Description : Doxygen Persian Translator + * Author : Ali Nadalizadeh < nadalisoft @ yahoo . com > + * ChangeLog : + * Thu 06 Jul 2006 11:54:09 PM IRDT <nadalisoft@yahoo.com> + * >> First version of persian language support has been completed. + * + */ + +#ifndef TRANSLATOR_FA_H +#define TRANSLATOR_FA_H + +#define HtmlRightToLeft QCString("<div dir=rtl>") +#define HtmlLeftToRight QCString("<div dir=rtl>") +#define HtmlDivEnd QCString("</div>") + + +class TranslatorPersian : public TranslatorAdapter_1_4_6 +{ + public: + + // --- Language control methods ------------------- + + /*! Used for identification of the language. The identification + * should not be translated. It should be replaced by the name + * of the language in Persian using lower-case characters only + * (e.g. "czech", "japanese", "russian", etc.). It should be equal to + * the identification used in language.cpp. + */ + virtual QCString idLanguage() + { return "persian"; } + + /*! Used to get the LaTeX command(s) for the language support. + * This method should return string with commands that switch + * LaTeX to the desired language. For example + * <pre>"\\usepackage[german]{babel}\n" + * </pre> + * or + * <pre>"\\usepackage{polski}\n" + * "\\usepackage[latin2]{inputenc}\n" + * "\\usepackage[T1]{fontenc}\n" + * </pre> + * + * The Persian LaTeX does not use such commands. Because of this + * the empty string is returned in this implementation. + */ + virtual QCString latexLanguageSupportCommand() + { + return ""; + } + + /*! return the language charset. This will be used for the HTML output */ + virtual QCString idLanguageCharset() + { + return "utf-8"; + } + + // --- Language translation methods ------------------- + + /*! used in the compound documentation before a list of related functions. */ + virtual QCString trRelatedFunctions() + { return "توابع مربوط"; } + + /*! subscript for the related functions. */ + virtual QCString trRelatedSubscript() + { return "(لازم به ذکر است که اينها توابع عضو نيستند)"; } + + /*! header that is put before the detailed description of files, classes and namespaces. */ + virtual QCString trDetailedDescription() + { return "توضيحات جزئی"; } + + /*! header that is put before the list of typedefs. */ + virtual QCString trMemberTypedefDocumentation() + { return "های عضو Typedef مستندات"; } + + /*! header that is put before the list of enumerations. */ + virtual QCString trMemberEnumerationDocumentation() + { return "Member Enumeration Documentation"; } + + /*! header that is put before the list of member functions. */ + virtual QCString trMemberFunctionDocumentation() + { return "توضيحات توابع عضو"; } + + /*! header that is put before the list of member attributes. */ + virtual QCString trMemberDataDocumentation() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Field مستندات"; + } + else + { + return "مستندات متغيير های عضو"; + } + } + + /*! this is the text of a link put after brief descriptions. */ + virtual QCString trMore() + { return "بيشتر..."; } + + /*! put in the class documentation */ + virtual QCString trListOfAllMembers() + { return "ليست تمام اعضاء ."; } + + /*! used as the title of the "list of all members" page of a class */ + virtual QCString trMemberList() + { return "ليست اعضاء"; } + + /*! this is the first part of a sentence that is followed by a class name */ + virtual QCString trThisIsTheListOfAllMembers() + { return "اين ليستی کامل از همه اعضای "; } + + /*! this is the remainder of the sentence after the class name */ + virtual QCString trIncludingInheritedMembers() + { return "شامل همه ی اعضای به ارث برده شده می باشد."; } + + /*! this is put at the author sections at the bottom of man pages. + * parameter s is name of the project name. + */ + virtual QCString trGeneratedAutomatically(const char *s) + { QCString result="Generated automatically by Doxygen"; + if (s) result+=(QCString)" for "+s; + result+=" from the source code."; + return result; + } + + /*! put after an enum name in the list of all members */ + virtual QCString trEnumName() + { return "enum name"; } + + /*! put after an enum value in the list of all members */ + virtual QCString trEnumValue() + { return "enum value"; } + + /*! put after an undocumented member in the list of all members */ + virtual QCString trDefinedIn() + { return "defined in"; } + + // quick reference sections + + /*! This is put above each page as a link to the list of all groups of + * compounds or files (see the \\group command). + */ + virtual QCString trModules() + { return "Modules"; } + + /*! This is put above each page as a link to the class hierarchy */ + virtual QCString trClassHierarchy() + { return "سلسله مراتب کلاس ها"; } + + /*! This is put above each page as a link to the list of annotated classes */ + virtual QCString trCompoundList() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "ساختار های داده "; + } + else + { + return "ليست کلاس ها "; + } + } + + /*! This is put above each page as a link to the list of documented files */ + virtual QCString trFileList() + { return "ليست فايل ها"; } + + /*! This is put above each page as a link to the list of all verbatim headers */ + virtual QCString trHeaderFiles() + { return "Header Files"; } + + /*! This is put above each page as a link to all members of compounds. */ + virtual QCString trCompoundMembers() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Data Fields"; + } + else + { + return "اعضاء کلاس ها"; + } + } + + /*! This is put above each page as a link to all members of files. */ + virtual QCString trFileMembers() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Globals"; + } + else + { + return "اعضاء فايل"; + } + } + + /*! This is put above each page as a link to all related pages. */ + virtual QCString trRelatedPages() + { return "صفحات مربوط"; } + + /*! This is put above each page as a link to all examples. */ + virtual QCString trExamples() + { return "مثال ها"; } + + /*! This is put above each page as a link to the search engine. */ + virtual QCString trSearch() + { return "جستجو"; } + + /*! This is an introduction to the class hierarchy. */ + virtual QCString trClassHierarchyDescription() + { return "ليست و سلسله مراتب درختی کلاس ها به صورت مرتب شده :"; + } + + /*! This is an introduction to the list with all files. */ + virtual QCString trFileListDescription(bool extractAll) + { + QCString result="هم اکنون ليست همه ي پرونده ها "; + if (!extractAll) result+="(مستند شده) "; + result+="را مشاهده می کنيد :"; + return result; + } + + /*! This is an introduction to the annotated compound list. */ + virtual QCString trCompoundListDescription() + { + + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "ليست ساختارهای داده به همراه توضيحی کوتاه :"; + } + else + { + return "ليست کلاس ها ، ساختارهای داده و ... به همراه توضيحات مختصر راجع به آنها :"; + } + } + + /*! This is an introduction to the page with all class members. */ + virtual QCString trCompoundMembersDescription(bool extractAll) + { + QCString result=" در ذيل ليست "; + if (!extractAll) + { + result+="آن اعضايي که مستند شده اند "; + } + else + { + result+="همه ی اعضاء ٫"; + } + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="ساختارهای داده "; + } + else + { + result+="كلاس ها "; + } + result+=" با ارتباطشان با "; + + if (!extractAll) + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="the struct/union documentation for each field:"; + } + else + { + result+="the class documentation for each member:"; + } + } + else + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="ساختارهای داده ای که به آنها مربوط هستند"; + } + else + { + result+="کلاس هايي که به آنها مربوط هستند"; + } + } + result+="را مشاهده ميکنيد :"; + return result; + } + + /*! This is an introduction to the page with all file members. */ + virtual QCString trFileMembersDescription(bool extractAll) + { + QCString result="هم اکنون ليست همه ی توابع ٫ متغيير ها ٫ تعاريف و ... "; + if (!extractAll) result+="(مستند شده) "; + + result+=" با ارتباط های آنها "; + if (extractAll) + result+="به پرونده هايی که به آن مربوط اند را مشاهده می کنيد :"; + else + result+="به مستنداتشان را می بينيد :"; + return result; + } + + /*! This is an introduction to the page with the list of all header files. */ + virtual QCString trHeaderFilesDescription() + { return "Here are the header files that make up the API:"; } + + /*! This is an introduction to the page with the list of all examples */ + virtual QCString trExamplesDescription() + { return "ليست همه ی مثال ها :"; } + + /*! This is an introduction to the page with the list of related pages */ + virtual QCString trRelatedPagesDescription() + { return "Here is a list of all related documentation pages:"; } + + /*! This is an introduction to the page with the list of class/file groups */ + virtual QCString trModulesDescription() + { return "Here is a list of all modules:"; } + + /*! This sentences is used in the annotated class/file lists if no brief + * description is given. + */ + virtual QCString trNoDescriptionAvailable() + { return "هيچ توضيحی موجود نمي باشد"; } + + // index titles (the project name is prepended for these) + + + /*! This is used in HTML as the title of index.html. */ + virtual QCString trDocumentation() + { return "مستند سازی"; } + + /*! This is used in LaTeX as the title of the chapter with the + * index of all groups. + */ + virtual QCString trModuleIndex() + { return "Module Index"; } + + /*! This is used in LaTeX as the title of the chapter with the + * class hierarchy. + */ + virtual QCString trHierarchicalIndex() + { return "Hierarchical Index"; } + + /*! This is used in LaTeX as the title of the chapter with the + * annotated compound index. + */ + virtual QCString trCompoundIndex() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Data Structure Index"; + } + else + { + return "فهرست کلاس های"; + } + } + + /*! This is used in LaTeX as the title of the chapter with the + * list of all files. + */ + virtual QCString trFileIndex() + { return "فهرست پرونده ها"; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all groups. + */ + virtual QCString trModuleDocumentation() + { return "Module Documentation"; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all classes, structs and unions. + */ + virtual QCString trClassDocumentation() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Data Structure Documentation"; + } + else + { + return "Class Documentation"; + } + } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all files. + */ + virtual QCString trFileDocumentation() + { return "File Documentation"; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all examples. + */ + virtual QCString trExampleDocumentation() + { return "Example Documentation"; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all related pages. + */ + virtual QCString trPageDocumentation() + { return "Page Documentation"; } + + /*! This is used in LaTeX as the title of the document */ + virtual QCString trReferenceManual() + { return "Reference Manual"; } + + /*! This is used in the documentation of a file as a header before the + * list of defines + */ + virtual QCString trDefines() + { return "تعاريف"; } + + /*! This is used in the documentation of a file as a header before the + * list of function prototypes + */ + virtual QCString trFuncProtos() + { return "Function Prototypes"; } + + /*! This is used in the documentation of a file as a header before the + * list of typedefs + */ + virtual QCString trTypedefs() + { return "Typedefs"; } + + /*! This is used in the documentation of a file as a header before the + * list of enumerations + */ + virtual QCString trEnumerations() + { return "تعاريف"; } + + /*! This is used in the documentation of a file as a header before the + * list of (global) functions + */ + virtual QCString trFunctions() + { return "توابع"; } + + /*! This is used in the documentation of a file as a header before the + * list of (global) variables + */ + virtual QCString trVariables() + { return "متغيير ها"; } + + /*! This is used in the documentation of a file as a header before the + * list of (global) variables + */ + virtual QCString trEnumerationValues() + { return "معرف ها"; } + + /*! This is used in the documentation of a file before the list of + * documentation blocks for defines + */ + virtual QCString trDefineDocumentation() + { return "Define Documentation"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for function prototypes + */ + virtual QCString trFunctionPrototypeDocumentation() + { return "Function Prototype Documentation"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for typedefs + */ + virtual QCString trTypedefDocumentation() + { return "Typedef Documentation"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration types + */ + virtual QCString trEnumerationTypeDocumentation() + { return "مستندات تعريف"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration values + */ + virtual QCString trEnumerationValueDocumentation() + { return "مستندات معرف"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for functions + */ + virtual QCString trFunctionDocumentation() + { return "توضيح تابع"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for variables + */ + virtual QCString trVariableDocumentation() + { return "توضيح متغير"; } + + /*! This is used in the documentation of a file/namespace/group before + * the list of links to documented compounds + */ + virtual QCString trCompounds() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "ساختارهای داده"; + } + else + { + return "کلاس ها"; + } + } + + /*! This is used in the standard footer of each page and indicates when + * the page was generated + */ + virtual QCString trGeneratedAt(const char *date,const char *projName) + { + QCString result = HtmlDivEnd + HtmlRightToLeft + QCString("توليد شده در ") +date ; + if (projName) result+=(QCString)" برای "+projName; + result+=(QCString)" توسط"; + return result; + } + /*! This is part of the sentence used in the standard footer of each page. + */ + virtual QCString trWrittenBy() + { + return "نوشته شده توسط"; + } + + /*! this text is put before a class diagram */ + virtual QCString trClassDiagram(const char *clName) + { + return (QCString)""+clName+" نمودار وراثت برای :"; + } + + /*! this text is generated when the \\internal command is used. */ + virtual QCString trForInternalUseOnly() + { return ".فقط برای استعمال داخلی"; } + + /*! this text is generated when the \\reimp command is used. */ + virtual QCString trReimplementedForInternalReasons() + { return "Reimplemented for internal reasons; the API is not affected."; } + + /*! this text is generated when the \\warning command is used. */ + virtual QCString trWarning() + { return "اخطار"; } + + /*! this text is generated when the \\bug command is used. */ + virtual QCString trBugsAndLimitations() + { return "Bugs and limitations"; } + + /*! this text is generated when the \\version command is used. */ + virtual QCString trVersion() + { return "نسخه"; } + + /*! this text is generated when the \\date command is used. */ + virtual QCString trDate() + { return "تاريخ"; } + + /*! this text is generated when the \\return command is used. */ + virtual QCString trReturns() + { return "Returns"; } + + /*! this text is generated when the \\sa command is used. */ + virtual QCString trSeeAlso() + { return "See also"; } + + /*! this text is generated when the \\param command is used. */ + virtual QCString trParameters() + { return "پارامترها"; } + + /*! this text is generated when the \\exception command is used. */ + virtual QCString trExceptions() + { return "استثناء ها"; } + + /*! this text is used in the title page of a LaTeX document. */ + virtual QCString trGeneratedBy() + { return "توليد شده توسط"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990307 +////////////////////////////////////////////////////////////////////////// + + /*! used as the title of page containing all the index of all namespaces. */ + virtual QCString trNamespaceList() + { return "ليست فضاهای نام"; } + + /*! used as an introduction to the namespace list */ + virtual QCString trNamespaceListDescription(bool extractAll) + { + QCString result="در ذيل ليستی از همه ی فضاهای نام "; + if (!extractAll) result+="(مستند سازی شده) "; + result+="به همراه توضيح کوتاه آنها مشاهده می کنيد :"; + return result; + } + + /*! used in the class documentation as a header before the list of all + * friends of a class + */ + virtual QCString trFriends() + { return "کلاس های دوست"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990405 +////////////////////////////////////////////////////////////////////////// + + /*! used in the class documentation as a header before the list of all + * related classes + */ + virtual QCString trRelatedFunctionDocumentation() + { return "Friends And Related Function Documentation"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990425 +////////////////////////////////////////////////////////////////////////// + + /*! used as the title of the HTML page of a class/struct/union */ + virtual QCString trCompoundReference(const char *clName, + ClassDef::CompoundType compType, + bool isTemplate) + { + QCString result; + switch(compType) + { + case ClassDef::Class: result=" کلاس"; break; + case ClassDef::Struct: result=" ساختار داده"; break; + case ClassDef::Union: result=" Union"; break; + case ClassDef::Interface: result=" Interface"; break; + case ClassDef::Protocol: result=" Protocol"; break; + case ClassDef::Category: result=" Category"; break; + case ClassDef::Exception: result=" Exception"; break; + } + if (isTemplate) result+=" قالب"; + result=QCString(clName) + " مرجع" +result ; + return result; + } + + /*! used as the title of the HTML page of a file */ + virtual QCString trFileReference(const char *fileName) + { + QCString result=fileName; + result+=" مرجع پرونده"; + return result; + } + + /*! used as the title of the HTML page of a namespace */ + virtual QCString trNamespaceReference(const char *namespaceName) + { + QCString result=namespaceName; + result+=" مرجع فضای نام"; + return result; + } + + virtual QCString trPublicMembers() + { return "توابع عمومی عضو کلاس"; } + virtual QCString trPublicSlots() + { return "های عمومی Slot"; } + virtual QCString trSignals() + { return "سيگنال ها"; } + virtual QCString trStaticPublicMembers() + { return "توابع ثابت عمومی عضو کلاس"; } + virtual QCString trProtectedMembers() + { return "توابع خصوصی عضو کلاس"; } + virtual QCString trProtectedSlots() + { return "های محافظت شده Slot"; } + virtual QCString trStaticProtectedMembers() + { return "توابع ثابت محافظت شده عضو کلاس"; } + virtual QCString trPrivateMembers() + { return "توابع خصوصی عضو کلاس"; } + virtual QCString trPrivateSlots() + { return "های خصوصی Slot"; } + virtual QCString trStaticPrivateMembers() + { return "توابع خصوصی ثابت عضو کلاس"; } + + /*! this function is used to produce a comma-separated list of items. + * use generateMarker(i) to indicate where item i should be put. + */ + virtual QCString trWriteList(int numEntries) + { + QCString result; + int i; + // the inherits list contain `numEntries' classes + for (i=0;i<numEntries;i++) + { + // use generateMarker to generate placeholders for the class links! + result+=generateMarker(i); // generate marker for entry i in the list + // (order is left to right) + + if (i!=numEntries-1) // not the last entry, so we need a separator + { + if (i<numEntries-2) // not the fore last entry + result+=", "; + else // the fore last entry + result+=" و "; + } + } + return result; + } + + /*! used in class documentation to produce a list of base classes, + * if class diagrams are disabled. + */ + virtual QCString trInheritsList(int numEntries) + { + return ".را به ارث می برد "+trWriteList(numEntries)+"."; + } + + /*! used in class documentation to produce a list of super classes, + * if class diagrams are disabled. + */ + virtual QCString trInheritedByList(int numEntries) + { + return ".اين کلاس را به ارث برده است "+trWriteList(numEntries)+"."; + } + + /*! used in member documentation blocks to produce a list of + * members that are hidden by this one. + */ + virtual QCString trReimplementedFromList(int numEntries) + { + return "Reimplemented from "+trWriteList(numEntries)+"."; + } + + /*! used in member documentation blocks to produce a list of + * all member that overwrite the implementation of this member. + */ + virtual QCString trReimplementedInList(int numEntries) + { + return "Reimplemented in "+trWriteList(numEntries)+"."; + } + + /*! This is put above each page as a link to all members of namespaces. */ + virtual QCString trNamespaceMembers() + { return "اعضای فضاهای نام"; } + + /*! This is an introduction to the page with all namespace members */ + virtual QCString trNamespaceMemberDescription(bool extractAll) + { + QCString result="ليست همه اعضای فضای نام "; + if (!extractAll) result+="(مستند شده) "; + result+=" با ارتباطشان با"; + result+="فضاهای نامی که به آن مربوط اند را مشاهده ميکنيد :"; + return result; + } + /*! This is used in LaTeX as the title of the chapter with the + * index of all namespaces. + */ + virtual QCString trNamespaceIndex() + { return "فهرست فضاهای نام"; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all namespaces. + */ + virtual QCString trNamespaceDocumentation() + { return "توضيحات فضای نام"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990522 +////////////////////////////////////////////////////////////////////////// + + /*! This is used in the documentation before the list of all + * namespaces in a file. + */ + virtual QCString trNamespaces() + { return "فضاهای نام"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990728 +////////////////////////////////////////////////////////////////////////// + + /*! This is put at the bottom of a class documentation page and is + * followed by a list of files that were used to generate the page. + */ + virtual QCString trGeneratedFromFiles(ClassDef::CompoundType compType, + bool single) + { // here s is one of " Class", " Struct" or " Union" + // single is true implies a single file + QCString result=(QCString)"مستندات اين "; + switch(compType) + { + case ClassDef::Class: result+="کلاس"; break; + case ClassDef::Struct: result+="ساختار داده"; break; + case ClassDef::Union: result+="union"; break; + case ClassDef::Interface: result+="interface"; break; + case ClassDef::Protocol: result+="protocol"; break; + case ClassDef::Category: result+="category"; break; + case ClassDef::Exception: result+="exception"; break; + } + result+=" از روی پرونده "; + if (single) result+=""; else result+="های "; + result+="زير توليد شده است :"; + return result; + } + + /*! This is in the (quick) index as a link to the alphabetical compound + * list. + */ + virtual QCString trAlphabeticalList() + { return "ليست الفبايي"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990901 +////////////////////////////////////////////////////////////////////////// + + /*! This is used as the heading text for the retval command. */ + virtual QCString trReturnValues() + { return "مقادير بازگشتی"; } + + /*! This is in the (quick) index as a link to the main page (index.html) + */ + virtual QCString trMainPage() + { return "صفحه ی اصلی"; } + + /*! This is used in references to page that are put in the LaTeX + * documentation. It should be an abbreviation of the word page. + */ + virtual QCString trPageAbbreviation() + { return "ص."; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-991003 +////////////////////////////////////////////////////////////////////////// + + virtual QCString trSources() + { + return "Sources"; + } + virtual QCString trDefinedAtLineInSourceFile() + { + return ".در خط @0 از پرونده @1 تعريف شده است"; + } + virtual QCString trDefinedInSourceFile() + { + return ".در فايل @0 تعريف شده است"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-991205 +////////////////////////////////////////////////////////////////////////// + + virtual QCString trDeprecated() + { + return "منسوخ شده"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.0.0 +////////////////////////////////////////////////////////////////////////// + + /*! this text is put before a collaboration diagram */ + virtual QCString trCollaborationDiagram(const char *clName) + { + return (QCString)"Collaboration diagram for "+clName+":"; + } + /*! this text is put before an include dependency graph */ + virtual QCString trInclDepGraph(const char *fName) + { + return (QCString)"Include dependency graph for "+fName+":"; + } + /*! header that is put before the list of constructor/destructors. */ + virtual QCString trConstructorDocumentation() + { + return "Constructor و Destructor مستندات"; + } + /*! Used in the file documentation to point to the corresponding sources. */ + virtual QCString trGotoSourceCode() + { + return "کد منبع اين پرونده."; + } + /*! Used in the file sources to point to the corresponding documentation. */ + virtual QCString trGotoDocumentation() + { + return "توضيحات اين پرونده."; + } + /*! Text for the \\pre command */ + virtual QCString trPrecondition() + { + return "Precondition"; + } + /*! Text for the \\post command */ + virtual QCString trPostcondition() + { + return "Postcondition"; + } + /*! Text for the \\invariant command */ + virtual QCString trInvariant() + { + return "Invariant"; + } + /*! Text shown before a multi-line variable/enum initialization */ + virtual QCString trInitialValue() + { + return "مقدار اوليه :"; + } + /*! Text used the source code in the file index */ + virtual QCString trCode() + { + return "کد"; + } + virtual QCString trGraphicalHierarchy() + { + return "سلسله مراتب گرافيکی کلاس"; + } + virtual QCString trGotoGraphicalHierarchy() + { + return "Go to the graphical class hierarchy"; + } + virtual QCString trGotoTextualHierarchy() + { + return "Go to the textual class hierarchy"; + } + virtual QCString trPageIndex() + { + return "فهرست صفحات"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.1.0 +////////////////////////////////////////////////////////////////////////// + + virtual QCString trNote() + { + return "نکته"; + } + virtual QCString trPublicTypes() + { + return "های عمومی Type"; + } + virtual QCString trPublicAttribs() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Data Fields"; + } + else + { + return "خواص (متغييرهای) عمومی"; + } + } + virtual QCString trStaticPublicAttribs() + { + return "خواص (متغييرهای) عمومی ثابت"; + } + virtual QCString trProtectedTypes() + { + return "های حفاظت شده Type"; + } + virtual QCString trProtectedAttribs() + { + return "خواص (متغييرهای) حفاظت شده"; + } + virtual QCString trStaticProtectedAttribs() + { + return "خواص (متغييرهای) حفاظت شده ثابت"; + } + virtual QCString trPrivateTypes() + { + return "های خصوصی Type"; + } + virtual QCString trPrivateAttribs() + { + return "خواص (متغييرهای) خصوصی"; + } + virtual QCString trStaticPrivateAttribs() + { + return "خواص (متغييرهای) خصوصی ثابت"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.1.3 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a marker that is put before a \\todo item */ + virtual QCString trTodo() + { + return "برای انجام"; + } + /*! Used as the header of the todo list */ + virtual QCString trTodoList() + { + return "ليست کارهاي آينده"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.1.4 +////////////////////////////////////////////////////////////////////////// + + virtual QCString trReferencedBy() + { + return " استفاده شده توسط "; + } + virtual QCString trRemarks() + { + return "Remarks"; + } + virtual QCString trAttention() + { + return "توجه"; + } + virtual QCString trInclByDepGraph() + { + return "This graph shows which files directly or " + "indirectly include this file:"; + } + virtual QCString trSince() + { + return "از"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.1.5 +////////////////////////////////////////////////////////////////////////// + + /*! title of the graph legend page */ + virtual QCString trLegendTitle() + { + return "راهنمای نمودار"; + } + /*! page explaining how the dot graph's should be interpreted + * The %A in the text below are to prevent link to classes called "A". + */ + virtual QCString trLegendDocs() + { + return + "This page explains how to interpret the graphs that are generated " + "by doxygen.<p>\n" + "Consider the following example:\n" + "\\code\n" + "/*! Invisible class because of truncation */\n" + "class Invisible { };\n\n" + "/*! Truncated class, inheritance relation is hidden */\n" + "class Truncated : public Invisible { };\n\n" + "/* Class not documented with doxygen comments */\n" + "class Undocumented { };\n\n" + "/*! Class that is inherited using public inheritance */\n" + "class PublicBase : public Truncated { };\n\n" + "/*! A template class */\n" + "template<class T> class Templ { };\n\n" + "/*! Class that is inherited using protected inheritance */\n" + "class ProtectedBase { };\n\n" + "/*! Class that is inherited using private inheritance */\n" + "class PrivateBase { };\n\n" + "/*! Class that is used by the Inherited class */\n" + "class Used { };\n\n" + "/*! Super class that inherits a number of other classes */\n" + "class Inherited : public PublicBase,\n" + " protected ProtectedBase,\n" + " private PrivateBase,\n" + " public Undocumented\n" + " public Templ<int>\n" + "{\n" + " private:\n" + " Used *m_usedClass;\n" + "};\n" + "\\endcode\n" + "If the \\c MAX_DOT_GRAPH_HEIGHT tag in the configuration file " + "is set to 240 this will result in the following graph:" + "<p><center><img alt=\"\" src=\"graph_legend."+Config_getEnum("DOT_IMAGE_FORMAT")+"\"></center>\n" + "<p>\n" + "The boxes in the above graph have the following meaning:\n" + "<ul>\n" + "<li>%A filled black box represents the struct or class for which the " + "graph is generated.\n" + "<li>%A box with a black border denotes a documented struct or class.\n" + "<li>%A box with a grey border denotes an undocumented struct or class.\n" + "<li>%A box with a red border denotes a documented struct or class for" + "which not all inheritance/containment relations are shown. %A graph is " + "truncated if it does not fit within the specified boundaries.\n" + "</ul>\n" + "The arrows have the following meaning:\n" + "<ul>\n" + "<li>%A dark blue arrow is used to visualize a public inheritance " + "relation between two classes.\n" + "<li>%A dark green arrow is used for protected inheritance.\n" + "<li>%A dark red arrow is used for private inheritance.\n" + "<li>%A purple dashed arrow is used if a class is contained or used " + "by another class. The arrow is labeled with the variable(s) " + "through which the pointed class or struct is accessible.\n" + "<li>%A yellow dashed arrow denotes a relation between a template instance and " + "the template class it was instantiated from. The arrow is labeled with " + "the template parameters of the instance.\n" + "</ul>\n"; + } + /*! text for the link to the legend page */ + virtual QCString trLegend() + { + return "راهنما"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.0 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a marker that is put before a test item */ + virtual QCString trTest() + { + return "Test"; + } + /*! Used as the header of the test list */ + virtual QCString trTestList() + { + return "Test List"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.1 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a section header for KDE-2 IDL methods */ + virtual QCString trDCOPMethods() + { + return "DCOP توابع عضو"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.2 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a section header for IDL properties */ + virtual QCString trProperties() + { + return "Properties"; + } + /*! Used as a section header for IDL property documentation */ + virtual QCString trPropertyDocumentation() + { + return "Property Documentation"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.4 +////////////////////////////////////////////////////////////////////////// + + /*! Used for Java interfaces in the summary section of Java packages */ + virtual QCString trInterfaces() + { + return "Interfaces"; + } + /*! Used for Java classes in the summary section of Java packages */ + virtual QCString trClasses() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "ساختار های داده"; + } + else + { + return "كلاس ها"; + } + } + /*! Used as the title of a Java package */ + virtual QCString trPackage(const char *name) + { + return (QCString)"Package "+name; + } + /*! Title of the package index page */ + virtual QCString trPackageList() + { + return "Package List"; + } + /*! The description of the package index page */ + virtual QCString trPackageListDescription() + { + return "Here are the packages with brief descriptions (if available):"; + } + /*! The link name in the Quick links header for each page */ + virtual QCString trPackages() + { + return "Packages"; + } + /*! Used as a chapter title for Latex & RTF output */ + virtual QCString trPackageDocumentation() + { + return "Package Documentation"; + } + /*! Text shown before a multi-line define */ + virtual QCString trDefineValue() + { + return "Value:"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.5 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a marker that is put before a \\bug item */ + virtual QCString trBug() + { + return "اشکال"; + } + /*! Used as the header of the bug list */ + virtual QCString trBugList() + { + return "ليست اشکالات"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.6 +////////////////////////////////////////////////////////////////////////// + + /*! Used as ansicpg for RTF file + * + * The following table shows the correlation of Charset name, Charset Value and + * <pre> + * Codepage number: + * Charset Name Charset Value(hex) Codepage number + * ------------------------------------------------------ + * DEFAULT_CHARSET 1 (x01) + * SYMBOL_CHARSET 2 (x02) + * OEM_CHARSET 255 (xFF) + * ANSI_CHARSET 0 (x00) 1252 + * RUSSIAN_CHARSET 204 (xCC) 1251 + * EE_CHARSET 238 (xEE) 1250 + * GREEK_CHARSET 161 (xA1) 1253 + * TURKISH_CHARSET 162 (xA2) 1254 + * BALTIC_CHARSET 186 (xBA) 1257 + * HEBREW_CHARSET 177 (xB1) 1255 + * ARABIC _CHARSET 178 (xB2) 1256 + * SHIFTJIS_CHARSET 128 (x80) 932 + * HANGEUL_CHARSET 129 (x81) 949 + * GB2313_CHARSET 134 (x86) 936 + * CHINESEBIG5_CHARSET 136 (x88) 950 + * </pre> + * + */ + virtual QCString trRTFansicp() + { + return "1256"; + } + + + /*! Used as ansicpg for RTF fcharset + * \see trRTFansicp() for a table of possible values. + */ + virtual QCString trRTFCharSet() + { + return "0"; + } + + /*! Used as header RTF general index */ + virtual QCString trRTFGeneralIndex() + { + return "فهرست"; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trClass(bool first_capital, bool singular) + { + QCString result((first_capital ? "کلاس" : "کلاس")); + if (!singular) result+="ها"; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trFile(bool /*first_capital*/, bool singular) + { + QCString result("پرونده"); + if (!singular) result=result+" ها"; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trNamespace(bool first_capital, bool singular) + { + QCString result((first_capital ? "فضای نام " : "فضای نام ")); + if (!singular) result+="ها"; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trGroup(bool first_capital, bool singular) + { + QCString result((first_capital ? "Group" : "group")); + if (!singular) result+="s"; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trPage(bool first_capital, bool singular) + { + QCString result((first_capital ? "صفحه" : "صفحه")); + if (!singular) result+=" ها "; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trMember(bool first_capital, bool singular) + { + QCString result((first_capital ? "عضو" : "عضو")); + if (!singular) result+="ها"; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trField(bool first_capital, bool singular) + { + QCString result((first_capital ? "Field" : "field")); + if (!singular) result+="s"; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trGlobal(bool first_capital, bool singular) + { + QCString result((first_capital ? "Global" : "global")); + if (!singular) result+="s"; + return result; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.7 +////////////////////////////////////////////////////////////////////////// + + /*! This text is generated when the \\author command is used and + * for the author section in man pages. */ + virtual QCString trAuthor(bool first_capital, bool singular) + { + QCString result((first_capital ? "Author" : "author")); + if (!singular) result+="s"; + return result; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.11 +////////////////////////////////////////////////////////////////////////// + + /*! This text is put before the list of members referenced by a member + */ + virtual QCString trReferences() + { + return "را استفاده ميکند "; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.13 +////////////////////////////////////////////////////////////////////////// + + /*! used in member documentation blocks to produce a list of + * members that are implemented by this one. + */ + virtual QCString trImplementedFromList(int numEntries) + { + return "را تکميل می کند "+trWriteList(numEntries)+"."; + } + + /*! used in member documentation blocks to produce a list of + * all members that implement this abstract member. + */ + virtual QCString trImplementedInList(int numEntries) + { + return ".تکميل شده است "+trWriteList(numEntries)+" در"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.16 +////////////////////////////////////////////////////////////////////////// + + /*! used in RTF documentation as a heading for the Table + * of Contents. + */ + virtual QCString trRTFTableOfContents() + { + return "Table of Contents"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.17 +////////////////////////////////////////////////////////////////////////// + + /*! Used as the header of the list of item that have been + * flagged deprecated + */ + virtual QCString trDeprecatedList() + { + return "Deprecated List"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.18 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a header for declaration section of the events found in + * a C# program + */ + virtual QCString trEvents() + { + return "Events"; + } + /*! Header used for the documentation section of a class' events. */ + virtual QCString trEventDocumentation() + { + return "Event Documentation"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.3 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a heading for a list of Java class types with package scope. + */ + virtual QCString trPackageTypes() + { + return "Package Types"; + } + /*! Used as a heading for a list of Java class functions with package + * scope. + */ + virtual QCString trPackageMembers() + { + return "Package Functions"; + } + /*! Used as a heading for a list of static Java class functions with + * package scope. + */ + virtual QCString trStaticPackageMembers() + { + return "Static Package Functions"; + } + /*! Used as a heading for a list of Java class variables with package + * scope. + */ + virtual QCString trPackageAttribs() + { + return "Package Attributes"; + } + /*! Used as a heading for a list of static Java class variables with + * package scope. + */ + virtual QCString trStaticPackageAttribs() + { + return "Static Package Attributes"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.3.1 +////////////////////////////////////////////////////////////////////////// + + /*! Used in the quick index of a class/file/namespace member list page + * to link to the unfiltered list of all members. + */ + virtual QCString trAll() + { + return "همه"; + } + /*! Put in front of the call graph for a function. */ + virtual QCString trCallGraph() + { + return "Here is the call graph for this function:"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.3.3 +////////////////////////////////////////////////////////////////////////// + + /*! When the search engine is enabled this text is put in the header + * of each page before the field where one can enter the text to search + * for. + */ + virtual QCString trSearchForIndex() + { + return "جستجو برای"; + } + /*! This string is used as the title for the page listing the search + * results. + */ + virtual QCString trSearchResultsTitle() + { + return "نتايج جستجو"; + } + /*! This string is put just before listing the search results. The + * text can be different depending on the number of documents found. + * Inside the text you can put the special marker $num to insert + * the number representing the actual number of search results. + * The @a numDocuments parameter can be either 0, 1 or 2, where the + * value 2 represents 2 or more matches. HTML markup is allowed inside + * the returned string. + */ + virtual QCString trSearchResults(int numDocuments) + { + if (numDocuments==0) + { + return "Sorry, no documents matching your query."; + } + else if (numDocuments==1) + { + return "Found <b>1</b> document matching your query."; + } + else + { + return "Found <b>$num</b> documents matching your query. " + "Showing best matches first."; + } + } + /*! This string is put before the list of matched words, for each search + * result. What follows is the list of words that matched the query. + */ + virtual QCString trSearchMatches() + { + return "Matches:"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.3.8 +////////////////////////////////////////////////////////////////////////// + + /*! This is used in HTML as the title of page with source code for file filename + */ + virtual QCString trSourceFile(QCString& filename) + { + return filename + " کد و پرونده منبع"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.3.9 +////////////////////////////////////////////////////////////////////////// + + /*! This is used as the name of the chapter containing the directory + * hierarchy. + */ + virtual QCString trDirIndex() + { return "ساختار و سلسله مراتب شاخه ها"; } + + /*! This is used as the name of the chapter containing the documentation + * of the directories. + */ + virtual QCString trDirDocumentation() + { return "مستندات دايرکتوری"; } + + /*! This is used as the title of the directory index and also in the + * Quick links of an HTML page, to link to the directory hierarchy. + */ + virtual QCString trDirectories() + { return "شاخه ها"; } + + /*! This returns a sentences that introduces the directory hierarchy. + * and the fact that it is sorted alphabetically per level + */ + virtual QCString trDirDescription() + { return "در ذيل ساختار شاخه ها و دايرکتوری ها را نسبتا مرتب شده می بينيد :"; + } + + /*! This returns the title of a directory page. The name of the + * directory is passed via \a dirName. + */ + virtual QCString trDirReference(const char *dirName) + { QCString result=dirName; result+=" مرجع شاخه ی"; return result; } + + /*! This returns the word directory with or without starting capital + * (\a first_capital) and in sigular or plural form (\a singular). + */ + virtual QCString trDir(bool /*first_capital*/, bool singular) + { + QCString result("شاخه"); + if (singular) result+=" ها "+result; + return result; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.4.1 +////////////////////////////////////////////////////////////////////////// + + /*! This text is added to the documentation when the \\overload command + * is used for a overloaded function. + */ + virtual QCString trOverloadText() + { + return "This is an overloaded member function, " + "provided for convenience. It differs from the above " + "function only in what argument(s) it accepts."; + } +}; + +#endif diff --git a/src/translator_hr.h b/src/translator_hr.h index 0377447..e4d6f43 100644 --- a/src/translator_hr.h +++ b/src/translator_hr.h @@ -65,11 +65,13 @@ // 2005/03/21 // - Added strings for 1.4.1 // - +// 2006/06/11 +// - Added strings for 1.4.6 +// #ifndef TRANSLATOR_HR_H #define TRANSLATOR_HR_H -class TranslatorCroatian : public TranslatorAdapter_1_4_6 +class TranslatorCroatian : public Translator { private: /*! to avoid macro redefinition from translator_cz.h */ @@ -1254,6 +1256,21 @@ class TranslatorCroatian : public TranslatorAdapter_1_4_6 "samo po vrsti argumenata koje prihvata."); } +////////////////////////////////////////////////////////////////////////// +// new since 1.4.6 +////////////////////////////////////////////////////////////////////////// + + /*! This is used to introduce a caller (or called-by) graph */ + virtual QCString trCallerGraph() + { + return "Ovo je graf funkcija koje pozivaju ovu funkciju:"; + } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration values + */ + virtual QCString trEnumerationValueDocumentation() + { return "Dokumentacija enumeracija"; } }; #endif diff --git a/src/translator_it.h b/src/translator_it.h index 5515a89..ef3fbf1 100644 --- a/src/translator_it.h +++ b/src/translator_it.h @@ -19,6 +19,7 @@ * * Revision history * + * 2006/06: updated translation of new items used since version 1.4.6 * 2006/05: translated new items used since version 1.4.6 * corrected typo in trPackageMembers method * 2005/03: translated new items used since version 1.4.1 @@ -1530,11 +1531,18 @@ class TranslatorItalian : public TranslatorAdapter_1_4_6 // new since 1.4.6 ////////////////////////////////////////////////////////////////////////// + /*! This is used to introduce a caller (or called-by) graph */ virtual QCString trCallerGraph() { return "Questo il grafo dei chiamanti di questa funzione:"; } + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration values + */ + virtual QCString trEnumerationValueDocumentation() + { return "Documentazione dei tipi enumerati"; } + }; #endif diff --git a/src/translator_ru.h b/src/translator_ru.h index df199fa..19452b7 100644 --- a/src/translator_ru.h +++ b/src/translator_ru.h @@ -49,7 +49,7 @@ #ifndef TRANSLATOR_RU_H #define TRANSLATOR_RU_H -class TranslatorRussian : public TranslatorAdapter_1_4_6 +class TranslatorRussian : public Translator { private: /*! The decode() inline assumes the source written in the @@ -1575,6 +1575,24 @@ class TranslatorRussian : public TranslatorAdapter_1_4_6 " . " " ." ); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.4.6 +////////////////////////////////////////////////////////////////////////// + + /*! This is used to introduce a caller (or called-by) graph */ + virtual QCString trCallerGraph() + { + return " :"; + } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration values + */ + virtual QCString trEnumerationValueDocumentation() + { return " "; } + + }; #endif diff --git a/src/util.cpp b/src/util.cpp index f2b643d..0969ae8 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1747,6 +1747,7 @@ QCString tempArgListToString(ArgumentList *al) void setAnchors(ClassDef *cd,char id,MemberList *ml,int groupId) { int count=0; + if (ml==0) return; MemberListIterator mli(*ml); MemberDef *md; for (;(md=mli.current());++mli) @@ -1997,14 +1998,17 @@ int minClassDistance(ClassDef *cd,ClassDef *bcd,int level) "inheritance relation! Please send a bug report to dimitri@stack.nl\n",cd->name().data()); return -1; } - BaseClassListIterator bcli(*cd->baseClasses()); int m=maxInheritanceDepth; - for ( ; bcli.current() ; ++bcli) + if (cd->baseClasses()) { - //printf("class %s base class %s\n",cd->name().data(),bcli.current()->classDef->name().data()); - int mc=minClassDistance(bcli.current()->classDef,bcd,level+1); - if (mc<m) m=mc; - if (m<0) break; + BaseClassListIterator bcli(*cd->baseClasses()); + for ( ; bcli.current() ; ++bcli) + { + //printf("class %s base class %s\n",cd->name().data(),bcli.current()->classDef->name().data()); + int mc=minClassDistance(bcli.current()->classDef,bcd,level+1); + if (mc<m) m=mc; + if (m<0) break; + } } return m; } @@ -2198,7 +2202,7 @@ void trimBaseClassScope(BaseClassList *bcl,QCString &s,int level=0) ); } //printf("base class `%s'\n",cd->name().data()); - if (cd->baseClasses()->count()>0) + if (cd->baseClasses()) trimBaseClassScope(cd->baseClasses(),s,level+1); } } @@ -2445,7 +2449,7 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA, cd=getClass(namespaceName+"::"+className); else cd=getClass(className); - if (cd && cd->baseClasses()->count()>0) + if (cd && cd->baseClasses()) { trimBaseClassScope(cd->baseClasses(),srcAType); trimBaseClassScope(cd->baseClasses(),dstAType); @@ -2795,18 +2799,20 @@ static QCString getCanonicalTypeForIdentifier( cd = getResolvedClass(d,fs,word,&mType,&ts,TRUE); } - //printf("symbol=%s word=%s cd=%s d=%s fs=%s\n", + //printf("symbol=%s word=%s cd=%s d=%s fs=%s cd->isTemplate=%d\n", // symName.data(), // word.data(), // cd?cd->name().data():"<none>", // d?d->name().data():"<none>", - // fs?fs->name().data():"<none>" + // fs?fs->name().data():"<none>", + // cd?cd->isTemplate():-1 // ); - //printf(">>>> word '%s' => '%s' templSpec=%s ts=%s\n", + //printf(">>>> word '%s' => '%s' templSpec=%s ts=%s tSpec=%s\n", // (word+templSpec).data(), // cd?cd->qualifiedName().data():"<none>", - // templSpec.data(),ts.data()); + // templSpec.data(),ts.data(), + // tSpec?tSpec->data():"<null>"); if (cd) // known class type { @@ -2826,6 +2832,13 @@ static QCString getCanonicalTypeForIdentifier( if (cd->isTemplate() && tSpec) { + // template class, so remove the template part (it is part of the class name) + *tSpec=""; + } + else if (ts.isEmpty() && !templSpec.isEmpty() && cd && !cd->isTemplate() && tSpec) + { + // obscure case, where a class is used as a template, but doxygen think it is + // not (could happen when loading the class from a tag file). *tSpec=""; } } @@ -2863,7 +2876,7 @@ static QCString extractCanonicalType(Definition *d,FileDef *fs,QCString type) type.stripPrefix("typename "); type = removeRedundantWhiteSpace(type); - //printf("extractCanonicalType(type=%s,name=%s)\n",type.data(),name.data()); + //printf("extractCanonicalType(type=%s)\n",type.data()); static QRegExp id("[a-z_A-Z][:a-z_A-Z0-9]*"); @@ -2885,6 +2898,7 @@ static QCString extractCanonicalType(Definition *d,FileDef *fs,QCString type) static QRegExp re("[a-z_A-Z][a-z_A-Z0-9]*"); int tp=0,tl,ti; // for each identifier template specifier + //printf("adding resolved %s to %s\n",templSpec.data(),canType.data()); while ((ti=re.match(templSpec,tp,&tl))!=-1) { canType += templSpec.mid(tp,ti-tp); @@ -4220,11 +4234,12 @@ int getPrefixIndex(const QCString &name) static void initBaseClassHierarchy(BaseClassList *bcl) { + if (bcl==0) return; BaseClassListIterator bcli(*bcl); for ( ; bcli.current(); ++bcli) { ClassDef *cd=bcli.current()->classDef; - if (cd->baseClasses()->count()==0) // no base classes => new root + if (cd->baseClasses()==0) // no base classes => new root { initBaseClassHierarchy(cd->baseClasses()); } @@ -4249,12 +4264,15 @@ void initClassHierarchy(ClassSDict *cl) bool hasVisibleRoot(BaseClassList *bcl) { - BaseClassListIterator bcli(*bcl); - for ( ; bcli.current(); ++bcli) + if (bcl) { - ClassDef *cd=bcli.current()->classDef; - if (cd->isVisibleInHierarchy()) return TRUE; - hasVisibleRoot(cd->baseClasses()); + BaseClassListIterator bcli(*bcl); + for ( ; bcli.current(); ++bcli) + { + ClassDef *cd=bcli.current()->classDef; + if (cd->isVisibleInHierarchy()) return TRUE; + hasVisibleRoot(cd->baseClasses()); + } } return FALSE; } @@ -4606,11 +4624,12 @@ QCString getOverloadDocs() } void addMembersToMemberGroup(MemberList *ml, - MemberGroupSDict *memberGroupSDict, + MemberGroupSDict **ppMemberGroupSDict, Definition *context) { ASSERT(context!=0); //printf("addMemberToMemberGroup()\n"); + if (ml==0) return; MemberListIterator mli(*ml); MemberDef *md; uint index; @@ -4632,7 +4651,12 @@ void addMembersToMemberGroup(MemberList *ml, //QCString *pDocs = Doxygen::memberDocDict[groupId]; if (info) { - MemberGroup *mg = memberGroupSDict->find(groupId); + if (*ppMemberGroupSDict==0) + { + *ppMemberGroupSDict = new MemberGroupSDict; + (*ppMemberGroupSDict)->setAutoDelete(TRUE); + } + MemberGroup *mg = (*ppMemberGroupSDict)->find(groupId); if (mg==0) { mg = new MemberGroup( @@ -4642,7 +4666,7 @@ void addMembersToMemberGroup(MemberList *ml, info->doc, info->docFile ); - memberGroupSDict->append(groupId,mg); + (*ppMemberGroupSDict)->append(groupId,mg); } mg->insertMember(fmd); // insert in member group fmd->setMemberGroup(mg); @@ -4660,7 +4684,12 @@ void addMembersToMemberGroup(MemberList *ml, //QCString *pDocs = Doxygen::memberDocDict[groupId]; if (info) { - MemberGroup *mg = memberGroupSDict->find(groupId); + if (*ppMemberGroupSDict==0) + { + *ppMemberGroupSDict = new MemberGroupSDict; + (*ppMemberGroupSDict)->setAutoDelete(TRUE); + } + MemberGroup *mg = (*ppMemberGroupSDict)->find(groupId); if (mg==0) { mg = new MemberGroup( @@ -4670,7 +4699,7 @@ void addMembersToMemberGroup(MemberList *ml, info->doc, info->docFile ); - memberGroupSDict->append(groupId,mg); + (*ppMemberGroupSDict)->append(groupId,mg); } md = ml->take(index); // remove from member list mg->insertMember(md); // insert in member group @@ -240,9 +240,9 @@ QCString convertToXML(const char *s); QCString getOverloadDocs(); -void addMembersToMemberGroup(MemberList *ml, - MemberGroupSDict *memberGroupSDict, - Definition *context); +void addMembersToMemberGroup(/* in */ MemberList *ml, + /* in,out */ MemberGroupSDict **ppMemberGroupSDict, + /* in */ Definition *context); int extractClassNameFromType(const QCString &type,int &pos, QCString &name,QCString &templSpec); diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index bfc02ed..ebc1ced 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -863,6 +863,7 @@ static void generateXMLSection(Definition *d,QTextStream &ti,QTextStream &t, MemberList *ml,const char *kind,const char *header=0, const char *documentation=0) { + if (ml==0) return; MemberListIterator mli(*ml); MemberDef *md; int count=0; @@ -903,40 +904,43 @@ static void generateXMLSection(Definition *d,QTextStream &ti,QTextStream &t, static void writeListOfAllMembers(ClassDef *cd,QTextStream &t) { t << " <listofallmembers>" << endl; - MemberNameInfoSDict::Iterator mnii(*cd->memberNameInfoSDict()); - MemberNameInfo *mni; - for (mnii.toFirst();(mni=mnii.current());++mnii) + if (cd->memberNameInfoSDict()) { - MemberNameInfoIterator mii(*mni); - MemberInfo *mi; - for (mii.toFirst();(mi=mii.current());++mii) + MemberNameInfoSDict::Iterator mnii(*cd->memberNameInfoSDict()); + MemberNameInfo *mni; + for (mnii.toFirst();(mni=mnii.current());++mnii) { - MemberDef *md=mi->memberDef; - Protection prot = mi->prot; - Specifier virt=md->virtualness(); - t << " <member refid=\"" << md->getOutputFileBase() << "_1" << - md->anchor() << "\" prot=\""; - switch (prot) + MemberNameInfoIterator mii(*mni); + MemberInfo *mi; + for (mii.toFirst();(mi=mii.current());++mii) { - case Public: t << "public"; break; - case Protected: t << "protected"; break; - case Private: t << "private"; break; - case Package: t << "package"; break; - } - t << "\" virt=\""; - switch(virt) - { - case Normal: t << "non-virtual"; break; - case Virtual: t << "virtual"; break; - case Pure: t << "pure-virtual"; break; - } - t << "\""; - if (!mi->ambiguityResolutionScope.isEmpty()) - { - t << " ambiguityscope=\"" << convertToXML(mi->ambiguityResolutionScope) << "\""; + MemberDef *md=mi->memberDef; + Protection prot = mi->prot; + Specifier virt=md->virtualness(); + t << " <member refid=\"" << md->getOutputFileBase() << "_1" << + md->anchor() << "\" prot=\""; + switch (prot) + { + case Public: t << "public"; break; + case Protected: t << "protected"; break; + case Private: t << "private"; break; + case Package: t << "package"; break; + } + t << "\" virt=\""; + switch(virt) + { + case Normal: t << "non-virtual"; break; + case Virtual: t << "virtual"; break; + case Pure: t << "pure-virtual"; break; + } + t << "\""; + if (!mi->ambiguityResolutionScope.isEmpty()) + { + t << " ambiguityscope=\"" << convertToXML(mi->ambiguityResolutionScope) << "\""; + } + t << "><scope>" << convertToXML(cd->name()) << "</scope><name>" << + convertToXML(md->name()) << "</name></member>" << endl; } - t << "><scope>" << convertToXML(cd->name()) << "</scope><name>" << - convertToXML(md->name()) << "</name></member>" << endl; } } t << " </listofallmembers>" << endl; @@ -1098,7 +1102,7 @@ static void generateXMLForClass(ClassDef *cd,QTextStream &ti) t << " <compoundname>"; writeXMLString(t,cd->name()); t << "</compoundname>" << endl; - if (cd->baseClasses()->count()>0) + if (cd->baseClasses()) { BaseClassListIterator bcli(*cd->baseClasses()); BaseClassDef *bcd; @@ -1139,7 +1143,7 @@ static void generateXMLForClass(ClassDef *cd,QTextStream &ti) t << "</basecompoundref>" << endl; } } - if (cd->subClasses()->count()>0) + if (cd->subClasses()) { BaseClassListIterator bcli(*cd->subClasses()); BaseClassDef *bcd; @@ -1188,43 +1192,46 @@ static void generateXMLForClass(ClassDef *cd,QTextStream &ti) writeInnerClasses(cd->getInnerClasses(),t); writeTemplateList(cd,t); - MemberGroupSDict::Iterator mgli(*cd->memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - generateXMLSection(cd,ti,t,mg->members(),"user-defined",mg->header(), - mg->documentation()); - } - - generateXMLSection(cd,ti,t,&cd->pubTypes,"public-type"); - generateXMLSection(cd,ti,t,&cd->pubMethods,"public-func"); - generateXMLSection(cd,ti,t,&cd->pubAttribs,"public-attrib"); - generateXMLSection(cd,ti,t,&cd->pubSlots,"public-slot"); - generateXMLSection(cd,ti,t,&cd->signals,"signal"); - generateXMLSection(cd,ti,t,&cd->dcopMethods,"dcop-func"); - generateXMLSection(cd,ti,t,&cd->properties,"property"); - generateXMLSection(cd,ti,t,&cd->events,"event"); - generateXMLSection(cd,ti,t,&cd->pubStaticMethods,"public-static-func"); - generateXMLSection(cd,ti,t,&cd->pubStaticAttribs,"public-static-attrib"); - generateXMLSection(cd,ti,t,&cd->proTypes,"protected-type"); - generateXMLSection(cd,ti,t,&cd->proMethods,"protected-func"); - generateXMLSection(cd,ti,t,&cd->proAttribs,"protected-attrib"); - generateXMLSection(cd,ti,t,&cd->proSlots,"protected-slot"); - generateXMLSection(cd,ti,t,&cd->proStaticMethods,"protected-static-func"); - generateXMLSection(cd,ti,t,&cd->proStaticAttribs,"protected-static-attrib"); - generateXMLSection(cd,ti,t,&cd->pacTypes,"package-type"); - generateXMLSection(cd,ti,t,&cd->pacMethods,"package-func"); - generateXMLSection(cd,ti,t,&cd->pacAttribs,"package-attrib"); - generateXMLSection(cd,ti,t,&cd->pacStaticMethods,"package-static-func"); - generateXMLSection(cd,ti,t,&cd->pacStaticAttribs,"package-static-attrib"); - generateXMLSection(cd,ti,t,&cd->priTypes,"private-type"); - generateXMLSection(cd,ti,t,&cd->priMethods,"private-func"); - generateXMLSection(cd,ti,t,&cd->priAttribs,"private-attrib"); - generateXMLSection(cd,ti,t,&cd->priSlots,"private-slot"); - generateXMLSection(cd,ti,t,&cd->priStaticMethods,"private-static-func"); - generateXMLSection(cd,ti,t,&cd->priStaticAttribs,"private-static-attrib"); - generateXMLSection(cd,ti,t,&cd->friends,"friend"); - generateXMLSection(cd,ti,t,&cd->related,"related"); + if (cd->memberGroupSDict) + { + MemberGroupSDict::Iterator mgli(*cd->memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + generateXMLSection(cd,ti,t,mg->members(),"user-defined",mg->header(), + mg->documentation()); + } + } + + generateXMLSection(cd,ti,t,cd->pubTypes,"public-type"); + generateXMLSection(cd,ti,t,cd->pubMethods,"public-func"); + generateXMLSection(cd,ti,t,cd->pubAttribs,"public-attrib"); + generateXMLSection(cd,ti,t,cd->pubSlots,"public-slot"); + generateXMLSection(cd,ti,t,cd->signals,"signal"); + generateXMLSection(cd,ti,t,cd->dcopMethods,"dcop-func"); + generateXMLSection(cd,ti,t,cd->properties,"property"); + generateXMLSection(cd,ti,t,cd->events,"event"); + generateXMLSection(cd,ti,t,cd->pubStaticMethods,"public-static-func"); + generateXMLSection(cd,ti,t,cd->pubStaticAttribs,"public-static-attrib"); + generateXMLSection(cd,ti,t,cd->proTypes,"protected-type"); + generateXMLSection(cd,ti,t,cd->proMethods,"protected-func"); + generateXMLSection(cd,ti,t,cd->proAttribs,"protected-attrib"); + generateXMLSection(cd,ti,t,cd->proSlots,"protected-slot"); + generateXMLSection(cd,ti,t,cd->proStaticMethods,"protected-static-func"); + generateXMLSection(cd,ti,t,cd->proStaticAttribs,"protected-static-attrib"); + generateXMLSection(cd,ti,t,cd->pacTypes,"package-type"); + generateXMLSection(cd,ti,t,cd->pacMethods,"package-func"); + generateXMLSection(cd,ti,t,cd->pacAttribs,"package-attrib"); + generateXMLSection(cd,ti,t,cd->pacStaticMethods,"package-static-func"); + generateXMLSection(cd,ti,t,cd->pacStaticAttribs,"package-static-attrib"); + generateXMLSection(cd,ti,t,cd->priTypes,"private-type"); + generateXMLSection(cd,ti,t,cd->priMethods,"private-func"); + generateXMLSection(cd,ti,t,cd->priAttribs,"private-attrib"); + generateXMLSection(cd,ti,t,cd->priSlots,"private-slot"); + generateXMLSection(cd,ti,t,cd->priStaticMethods,"private-static-func"); + generateXMLSection(cd,ti,t,cd->priStaticAttribs,"private-static-attrib"); + generateXMLSection(cd,ti,t,cd->friends,"friend"); + generateXMLSection(cd,ti,t,cd->related,"related"); t << " <briefdescription>" << endl; writeXMLDocBlock(t,cd->briefFile(),cd->briefLine(),cd,0,cd->briefDescription()); @@ -1307,12 +1314,15 @@ static void generateXMLForNamespace(NamespaceDef *nd,QTextStream &ti) writeInnerClasses(nd->classSDict,t); writeInnerNamespaces(nd->namespaceSDict,t); - MemberGroupSDict::Iterator mgli(*nd->memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) + if (nd->memberGroupSDict) { - generateXMLSection(nd,ti,t,mg->members(),"user-defined",mg->header(), - mg->documentation()); + MemberGroupSDict::Iterator mgli(*nd->memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + generateXMLSection(nd,ti,t,mg->members(),"user-defined",mg->header(), + mg->documentation()); + } } generateXMLSection(nd,ti,t,&nd->decDefineMembers,"define"); @@ -1377,31 +1387,38 @@ static void generateXMLForFile(FileDef *fd,QTextStream &ti) writeXMLString(t,fd->name()); t << "</compoundname>" << endl; - QListIterator<IncludeInfo> ili1(*fd->includeFileList()); IncludeInfo *inc; - for (ili1.toFirst();(inc=ili1.current());++ili1) + + if (fd->includeFileList()) { - t << " <includes"; - if (inc->fileDef && !inc->fileDef->isReference()) // TODO: support external references + QListIterator<IncludeInfo> ili1(*fd->includeFileList()); + for (ili1.toFirst();(inc=ili1.current());++ili1) { - t << " refid=\"" << inc->fileDef->getOutputFileBase() << "\""; + t << " <includes"; + if (inc->fileDef && !inc->fileDef->isReference()) // TODO: support external references + { + t << " refid=\"" << inc->fileDef->getOutputFileBase() << "\""; + } + t << " local=\"" << (inc->local ? "yes" : "no") << "\">"; + t << inc->includeName; + t << "</includes>" << endl; } - t << " local=\"" << (inc->local ? "yes" : "no") << "\">"; - t << inc->includeName; - t << "</includes>" << endl; } - QListIterator<IncludeInfo> ili2(*fd->includedByFileList()); - for (ili2.toFirst();(inc=ili2.current());++ili2) + if (fd->includedByFileList()) { - t << " <includedby"; - if (inc->fileDef && !inc->fileDef->isReference()) // TODO: support external references + QListIterator<IncludeInfo> ili2(*fd->includedByFileList()); + for (ili2.toFirst();(inc=ili2.current());++ili2) { - t << " refid=\"" << inc->fileDef->getOutputFileBase() << "\""; + t << " <includedby"; + if (inc->fileDef && !inc->fileDef->isReference()) // TODO: support external references + { + t << " refid=\"" << inc->fileDef->getOutputFileBase() << "\""; + } + t << " local=\"" << (inc->local ? "yes" : "no") << "\">"; + t << inc->includeName; + t << "</includedby>" << endl; } - t << " local=\"" << (inc->local ? "yes" : "no") << "\">"; - t << inc->includeName; - t << "</includedby>" << endl; } DotInclDepGraph incDepGraph(fd,Config_getInt("MAX_DOT_GRAPH_DEPTH"),FALSE); @@ -1420,23 +1437,32 @@ static void generateXMLForFile(FileDef *fd,QTextStream &ti) t << " </invincdepgraph>" << endl; } - writeInnerClasses(fd->classSDict,t); - writeInnerNamespaces(fd->namespaceSDict,t); + if (fd->classSDict) + { + writeInnerClasses(fd->classSDict,t); + } + if (fd->namespaceSDict) + { + writeInnerNamespaces(fd->namespaceSDict,t); + } - MemberGroupSDict::Iterator mgli(*fd->memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) + if (fd->memberGroupSDict) { - generateXMLSection(fd,ti,t,mg->members(),"user-defined",mg->header(), - mg->documentation()); + MemberGroupSDict::Iterator mgli(*fd->memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + generateXMLSection(fd,ti,t,mg->members(),"user-defined",mg->header(), + mg->documentation()); + } } - generateXMLSection(fd,ti,t,&fd->decDefineMembers,"define"); - generateXMLSection(fd,ti,t,&fd->decProtoMembers,"prototype"); - generateXMLSection(fd,ti,t,&fd->decTypedefMembers,"typedef"); - generateXMLSection(fd,ti,t,&fd->decEnumMembers,"enum"); - generateXMLSection(fd,ti,t,&fd->decFuncMembers,"func"); - generateXMLSection(fd,ti,t,&fd->decVarMembers,"var"); + generateXMLSection(fd,ti,t,fd->decDefineMembers,"define"); + generateXMLSection(fd,ti,t,fd->decProtoMembers,"prototype"); + generateXMLSection(fd,ti,t,fd->decTypedefMembers,"typedef"); + generateXMLSection(fd,ti,t,fd->decEnumMembers,"enum"); + generateXMLSection(fd,ti,t,fd->decFuncMembers,"func"); + generateXMLSection(fd,ti,t,fd->decVarMembers,"var"); t << " <briefdescription>" << endl; writeXMLDocBlock(t,fd->briefFile(),fd->briefLine(),fd,0,fd->briefDescription()); @@ -1499,12 +1525,15 @@ static void generateXMLForGroup(GroupDef *gd,QTextStream &ti) writeInnerPages(gd->getPages(),t); writeInnerGroups(gd->getSubGroups(),t); - MemberGroupSDict::Iterator mgli(*gd->memberGroupSDict); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) + if (gd->memberGroupSDict) { - generateXMLSection(gd,ti,t,mg->members(),"user-defined",mg->header(), - mg->documentation()); + MemberGroupSDict::Iterator mgli(*gd->memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + generateXMLSection(gd,ti,t,mg->members(),"user-defined",mg->header(), + mg->documentation()); + } } generateXMLSection(gd,ti,t,&gd->decDefineMembers,"define"); |