diff options
Diffstat (limited to 'src')
102 files changed, 3133 insertions, 1677 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp index 5ea8cea..c6d1bca 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -61,6 +61,7 @@ class ClassDefImpl : public DefinitionImpl, public ClassDef /** Destroys a compound definition. */ ~ClassDefImpl(); + virtual ClassDef *resolveAlias() { return this; } virtual DefType definitionType() const { return TypeClass; } virtual QCString getOutputFileBase() const; virtual QCString getInstanceOutputFileBase() const; @@ -92,7 +93,7 @@ class ClassDefImpl : public DefinitionImpl, public ClassDef virtual bool isSubClass(ClassDef *bcd,int level=0) const; virtual bool isAccessibleMember(const MemberDef *md) const; virtual QDict<ClassDef> *getTemplateInstances() const; - virtual ClassDef *templateMaster() const; + virtual const ClassDef *templateMaster() const; virtual bool isTemplate() const; virtual IncludeInfo *includeInfo() const; virtual UsesClassDict *usedImplementationClasses() const; @@ -120,7 +121,7 @@ class ClassDefImpl : public DefinitionImpl, public ClassDef virtual const QList<MemberList> &getMemberLists() const; virtual MemberGroupSDict *getMemberGroupSDict() const; virtual QDict<int> *getTemplateBaseClassNames() const; - virtual ClassDef *getVariableInstance(const char *templSpec); + virtual ClassDef *getVariableInstance(const char *templSpec) const; virtual bool isUsedOnly() const; virtual QCString anchor() const; virtual bool isEmbeddedInOuterScope() const; @@ -141,6 +142,10 @@ class ClassDefImpl : public DefinitionImpl, public ClassDef virtual QCString getMemberListFileName() const; virtual bool subGrouping() const; virtual bool isSliceLocal() const; + virtual bool hasNonReferenceSuperClass() const; + virtual ClassDef *insertTemplateInstance(const QCString &fileName,int startLine,int startColumn, + const QCString &templSpec,bool &freshInstance) const; + virtual void insertBaseClass(ClassDef *,const char *name,Protection p,Specifier s,const char *t=0); virtual void insertSubClass(ClassDef *,Protection p,Specifier s,const char *t=0); virtual void setIncludeFile(FileDef *fd,const char *incName,bool local,bool force); @@ -153,9 +158,7 @@ class ClassDefImpl : public DefinitionImpl, public ClassDef virtual void setSubGrouping(bool enabled); virtual void setProtection(Protection p); virtual void setGroupDefForAllMembers(GroupDef *g,Grouping::GroupPri_t pri,const QCString &fileName,int startLine,bool hasDocs); - virtual void addInnerCompound(Definition *d); - virtual ClassDef *insertTemplateInstance(const QCString &fileName,int startLine,int startColumn, - const QCString &templSpec,bool &freshInstance); + virtual void addInnerCompound(const Definition *d); virtual void addUsedClass(ClassDef *cd,const char *accessName,Protection prot); virtual void addUsedByClass(ClassDef *cd,const char *accessName,Protection prot); virtual void setIsStatic(bool b); @@ -164,9 +167,9 @@ class ClassDefImpl : public DefinitionImpl, public ClassDef virtual void setClassSpecifier(uint64 spec); virtual void setTemplateArguments(ArgumentList *al); virtual void setTemplateBaseClassNames(QDict<int> *templateNames); - virtual void setTemplateMaster(ClassDef *tm); + virtual void setTemplateMaster(const ClassDef *tm); virtual void setTypeConstraints(ArgumentList *al); - virtual void addMembersToTemplateInstance(ClassDef *cd,const char *templSpec); + virtual void addMembersToTemplateInstance(const ClassDef *cd,const char *templSpec); virtual void makeTemplateArgument(bool b=TRUE); virtual void setCategoryOf(ClassDef *cd); virtual void setUsedOnly(bool b); @@ -182,75 +185,79 @@ class ClassDefImpl : public DefinitionImpl, public ClassDef virtual void mergeMembers(); virtual void sortMemberLists(); virtual void distributeMemberGroupDocumentation(); - virtual void writeDocumentation(OutputList &ol); - virtual void writeDocumentationForInnerClasses(OutputList &ol); - virtual void writeMemberPages(OutputList &ol); - virtual void writeMemberList(OutputList &ol); - virtual void writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup, - ClassDef *inheritedFrom,const char *inheritId); - virtual void writeQuickMemberLinks(OutputList &ol,MemberDef *md) const; - virtual void writeSummaryLinks(OutputList &ol); + virtual void writeDocumentation(OutputList &ol) const; + virtual void writeDocumentationForInnerClasses(OutputList &ol) const; + virtual void writeMemberPages(OutputList &ol) const; + virtual void writeMemberList(OutputList &ol) const; + virtual void writeDeclaration(OutputList &ol,const MemberDef *md,bool inGroup, + const ClassDef *inheritedFrom,const char *inheritId) const; + virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *md) const; + virtual void writeSummaryLinks(OutputList &ol) const; virtual void reclassifyMember(MemberDef *md,MemberType t); - virtual void writeInlineDocumentation(OutputList &ol); + virtual void writeInlineDocumentation(OutputList &ol) const; virtual void writeDeclarationLink(OutputList &ol,bool &found, - const char *header,bool localNames); + const char *header,bool localNames) const; virtual void removeMemberFromLists(MemberDef *md); + virtual void setAnonymousEnumType(); + virtual void countMembers(); + virtual void addGroupedInheritedMembers(OutputList &ol,MemberListType lt, - ClassDef *inheritedFrom,const QCString &inheritId); - virtual int countMembersIncludingGrouped(MemberListType lt,ClassDef *inheritedFrom,bool additional); - virtual int countInheritanceNodes(); + const ClassDef *inheritedFrom,const QCString &inheritId) const; virtual void writeTagFile(FTextStream &); - virtual void setVisited(bool visited) { m_visited = visited; } + virtual void setVisited(bool visited) const { m_visited = visited; } virtual bool isVisited() const { return m_visited; } - virtual bool hasNonReferenceSuperClass() const; - virtual int countMemberDeclarations(MemberListType lt,ClassDef *inheritedFrom, - int lt2,bool invert,bool showAlways,QPtrDict<void> *visitedClasses); + virtual int countMembersIncludingGrouped(MemberListType lt,const ClassDef *inheritedFrom,bool additional) const; + virtual int countInheritanceNodes() const; + virtual int countMemberDeclarations(MemberListType lt,const ClassDef *inheritedFrom, + int lt2,bool invert,bool showAlways,QPtrDict<void> *visitedClasses) const; virtual void writeMemberDeclarations(OutputList &ol,MemberListType lt,const QCString &title, - const char *subTitle=0,bool showInline=FALSE,ClassDef *inheritedFrom=0, + const char *subTitle=0,bool showInline=FALSE,const ClassDef *inheritedFrom=0, int lt2=-1,bool invert=FALSE,bool showAlways=FALSE, - QPtrDict<void> *visitedClasses=0); + QPtrDict<void> *visitedClasses=0) const; private: - bool m_visited; + mutable bool m_visited; void addUsedInterfaceClasses(MemberDef *md,const char *typeStr); - void showUsedFiles(OutputList &ol); + void showUsedFiles(OutputList &ol) const; - void writeDocumentationContents(OutputList &ol,const QCString &pageTitle); + void writeDocumentationContents(OutputList &ol,const QCString &pageTitle) const; void internalInsertMember(MemberDef *md,Protection prot,bool addToAllList); void addMemberToList(MemberListType lt,MemberDef *md,bool isBrief); MemberList *createMemberList(MemberListType lt); - void writeInheritedMemberDeclarations(OutputList &ol,MemberListType lt,int lt2,const QCString &title,ClassDef *inheritedFrom,bool invert,bool showAlways,QPtrDict<void> *visitedClasses); - void writeMemberDocumentation(OutputList &ol,MemberListType lt,const QCString &title,bool showInline=FALSE); - void writeSimpleMemberDocumentation(OutputList &ol,MemberListType lt); - void writePlainMemberDeclaration(OutputList &ol,MemberListType lt,bool inGroup,ClassDef *inheritedFrom,const char *inheritId); - void writeBriefDescription(OutputList &ol,bool exampleFlag); + void writeInheritedMemberDeclarations(OutputList &ol,MemberListType lt,int lt2,const QCString &title, + const ClassDef *inheritedFrom,bool invert, + bool showAlways,QPtrDict<void> *visitedClasses) const; + void writeMemberDocumentation(OutputList &ol,MemberListType lt,const QCString &title,bool showInline=FALSE) const; + void writeSimpleMemberDocumentation(OutputList &ol,MemberListType lt) const; + void writePlainMemberDeclaration(OutputList &ol,MemberListType lt,bool inGroup,const ClassDef *inheritedFrom,const char *inheritId) const; + void writeBriefDescription(OutputList &ol,bool exampleFlag) const; void writeDetailedDescription(OutputList &ol,const QCString &pageType,bool exampleFlag, - const QCString &title,const QCString &anchor=QCString()); - void writeIncludeFiles(OutputList &ol); - void writeIncludeFilesForSlice(OutputList &ol); + const QCString &title,const QCString &anchor=QCString()) const; + void writeIncludeFiles(OutputList &ol) const; + void writeIncludeFilesForSlice(OutputList &ol) const; //void writeAllMembersLink(OutputList &ol); - void writeInheritanceGraph(OutputList &ol); - void writeCollaborationGraph(OutputList &ol); - void writeMemberGroups(OutputList &ol,bool showInline=FALSE); - void writeNestedClasses(OutputList &ol,const QCString &title); - void writeInlineClasses(OutputList &ol); - void startMemberDeclarations(OutputList &ol); - void endMemberDeclarations(OutputList &ol); - void startMemberDocumentation(OutputList &ol); - void endMemberDocumentation(OutputList &ol); - void writeAuthorSection(OutputList &ol); - void writeMoreLink(OutputList &ol,const QCString &anchor); - void writeDetailedDocumentationBody(OutputList &ol); - - int countAdditionalInheritedMembers(); - void writeAdditionalInheritedMembers(OutputList &ol); - void addClassAttributes(OutputList &ol); + void writeInheritanceGraph(OutputList &ol) const; + void writeCollaborationGraph(OutputList &ol) const; + void writeMemberGroups(OutputList &ol,bool showInline=FALSE) const; + void writeNestedClasses(OutputList &ol,const QCString &title) const; + void writeInlineClasses(OutputList &ol) const; + void startMemberDeclarations(OutputList &ol) const; + void endMemberDeclarations(OutputList &ol) const; + void startMemberDocumentation(OutputList &ol) const; + void endMemberDocumentation(OutputList &ol) const; + void writeAuthorSection(OutputList &ol) const; + void writeMoreLink(OutputList &ol,const QCString &anchor) const; + void writeDetailedDocumentationBody(OutputList &ol) const; + + int countAdditionalInheritedMembers() const; + void writeAdditionalInheritedMembers(OutputList &ol) const; + void addClassAttributes(OutputList &ol) const; int countInheritedDecMembers(MemberListType lt, - ClassDef *inheritedFrom,bool invert,bool showAlways, - QPtrDict<void> *visitedClasses); + const ClassDef *inheritedFrom,bool invert,bool showAlways, + QPtrDict<void> *visitedClasses) const; void getTitleForMemberListType(MemberListType type, - QCString &title,QCString &subtitle); + QCString &title,QCString &subtitle) const; QCString includeStatement() const; void addTypeConstraint(const QCString &typeConstraint,const QCString &type); @@ -267,6 +274,265 @@ ClassDef *createClassDef( { return new ClassDefImpl(fileName,startLine,startColumn,name,ct,ref,fName,isSymbol,isJavaEnum); } +//----------------------------------------------------------------------------- + +class ClassDefAliasImpl : public DefinitionAliasImpl, public ClassDef +{ + public: + ClassDefAliasImpl(const Definition *newScope,const ClassDef *cd) : DefinitionAliasImpl(newScope,cd) {} + virtual ~ClassDefAliasImpl() {} + virtual DefType definitionType() const { return TypeClass; } + + const ClassDef *getCdAlias() const { return dynamic_cast<const ClassDef*>(getAlias()); } + virtual ClassDef *resolveAlias() { return const_cast<ClassDef*>(getCdAlias()); } + + virtual QCString getOutputFileBase() const + { return getCdAlias()->getOutputFileBase(); } + virtual QCString getInstanceOutputFileBase() const + { return getCdAlias()->getInstanceOutputFileBase(); } + virtual QCString getSourceFileBase() const + { return getCdAlias()->getSourceFileBase(); } + virtual QCString getReference() const + { return getCdAlias()->getReference(); } + virtual bool isReference() const + { return getCdAlias()->isReference(); } + virtual bool isLocal() const + { return getCdAlias()->isLocal(); } + virtual ClassSDict *getClassSDict() const + { return getCdAlias()->getClassSDict(); } + virtual bool hasDocumentation() const + { return getCdAlias()->hasDocumentation(); } + virtual bool hasDetailedDescription() const + { return getCdAlias()->hasDetailedDescription(); } + virtual QCString collaborationGraphFileName() const + { return getCdAlias()->collaborationGraphFileName(); } + virtual QCString inheritanceGraphFileName() const + { return getCdAlias()->inheritanceGraphFileName(); } + virtual QCString displayName(bool includeScope=TRUE) const + { return getCdAlias()->displayName(includeScope); } + virtual CompoundType compoundType() const + { return getCdAlias()->compoundType(); } + virtual QCString compoundTypeString() const + { return getCdAlias()->compoundTypeString(); } + virtual BaseClassList *baseClasses() const + { return getCdAlias()->baseClasses(); } + virtual BaseClassList *subClasses() const + { return getCdAlias()->subClasses(); } + virtual MemberNameInfoSDict *memberNameInfoSDict() const + { return getCdAlias()->memberNameInfoSDict(); } + virtual Protection protection() const + { return getCdAlias()->protection(); } + virtual bool isLinkableInProject() const + { return getCdAlias()->isLinkableInProject(); } + virtual bool isLinkable() const + { return getCdAlias()->isLinkable(); } + virtual bool isVisibleInHierarchy() const + { return getCdAlias()->isVisibleInHierarchy(); } + virtual bool visibleInParentsDeclList() const + { return getCdAlias()->visibleInParentsDeclList(); } + virtual ArgumentList *templateArguments() const + { return getCdAlias()->templateArguments(); } + virtual NamespaceDef *getNamespaceDef() const + { return getCdAlias()->getNamespaceDef(); } + virtual FileDef *getFileDef() const + { return getCdAlias()->getFileDef(); } + virtual MemberDef *getMemberByName(const QCString &s) const + { return getCdAlias()->getMemberByName(s); } + virtual bool isBaseClass(const ClassDef *bcd,bool followInstances,int level=0) const + { return getCdAlias()->isBaseClass(bcd,followInstances,level); } + virtual bool isSubClass(ClassDef *bcd,int level=0) const + { return getCdAlias()->isSubClass(bcd,level); } + virtual bool isAccessibleMember(const MemberDef *md) const + { return getCdAlias()->isAccessibleMember(md); } + virtual QDict<ClassDef> *getTemplateInstances() const + { return getCdAlias()->getTemplateInstances(); } + virtual const ClassDef *templateMaster() const + { return getCdAlias()->templateMaster(); } + virtual bool isTemplate() const + { return getCdAlias()->isTemplate(); } + virtual IncludeInfo *includeInfo() const + { return getCdAlias()->includeInfo(); } + virtual UsesClassDict *usedImplementationClasses() const + { return getCdAlias()->usedImplementationClasses(); } + virtual UsesClassDict *usedByImplementationClasses() const + { return getCdAlias()->usedByImplementationClasses(); } + virtual UsesClassDict *usedInterfaceClasses() const + { return getCdAlias()->usedInterfaceClasses(); } + virtual ConstraintClassDict *templateTypeConstraints() const + { return getCdAlias()->templateTypeConstraints(); } + virtual bool isTemplateArgument() const + { return getCdAlias()->isTemplateArgument(); } + virtual Definition *findInnerCompound(const char *name) const + { return getCdAlias()->findInnerCompound(name); } + virtual void getTemplateParameterLists(QList<ArgumentList> &lists) const + { return getCdAlias()->getTemplateParameterLists(lists); } + virtual QCString qualifiedNameWithTemplateParameters( + QList<ArgumentList> *actualParams=0,int *actualParamIndex=0) const + { return getCdAlias()->qualifiedNameWithTemplateParameters(actualParams,actualParamIndex); } + virtual bool isAbstract() const + { return getCdAlias()->isAbstract(); } + virtual bool isObjectiveC() const + { return getCdAlias()->isObjectiveC(); } + virtual bool isFortran() const + { return getCdAlias()->isFortran(); } + virtual bool isCSharp() const + { return getCdAlias()->isCSharp(); } + virtual bool isFinal() const + { return getCdAlias()->isFinal(); } + virtual bool isSealed() const + { return getCdAlias()->isSealed(); } + virtual bool isPublished() const + { return getCdAlias()->isPublished(); } + virtual bool isExtension() const + { return getCdAlias()->isExtension(); } + virtual bool isForwardDeclared() const + { return getCdAlias()->isForwardDeclared(); } + virtual bool isInterface() const + { return getCdAlias()->isInterface(); } + virtual ClassDef *categoryOf() const + { return getCdAlias()->categoryOf(); } + virtual QCString className() const + { return getCdAlias()->className(); } + virtual MemberList *getMemberList(MemberListType lt) const + { return getCdAlias()->getMemberList(lt); } + virtual const QList<MemberList> &getMemberLists() const + { return getCdAlias()->getMemberLists(); } + virtual MemberGroupSDict *getMemberGroupSDict() const + { return getCdAlias()->getMemberGroupSDict(); } + virtual QDict<int> *getTemplateBaseClassNames() const + { return getCdAlias()->getTemplateBaseClassNames(); } + virtual ClassDef *getVariableInstance(const char *templSpec) const + { return getCdAlias()->getVariableInstance(templSpec); } + virtual bool isUsedOnly() const + { return getCdAlias()->isUsedOnly(); } + virtual QCString anchor() const + { return getCdAlias()->anchor(); } + virtual bool isEmbeddedInOuterScope() const + { return getCdAlias()->isEmbeddedInOuterScope(); } + virtual bool isSimple() const + { return getCdAlias()->isSimple(); } + virtual const ClassList *taggedInnerClasses() const + { return getCdAlias()->taggedInnerClasses(); } + virtual ClassDef *tagLessReference() const + { return getCdAlias()->tagLessReference(); } + virtual MemberDef *isSmartPointer() const + { return getCdAlias()->isSmartPointer(); } + virtual bool isJavaEnum() const + { return getCdAlias()->isJavaEnum(); } + virtual bool isGeneric() const + { return getCdAlias()->isGeneric(); } + virtual bool isAnonymous() const + { return getCdAlias()->isAnonymous(); } + virtual const ClassSDict *innerClasses() const + { return getCdAlias()->innerClasses(); } + virtual QCString title() const + { return getCdAlias()->title(); } + virtual QCString generatedFromFiles() const + { return getCdAlias()->generatedFromFiles(); } + virtual const FileList &usedFiles() const + { return getCdAlias()->usedFiles(); } + virtual const ArgumentList *typeConstraints() const + { return getCdAlias()->typeConstraints(); } + virtual const ExampleSDict *exampleList() const + { return getCdAlias()->exampleList(); } + virtual bool hasExamples() const + { return getCdAlias()->hasExamples(); } + virtual QCString getMemberListFileName() const + { return getCdAlias()->getMemberListFileName(); } + virtual bool subGrouping() const + { return getCdAlias()->subGrouping(); } + virtual bool isSliceLocal() const + { return getCdAlias()->isSliceLocal(); } + virtual bool hasNonReferenceSuperClass() const + { return getCdAlias()->hasNonReferenceSuperClass(); } + virtual ClassDef *insertTemplateInstance(const QCString &fileName,int startLine,int startColumn, + const QCString &templSpec,bool &freshInstance) const + { return getCdAlias()->insertTemplateInstance(fileName,startLine,startColumn,templSpec,freshInstance); } + + virtual void insertBaseClass(ClassDef *,const char *name,Protection p,Specifier s,const char *t=0) { } + virtual void insertSubClass(ClassDef *,Protection p,Specifier s,const char *t=0) { } + virtual void setIncludeFile(FileDef *fd,const char *incName,bool local,bool force) {} + virtual void insertMember(MemberDef *) {} + virtual void insertUsedFile(FileDef *) {} + virtual bool addExample(const char *anchor,const char *name, const char *file) { return FALSE; } + virtual void mergeCategory(ClassDef *category) {} + virtual void setNamespace(NamespaceDef *nd) {} + virtual void setFileDef(FileDef *fd) {} + virtual void setSubGrouping(bool enabled) {} + virtual void setProtection(Protection p) {} + virtual void setGroupDefForAllMembers(GroupDef *g,Grouping::GroupPri_t pri,const QCString &fileName,int startLine,bool hasDocs) {} + virtual void addInnerCompound(const Definition *d) {} + virtual void addUsedClass(ClassDef *cd,const char *accessName,Protection prot) {} + virtual void addUsedByClass(ClassDef *cd,const char *accessName,Protection prot) {} + virtual void setIsStatic(bool b) {} + virtual void setCompoundType(CompoundType t) {} + virtual void setClassName(const char *name) {} + virtual void setClassSpecifier(uint64 spec) {} + virtual void setTemplateArguments(ArgumentList *al) {} + virtual void setTemplateBaseClassNames(QDict<int> *templateNames) {} + virtual void setTemplateMaster(const ClassDef *tm) {} + virtual void setTypeConstraints(ArgumentList *al) {} + virtual void addMembersToTemplateInstance(const ClassDef *cd,const char *templSpec) {} + virtual void makeTemplateArgument(bool b=TRUE) {} + virtual void setCategoryOf(ClassDef *cd) {} + virtual void setUsedOnly(bool b) {} + virtual void addTaggedInnerClass(ClassDef *cd) {} + virtual void setTagLessReference(ClassDef *cd) {} + virtual void setName(const char *name) {} + virtual void setMetaData(const char *md) {} + virtual void findSectionsInDocumentation() {} + virtual void addMembersToMemberGroup() {} + virtual void addListReferences() {} + virtual void addTypeConstraints() {} + virtual void computeAnchors() {} + virtual void mergeMembers() {} + virtual void sortMemberLists() {} + virtual void distributeMemberGroupDocumentation() {} + virtual void writeDocumentation(OutputList &ol) const {} + virtual void writeDocumentationForInnerClasses(OutputList &ol) const {} + virtual void writeMemberPages(OutputList &ol) const {} + virtual void writeMemberList(OutputList &ol) const {} + virtual void writeDeclaration(OutputList &ol,const MemberDef *md,bool inGroup, + const ClassDef *inheritedFrom,const char *inheritId) const {} + virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *md) const {} + virtual void writeSummaryLinks(OutputList &ol) const {} + virtual void reclassifyMember(MemberDef *md,MemberType t) {} + virtual void writeInlineDocumentation(OutputList &ol) const {} + virtual void writeDeclarationLink(OutputList &ol,bool &found, + const char *header,bool localNames) const + { getCdAlias()->writeDeclarationLink(ol,found,header,localNames); } + virtual void removeMemberFromLists(MemberDef *md) {} + virtual void setAnonymousEnumType() {} + virtual void countMembers() {} + virtual void addGroupedInheritedMembers(OutputList &ol,MemberListType lt, + const ClassDef *inheritedFrom,const QCString &inheritId) const {} + virtual void writeTagFile(FTextStream &) {} + + virtual void setVisited(bool visited) const { m_visited = visited; } + virtual bool isVisited() const { return m_visited; } + virtual int countMembersIncludingGrouped(MemberListType lt,const ClassDef *inheritedFrom,bool additional) const + { return getCdAlias()->countMembersIncludingGrouped(lt,inheritedFrom,additional); } + virtual int countInheritanceNodes() const + { return getCdAlias()->countInheritanceNodes(); } + virtual int countMemberDeclarations(MemberListType lt,const ClassDef *inheritedFrom, + int lt2,bool invert,bool showAlways,QPtrDict<void> *visitedClasses) const + { return countMemberDeclarations(lt,inheritedFrom,lt2,invert,showAlways,visitedClasses); } + virtual void writeMemberDeclarations(OutputList &ol,MemberListType lt,const QCString &title, + const char *subTitle=0,bool showInline=FALSE,const ClassDef *inheritedFrom=0, + int lt2=-1,bool invert=FALSE,bool showAlways=FALSE, + QPtrDict<void> *visitedClasses=0) const {} + + private: + mutable bool m_visited; +}; + + +ClassDef *createClassDefAlias(const Definition *newScope,const ClassDef *cd) +{ + return new ClassDefAliasImpl(newScope,cd); +} + +//----------------------------------------------------------------------------- /** Private data associated with a ClassDef object. */ class ClassDefImpl::IMPL @@ -353,18 +619,18 @@ class ClassDefImpl::IMPL /*! Template instances that exists of this class, the key in the * dictionary is the template argument list. */ - QDict<ClassDef> *templateInstances; + mutable QDict<ClassDef> *templateInstances; /*! Template instances that exists of this class, as defined by variables. * We do NOT want to document these individually. The key in the * dictionary is the template argument list. */ - QDict<ClassDef> *variableInstances; + mutable QDict<ClassDef> *variableInstances; QDict<int> *templBaseClassNames; /*! The class this class is an instance of. */ - ClassDef *templateMaster; + const ClassDef *templateMaster; /*! local class name which could be a typedef'ed alias name. */ QCString className; @@ -1107,7 +1373,7 @@ void ClassDefImpl::setIncludeFile(FileDef *fd, // return 0; //} -static void searchTemplateSpecs(/*in*/ Definition *d, +static void searchTemplateSpecs(/*in*/ const Definition *d, /*out*/ QList<ArgumentList> &result, /*out*/ QCString &name, /*in*/ SrcLangExt lang) @@ -1118,7 +1384,7 @@ static void searchTemplateSpecs(/*in*/ Definition *d, { searchTemplateSpecs(d->getOuterScope(),result,name,lang); } - ClassDef *cd=dynamic_cast<ClassDef *>(d); + const ClassDef *cd=dynamic_cast<const ClassDef *>(d); if (!name.isEmpty()) name+="::"; QCString clName = d->localName(); if (/*clName.right(2)=="-g" ||*/ clName.right(2)=="-p") @@ -1142,7 +1408,7 @@ static void searchTemplateSpecs(/*in*/ Definition *d, } } -static void writeTemplateSpec(OutputList &ol,Definition *d, +static void writeTemplateSpec(OutputList &ol,const Definition *d, const QCString &type,SrcLangExt lang) { QList<ArgumentList> specs; @@ -1184,7 +1450,7 @@ static void writeTemplateSpec(OutputList &ol,Definition *d, } } -void ClassDefImpl::writeBriefDescription(OutputList &ol,bool exampleFlag) +void ClassDefImpl::writeBriefDescription(OutputList &ol,bool exampleFlag) const { if (hasBriefDescription()) { @@ -1211,7 +1477,7 @@ void ClassDefImpl::writeBriefDescription(OutputList &ol,bool exampleFlag) ol.writeSynopsis(); } -void ClassDefImpl::writeDetailedDocumentationBody(OutputList &ol) +void ClassDefImpl::writeDetailedDocumentationBody(OutputList &ol) const { static bool repeatBrief = Config_getBool(REPEAT_BRIEF); @@ -1270,7 +1536,7 @@ bool ClassDefImpl::hasDetailedDescription() const // write the detailed description for this class void ClassDefImpl::writeDetailedDescription(OutputList &ol, const QCString &/*pageType*/, bool exampleFlag, - const QCString &title,const QCString &anchor) + const QCString &title,const QCString &anchor) const { if (hasDetailedDescription() || exampleFlag) { @@ -1336,7 +1602,7 @@ QCString ClassDefImpl::generatedFromFiles() const return result; } -void ClassDefImpl::showUsedFiles(OutputList &ol) +void ClassDefImpl::showUsedFiles(OutputList &ol) const { ol.pushGeneratorState(); ol.disable(OutputGenerator::Man); @@ -1416,7 +1682,7 @@ void ClassDefImpl::showUsedFiles(OutputList &ol) ol.popGeneratorState(); } -int ClassDefImpl::countInheritanceNodes() +int ClassDefImpl::countInheritanceNodes() const { int count=0; BaseClassDef *ibcd; @@ -1441,7 +1707,7 @@ int ClassDefImpl::countInheritanceNodes() return count; } -void ClassDefImpl::writeInheritanceGraph(OutputList &ol) +void ClassDefImpl::writeInheritanceGraph(OutputList &ol) const { // count direct inheritance relations const int count=countInheritanceNodes(); @@ -1566,7 +1832,7 @@ void ClassDefImpl::writeInheritanceGraph(OutputList &ol) } } -void ClassDefImpl::writeCollaborationGraph(OutputList &ol) +void ClassDefImpl::writeCollaborationGraph(OutputList &ol) const { if (Config_getBool(HAVE_DOT) /*&& Config_getBool(COLLABORATION_GRAPH)*/) { @@ -1601,7 +1867,7 @@ QCString ClassDefImpl::includeStatement() const } } -void ClassDefImpl::writeIncludeFilesForSlice(OutputList &ol) +void ClassDefImpl::writeIncludeFilesForSlice(OutputList &ol) const { if (m_impl->incInfo) { @@ -1755,7 +2021,7 @@ void ClassDefImpl::writeIncludeFilesForSlice(OutputList &ol) ol.endParagraph(); } -void ClassDefImpl::writeIncludeFiles(OutputList &ol) +void ClassDefImpl::writeIncludeFiles(OutputList &ol) const { if (m_impl->incInfo /*&& Config_getBool(SHOW_INCLUDE_FILES)*/) { @@ -1822,7 +2088,7 @@ void ClassDefImpl::writeAllMembersLink(OutputList &ol) } #endif -void ClassDefImpl::writeMemberGroups(OutputList &ol,bool showInline) +void ClassDefImpl::writeMemberGroups(OutputList &ol,bool showInline) const { // write user defined member groups if (m_impl->memberGroupSDict) @@ -1845,7 +2111,7 @@ void ClassDefImpl::writeMemberGroups(OutputList &ol,bool showInline) } } -void ClassDefImpl::writeNestedClasses(OutputList &ol,const QCString &title) +void ClassDefImpl::writeNestedClasses(OutputList &ol,const QCString &title) const { // nested classes if (m_impl->innerClasses) @@ -1854,7 +2120,7 @@ void ClassDefImpl::writeNestedClasses(OutputList &ol,const QCString &title) } } -void ClassDefImpl::writeInlineClasses(OutputList &ol) +void ClassDefImpl::writeInlineClasses(OutputList &ol) const { if (m_impl->innerClasses) { @@ -1862,7 +2128,7 @@ void ClassDefImpl::writeInlineClasses(OutputList &ol) } } -void ClassDefImpl::startMemberDocumentation(OutputList &ol) +void ClassDefImpl::startMemberDocumentation(OutputList &ol) const { //printf("%s: ClassDefImpl::startMemberDocumentation()\n",name().data()); if (Config_getBool(SEPARATE_MEMBER_PAGES)) @@ -1872,7 +2138,7 @@ void ClassDefImpl::startMemberDocumentation(OutputList &ol) } } -void ClassDefImpl::endMemberDocumentation(OutputList &ol) +void ClassDefImpl::endMemberDocumentation(OutputList &ol) const { //printf("%s: ClassDefImpl::endMemberDocumentation()\n",name().data()); if (Config_getBool(SEPARATE_MEMBER_PAGES)) @@ -1882,13 +2148,13 @@ void ClassDefImpl::endMemberDocumentation(OutputList &ol) } } -void ClassDefImpl::startMemberDeclarations(OutputList &ol) +void ClassDefImpl::startMemberDeclarations(OutputList &ol) const { //printf("%s: ClassDefImpl::startMemberDeclarations()\n",name().data()); ol.startMemberSections(); } -void ClassDefImpl::endMemberDeclarations(OutputList &ol) +void ClassDefImpl::endMemberDeclarations(OutputList &ol) const { //printf("%s: ClassDefImpl::endMemberDeclarations()\n",name().data()); static bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB); @@ -1902,7 +2168,7 @@ void ClassDefImpl::endMemberDeclarations(OutputList &ol) ol.endMemberSections(); } -void ClassDefImpl::writeAuthorSection(OutputList &ol) +void ClassDefImpl::writeAuthorSection(OutputList &ol) const { ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Man); @@ -1915,7 +2181,7 @@ void ClassDefImpl::writeAuthorSection(OutputList &ol) } -void ClassDefImpl::writeSummaryLinks(OutputList &ol) +void ClassDefImpl::writeSummaryLinks(OutputList &ol) const { ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); @@ -2093,7 +2359,7 @@ void ClassDefImpl::writeTagFile(FTextStream &tagFile) } /** Write class documentation inside another container (i.e. a group) */ -void ClassDefImpl::writeInlineDocumentation(OutputList &ol) +void ClassDefImpl::writeInlineDocumentation(OutputList &ol) const { bool isSimple = m_impl->isSimple; @@ -2210,7 +2476,7 @@ void ClassDefImpl::writeInlineDocumentation(OutputList &ol) ol.popGeneratorState(); } -void ClassDefImpl::writeMoreLink(OutputList &ol,const QCString &anchor) +void ClassDefImpl::writeMoreLink(OutputList &ol,const QCString &anchor) const { // TODO: clean up this mess by moving it to // the output generators... @@ -2266,7 +2532,7 @@ bool ClassDefImpl::visibleInParentsDeclList() const ); } -void ClassDefImpl::writeDeclarationLink(OutputList &ol,bool &found,const char *header,bool localNames) +void ClassDefImpl::writeDeclarationLink(OutputList &ol,bool &found,const char *header,bool localNames) const { //static bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN); //static bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL); @@ -2375,7 +2641,7 @@ void ClassDefImpl::writeDeclarationLink(OutputList &ol,bool &found,const char *h } } -void ClassDefImpl::addClassAttributes(OutputList &ol) +void ClassDefImpl::addClassAttributes(OutputList &ol) const { QStrList sl; if (isFinal()) sl.append("final"); @@ -2400,7 +2666,7 @@ void ClassDefImpl::addClassAttributes(OutputList &ol) ol.popGeneratorState(); } -void ClassDefImpl::writeDocumentationContents(OutputList &ol,const QCString & /*pageTitle*/) +void ClassDefImpl::writeDocumentationContents(OutputList &ol,const QCString & /*pageTitle*/) const { ol.startContents(); @@ -2585,7 +2851,7 @@ QCString ClassDefImpl::title() const } // write all documentation for this class -void ClassDefImpl::writeDocumentation(OutputList &ol) +void ClassDefImpl::writeDocumentation(OutputList &ol) const { static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW); //static bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN); @@ -2643,7 +2909,7 @@ void ClassDefImpl::writeDocumentation(OutputList &ol) } } -void ClassDefImpl::writeMemberPages(OutputList &ol) +void ClassDefImpl::writeMemberPages(OutputList &ol) const { /////////////////////////////////////////////////////////////////////////// //// Member definitions on separate pages @@ -2656,8 +2922,7 @@ void ClassDefImpl::writeMemberPages(OutputList &ol) MemberList *ml; for (mli.toFirst();(ml=mli.current());++mli) { - ml->countDocMembers(); - if (ml->numDocMembers()>0 && (ml->listType()&MemberListType_detailedLists)) + if (ml->numDocMembers()>ml->numDocEnumValues() && (ml->listType()&MemberListType_detailedLists)) { ml->writeDocumentationPage(ol,displayName(),this); } @@ -2666,7 +2931,7 @@ void ClassDefImpl::writeMemberPages(OutputList &ol) ol.popGeneratorState(); } -void ClassDefImpl::writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const +void ClassDefImpl::writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const { static bool createSubDirs=Config_getBool(CREATE_SUBDIRS); @@ -2716,7 +2981,7 @@ void ClassDefImpl::writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) co -void ClassDefImpl::writeDocumentationForInnerClasses(OutputList &ol) +void ClassDefImpl::writeDocumentationForInnerClasses(OutputList &ol) const { // write inner classes after the parent, so the tag files contain // the definition in proper order! @@ -2741,7 +3006,7 @@ void ClassDefImpl::writeDocumentationForInnerClasses(OutputList &ol) } // write the list of all (inherited) members for this class -void ClassDefImpl::writeMemberList(OutputList &ol) +void ClassDefImpl::writeMemberList(OutputList &ol) const { static bool cOpt = Config_getBool(OPTIMIZE_OUTPUT_FOR_C); //static bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL); @@ -2811,7 +3076,7 @@ void ClassDefImpl::writeMemberList(OutputList &ol) for (;(mi=it.current());++it) { MemberDef *md=mi->memberDef; - ClassDef *cd=md->getClassDef(); + const ClassDef *cd=md->getClassDef(); Protection prot = mi->prot; Specifier virt=md->virtualness(); @@ -3024,7 +3289,6 @@ void ClassDefImpl::writeMemberList(OutputList &ol) ol.popGeneratorState(); } - // add a reference to an example bool ClassDefImpl::addExample(const char *anchor,const char *nameStr, const char *file) @@ -3183,8 +3447,8 @@ bool ClassDefImpl::hasNonReferenceSuperClass() const /*! called from MemberDef::writeDeclaration() to (recursively) write the * definition of an anonymous struct, union or class. */ -void ClassDefImpl::writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup, - ClassDef *inheritedFrom,const char *inheritId) +void ClassDefImpl::writeDeclaration(OutputList &ol,const MemberDef *md,bool inGroup, + const ClassDef *inheritedFrom,const char *inheritId) const { //printf("ClassName=`%s' inGroup=%d\n",name().data(),inGroup); @@ -3319,7 +3583,7 @@ bool ClassDefImpl::isBaseClass(const ClassDef *bcd, bool followInstances,int lev BaseClassListIterator bcli(*baseClasses()); for ( ; bcli.current() && !found ; ++bcli) { - ClassDef *ccd=bcli.current()->classDef; + const ClassDef *ccd=bcli.current()->classDef; if (!followInstances && ccd->templateMaster()) ccd=ccd->templateMaster(); //printf("isBaseClass() baseclass %s\n",ccd->name().data()); if (ccd==bcd) @@ -3422,13 +3686,13 @@ void ClassDefImpl::mergeMembers() bool hidden=FALSE; MemberNameInfoIterator dstMnii(*dstMni); MemberInfo *dstMi; - ClassDef *srcCd = srcMd->getClassDef(); + const ClassDef *srcCd = srcMd->getClassDef(); for ( ; (dstMi=dstMnii.current()) && !found; ++dstMnii ) { MemberDef *dstMd = dstMi->memberDef; if (srcMd!=dstMd) // different members { - ClassDef *dstCd = dstMd->getClassDef(); + const 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 @@ -4135,7 +4399,7 @@ void ClassDefImpl::setGroupDefForAllMembers(GroupDef *gd,Grouping::GroupPri_t pr } } -void ClassDefImpl::addInnerCompound(Definition *d) +void ClassDefImpl::addInnerCompound(const Definition *d) { //printf("**** %s::addInnerCompound(%s)\n",name().data(),d->name().data()); if (d->definitionType()==Definition::TypeClass) // only classes can be @@ -4145,7 +4409,7 @@ void ClassDefImpl::addInnerCompound(Definition *d) { m_impl->innerClasses = new ClassSDict(17); } - m_impl->innerClasses->inSort(d->localName(),dynamic_cast<ClassDef *>(d)); + m_impl->innerClasses->inSort(d->localName(),dynamic_cast<const ClassDef *>(d)); } } @@ -4201,7 +4465,7 @@ Definition *ClassDefImpl::findInnerCompound(const char *name) const //} ClassDef *ClassDefImpl::insertTemplateInstance(const QCString &fileName, - int startLine, int startColumn, const QCString &templSpec,bool &freshInstance) + int startLine, int startColumn, const QCString &templSpec,bool &freshInstance) const { freshInstance = FALSE; if (m_impl->templateInstances==0) @@ -4224,7 +4488,7 @@ ClassDef *ClassDefImpl::insertTemplateInstance(const QCString &fileName, return templateClass; } -ClassDef *ClassDefImpl::getVariableInstance(const char *templSpec) +ClassDef *ClassDefImpl::getVariableInstance(const char *templSpec) const { if (m_impl->variableInstances==0) { @@ -4269,7 +4533,7 @@ QDict<int> *ClassDefImpl::getTemplateBaseClassNames() const return m_impl->templBaseClassNames; } -void ClassDefImpl::addMembersToTemplateInstance(ClassDef *cd,const char *templSpec) +void ClassDefImpl::addMembersToTemplateInstance(const ClassDef *cd,const char *templSpec) { //printf("%s::addMembersToTemplateInstance(%s,%s)\n",name().data(),cd->name().data(),templSpec); if (cd->memberNameInfoSDict()==0) return; @@ -4480,7 +4744,7 @@ MemberDef *ClassDefImpl::getMemberByName(const QCString &name) const MemberInfo *mi; for (mnii.toFirst();(mi=mnii.current());++mnii) { - ClassDef *mcd=mi->memberDef->getClassDef(); + const 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); @@ -4559,8 +4823,8 @@ void ClassDefImpl::sortMemberLists() } } -int ClassDefImpl::countMemberDeclarations(MemberListType lt,ClassDef *inheritedFrom, - int lt2,bool invert,bool showAlways,QPtrDict<void> *visitedClasses) +int ClassDefImpl::countMemberDeclarations(MemberListType lt,const ClassDef *inheritedFrom, + int lt2,bool invert,bool showAlways,QPtrDict<void> *visitedClasses) const { //printf("%s: countMemberDeclarations for %d and %d\n",name().data(),lt,lt2); int count=0; @@ -4570,13 +4834,11 @@ int ClassDefImpl::countMemberDeclarations(MemberListType lt,ClassDef *inheritedF { if (ml) { - ml->countDecMembers(); count+=ml->numDecMembers(); //printf("-> ml=%d\n",ml->numDecMembers()); } if (ml2) { - ml2->countDecMembers(); count+=ml2->numDecMembers(); //printf("-> ml2=%d\n",ml2->numDecMembers()); } @@ -4601,10 +4863,61 @@ int ClassDefImpl::countMemberDeclarations(MemberListType lt,ClassDef *inheritedF return count; } +void ClassDefImpl::setAnonymousEnumType() +{ + QListIterator<LayoutDocEntry> eli( + LayoutDocManager::instance().docEntries(LayoutDocManager::Class)); + LayoutDocEntry *lde; + for (eli.toFirst();(lde=eli.current());++eli) + { + if (lde->kind()==LayoutDocEntry::MemberDecl) + { + LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + MemberList * ml = getMemberList(lmd->type); + if (ml) + { + ml->setAnonymousEnumType(); + } + } + else if (lde->kind()==LayoutDocEntry::MemberGroups) + { + if (m_impl->memberGroupSDict) + { + MemberGroupSDict::Iterator mgli(*m_impl->memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->setAnonymousEnumType(); + } + } + } + } +} + +void ClassDefImpl::countMembers() +{ + QListIterator<MemberList> mli(m_impl->memberLists); + MemberList *ml; + for (mli.toFirst();(ml=mli.current());++mli) + { + ml->countDecMembers(); + ml->countDocMembers(); + } + if (m_impl->memberGroupSDict) + { + MemberGroupSDict::Iterator mgli(*m_impl->memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->countDecMembers(); + mg->countDocMembers(); + } + } +} int ClassDefImpl::countInheritedDecMembers(MemberListType lt, - ClassDef *inheritedFrom,bool invert,bool showAlways, - QPtrDict<void> *visitedClasses) + const ClassDef *inheritedFrom,bool invert,bool showAlways, + QPtrDict<void> *visitedClasses) const { int inhCount = 0; int count = countMembersIncludingGrouped(lt,inheritedFrom,FALSE); @@ -4642,7 +4955,7 @@ int ClassDefImpl::countInheritedDecMembers(MemberListType lt, } void ClassDefImpl::getTitleForMemberListType(MemberListType type, - QCString &title,QCString &subtitle) + QCString &title,QCString &subtitle) const { SrcLangExt lang = getLanguage(); QListIterator<LayoutDocEntry> eli( @@ -4665,7 +4978,7 @@ void ClassDefImpl::getTitleForMemberListType(MemberListType type, subtitle=""; } -int ClassDefImpl::countAdditionalInheritedMembers() +int ClassDefImpl::countAdditionalInheritedMembers() const { int totalCount=0; QListIterator<LayoutDocEntry> eli( @@ -4691,7 +5004,7 @@ int ClassDefImpl::countAdditionalInheritedMembers() return totalCount; } -void ClassDefImpl::writeAdditionalInheritedMembers(OutputList &ol) +void ClassDefImpl::writeAdditionalInheritedMembers(OutputList &ol) const { //printf("**** writeAdditionalInheritedMembers()\n"); QListIterator<LayoutDocEntry> eli( @@ -4712,7 +5025,7 @@ void ClassDefImpl::writeAdditionalInheritedMembers(OutputList &ol) } int ClassDefImpl::countMembersIncludingGrouped(MemberListType lt, - ClassDef *inheritedFrom,bool additional) + const ClassDef *inheritedFrom,bool additional) const { int count=0; MemberList *ml = getMemberList(lt); @@ -4740,10 +5053,11 @@ int ClassDefImpl::countMembersIncludingGrouped(MemberListType lt, return count; } + void ClassDefImpl::writeInheritedMemberDeclarations(OutputList &ol, MemberListType lt,int lt2,const QCString &title, - ClassDef *inheritedFrom,bool invert,bool showAlways, - QPtrDict<void> *visitedClasses) + const ClassDef *inheritedFrom,bool invert,bool showAlways, + QPtrDict<void> *visitedClasses) const { ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); @@ -4790,15 +5104,15 @@ void ClassDefImpl::writeInheritedMemberDeclarations(OutputList &ol, } void ClassDefImpl::writeMemberDeclarations(OutputList &ol,MemberListType lt,const QCString &title, - const char *subTitle,bool showInline,ClassDef *inheritedFrom,int lt2, - bool invert,bool showAlways,QPtrDict<void> *visitedClasses) + const char *subTitle,bool showInline,const ClassDef *inheritedFrom,int lt2, + bool invert,bool showAlways,QPtrDict<void> *visitedClasses) const { //printf("%s: ClassDefImpl::writeMemberDeclarations lt=%d lt2=%d\n",name().data(),lt,lt2); MemberList * ml = getMemberList(lt); MemberList * ml2 = getMemberList((MemberListType)lt2); if (getLanguage()==SrcLangExt_VHDL) // use specific declarations function { - static ClassDef *cdef; + static const ClassDef *cdef; if (cdef!=this) { // only one inline link VhdlDocGen::writeInlineClassLink(this,ol); @@ -4838,7 +5152,7 @@ void ClassDefImpl::writeMemberDeclarations(OutputList &ol,MemberListType lt,cons } void ClassDefImpl::addGroupedInheritedMembers(OutputList &ol,MemberListType lt, - ClassDef *inheritedFrom,const QCString &inheritId) + const ClassDef *inheritedFrom,const QCString &inheritId) const { //printf("** %s::addGroupedInheritedMembers(%p) inheritId=%s\n",name().data(),m_impl->memberGroupSDict,inheritId.data()); if (m_impl->memberGroupSDict) @@ -4855,14 +5169,14 @@ void ClassDefImpl::addGroupedInheritedMembers(OutputList &ol,MemberListType lt, } } -void ClassDefImpl::writeMemberDocumentation(OutputList &ol,MemberListType lt,const QCString &title,bool showInline) +void ClassDefImpl::writeMemberDocumentation(OutputList &ol,MemberListType lt,const QCString &title,bool showInline) const { //printf("%s: ClassDefImpl::writeMemberDocumentation()\n",name().data()); MemberList * ml = getMemberList(lt); if (ml) ml->writeDocumentation(ol,displayName(),this,title,FALSE,showInline); } -void ClassDefImpl::writeSimpleMemberDocumentation(OutputList &ol,MemberListType lt) +void ClassDefImpl::writeSimpleMemberDocumentation(OutputList &ol,MemberListType lt) const { //printf("%s: ClassDefImpl::writeSimpleMemberDocumentation()\n",name().data()); MemberList * ml = getMemberList(lt); @@ -4871,7 +5185,7 @@ void ClassDefImpl::writeSimpleMemberDocumentation(OutputList &ol,MemberListType void ClassDefImpl::writePlainMemberDeclaration(OutputList &ol, MemberListType lt,bool inGroup, - ClassDef *inheritedFrom,const char *inheritId) + const ClassDef *inheritedFrom,const char *inheritId) const { //printf("%s: ClassDefImpl::writePlainMemberDeclaration()\n",name().data()); MemberList * ml = getMemberList(lt); @@ -4937,7 +5251,7 @@ QDict<ClassDef> *ClassDefImpl::getTemplateInstances() const return m_impl->templateInstances; } -ClassDef *ClassDefImpl::templateMaster() const +const ClassDef *ClassDefImpl::templateMaster() const { return m_impl->templateMaster; } @@ -5067,7 +5381,7 @@ void ClassDefImpl::setCompoundType(CompoundType t) m_impl->compType = t; } -void ClassDefImpl::setTemplateMaster(ClassDef *tm) +void ClassDefImpl::setTemplateMaster(const ClassDef *tm) { m_impl->templateMaster=tm; } diff --git a/src/classdef.h b/src/classdef.h index 58a3dee..a442ace 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -72,6 +72,8 @@ class ClassDef : virtual public Definition virtual ~ClassDef() {} + virtual ClassDef *resolveAlias() = 0; + //----------------------------------------------------------------------------------- // --- getters //----------------------------------------------------------------------------------- @@ -197,7 +199,7 @@ class ClassDef : virtual public Definition /** Returns the template master of which this class is an instance. * Returns 0 if not applicable. */ - virtual ClassDef *templateMaster() const = 0; + virtual const ClassDef *templateMaster() const = 0; /** Returns TRUE if this class is a template */ virtual bool isTemplate() const = 0; @@ -283,7 +285,7 @@ class ClassDef : virtual public Definition virtual QDict<int> *getTemplateBaseClassNames() const = 0; - virtual ClassDef *getVariableInstance(const char *templSpec) = 0; + virtual ClassDef *getVariableInstance(const char *templSpec) const = 0; virtual bool isUsedOnly() const = 0; @@ -314,52 +316,50 @@ class ClassDef : virtual public Definition virtual bool subGrouping() const = 0; virtual bool isSliceLocal() const = 0; + virtual bool hasNonReferenceSuperClass() const = 0; //----------------------------------------------------------------------------------- // --- setters ---- //----------------------------------------------------------------------------------- - virtual void insertBaseClass(ClassDef *,const char *name,Protection p,Specifier s,const char *t=0) = 0; - virtual void insertSubClass(ClassDef *,Protection p,Specifier s,const char *t=0) = 0; virtual void setIncludeFile(FileDef *fd,const char *incName,bool local,bool force) = 0; - virtual void insertMember(MemberDef *) = 0; - virtual void insertUsedFile(FileDef *) = 0; - virtual bool addExample(const char *anchor,const char *name, const char *file) = 0; - virtual void mergeCategory(ClassDef *category) = 0; virtual void setNamespace(NamespaceDef *nd) = 0; virtual void setFileDef(FileDef *fd) = 0; virtual void setSubGrouping(bool enabled) = 0; virtual void setProtection(Protection p) = 0; virtual void setGroupDefForAllMembers(GroupDef *g,Grouping::GroupPri_t pri,const QCString &fileName,int startLine,bool hasDocs) = 0; - virtual void addInnerCompound(Definition *d) = 0; - virtual ClassDef *insertTemplateInstance(const QCString &fileName,int startLine,int startColumn, - const QCString &templSpec,bool &freshInstance) = 0; - virtual void addUsedClass(ClassDef *cd,const char *accessName,Protection prot) = 0; - virtual void addUsedByClass(ClassDef *cd,const char *accessName,Protection prot) = 0; virtual void setIsStatic(bool b) = 0; virtual void setCompoundType(CompoundType t) = 0; virtual void setClassName(const char *name) = 0; virtual void setClassSpecifier(uint64 spec) = 0; - virtual void setTemplateArguments(ArgumentList *al) = 0; virtual void setTemplateBaseClassNames(QDict<int> *templateNames) = 0; - virtual void setTemplateMaster(ClassDef *tm) = 0; + virtual void setTemplateMaster(const ClassDef *tm) = 0; virtual void setTypeConstraints(ArgumentList *al) = 0; - virtual void addMembersToTemplateInstance(ClassDef *cd,const char *templSpec) = 0; - virtual void makeTemplateArgument(bool b=TRUE) = 0; virtual void setCategoryOf(ClassDef *cd) = 0; virtual void setUsedOnly(bool b) = 0; - - virtual void addTaggedInnerClass(ClassDef *cd) = 0; virtual void setTagLessReference(ClassDef *cd) = 0; virtual void setName(const char *name) = 0; - virtual void setMetaData(const char *md) = 0; //----------------------------------------------------------------------------------- // --- actions ---- //----------------------------------------------------------------------------------- + virtual void insertBaseClass(ClassDef *,const char *name,Protection p,Specifier s,const char *t=0) = 0; + virtual void insertSubClass(ClassDef *,Protection p,Specifier s,const char *t=0) = 0; + virtual void insertMember(MemberDef *) = 0; + virtual void insertUsedFile(FileDef *) = 0; + virtual void addMembersToTemplateInstance(const ClassDef *cd,const char *templSpec) = 0; + virtual void addTaggedInnerClass(ClassDef *cd) = 0; + virtual void addInnerCompound(const Definition *d) = 0; + virtual bool addExample(const char *anchor,const char *name, const char *file) = 0; + virtual ClassDef *insertTemplateInstance(const QCString &fileName,int startLine,int startColumn, + const QCString &templSpec,bool &freshInstance) const = 0; + virtual void addUsedClass(ClassDef *cd,const char *accessName,Protection prot) = 0; + virtual void addUsedByClass(ClassDef *cd,const char *accessName,Protection prot) = 0; + virtual void makeTemplateArgument(bool b=TRUE) = 0; + virtual void mergeCategory(ClassDef *category) = 0; virtual void findSectionsInDocumentation() = 0; virtual void addMembersToMemberGroup() = 0; virtual void addListReferences() = 0; @@ -368,34 +368,51 @@ class ClassDef : virtual public Definition virtual void mergeMembers() = 0; virtual void sortMemberLists() = 0; virtual void distributeMemberGroupDocumentation() = 0; - virtual void writeDocumentation(OutputList &ol) = 0; - virtual void writeDocumentationForInnerClasses(OutputList &ol) = 0; - virtual void writeMemberPages(OutputList &ol) = 0; - virtual void writeMemberList(OutputList &ol) = 0; - virtual void writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup, - ClassDef *inheritedFrom,const char *inheritId) = 0; - virtual void writeQuickMemberLinks(OutputList &ol,MemberDef *md) const = 0; - virtual void writeSummaryLinks(OutputList &ol) = 0; virtual void reclassifyMember(MemberDef *md,MemberType t) = 0; - virtual void writeInlineDocumentation(OutputList &ol) = 0; - virtual void writeDeclarationLink(OutputList &ol,bool &found, - const char *header,bool localNames) = 0; virtual void removeMemberFromLists(MemberDef *md) = 0; - virtual void addGroupedInheritedMembers(OutputList &ol,MemberListType lt, - ClassDef *inheritedFrom,const QCString &inheritId) = 0; - virtual int countMembersIncludingGrouped(MemberListType lt,ClassDef *inheritedFrom,bool additional) = 0; - virtual int countInheritanceNodes() = 0; - virtual void writeTagFile(FTextStream &) = 0; + virtual void setAnonymousEnumType() = 0; + virtual void countMembers() = 0; - virtual void setVisited(bool visited) = 0; - virtual bool isVisited() const = 0; - virtual bool hasNonReferenceSuperClass() const = 0; - virtual int countMemberDeclarations(MemberListType lt,ClassDef *inheritedFrom, - int lt2,bool invert,bool showAlways,QPtrDict<void> *visitedClasses) = 0; + //----------------------------------------------------------------------------------- + // --- write output ---- + //----------------------------------------------------------------------------------- + + virtual void writeDocumentation(OutputList &ol) const = 0; + virtual void writeDocumentationForInnerClasses(OutputList &ol) const = 0; + virtual void writeMemberPages(OutputList &ol) const = 0; + virtual void writeMemberList(OutputList &ol) const = 0; + virtual void writeDeclaration(OutputList &ol,const MemberDef *md,bool inGroup, + const ClassDef *inheritedFrom,const char *inheritId) const = 0; + virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *md) const = 0; + virtual void writeSummaryLinks(OutputList &ol) const = 0; + virtual void writeInlineDocumentation(OutputList &ol) const = 0; + virtual void writeDeclarationLink(OutputList &ol,bool &found, + const char *header,bool localNames) const = 0; + virtual void writeTagFile(FTextStream &) = 0; virtual void writeMemberDeclarations(OutputList &ol,MemberListType lt,const QCString &title, - const char *subTitle=0,bool showInline=FALSE,ClassDef *inheritedFrom=0, + const char *subTitle=0,bool showInline=FALSE,const ClassDef *inheritedFrom=0, int lt2=-1,bool invert=FALSE,bool showAlways=FALSE, - QPtrDict<void> *visitedClasses=0) = 0; + QPtrDict<void> *visitedClasses=0) const = 0; + virtual void addGroupedInheritedMembers(OutputList &ol,MemberListType lt, + const ClassDef *inheritedFrom,const QCString &inheritId) const = 0; + + //----------------------------------------------------------------------------------- + // --- count members ---- + //----------------------------------------------------------------------------------- + + virtual int countMembersIncludingGrouped(MemberListType lt, + const ClassDef *inheritedFrom,bool additional) const = 0; + virtual int countInheritanceNodes() const = 0; + virtual int countMemberDeclarations(MemberListType lt,const ClassDef *inheritedFrom, + int lt2,bool invert,bool showAlways,QPtrDict<void> *visitedClasses) const = 0; + + + //----------------------------------------------------------------------------------- + // --- visiting administration ---- + //----------------------------------------------------------------------------------- + + virtual void setVisited(bool visited) const = 0; + virtual bool isVisited() const = 0; }; /** Factory method to create a new ClassDef object */ @@ -405,6 +422,9 @@ ClassDef *createClassDef( const char *ref=0,const char *fName=0, bool isSymbol=TRUE,bool isJavaEnum=FALSE); +ClassDef *createClassDefAlias(const Definition *newScope,const ClassDef *cd); + + //------------------------------------------------------------------------ /** Class that contains information about a usage relation. diff --git a/src/classlist.cpp b/src/classlist.cpp index c752fd3..93ae8aa 100644 --- a/src/classlist.cpp +++ b/src/classlist.cpp @@ -92,7 +92,7 @@ bool ClassSDict::declVisible(const ClassDef::CompoundType *filter) const } void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *filter, - const char *header,bool localNames) + const char *header,bool localNames) const { static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE); if (count()>0) @@ -109,6 +109,7 @@ void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *f (filter==0 || *filter==cd->compoundType()) ) { + //printf("writeDeclarationLink()\n"); cd->writeDeclarationLink(ol,found,header,localNames); } } @@ -116,7 +117,7 @@ void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *f } } -void ClassSDict::writeDocumentation(OutputList &ol,Definition * container) +void ClassSDict::writeDocumentation(OutputList &ol,const Definition * container) const { static bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN); @@ -139,6 +140,7 @@ void ClassSDict::writeDocumentation(OutputList &ol,Definition * container) if (cd->name().find('@')==-1 && cd->isLinkableInProject() && cd->isEmbeddedInOuterScope() && + !cd->isAlias() && (container==0 || cd->partOfGroups()==0) // if container==0 -> show as part of the group docs, otherwise only show if not part of a group ) { diff --git a/src/classlist.h b/src/classlist.h index 2ae7de8..11c8305 100644 --- a/src/classlist.h +++ b/src/classlist.h @@ -59,8 +59,8 @@ class ClassSDict : public SDict<ClassDef> ClassSDict(int size=17) : SDict<ClassDef>(size) {} ~ClassSDict() {} void writeDeclaration(OutputList &ol,const ClassDef::CompoundType *filter=0, - const char *header=0,bool localNames=FALSE); - void writeDocumentation(OutputList &ol,Definition *container=0); + const char *header=0,bool localNames=FALSE) const; + void writeDocumentation(OutputList &ol,const Definition *container=0) const; bool declVisible(const ClassDef::CompoundType *filter=0) const; private: int compareValues(const ClassDef *item1,const ClassDef *item2) const; @@ -29,7 +29,7 @@ class Definition; void parseCCode(CodeOutputInterface &,const char *,const QCString &, SrcLangExt lang, bool isExample, const char *exName,FileDef *fd, int startLine,int endLine,bool inlineFragment, - MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx, + const MemberDef *memberDef,bool showLineNumbers,const Definition *searchCtx, bool collectXRefs); void resetCCodeParserState(); void codeFreeScanner(); @@ -129,7 +129,7 @@ static bool g_lexInit = FALSE; static QStack<int> g_classScopeLengthStack; static int g_prefixed_with_this_keyword = FALSE; -static Definition *g_searchCtx; +static const Definition *g_searchCtx; static bool g_collectXRefs; // context for an Objective-C method call @@ -341,7 +341,7 @@ class CallContext Ctx() : name(g_name), type(g_type), d(0) {} QCString name; QCString type; - Definition *d; + const Definition *d; }; CallContext() @@ -350,7 +350,7 @@ class CallContext m_defList.setAutoDelete(TRUE); } virtual ~CallContext() {} - void setScope(Definition *d) + void setScope(const Definition *d) { Ctx *ctx = m_defList.getLast(); if (ctx) @@ -388,7 +388,7 @@ class CallContext m_defList.clear(); m_defList.append(new Ctx); } - Definition *getScope() const + const Definition *getScope() const { Ctx *ctx = m_defList.getLast(); if (ctx) return ctx->d; else return 0; @@ -606,7 +606,7 @@ static void codifyLines(const char *text) * split into multiple links with the same destination, one for each line. */ static void writeMultiLineCodeLink(CodeOutputInterface &ol, - Definition *d, + const Definition *d, const char *text) { static bool sourceTooltips = Config_getBool(SOURCE_TOOLTIPS); @@ -674,7 +674,7 @@ static void addUsingDirective(const char *name) } } -static void setParameterList(MemberDef *md) +static void setParameterList(const MemberDef *md) { g_classScope = md->getClassDef() ? md->getClassDef()->name().data() : ""; ArgumentList *al = md->argumentList(); @@ -747,7 +747,7 @@ static MemberDef *setCallContextForVar(const QCString &name) } else // check namespace as well { - NamespaceDef *mnd = getResolvedNamespace(scope); + const NamespaceDef *mnd = getResolvedNamespace(scope); if (mnd && !locName.isEmpty()) { MemberDef *md=mnd->getMemberByName(locName); @@ -838,10 +838,10 @@ static MemberDef *setCallContextForVar(const QCString &name) static void updateCallContextForSmartPointer() { - Definition *d = g_theCallContext.getScope(); + const Definition *d = g_theCallContext.getScope(); //printf("updateCallContextForSmartPointer() cd=%s\n",cd ? d->name().data() : "<none>"); MemberDef *md; - if (d && d->definitionType()==Definition::TypeClass && (md=(dynamic_cast<ClassDef*>(d))->isSmartPointer())) + if (d && d->definitionType()==Definition::TypeClass && (md=(dynamic_cast<const ClassDef*>(d))->isSmartPointer())) { ClassDef *ncd = stripClassName(md->typeString(),md->getOuterScope()); if (ncd) @@ -860,11 +860,11 @@ static bool getLinkInScope(const QCString &c, // scope bool varOnly=FALSE ) { - MemberDef *md; - ClassDef *cd; - FileDef *fd; - NamespaceDef *nd; - GroupDef *gd; + MemberDef *md = 0; + const ClassDef *cd = 0; + const FileDef *fd = 0; + const NamespaceDef *nd = 0; + const GroupDef *gd = 0; DBG_CTX((stderr,"getLinkInScope: trying `%s'::`%s' varOnly=%d\n",c.data(),m.data(),varOnly)); if (getDefs(c,m,"()",md,cd,fd,nd,gd,FALSE,g_sourceFileDef,FALSE,g_forceTagReference) && (!varOnly || md->isVariable())) @@ -885,9 +885,9 @@ static bool getLinkInScope(const QCString &c, // scope } } - Definition *d = md->getOuterScope()==Doxygen::globalScope ? - md->getFileDef() : md->getOuterScope(); - if (md->getGroupDef()) d = md->getGroupDef(); + const Definition *d = md->getOuterScope()==Doxygen::globalScope ? + md->resolveAlias()->getFileDef() : md->getOuterScope(); + if (md->resolveAlias()->getGroupDef()) d = md->resolveAlias()->getGroupDef(); if (d && d->isLinkable()) { g_theCallContext.setScope(stripClassName(md->typeString(),md->getOuterScope())); @@ -983,7 +983,7 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName cd=getResolvedClass(d,g_sourceFileDef,bareName,&md); // try unspecialized version } } - NamespaceDef *nd = getResolvedNamespace(className); + const NamespaceDef *nd = getResolvedNamespace(className); if (nd && nd->isLinkableInProject()) { g_theCallContext.setScope(nd); @@ -1044,7 +1044,7 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName g_theCallContext.setScope(cd); if (md) { - Definition *d = md->getOuterScope()==Doxygen::globalScope ? + const Definition *d = md->getOuterScope()==Doxygen::globalScope ? md->getFileDef() : md->getOuterScope(); if (md->getGroupDef()) d = md->getGroupDef(); if (d && d->isLinkable() && md->isLinkable() && @@ -1143,7 +1143,7 @@ static bool generateClassMemberLink(CodeOutputInterface &ol,MemberDef *xmd,const DBG_CTX((stderr,"%s -> typeName=%p\n",xmd->typeString(),typeClass)); g_theCallContext.setScope(typeClass); - Definition *xd = xmd->getOuterScope()==Doxygen::globalScope ? + const Definition *xd = xmd->getOuterScope()==Doxygen::globalScope ? xmd->getFileDef() : xmd->getOuterScope(); if (xmd->getGroupDef()) xd = xmd->getGroupDef(); if (xd && xd->isLinkable()) @@ -1172,11 +1172,11 @@ static bool generateClassMemberLink(CodeOutputInterface &ol,MemberDef *xmd,const return FALSE; } -static bool generateClassMemberLink(CodeOutputInterface &ol,Definition *def,const char *memName) +static bool generateClassMemberLink(CodeOutputInterface &ol,const Definition *def,const char *memName) { if (def && def->definitionType()==Definition::TypeClass) { - ClassDef *cd = dynamic_cast<ClassDef*>(def); + const ClassDef *cd = dynamic_cast<const ClassDef*>(def); MemberDef *xmd = cd->getMemberByName(memName); //printf("generateClassMemberLink(class=%s,member=%s)=%p\n",def->name().data(),memName,xmd); if (xmd) @@ -1197,7 +1197,7 @@ static bool generateClassMemberLink(CodeOutputInterface &ol,Definition *def,cons } else if (def && def->definitionType()==Definition::TypeNamespace) { - NamespaceDef *nd = dynamic_cast<NamespaceDef*>(def); + const NamespaceDef *nd = dynamic_cast<const NamespaceDef*>(def); //printf("Looking for %s inside namespace %s\n",memName,nd->name().data()); Definition *innerDef = nd->findInnerCompound(memName); if (innerDef) @@ -1335,7 +1335,7 @@ static void generateFunctionLink(CodeOutputInterface &ol,const char *funcName) DBG_CTX((stdout,"*** locScope=%s locFunc=%s\n",locScope.data(),locFunc.data())); int len=2; int i=locFunc.findRev("::"); - if (g_currentMemberDef && g_currentMemberDef->getClassDef() && + if (g_currentMemberDef && g_currentMemberDef->resolveAlias()->getClassDef() && funcName==g_currentMemberDef->localName() && g_currentMemberDef->getDefLine()==g_yyLineNr && generateClassMemberLink(ol,g_currentMemberDef,funcName) @@ -3719,7 +3719,7 @@ void resetCCodeParserState() void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s, SrcLangExt lang,bool exBlock, const char *exName,FileDef *fd, int startLine,int endLine,bool inlineFragment, - MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx, + const MemberDef *memberDef,bool showLineNumbers,const Definition *searchCtx, bool collectXRefs) { //printf("***parseCode() exBlock=%d exName=%s fd=%p className=%s searchCtx=%s\n", diff --git a/src/configimpl.l b/src/configimpl.l index 644250f..d114b4a 100644 --- a/src/configimpl.l +++ b/src/configimpl.l @@ -699,12 +699,12 @@ static void readIncludeFile(const char *incName) %% <*>\0x0d -<PreStart>"##".*"\n" { config->appendStartComment(yytext);} +<PreStart>"##".*"\n" { config->appendStartComment(yytext);yyLineNr++;} <PreStart>. { BEGIN(Start); unput(*yytext); } -<Start,GetString,GetStrList,GetBool,SkipInvalid>"##".*"\n" { config->appendUserComment(yytext);} +<Start,GetString,GetStrList,GetBool,SkipInvalid>"##".*"\n" { config->appendUserComment(yytext);yyLineNr++;} <Start,GetString,GetStrList,GetBool,SkipInvalid>"#" { BEGIN(SkipComment); } <Start>[a-z_A-Z][a-z_A-Z0-9]*[ \t]*"=" { QCString cmd=yytext; cmd=cmd.left(cmd.length()-1).stripWhiteSpace(); diff --git a/src/context.cpp b/src/context.cpp index 7b7c725..6ecf142 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -1254,7 +1254,7 @@ TemplateVariant TranslateContext::get(const char *n) const return p->get(n); } -static TemplateVariant parseDoc(Definition *def,const QCString &file,int line, +static TemplateVariant parseDoc(const Definition *def,const QCString &file,int line, const QCString &relPath,const QCString &docStr,bool isBrief) { TemplateVariant result; @@ -1324,7 +1324,7 @@ static TemplateVariant parseCode(MemberDef *md,const QCString &scopeName,const Q return TemplateVariant(s.data(),TRUE); } -static TemplateVariant parseCode(FileDef *fd,const QCString &relPath) +static TemplateVariant parseCode(const FileDef *fd,const QCString &relPath) { static bool filterSourceFiles = Config_getBool(FILTER_SOURCE_FILES); ParserInterface *pIntf = Doxygen::parserManager->getParser(fd->getDefFileExtension()); @@ -1341,7 +1341,7 @@ static TemplateVariant parseCode(FileDef *fd,const QCString &relPath) fd->getLanguage(), // lang FALSE, // isExampleBlock 0, // exampleName - fd, // fileDef + const_cast<FileDef*>(fd), // fileDef, TODO: should be const -1, // startLine -1, // endLine FALSE, // inlineFragment @@ -1360,7 +1360,7 @@ static TemplateVariant parseCode(FileDef *fd,const QCString &relPath) fd->getLanguage(), // lang FALSE, // isExampleBlock 0, // exampleName - fd, // fileDef + const_cast<FileDef*>(fd), // fileDef, TODO: should be const -1, // startLine -1, // endLine FALSE, // inlineFragment @@ -1387,7 +1387,7 @@ template<typename T> class DefinitionContext { public: - DefinitionContext(Definition *d) : m_def(d) + DefinitionContext(const Definition *d) : m_def(d) { assert(d!=0); } @@ -1574,9 +1574,9 @@ class DefinitionContext return FALSE; } } - void fillPath(Definition *def,TemplateList *list) const + void fillPath(const Definition *def,TemplateList *list) const { - Definition *outerScope = def->getOuterScope(); + const Definition *outerScope = def->getOuterScope(); Definition::DefType type = def->definitionType(); if (outerScope && outerScope!=Doxygen::globalScope) { @@ -1618,7 +1618,7 @@ class DefinitionContext protected: struct Cachable : public Definition::Cookie { - Cachable(Definition *def) : detailsOutputFormat(ContextOutputFormat_Unspecified), + Cachable(const Definition *def) : detailsOutputFormat(ContextOutputFormat_Unspecified), briefOutputFormat(ContextOutputFormat_Unspecified), inbodyDocsOutputFormat(ContextOutputFormat_Unspecified) { @@ -1675,7 +1675,7 @@ class DefinitionContext assert(c!=0); return *c; } - Definition *m_def; + const Definition *m_def; }; //%% } @@ -1810,7 +1810,7 @@ TemplateListIntf::ConstIterator *IncludeInfoListContext::createIterator() const class ClassContext::Private : public DefinitionContext<ClassContext::Private> { public: - Private(ClassDef *cd) : DefinitionContext<ClassContext::Private>(cd), + Private(const ClassDef *cd) : DefinitionContext<ClassContext::Private>(cd), m_classDef(cd) { static bool init=FALSE; @@ -2322,7 +2322,7 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private> if (m_classDef->getClassSDict()) { ClassSDict::Iterator sdi(*m_classDef->getClassSDict()); - ClassDef *cd; + const ClassDef *cd; for (sdi.toFirst();(cd=sdi.current());++sdi) { if (cd->visibleInParentsDeclList()) @@ -2344,7 +2344,7 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private> if (m_classDef->getClassSDict()) { ClassSDict::Iterator sdi(*m_classDef->getClassSDict()); - ClassDef *cd; + const ClassDef *cd; for (sdi.toFirst();(cd=sdi.current());++sdi) { if (cd->name().find('@')==-1 && @@ -2365,16 +2365,16 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private> { return m_classDef->compoundTypeString(); } - void addTemplateDecls(Definition *d,TemplateList *tl) const + void addTemplateDecls(const Definition *d,TemplateList *tl) const { if (d->definitionType()==Definition::TypeClass) { - Definition *parent = d->getOuterScope(); + const Definition *parent = d->getOuterScope(); if (parent) { addTemplateDecls(parent,tl); } - ClassDef *cd=dynamic_cast<ClassDef *>(d); + const ClassDef *cd=dynamic_cast<const ClassDef *>(d); if (cd->templateArguments()) { ArgumentListContext *al = ArgumentListContext::alloc(cd->templateArguments(),cd,relPathAsString()); @@ -2438,7 +2438,7 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private> } return cache.examples.get(); } - void addMembers(ClassDef *cd,MemberListType lt) const + void addMembers(const ClassDef *cd,MemberListType lt) const { MemberList *ml = cd->getMemberList(lt); if (ml) @@ -2595,10 +2595,10 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private> } private: - ClassDef *m_classDef; + const ClassDef *m_classDef; struct Cachable : public DefinitionContext<ClassContext::Private>::Cachable { - Cachable(ClassDef *cd) : DefinitionContext<ClassContext::Private>::Cachable(cd), + Cachable(const ClassDef *cd) : DefinitionContext<ClassContext::Private>::Cachable(cd), inheritanceNodes(-1) { } SharedPtr<IncludeInfoContext> includeInfo; SharedPtr<InheritanceListContext> inheritsList; @@ -2672,7 +2672,7 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private> PropertyMapper<ClassContext::Private> ClassContext::Private::s_inst; -ClassContext::ClassContext(ClassDef *cd) : RefCountedContext("ClassContext") +ClassContext::ClassContext(const ClassDef *cd) : RefCountedContext("ClassContext") { //printf("ClassContext::ClassContext(%s)\n",cd?cd->name().data():"<none>"); p = new Private(cd); @@ -2695,7 +2695,7 @@ TemplateVariant ClassContext::get(const char *n) const class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Private> { public: - Private(NamespaceDef *nd) : DefinitionContext<NamespaceContext::Private>(nd), + Private(const NamespaceDef *nd) : DefinitionContext<NamespaceContext::Private>(nd), m_namespaceDef(nd) { static bool init=FALSE; @@ -2764,7 +2764,7 @@ class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Pri if (m_namespaceDef->getClassSDict()) { ClassSDict::Iterator sdi(*m_namespaceDef->getClassSDict()); - ClassDef *cd; + const ClassDef *cd; for (sdi.toFirst();(cd=sdi.current());++sdi) { if (sliceOpt && (cd->compoundType()==ClassDef::Struct || @@ -2792,7 +2792,7 @@ class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Pri if (m_namespaceDef->getNamespaceSDict()) { NamespaceSDict::Iterator sdi(*m_namespaceDef->getNamespaceSDict()); - NamespaceDef *nd; + const NamespaceDef *nd; for (sdi.toFirst();(nd=sdi.current());++sdi) { if (nd->isLinkable() && !nd->isConstantGroup()) @@ -2814,7 +2814,7 @@ class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Pri if (m_namespaceDef->getNamespaceSDict()) { NamespaceSDict::Iterator sdi(*m_namespaceDef->getNamespaceSDict()); - NamespaceDef *nd; + const NamespaceDef *nd; for (sdi.toFirst();(nd=sdi.current());++sdi) { if (nd->isLinkable() && nd->isConstantGroup()) @@ -2932,7 +2932,7 @@ class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Pri if (m_namespaceDef->getClassSDict()) { ClassSDict::Iterator sdi(*m_namespaceDef->getClassSDict()); - ClassDef *cd; + const ClassDef *cd; for (sdi.toFirst();(cd=sdi.current());++sdi) { if (cd->name().find('@')==-1 && @@ -2949,10 +2949,10 @@ class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Pri return cache.inlineClasses.get(); } private: - NamespaceDef *m_namespaceDef; + const NamespaceDef *m_namespaceDef; struct Cachable : public DefinitionContext<NamespaceContext::Private>::Cachable { - Cachable(NamespaceDef *nd) : DefinitionContext<NamespaceContext::Private>::Cachable(nd) {} + Cachable(const NamespaceDef *nd) : DefinitionContext<NamespaceContext::Private>::Cachable(nd) {} SharedPtr<TemplateList> classes; SharedPtr<TemplateList> interfaces; SharedPtr<TemplateList> namespaces; @@ -2984,7 +2984,7 @@ class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Pri PropertyMapper<NamespaceContext::Private> NamespaceContext::Private::s_inst; -NamespaceContext::NamespaceContext(NamespaceDef *nd) : RefCountedContext("NamespaceContext") +NamespaceContext::NamespaceContext(const NamespaceDef *nd) : RefCountedContext("NamespaceContext") { p = new Private(nd); } @@ -3006,7 +3006,7 @@ TemplateVariant NamespaceContext::get(const char *n) const class FileContext::Private : public DefinitionContext<FileContext::Private> { public: - Private(FileDef *fd) : DefinitionContext<FileContext::Private>(fd) , m_fileDef(fd) + Private(const FileDef *fd) : DefinitionContext<FileContext::Private>(fd) , m_fileDef(fd) { if (fd==0) abort(); static bool init=FALSE; @@ -3229,7 +3229,7 @@ class FileContext::Private : public DefinitionContext<FileContext::Private> if (m_fileDef->getClassSDict()) { ClassSDict::Iterator sdi(*m_fileDef->getClassSDict()); - ClassDef *cd; + const ClassDef *cd; for (sdi.toFirst();(cd=sdi.current());++sdi) { if (cd->visibleInParentsDeclList()) @@ -3251,7 +3251,7 @@ class FileContext::Private : public DefinitionContext<FileContext::Private> if (m_fileDef->getNamespaceSDict()) { NamespaceSDict::Iterator sdi(*m_fileDef->getNamespaceSDict()); - NamespaceDef *nd; + const NamespaceDef *nd; for (sdi.toFirst();(nd=sdi.current());++sdi) { if (nd->isLinkable() && !nd->isConstantGroup()) @@ -3396,7 +3396,7 @@ class FileContext::Private : public DefinitionContext<FileContext::Private> if (m_fileDef->getClassSDict()) { ClassSDict::Iterator sdi(*m_fileDef->getClassSDict()); - ClassDef *cd; + const ClassDef *cd; for (sdi.toFirst();(cd=sdi.current());++sdi) { if (cd->name().find('@')==-1 && @@ -3418,10 +3418,10 @@ class FileContext::Private : public DefinitionContext<FileContext::Private> } private: - FileDef *m_fileDef; + const FileDef *m_fileDef; struct Cachable : public DefinitionContext<FileContext::Private>::Cachable { - Cachable(FileDef *fd) : DefinitionContext<FileContext::Private>::Cachable(fd) {} + Cachable(const FileDef *fd) : DefinitionContext<FileContext::Private>::Cachable(fd) {} SharedPtr<IncludeInfoListContext> includeInfoList; ScopedPtr<DotInclDepGraph> includeGraph; ScopedPtr<DotInclDepGraph> includedByGraph; @@ -3458,7 +3458,7 @@ class FileContext::Private : public DefinitionContext<FileContext::Private> PropertyMapper<FileContext::Private> FileContext::Private::s_inst; -FileContext::FileContext(FileDef *fd) : RefCountedContext("FileContext") +FileContext::FileContext(const FileDef *fd) : RefCountedContext("FileContext") { p = new Private(fd); } @@ -3480,7 +3480,7 @@ TemplateVariant FileContext::get(const char *n) const class DirContext::Private : public DefinitionContext<DirContext::Private> { public: - Private(DirDef *dd) : DefinitionContext<DirContext::Private>(dd) , m_dirDef(dd) + Private(const DirDef *dd) : DefinitionContext<DirContext::Private>(dd) , m_dirDef(dd) { static bool init=FALSE; if (!init) @@ -3529,7 +3529,7 @@ class DirContext::Private : public DefinitionContext<DirContext::Private> cache.dirs.reset(TemplateList::alloc()); const DirList &subDirs = m_dirDef->subDirs(); QListIterator<DirDef> it(subDirs); - DirDef *dd; + const DirDef *dd; for (it.toFirst();(dd=it.current());++it) { DirContext *dc = new DirContext(dd); @@ -3548,7 +3548,7 @@ class DirContext::Private : public DefinitionContext<DirContext::Private> if (files) { QListIterator<FileDef> it(*files); - FileDef *fd; + const FileDef *fd; for (it.toFirst();(fd=it.current());++it) { FileContext *fc = FileContext::alloc(fd); @@ -3637,10 +3637,10 @@ class DirContext::Private : public DefinitionContext<DirContext::Private> } private: - DirDef *m_dirDef; + const DirDef *m_dirDef; struct Cachable : public DefinitionContext<DirContext::Private>::Cachable { - Cachable(DirDef *dd) : DefinitionContext<DirContext::Private>::Cachable(dd) {} + Cachable(const DirDef *dd) : DefinitionContext<DirContext::Private>::Cachable(dd) {} SharedPtr<TemplateList> dirs; SharedPtr<TemplateList> files; ScopedPtr<DotDirDeps> dirDepsGraph; @@ -3657,7 +3657,7 @@ class DirContext::Private : public DefinitionContext<DirContext::Private> PropertyMapper<DirContext::Private> DirContext::Private::s_inst; -DirContext::DirContext(DirDef *fd) : RefCountedContext("DirContext") +DirContext::DirContext(const DirDef *fd) : RefCountedContext("DirContext") { p = new Private(fd); } @@ -3679,7 +3679,7 @@ TemplateVariant DirContext::get(const char *n) const class PageContext::Private : public DefinitionContext<PageContext::Private> { public: - Private(PageDef *pd,bool isMainPage,bool isExample) + Private(const PageDef *pd,bool isMainPage,bool isExample) : DefinitionContext<PageContext::Private>(pd) , m_pageDef(pd), m_isMainPage(isMainPage), m_isExample(isExample) { @@ -3768,10 +3768,10 @@ class PageContext::Private : public DefinitionContext<PageContext::Private> } } private: - PageDef *m_pageDef; + const PageDef *m_pageDef; struct Cachable : public DefinitionContext<PageContext::Private>::Cachable { - Cachable(PageDef *pd) : DefinitionContext<PageContext::Private>::Cachable(pd), + Cachable(const PageDef *pd) : DefinitionContext<PageContext::Private>::Cachable(pd), exampleOutputFormat(ContextOutputFormat_Unspecified) { } ScopedPtr<TemplateVariant> example; ContextOutputFormat exampleOutputFormat; @@ -3790,7 +3790,7 @@ class PageContext::Private : public DefinitionContext<PageContext::Private> PropertyMapper<PageContext::Private> PageContext::Private::s_inst; -PageContext::PageContext(PageDef *pd,bool isMainPage,bool isExample) : RefCountedContext("PageContext") +PageContext::PageContext(const PageDef *pd,bool isMainPage,bool isExample) : RefCountedContext("PageContext") { p = new Private(pd,isMainPage,isExample); } @@ -3949,7 +3949,7 @@ class TextGeneratorFactory virtual ~TextGeneratorFactory() {} }; -TemplateVariant createLinkedText(Definition *def,const QCString &relPath,const QCString &text) +TemplateVariant createLinkedText(const Definition *def,const QCString &relPath,const QCString &text) { QGString s; FTextStream ts(&s); @@ -4023,7 +4023,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> s_inst.addProperty("isSealed", &Private::isSealed); s_inst.addProperty("isImplementation", &Private::isImplementation); s_inst.addProperty("isExternal", &Private::isExternal); - s_inst.addProperty("isAlias", &Private::isAlias); + s_inst.addProperty("isTypeAlias", &Private::isTypeAlias); s_inst.addProperty("isDefault", &Private::isDefault); s_inst.addProperty("isDelete", &Private::isDelete); s_inst.addProperty("isNoExcept", &Private::isNoExcept); @@ -4334,9 +4334,9 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> { return m_memberDef->isExternal(); } - TemplateVariant isAlias() const + TemplateVariant isTypeAlias() const { - return m_memberDef->isAlias(); + return m_memberDef->isTypeAlias(); } TemplateVariant isDefault() const { @@ -4452,7 +4452,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> Cachable &cache = getCache(); if (!cache.anonymousType) { - ClassDef *cd = m_memberDef->getClassDefOfAnonymousType(); + const ClassDef *cd = m_memberDef->getClassDefOfAnonymousType(); if (cd) { cache.anonymousType.reset(ClassContext::alloc(cd)); @@ -4508,7 +4508,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> Cachable &cache = getCache(); if (!cache.enumValues) { - MemberList *ml = m_memberDef->enumFieldList(); + const MemberList *ml = m_memberDef->enumFieldList(); if (ml) { cache.enumValues.reset(MemberListContext::alloc(ml)); @@ -4538,7 +4538,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> } TemplateVariant templateAlias() const { - if (m_memberDef->isAlias()) + if (m_memberDef->isTypeAlias()) { return createLinkedText(m_memberDef,relPathAsString(), QCString(" = ")+m_memberDef->typeString()); @@ -4703,7 +4703,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> } void addTemplateDecls(TemplateList *tl) const { - ClassDef *cd=m_memberDef->getClassDef(); + const ClassDef *cd=m_memberDef->getClassDef(); if (m_memberDef->definitionTemplateParameterLists()) { QListIterator<ArgumentList> ali(*m_memberDef->definitionTemplateParameterLists()); @@ -4813,7 +4813,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> cache.implements.reset(TemplateList::alloc()); if (md) { - ClassDef *cd = md->getClassDef(); + const ClassDef *cd = md->getClassDef(); if (cd && (md->virtualness()==Pure || cd->compoundType()==ClassDef::Interface)) { MemberContext *mc = MemberContext::alloc(md); @@ -4832,7 +4832,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> cache.reimplements.reset(TemplateList::alloc()); if (md) { - ClassDef *cd = md->getClassDef(); + const ClassDef *cd = md->getClassDef(); if (cd && md->virtualness()!=Pure && cd->compoundType()!=ClassDef::Interface) { MemberContext *mc = MemberContext::alloc(md); @@ -4855,7 +4855,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> MemberDef *md=0; for (mli.toFirst();(md=mli.current());++mli) { - ClassDef *cd = md->getClassDef(); + const ClassDef *cd = md->getClassDef(); if (cd && (md->virtualness()==Pure || cd->compoundType()==ClassDef::Interface)) { MemberContext *mc = new MemberContext(md); @@ -4879,7 +4879,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> MemberDef *md=0; for (mli.toFirst();(md=mli.current());++mli) { - ClassDef *cd = md->getClassDef(); + const ClassDef *cd = md->getClassDef(); if (cd && md->virtualness()!=Pure && cd->compoundType()!=ClassDef::Interface) { MemberContext *mc = new MemberContext(md); @@ -4976,7 +4976,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> if (!cache.sourceCodeParsed) { QCString codeFragment; - FileDef *fd = m_memberDef->getBodyDef(); + const FileDef *fd = m_memberDef->getBodyDef(); int startLine = m_memberDef->getStartBodyLine(); int endLine = m_memberDef->getEndBodyLine(); if (fd && readCodeFragment(fd->absFilePath(), @@ -5271,7 +5271,7 @@ TemplateVariant MemberContext::get(const char *n) const class ModuleContext::Private : public DefinitionContext<ModuleContext::Private> { public: - Private(GroupDef *gd) : DefinitionContext<ModuleContext::Private>(gd) , m_groupDef(gd) + Private(const GroupDef *gd) : DefinitionContext<ModuleContext::Private>(gd) , m_groupDef(gd) { static bool init=FALSE; if (!init) @@ -5416,7 +5416,7 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private> if (m_groupDef->getSubGroups()) { GroupListIterator gli(*m_groupDef->getSubGroups()); - GroupDef *gd; + const GroupDef *gd; for (gli.toFirst();(gd=gli.current());++gli) { if (gd->isVisible()) @@ -5438,7 +5438,7 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private> if (m_groupDef->getExamples()) { PageSDict::Iterator eli(*m_groupDef->getExamples()); - PageDef *ex; + const PageDef *ex; for (eli.toFirst();(ex=eli.current());++eli) { exampleList->append(PageContext::alloc(ex,FALSE,TRUE)); @@ -5457,7 +5457,7 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private> if (m_groupDef->getExamples()) { PageSDict::Iterator eli(*m_groupDef->getPages()); - PageDef *ex; + const PageDef *ex; for (eli.toFirst();(ex=eli.current());++eli) { pageList->append(PageContext::alloc(ex,FALSE,TRUE)); @@ -5476,7 +5476,7 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private> if (m_groupDef->getDirs()) { QListIterator<DirDef> it(*m_groupDef->getDirs()); - DirDef *dd; + const DirDef *dd; for (it.toFirst();(dd=it.current());++it) { dirList->append(DirContext::alloc(dd)); @@ -5495,7 +5495,7 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private> if (m_groupDef->getFiles()) { QListIterator<FileDef> it(*m_groupDef->getFiles()); - FileDef *fd; + const FileDef *fd; for (it.toFirst();(fd=it.current());++it) { fileList->append(FileContext::alloc(fd)); @@ -5514,7 +5514,7 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private> if (m_groupDef->getClasses()) { ClassSDict::Iterator sdi(*m_groupDef->getClasses()); - ClassDef *cd; + const ClassDef *cd; for (sdi.toFirst();(cd=sdi.current());++sdi) { if (cd->visibleInParentsDeclList()) @@ -5536,7 +5536,7 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private> if (m_groupDef->getNamespaces()) { NamespaceSDict::Iterator sdi(*m_groupDef->getNamespaces()); - NamespaceDef *nd; + const NamespaceDef *nd; for (sdi.toFirst();(nd=sdi.current());++sdi) { if (nd->isLinkable() && !nd->isConstantGroup()) @@ -5730,7 +5730,7 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private> if (m_groupDef->getClasses()) { ClassSDict::Iterator sdi(*m_groupDef->getClasses()); - ClassDef *cd; + const ClassDef *cd; for (sdi.toFirst();(cd=sdi.current());++sdi) { if (cd->name().find('@')==-1 && @@ -5751,10 +5751,10 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private> return "module"; //theTranslator->trGroup(FALSE,TRUE); } private: - GroupDef *m_groupDef; + const GroupDef *m_groupDef; struct Cachable : public DefinitionContext<ModuleContext::Private>::Cachable { - Cachable(GroupDef *gd) : DefinitionContext<ModuleContext::Private>::Cachable(gd) {} + Cachable(const GroupDef *gd) : DefinitionContext<ModuleContext::Private>::Cachable(gd) {} SharedPtr<TemplateList> modules; SharedPtr<TemplateList> dirs; SharedPtr<TemplateList> files; @@ -5805,7 +5805,7 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private> PropertyMapper<ModuleContext::Private> ModuleContext::Private::s_inst; -ModuleContext::ModuleContext(GroupDef *gd) : RefCountedContext("ModuleContext") +ModuleContext::ModuleContext(const GroupDef *gd) : RefCountedContext("ModuleContext") { p = new Private(gd); } @@ -5829,7 +5829,7 @@ class ClassListContext::Private : public GenericNodeListContext void addClasses(const ClassSDict &classSDict) { ClassSDict::Iterator cli(classSDict); - ClassDef *cd; + const ClassDef *cd; for (cli.toFirst() ; (cd=cli.current()) ; ++cli ) { if (cd->getLanguage()==SrcLangExt_VHDL && @@ -5908,7 +5908,7 @@ class ClassIndexContext::Private if (Doxygen::classSDict) { ClassSDict::Iterator cli(*Doxygen::classSDict); - ClassDef *cd; + const ClassDef *cd; for (cli.toFirst() ; (cd=cli.current()) ; ++cli ) { if (cd->getLanguage()==SrcLangExt_VHDL && @@ -6216,7 +6216,7 @@ class NestingNodeContext::Private { public: Private(const NestingNodeContext *parent,const NestingNodeContext *thisNode, - Definition *d,int index,int level,bool addCls,bool inherit, bool hideSuper) + const Definition *d,int index,int level,bool addCls,bool inherit, bool hideSuper) : m_parent(parent), m_def(d), m_level(level), m_index(index) { m_children.reset(NestingContext::alloc(thisNode,level+1)); @@ -6278,7 +6278,7 @@ class NestingNodeContext::Private { if (!m_cache.classContext && m_def->definitionType()==Definition::TypeClass) { - m_cache.classContext.reset(ClassContext::alloc(dynamic_cast<ClassDef*>(m_def))); + m_cache.classContext.reset(ClassContext::alloc(dynamic_cast<const ClassDef*>(m_def))); } if (m_cache.classContext) { @@ -6293,7 +6293,7 @@ class NestingNodeContext::Private { if (!m_cache.namespaceContext && m_def->definitionType()==Definition::TypeNamespace) { - m_cache.namespaceContext.reset(NamespaceContext::alloc(dynamic_cast<NamespaceDef*>(m_def))); + m_cache.namespaceContext.reset(NamespaceContext::alloc(dynamic_cast<const NamespaceDef*>(m_def))); } if (m_cache.namespaceContext) { @@ -6308,7 +6308,7 @@ class NestingNodeContext::Private { if (!m_cache.dirContext && m_def->definitionType()==Definition::TypeDir) { - m_cache.dirContext.reset(DirContext::alloc(dynamic_cast<DirDef*>(m_def))); + m_cache.dirContext.reset(DirContext::alloc(dynamic_cast<const DirDef*>(m_def))); } if (m_cache.dirContext) { @@ -6323,7 +6323,7 @@ class NestingNodeContext::Private { if (!m_cache.fileContext && m_def->definitionType()==Definition::TypeFile) { - m_cache.fileContext.reset(FileContext::alloc(dynamic_cast<FileDef*>(m_def))); + m_cache.fileContext.reset(FileContext::alloc(dynamic_cast<const FileDef*>(m_def))); } if (m_cache.fileContext) { @@ -6338,7 +6338,7 @@ class NestingNodeContext::Private { if (!m_cache.pageContext && m_def->definitionType()==Definition::TypePage) { - m_cache.pageContext.reset(PageContext::alloc(dynamic_cast<PageDef*>(m_def),FALSE,FALSE)); + m_cache.pageContext.reset(PageContext::alloc(dynamic_cast<const PageDef*>(m_def),FALSE,FALSE)); } if (m_cache.pageContext) { @@ -6353,7 +6353,7 @@ class NestingNodeContext::Private { if (!m_cache.moduleContext && m_def->definitionType()==Definition::TypeGroup) { - m_cache.moduleContext.reset(ModuleContext::alloc(dynamic_cast<GroupDef*>(m_def))); + m_cache.moduleContext.reset(ModuleContext::alloc(dynamic_cast<const GroupDef*>(m_def))); } if (m_cache.moduleContext) { @@ -6425,7 +6425,7 @@ class NestingNodeContext::Private void addClasses(bool inherit, bool hideSuper) { - ClassDef *cd = dynamic_cast<ClassDef*>(m_def); + const ClassDef *cd = dynamic_cast<const ClassDef*>(m_def); if (cd && inherit) { bool hasChildren = !cd->isVisited() && !hideSuper && classHasVisibleChildren(cd); @@ -6453,7 +6453,7 @@ class NestingNodeContext::Private } void addNamespaces(bool addClasses) { - NamespaceDef *nd = dynamic_cast<NamespaceDef*>(m_def); + const NamespaceDef *nd = dynamic_cast<const NamespaceDef*>(m_def); if (nd && nd->getNamespaceSDict()) { m_children->addNamespaces(*nd->getNamespaceSDict(),FALSE,addClasses); @@ -6465,7 +6465,7 @@ class NestingNodeContext::Private } void addDirFiles() { - DirDef *dd = dynamic_cast<DirDef*>(m_def); + const DirDef *dd = dynamic_cast<const DirDef*>(m_def); if (dd) { m_children->addDirs(dd->subDirs()); @@ -6477,7 +6477,7 @@ class NestingNodeContext::Private } void addPages() { - PageDef *pd = dynamic_cast<PageDef*>(m_def); + const PageDef *pd = dynamic_cast<const PageDef*>(m_def); if (pd && pd->getSubPages()) { m_children->addPages(*pd->getSubPages(),FALSE); @@ -6485,7 +6485,7 @@ class NestingNodeContext::Private } void addModules() { - GroupDef *gd = dynamic_cast<GroupDef*>(m_def); + const GroupDef *gd = dynamic_cast<const GroupDef*>(m_def); if (gd && gd->getSubGroups()) { m_children->addModules(*gd->getSubGroups()); @@ -6493,7 +6493,7 @@ class NestingNodeContext::Private } private: const NestingNodeContext *m_parent; - Definition *m_def; + const Definition *m_def; SharedPtr<NestingContext> m_children; int m_level; int m_index; @@ -6515,7 +6515,7 @@ class NestingNodeContext::Private PropertyMapper<NestingNodeContext::Private> NestingNodeContext::Private::s_inst; NestingNodeContext::NestingNodeContext(const NestingNodeContext *parent, - Definition *d,int index,int level,bool addClass,bool inherit,bool hideSuper) + const Definition *d,int index,int level,bool addClass,bool inherit,bool hideSuper) : RefCountedContext("NestingNodeContext") { p = new Private(parent,this,d,index,level,addClass,inherit,hideSuper); @@ -6548,7 +6548,7 @@ class NestingContext::Private : public GenericNodeListContext void addNamespaces(const NamespaceSDict &nsDict,bool rootOnly,bool addClasses) { NamespaceSDict::Iterator nli(nsDict); - NamespaceDef *nd; + const NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) { if (nd->localName().find('@')==-1 && @@ -6568,7 +6568,7 @@ class NestingContext::Private : public GenericNodeListContext void addClasses(const ClassSDict &clDict,bool rootOnly) { ClassSDict::Iterator cli(clDict); - ClassDef *cd; + const ClassDef *cd; for (;(cd=cli.current());++cli) { if (cd->getLanguage()==SrcLangExt_VHDL) @@ -6597,7 +6597,7 @@ class NestingContext::Private : public GenericNodeListContext void addDirs(const DirSDict &dirDict) { SDict<DirDef>::Iterator dli(dirDict); - DirDef *dd; + const DirDef *dd; for (dli.toFirst();(dd=dli.current());++dli) { if (dd->getOuterScope()==Doxygen::globalScope) @@ -6610,7 +6610,7 @@ class NestingContext::Private : public GenericNodeListContext void addDirs(const DirList &dirList) { QListIterator<DirDef> li(dirList); - DirDef *dd; + const DirDef *dd; for (li.toFirst();(dd=li.current());++li) { append(NestingNodeContext::alloc(m_parent,dd,m_index,m_level,FALSE,FALSE,FALSE)); @@ -6624,7 +6624,7 @@ class NestingContext::Private : public GenericNodeListContext for (fnli.toFirst();(fn=fnli.current());++fnli) { FileNameIterator fni(*fn); - FileDef *fd; + const FileDef *fd; for (;(fd=fni.current());++fni) { if (fd->getDirDef()==0) // top level file @@ -6638,7 +6638,7 @@ class NestingContext::Private : public GenericNodeListContext void addFiles(const FileList &fList) { QListIterator<FileDef> li(fList); - FileDef *fd; + const FileDef *fd; for (li.toFirst();(fd=li.current());++li) { append(NestingNodeContext::alloc(m_parent,fd,m_index,m_level,FALSE,FALSE,FALSE)); @@ -6648,7 +6648,7 @@ class NestingContext::Private : public GenericNodeListContext void addPages(const PageSDict &pages,bool rootOnly) { SDict<PageDef>::Iterator pli(pages); - PageDef *pd; + const PageDef *pd; for (pli.toFirst();(pd=pli.current());++pli) { if (!rootOnly || @@ -6663,7 +6663,7 @@ class NestingContext::Private : public GenericNodeListContext void addModules(const GroupSDict &groups) { GroupSDict::Iterator gli(groups); - GroupDef *gd; + const GroupDef *gd; for (gli.toFirst();(gd=gli.current());++gli) { static bool externalGroups = Config_getBool(EXTERNAL_GROUPS); @@ -6679,7 +6679,7 @@ class NestingContext::Private : public GenericNodeListContext void addModules(const GroupList &list) { GroupListIterator gli(list); - GroupDef *gd; + const GroupDef *gd; for (gli.toFirst();(gd=gli.current());++gli) { if (gd->isVisible()) @@ -6696,7 +6696,7 @@ class NestingContext::Private : public GenericNodeListContext BaseClassDef *bcd; for (bcli.toFirst() ; (bcd=bcli.current()) ; ++bcli) { - ClassDef *cd=bcd->classDef; + const ClassDef *cd=bcd->classDef; if (cd->getLanguage()==SrcLangExt_VHDL && (VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS) { continue; @@ -6723,7 +6723,7 @@ class NestingContext::Private : public GenericNodeListContext void addClassHierarchy(const ClassSDict &classSDict,bool) { ClassSDict::Iterator cli(classSDict); - ClassDef *cd; + const ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) { bool b; @@ -6973,7 +6973,7 @@ class NamespaceListContext::Private : public GenericNodeListContext void addNamespaces(const NamespaceSDict &nsDict) { NamespaceSDict::Iterator nli(nsDict); - NamespaceDef *nd; + const NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) { if (nd->isLinkableInProject()) @@ -7148,7 +7148,7 @@ class FileListContext::Private : public GenericNodeListContext for (fnli.toFirst();(fn=fnli.current());++fnli) { FileNameIterator fni(*fn); - FileDef *fd; + const FileDef *fd; for (fni.toFirst();(fd=fni.current());++fni) { bool doc = fd->isLinkableInProject(); @@ -7198,7 +7198,7 @@ class DirListContext::Private : public GenericNodeListContext public: Private() { - DirDef *dir; + const DirDef *dir; DirSDict::Iterator sdi(*Doxygen::directories); for (sdi.toFirst();(dir=sdi.current());++sdi) { @@ -7240,19 +7240,19 @@ TemplateListIntf::ConstIterator *DirListContext::createIterator() const class UsedFilesContext::Private : public GenericNodeListContext { public: - void addFile(FileDef *fd) + void addFile(const FileDef *fd) { append(FileContext::alloc(fd)); } }; -UsedFilesContext::UsedFilesContext(ClassDef *cd) : RefCountedContext("UsedFilesContext") +UsedFilesContext::UsedFilesContext(const ClassDef *cd) : RefCountedContext("UsedFilesContext") { p = new Private; if (cd) { QListIterator<FileDef> li(cd->usedFiles()); - FileDef *fd; + const FileDef *fd; for (li.toFirst();(fd=li.current());++li) { p->addFile(fd); @@ -7281,7 +7281,7 @@ TemplateListIntf::ConstIterator *UsedFilesContext::createIterator() const return p->createIterator(); } -void UsedFilesContext::addFile(FileDef *fd) +void UsedFilesContext::addFile(const FileDef *fd) { p->addFile(fd); } @@ -7518,7 +7518,7 @@ class PageListContext::Private : public GenericNodeListContext void addPages(const PageSDict &pages) { PageSDict::Iterator pdi(pages); - PageDef *pd=0; + const PageDef *pd=0; for (pdi.toFirst();(pd=pdi.current());++pdi) { if (!pd->getGroupDef() && !pd->isReference()) @@ -7567,7 +7567,7 @@ class ExampleListContext::Private : public GenericNodeListContext if (Doxygen::exampleSDict) { PageSDict::Iterator pdi(*Doxygen::exampleSDict); - PageDef *pd=0; + const PageDef *pd=0; for (pdi.toFirst();(pd=pdi.current());++pdi) { if (!pd->getGroupDef() && !pd->isReference()) @@ -7614,7 +7614,7 @@ class ModuleListContext::Private : public GenericNodeListContext void addModules() { GroupSDict::Iterator gli(*Doxygen::groupSDict); - GroupDef *gd; + const GroupDef *gd; for (gli.toFirst();(gd=gli.current());++gli) { if (!gd->isReference()) @@ -7769,7 +7769,7 @@ TemplateVariant ModuleTreeContext::get(const char *name) const class NavPathElemContext::Private { public: - Private(Definition *def) : m_def(def) + Private(const Definition *def) : m_def(def) { static bool init=FALSE; if (!init) @@ -7834,14 +7834,14 @@ class NavPathElemContext::Private return m_def->externalReference(relPathAsString()); } private: - Definition *m_def; + const Definition *m_def; static PropertyMapper<NavPathElemContext::Private> s_inst; }; //%% } PropertyMapper<NavPathElemContext::Private> NavPathElemContext::Private::s_inst; -NavPathElemContext::NavPathElemContext(Definition *def) : RefCountedContext("NavPathElemContext") +NavPathElemContext::NavPathElemContext(const Definition *def) : RefCountedContext("NavPathElemContext") { p = new Private(def); } @@ -8014,7 +8014,7 @@ class GlobalsIndexContext::Private MemberNameIterator mni(*mn); for (mni.toFirst();(md=mni.current());++mni) { - FileDef *fd=md->getFileDef(); + const FileDef *fd=md->getFileDef(); if (fd && fd->isLinkableInProject() && !md->name().isEmpty() && !md->getNamespaceDef() && md->isLinkableInProject()) { @@ -8171,7 +8171,7 @@ class ClassMembersIndexContext::Private MemberNameIterator mni(*mn); for (mni.toFirst();(md=mni.current());++mni) { - ClassDef *cd = md->getClassDef(); + const ClassDef *cd = md->getClassDef(); if (cd && cd->isLinkableInProject() && cd->templateMaster()==0 && md->isLinkableInProject() && !md->name().isEmpty()) { @@ -8330,7 +8330,7 @@ class NamespaceMembersIndexContext::Private MemberNameIterator mni(*mn); for (mni.toFirst();(md=mni.current());++mni) { - NamespaceDef *nd=md->getNamespaceDef(); + const NamespaceDef *nd=md->getNamespaceDef(); if (nd && nd->isLinkableInProject() && !md->name().isEmpty() && md->isLinkableInProject()) { @@ -8508,7 +8508,7 @@ TemplateVariant InheritanceGraphContext::get(const char *name) const class InheritanceNodeContext::Private { public: - Private(ClassDef *cd,const QCString &name) : m_classDef(cd), m_name(name) + Private(const ClassDef *cd,const QCString &name) : m_classDef(cd), m_name(name) { static bool init=FALSE; if (!init) @@ -8535,7 +8535,7 @@ class InheritanceNodeContext::Private return m_name; } private: - ClassDef *m_classDef; + const ClassDef *m_classDef; mutable SharedPtr<ClassContext> m_classContext; QCString m_name; static PropertyMapper<InheritanceNodeContext::Private> s_inst; @@ -8544,7 +8544,7 @@ class InheritanceNodeContext::Private PropertyMapper<InheritanceNodeContext::Private> InheritanceNodeContext::Private::s_inst; -InheritanceNodeContext::InheritanceNodeContext(ClassDef *cd,const QCString &name) : RefCountedContext("InheritanceNodeContext") +InheritanceNodeContext::InheritanceNodeContext(const ClassDef *cd,const QCString &name) : RefCountedContext("InheritanceNodeContext") { p = new Private(cd,name); } @@ -8565,7 +8565,7 @@ TemplateVariant InheritanceNodeContext::get(const char *name) const class InheritanceListContext::Private : public GenericNodeListContext { public: - void addClass(ClassDef *cd,const QCString &name) + void addClass(const ClassDef *cd,const QCString &name) { append(InheritanceNodeContext::alloc(cd,name)); } @@ -8580,7 +8580,7 @@ InheritanceListContext::InheritanceListContext(const BaseClassList *list, bool b BaseClassDef *bcd; for (li.toFirst();(bcd=li.current());++li) { - ClassDef *cd=bcd->classDef; + const ClassDef *cd=bcd->classDef; QCString name; if (baseClasses) { @@ -8806,7 +8806,7 @@ class AllMembersListContext::Private : public GenericNodeListContext for (mnii2.toFirst();(mi=mnii2.current());++mnii2) { MemberDef *md=mi->memberDef; - ClassDef *cd=md->getClassDef(); + const ClassDef *cd=md->getClassDef(); if (cd && !md->name().isEmpty() && md->name()[0]!='@') { if ((cd->isLinkable() && md->isLinkable()) || @@ -8862,7 +8862,7 @@ TemplateListIntf::ConstIterator *AllMembersListContext::createIterator() const class MemberGroupInfoContext::Private { public: - Private(Definition *def,const QCString &relPath,const MemberGroup *mg) : + Private(const Definition *def,const QCString &relPath,const MemberGroup *mg) : m_def(def), m_relPath(relPath), m_memberGroup(mg) @@ -8936,7 +8936,7 @@ class MemberGroupInfoContext::Private return FALSE; } private: - Definition *m_def; + const Definition *m_def; QCString m_relPath; const MemberGroup *m_memberGroup; struct Cachable @@ -8952,7 +8952,7 @@ class MemberGroupInfoContext::Private PropertyMapper<MemberGroupInfoContext::Private> MemberGroupInfoContext::Private::s_inst; -MemberGroupInfoContext::MemberGroupInfoContext(Definition *def, +MemberGroupInfoContext::MemberGroupInfoContext(const Definition *def, const QCString &relPath,const MemberGroup *mg) : RefCountedContext("MemberGroupInfoContext") { p = new Private(def,relPath,mg); @@ -8974,7 +8974,7 @@ TemplateVariant MemberGroupInfoContext::get(const char *name) const class MemberGroupListContext::Private : public GenericNodeListContext { public: - void addMemberGroup(Definition *def,const QCString &relPath,const MemberGroup *mg) + void addMemberGroup(const Definition *def,const QCString &relPath,const MemberGroup *mg) { append(MemberGroupInfoContext::alloc(def,relPath,mg)); } @@ -8985,7 +8985,7 @@ MemberGroupListContext::MemberGroupListContext() : RefCountedContext("MemberGrou p = new Private; } -MemberGroupListContext::MemberGroupListContext(Definition *def,const QCString &relPath,const MemberGroupList *list) : RefCountedContext("MemberGroupListContext") +MemberGroupListContext::MemberGroupListContext(const Definition *def,const QCString &relPath,const MemberGroupList *list) : RefCountedContext("MemberGroupListContext") { p = new Private; if (list) @@ -8999,7 +8999,7 @@ MemberGroupListContext::MemberGroupListContext(Definition *def,const QCString &r } } -MemberGroupListContext::MemberGroupListContext(Definition *def,const QCString &relPath,const MemberGroupSDict *dict,bool subGrouping) : RefCountedContext("MemberGroupListContext") +MemberGroupListContext::MemberGroupListContext(const Definition *def,const QCString &relPath,const MemberGroupSDict *dict,bool subGrouping) : RefCountedContext("MemberGroupListContext") { p = new Private; if (dict) @@ -9045,7 +9045,7 @@ TemplateListIntf::ConstIterator *MemberGroupListContext::createIterator() const class MemberListInfoContext::Private { public: - Private(Definition *def,const QCString &relPath,const MemberList *ml,const QCString &title,const QCString &subtitle) : + Private(const Definition *def,const QCString &relPath,const MemberList *ml,const QCString &title,const QCString &subtitle) : m_def(def), m_memberList(ml), m_relPath(relPath), @@ -9102,7 +9102,7 @@ class MemberListInfoContext::Private m_def->definitionType()==Definition::TypeClass) { InheritedMemberInfoListContext *ctx = InheritedMemberInfoListContext::alloc(); - ctx->addMemberList(dynamic_cast<ClassDef*>(m_def),m_memberList->listType(),m_title,FALSE); + ctx->addMemberList(dynamic_cast<const ClassDef*>(m_def),m_memberList->listType(),m_title,FALSE); m_cache.inherited.reset(ctx); } if (m_cache.inherited) @@ -9115,7 +9115,7 @@ class MemberListInfoContext::Private } } private: - Definition *m_def; + const Definition *m_def; const MemberList *m_memberList; QCString m_relPath; QCString m_title; @@ -9134,7 +9134,7 @@ class MemberListInfoContext::Private PropertyMapper<MemberListInfoContext::Private> MemberListInfoContext::Private::s_inst; MemberListInfoContext::MemberListInfoContext( - Definition *def,const QCString &relPath,const MemberList *ml, + const Definition *def,const QCString &relPath,const MemberList *ml, const QCString &title,const QCString &subtitle) : RefCountedContext("MemberListInfoContext") { p = new Private(def,relPath,ml,title,subtitle); @@ -9157,7 +9157,7 @@ TemplateVariant MemberListInfoContext::get(const char *name) const class InheritedMemberInfoContext::Private { public: - Private(ClassDef *cd,MemberList *ml,const QCString &title) + Private(const ClassDef *cd,MemberList *ml,const QCString &title) : m_class(cd), m_memberList(ml), m_title(title) { static bool init=FALSE; @@ -9216,7 +9216,7 @@ class InheritedMemberInfoContext::Private } private: - ClassDef * m_class; + const ClassDef * m_class; MemberList *m_memberList; QCString m_title; mutable SharedPtr<ClassContext> m_classCtx; @@ -9228,7 +9228,7 @@ class InheritedMemberInfoContext::Private PropertyMapper<InheritedMemberInfoContext::Private> InheritedMemberInfoContext::Private::s_inst; -InheritedMemberInfoContext::InheritedMemberInfoContext(ClassDef *cd,MemberList *ml, +InheritedMemberInfoContext::InheritedMemberInfoContext(const ClassDef *cd,MemberList *ml, const QCString &title) : RefCountedContext("InheritedMemberInfoContext") { p = new Private(cd,ml,title); @@ -9250,7 +9250,7 @@ TemplateVariant InheritedMemberInfoContext::get(const char *name) const class InheritedMemberInfoListContext::Private : public GenericNodeListContext { public: - void addMemberList(ClassDef *inheritedFrom,MemberList *ml,MemberList *combinedList) + void addMemberList(const ClassDef *inheritedFrom,MemberList *ml,MemberList *combinedList) { if (ml) { @@ -9265,7 +9265,7 @@ class InheritedMemberInfoListContext::Private : public GenericNodeListContext } } } - void addMemberListIncludingGrouped(ClassDef *inheritedFrom,MemberList *ml,MemberList *combinedList) + void addMemberListIncludingGrouped(const ClassDef *inheritedFrom,MemberList *ml,MemberList *combinedList) { if (ml) { @@ -9281,8 +9281,8 @@ class InheritedMemberInfoListContext::Private : public GenericNodeListContext } } } - void addMemberGroupsOfClass(ClassDef *inheritedFrom, - ClassDef *cd,MemberListType lt,MemberList *combinedList) + void addMemberGroupsOfClass(const ClassDef *inheritedFrom, + const ClassDef *cd,MemberListType lt,MemberList *combinedList) { if (cd->getMemberGroupSDict()) { @@ -9307,7 +9307,7 @@ class InheritedMemberInfoListContext::Private : public GenericNodeListContext } } } - void addInheritedMembers(ClassDef *inheritedFrom,ClassDef *cd,MemberListType lt, + void addInheritedMembers(const ClassDef *inheritedFrom,const ClassDef *cd,MemberListType lt, MemberListType lt1,int lt2,const QCString &title,bool additionalList) { int count = cd->countMembersIncludingGrouped(lt1,inheritedFrom,additionalList); @@ -9324,7 +9324,7 @@ class InheritedMemberInfoListContext::Private : public GenericNodeListContext append(InheritedMemberInfoContext::alloc(cd,combinedList,title)); } } - void findInheritedMembers(ClassDef *inheritedFrom,ClassDef *cd,MemberListType lt, + void findInheritedMembers(const ClassDef *inheritedFrom,const ClassDef *cd,MemberListType lt, int lt2, const QCString &title,bool additionalList, QPtrDict<void> *visitedClasses) { @@ -9366,7 +9366,7 @@ InheritedMemberInfoListContext::InheritedMemberInfoListContext() : RefCountedCon } void InheritedMemberInfoListContext::addMemberList( - ClassDef *cd,MemberListType lt,const QCString &title,bool additionalList) + const ClassDef *cd,MemberListType lt,const QCString &title,bool additionalList) { QPtrDict<void> visited(17); bool memberInSection = cd->countMembersIncludingGrouped(lt,cd,FALSE)>0; @@ -9407,7 +9407,7 @@ TemplateListIntf::ConstIterator *InheritedMemberInfoListContext::createIterator( class ArgumentContext::Private { public: - Private(const Argument *arg,Definition *def,const QCString &relPath) : + Private(const Argument *arg,const Definition *def,const QCString &relPath) : m_argument(arg), m_def(def), m_relPath(relPath) { static bool init=FALSE; @@ -9477,7 +9477,7 @@ class ArgumentContext::Private } private: const Argument *m_argument; - Definition *m_def; + const Definition *m_def; QCString m_relPath; struct Cachable { @@ -9490,7 +9490,7 @@ class ArgumentContext::Private PropertyMapper<ArgumentContext::Private> ArgumentContext::Private::s_inst; -ArgumentContext::ArgumentContext(const Argument *al,Definition *def,const QCString &relPath) : RefCountedContext("ArgumentContext") +ArgumentContext::ArgumentContext(const Argument *al,const Definition *def,const QCString &relPath) : RefCountedContext("ArgumentContext") { p = new Private(al,def,relPath); } @@ -9511,7 +9511,7 @@ TemplateVariant ArgumentContext::get(const char *name) const class ArgumentListContext::Private : public GenericNodeListContext { public: - void addArgument(const Argument *arg,Definition *def,const QCString &relPath) + void addArgument(const Argument *arg,const Definition *def,const QCString &relPath) { append(ArgumentContext::alloc(arg,def,relPath)); } @@ -9523,7 +9523,7 @@ ArgumentListContext::ArgumentListContext() : RefCountedContext("ArgumentListCont } ArgumentListContext::ArgumentListContext(const ArgumentList *list, - Definition *def,const QCString &relPath) : RefCountedContext("ArgumentListContext") + const Definition *def,const QCString &relPath) : RefCountedContext("ArgumentListContext") { p = new Private; if (list) @@ -9645,7 +9645,7 @@ class SymbolContext::Private { if (md) { - FileDef *fd = md->getBodyDef(); + const FileDef *fd = md->getBodyDef(); if (fd==0) fd = md->getFileDef(); if (fd) { @@ -9713,8 +9713,8 @@ class SymbolListContext::Private : public GenericNodeListContext Private(const SearchDefinitionList *sdl) { QListIterator<Definition> li(*sdl); - Definition *def; - Definition *prev = 0; + const Definition *def; + const Definition *prev = 0; for (li.toFirst();(def=li.current());) { ++li; @@ -10364,13 +10364,13 @@ void generateOutputViaTemplate() // clear all cached data in Definition objects. QDictIterator<DefinitionIntf> di(*Doxygen::symbolMap); - DefinitionIntf *intf; + const DefinitionIntf *intf; for (;(intf=di.current());++di) { if (intf->definitionType()==DefinitionIntf::TypeSymbolList) // list of symbols { - DefinitionListIterator dli(*(DefinitionList*)intf); - Definition *d; + DefinitionListIterator dli(*dynamic_cast<const DefinitionList*>(intf)); + const Definition *d; // for each symbol for (dli.toFirst();(d=dli.current());++dli) { @@ -10379,7 +10379,7 @@ void generateOutputViaTemplate() } else // single symbol { - Definition *d = (Definition *)intf; + const Definition *d = dynamic_cast<const Definition *>(intf); d->setCookie(0); } } diff --git a/src/context.h b/src/context.h index e082c4b..ecd1227 100644 --- a/src/context.h +++ b/src/context.h @@ -186,7 +186,7 @@ class TranslateContext : public RefCountedContext, public TemplateStructIntf class UsedFilesContext : public RefCountedContext, public TemplateListIntf { public: - static UsedFilesContext *alloc(ClassDef *cd) { return new UsedFilesContext(cd); } + static UsedFilesContext *alloc(const ClassDef *cd) { return new UsedFilesContext(cd); } // TemplateListIntf virtual int count() const; @@ -195,10 +195,10 @@ class UsedFilesContext : public RefCountedContext, public TemplateListIntf virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } - void addFile(FileDef *fd); + void addFile(const FileDef *fd); private: - UsedFilesContext(ClassDef *cd); + UsedFilesContext(const ClassDef *cd); ~UsedFilesContext(); class Private; @@ -253,7 +253,7 @@ class IncludeInfoListContext : public RefCountedContext, public TemplateListIntf class ClassContext : public RefCountedContext, public TemplateStructIntf { public: - static ClassContext *alloc(ClassDef *cd) { return new ClassContext(cd); } + static ClassContext *alloc(const ClassDef *cd) { return new ClassContext(cd); } // TemplateStructIntf methods virtual TemplateVariant get(const char *name) const; @@ -261,7 +261,7 @@ class ClassContext : public RefCountedContext, public TemplateStructIntf virtual int release() { return RefCountedContext::release(); } private: - ClassContext(ClassDef *); + ClassContext(const ClassDef *); ~ClassContext(); class Private; Private *p; @@ -272,7 +272,7 @@ class ClassContext : public RefCountedContext, public TemplateStructIntf class NamespaceContext : public RefCountedContext, public TemplateStructIntf { public: - static NamespaceContext *alloc(NamespaceDef *nd) { return new NamespaceContext(nd); } + static NamespaceContext *alloc(const NamespaceDef *nd) { return new NamespaceContext(nd); } // TemplateStructIntf methods virtual TemplateVariant get(const char *name) const; @@ -280,7 +280,7 @@ class NamespaceContext : public RefCountedContext, public TemplateStructIntf virtual int release() { return RefCountedContext::release(); } private: - NamespaceContext(NamespaceDef *); + NamespaceContext(const NamespaceDef *); ~NamespaceContext(); class Private; Private *p; @@ -291,7 +291,7 @@ class NamespaceContext : public RefCountedContext, public TemplateStructIntf class FileContext : public RefCountedContext, public TemplateStructIntf { public: - static FileContext *alloc(FileDef *fd) { return new FileContext(fd); } + static FileContext *alloc(const FileDef *fd) { return new FileContext(fd); } // TemplateStructIntf methods virtual TemplateVariant get(const char *name) const; @@ -299,7 +299,7 @@ class FileContext : public RefCountedContext, public TemplateStructIntf virtual int release() { return RefCountedContext::release(); } private: - FileContext(FileDef *); + FileContext(const FileDef *); ~FileContext(); class Private; Private *p; @@ -309,7 +309,7 @@ class FileContext : public RefCountedContext, public TemplateStructIntf class DirContext : public RefCountedContext, public TemplateStructIntf { public: - static DirContext *alloc(DirDef *dd) { return new DirContext(dd); } + static DirContext *alloc(const DirDef *dd) { return new DirContext(dd); } // TemplateStructIntf methods virtual TemplateVariant get(const char *name) const; @@ -317,7 +317,7 @@ class DirContext : public RefCountedContext, public TemplateStructIntf virtual int release() { return RefCountedContext::release(); } private: - DirContext(DirDef *); + DirContext(const DirDef *); ~DirContext(); class Private; Private *p; @@ -329,7 +329,7 @@ class DirContext : public RefCountedContext, public TemplateStructIntf class PageContext : public RefCountedContext, public TemplateStructIntf { public: - static PageContext *alloc(PageDef *pd,bool isMainPage,bool isExample) { return new PageContext(pd,isMainPage,isExample); } + static PageContext *alloc(const PageDef *pd,bool isMainPage,bool isExample) { return new PageContext(pd,isMainPage,isExample); } // TemplateStructIntf methods virtual TemplateVariant get(const char *name) const; @@ -337,7 +337,7 @@ class PageContext : public RefCountedContext, public TemplateStructIntf virtual int release() { return RefCountedContext::release(); } private: - PageContext(PageDef *,bool isMainPage,bool isExample); + PageContext(const PageDef *,bool isMainPage,bool isExample); ~PageContext(); class Private; Private *p; @@ -368,7 +368,7 @@ class MemberContext : public RefCountedContext, public TemplateStructIntf class ModuleContext : public RefCountedContext, public TemplateStructIntf { public: - static ModuleContext *alloc(GroupDef *gd) { return new ModuleContext(gd); } + static ModuleContext *alloc(const GroupDef *gd) { return new ModuleContext(gd); } // TemplateStructIntf methods virtual TemplateVariant get(const char *name) const; @@ -376,7 +376,7 @@ class ModuleContext : public RefCountedContext, public TemplateStructIntf virtual int release() { return RefCountedContext::release(); } private: - ModuleContext(GroupDef *); + ModuleContext(const GroupDef *); ~ModuleContext(); class Private; Private *p; @@ -447,7 +447,7 @@ class InheritanceGraphContext : public RefCountedContext, public TemplateStructI class ClassInheritanceNodeContext : public RefCountedContext, public TemplateStructIntf { public: - static ClassInheritanceNodeContext *alloc(ClassDef *cd) + static ClassInheritanceNodeContext *alloc(const ClassDef *cd) { return new ClassInheritanceNodeContext(cd); } // TemplateStructIntf methods @@ -458,7 +458,7 @@ class ClassInheritanceNodeContext : public RefCountedContext, public TemplateStr void addChildren(const BaseClassList *bcl,bool hideSuper); private: - ClassInheritanceNodeContext(ClassDef *); + ClassInheritanceNodeContext(const ClassDef *); ~ClassInheritanceNodeContext(); class Private; Private *p; @@ -509,7 +509,7 @@ class ClassHierarchyContext : public RefCountedContext, public TemplateStructInt class NestingNodeContext : public RefCountedContext, public TemplateStructIntf { public: - static NestingNodeContext *alloc(const NestingNodeContext *parent,Definition *def, + static NestingNodeContext *alloc(const NestingNodeContext *parent,const Definition *def, int index,int level,bool addClasses,bool inherit,bool hideSuper) { return new NestingNodeContext(parent,def,index,level,addClasses,inherit,hideSuper); } @@ -522,7 +522,7 @@ class NestingNodeContext : public RefCountedContext, public TemplateStructIntf private: NestingNodeContext(const NestingNodeContext *parent, - Definition *,int index,int level,bool addClasses,bool inherit,bool hideSuper); + const Definition *,int index,int level,bool addClasses,bool inherit,bool hideSuper); ~NestingNodeContext(); class Private; Private *p; @@ -729,7 +729,7 @@ class PageTreeContext : public RefCountedContext, public TemplateStructIntf class ModuleNodeContext : public RefCountedContext, public TemplateStructIntf { public: - static ModuleNodeContext *alloc(GroupDef *gd) { return new ModuleNodeContext(gd); } + static ModuleNodeContext *alloc(const GroupDef *gd) { return new ModuleNodeContext(gd); } // TemplateStructIntf methods virtual TemplateVariant get(const char *name) const; @@ -737,7 +737,7 @@ class ModuleNodeContext : public RefCountedContext, public TemplateStructIntf virtual int release() { return RefCountedContext::release(); } private: - ModuleNodeContext(GroupDef *); + ModuleNodeContext(const GroupDef *); ~ModuleNodeContext(); class Private; Private *p; @@ -889,7 +889,7 @@ class NamespaceMembersIndexContext : public RefCountedContext, public TemplateSt class NavPathElemContext : public RefCountedContext, public TemplateStructIntf { public: - static NavPathElemContext *alloc(Definition *def) { return new NavPathElemContext(def); } + static NavPathElemContext *alloc(const Definition *def) { return new NavPathElemContext(def); } // TemplateStructIntf methods virtual TemplateVariant get(const char *name) const; @@ -897,7 +897,7 @@ class NavPathElemContext : public RefCountedContext, public TemplateStructIntf virtual int release() { return RefCountedContext::release(); } private: - NavPathElemContext(Definition *def); + NavPathElemContext(const Definition *def); ~NavPathElemContext(); class Private; Private *p; @@ -909,7 +909,7 @@ class NavPathElemContext : public RefCountedContext, public TemplateStructIntf class InheritanceNodeContext : public RefCountedContext, public TemplateStructIntf { public: - static InheritanceNodeContext *alloc(ClassDef *cd,const QCString &name) + static InheritanceNodeContext *alloc(const ClassDef *cd,const QCString &name) { return new InheritanceNodeContext(cd,name); } // TemplateStructIntf methods @@ -918,7 +918,7 @@ class InheritanceNodeContext : public RefCountedContext, public TemplateStructIn virtual int release() { return RefCountedContext::release(); } private: - InheritanceNodeContext(ClassDef *cd,const QCString &name); + InheritanceNodeContext(const ClassDef *cd,const QCString &name); ~InheritanceNodeContext(); class Private; Private *p; @@ -979,7 +979,7 @@ class MemberListContext : public RefCountedContext, public TemplateListIntf class MemberGroupInfoContext : public RefCountedContext, public TemplateStructIntf { public: - static MemberGroupInfoContext *alloc(Definition *def,const QCString &relPath,const MemberGroup *mg) + static MemberGroupInfoContext *alloc(const Definition *def,const QCString &relPath,const MemberGroup *mg) { return new MemberGroupInfoContext(def,relPath,mg); } // TemplateStructIntf methods @@ -988,7 +988,7 @@ class MemberGroupInfoContext : public RefCountedContext, public TemplateStructIn virtual int release() { return RefCountedContext::release(); } private: - MemberGroupInfoContext(Definition *def,const QCString &relPath,const MemberGroup *mg); + MemberGroupInfoContext(const Definition *def,const QCString &relPath,const MemberGroup *mg); ~MemberGroupInfoContext(); class Private; Private *p; @@ -1001,9 +1001,9 @@ class MemberGroupListContext : public RefCountedContext, public TemplateListIntf public: static MemberGroupListContext *alloc() { return new MemberGroupListContext; } - static MemberGroupListContext *alloc(Definition *def,const QCString &relPath,const MemberGroupList *list) + static MemberGroupListContext *alloc(const Definition *def,const QCString &relPath,const MemberGroupList *list) { return new MemberGroupListContext(def,relPath,list); } - static MemberGroupListContext *alloc(Definition *def,const QCString &relPath,const MemberGroupSDict *dict,bool subGrouping) + static MemberGroupListContext *alloc(const Definition *def,const QCString &relPath,const MemberGroupSDict *dict,bool subGrouping) { return new MemberGroupListContext(def,relPath,dict,subGrouping); } // TemplateListIntf @@ -1015,8 +1015,8 @@ class MemberGroupListContext : public RefCountedContext, public TemplateListIntf private: MemberGroupListContext(); - MemberGroupListContext(Definition *def,const QCString &relPath,const MemberGroupList *list); - MemberGroupListContext(Definition *def,const QCString &relPath,const MemberGroupSDict *mgDict,bool subGrouping); + MemberGroupListContext(const Definition *def,const QCString &relPath,const MemberGroupList *list); + MemberGroupListContext(const Definition *def,const QCString &relPath,const MemberGroupSDict *mgDict,bool subGrouping); ~MemberGroupListContext(); class Private; Private *p; @@ -1028,7 +1028,7 @@ class MemberGroupListContext : public RefCountedContext, public TemplateListIntf class MemberListInfoContext : public RefCountedContext, public TemplateStructIntf { public: - static MemberListInfoContext *alloc(Definition *def,const QCString &relPath, + static MemberListInfoContext *alloc(const Definition *def,const QCString &relPath, const MemberList *ml,const QCString &title, const QCString &subtitle=QCString()) { return new MemberListInfoContext(def,relPath,ml,title,subtitle); } @@ -1039,7 +1039,7 @@ class MemberListInfoContext : public RefCountedContext, public TemplateStructInt virtual int release() { return RefCountedContext::release(); } private: - MemberListInfoContext(Definition *def,const QCString &relPath, + MemberListInfoContext(const Definition *def,const QCString &relPath, const MemberList *ml,const QCString &title, const QCString &subtitle=QCString()); ~MemberListInfoContext(); @@ -1071,7 +1071,7 @@ class MemberInfoContext : public RefCountedContext, public TemplateStructIntf class InheritedMemberInfoContext : public RefCountedContext, public TemplateStructIntf { public: - static InheritedMemberInfoContext *alloc(ClassDef *cd,MemberList *ml,const QCString &title) + static InheritedMemberInfoContext *alloc(const ClassDef *cd,MemberList *ml,const QCString &title) { return new InheritedMemberInfoContext(cd,ml,title); } // TemplateStructIntf methods @@ -1080,7 +1080,7 @@ class InheritedMemberInfoContext : public RefCountedContext, public TemplateStru virtual int release() { return RefCountedContext::release(); } private: - InheritedMemberInfoContext(ClassDef *cd,MemberList *ml,const QCString &title); + InheritedMemberInfoContext(const ClassDef *cd,MemberList *ml,const QCString &title); ~InheritedMemberInfoContext(); class Private; Private *p; @@ -1092,7 +1092,7 @@ class InheritedMemberInfoListContext : public RefCountedContext, public Template { public: static InheritedMemberInfoListContext *alloc() { return new InheritedMemberInfoListContext; } - void addMemberList(ClassDef *cd,MemberListType lt,const QCString &title,bool additionalList=TRUE); + void addMemberList(const ClassDef *cd,MemberListType lt,const QCString &title,bool additionalList=TRUE); // TemplateListIntf virtual int count() const; @@ -1138,7 +1138,7 @@ class AllMembersListContext : public RefCountedContext, public TemplateListIntf class ArgumentContext : public RefCountedContext, public TemplateStructIntf { public: - static ArgumentContext *alloc(const Argument *arg,Definition *def,const QCString &relPath) + static ArgumentContext *alloc(const Argument *arg,const Definition *def,const QCString &relPath) { return new ArgumentContext(arg,def,relPath); } // TemplateStructIntf methods @@ -1147,7 +1147,7 @@ class ArgumentContext : public RefCountedContext, public TemplateStructIntf virtual int release() { return RefCountedContext::release(); } private: - ArgumentContext(const Argument *arg,Definition *def,const QCString &relPath); + ArgumentContext(const Argument *arg,const Definition *def,const QCString &relPath); ~ArgumentContext(); class Private; Private *p; @@ -1159,7 +1159,7 @@ class ArgumentListContext : public RefCountedContext, public TemplateListIntf { public: static ArgumentListContext *alloc() { return new ArgumentListContext; } - static ArgumentListContext *alloc(const ArgumentList *al,Definition *def,const QCString &relPath) + static ArgumentListContext *alloc(const ArgumentList *al,const Definition *def,const QCString &relPath) { return new ArgumentListContext(al,def,relPath); } // TemplateListIntf @@ -1171,7 +1171,7 @@ class ArgumentListContext : public RefCountedContext, public TemplateListIntf private: ArgumentListContext(); - ArgumentListContext(const ArgumentList *al,Definition *def,const QCString &relPath); + ArgumentListContext(const ArgumentList *al,const Definition *def,const QCString &relPath); ~ArgumentListContext(); class Private; Private *p; diff --git a/src/defgen.cpp b/src/defgen.cpp index a8f89c5..de11057 100644 --- a/src/defgen.cpp +++ b/src/defgen.cpp @@ -220,7 +220,7 @@ void generateDEFForMember(MemberDef *md, // TODO: exceptions, const volatile if (md->memberType()==MemberType_Enumeration) // enum { - MemberList *enumList = md->enumFieldList(); + const MemberList *enumList = md->enumFieldList(); if (enumList!=0) { MemberListIterator emli(*enumList); diff --git a/src/definition.cpp b/src/definition.cpp index 1233add..b9c40f6 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -223,7 +223,7 @@ static bool matchExcludedSymbols(const char *name) return FALSE; } -void DefinitionImpl::addToMap(const char *name,Definition *d) +static void addToMap(const char *name,Definition *d) { bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL); QCString symbolName = name; @@ -270,7 +270,7 @@ void DefinitionImpl::addToMap(const char *name,Definition *d) } } -void DefinitionImpl::removeFromMap(Definition *d) +static void removeFromMap(Definition *d) { QCString symbolName = d->_symbolName(); if (!symbolName.isEmpty()) @@ -532,7 +532,7 @@ void DefinitionImpl::addSectionsToIndex() } } -void DefinitionImpl::writeDocAnchorsToTagFile(FTextStream &tagFile) +void DefinitionImpl::writeDocAnchorsToTagFile(FTextStream &tagFile) const { if (m_impl->sectionDict) { @@ -1047,7 +1047,7 @@ QCString DefinitionImpl::getSourceAnchor() const } /*! Write a reference to the source code defining this definition */ -void DefinitionImpl::writeSourceDef(OutputList &ol,const char *) +void DefinitionImpl::writeSourceDef(OutputList &ol,const char *) const { static bool latexSourceCode = Config_getBool(LATEX_SOURCE_CODE); static bool rtfSourceCode = Config_getBool(RTF_SOURCE_CODE); @@ -1259,7 +1259,7 @@ bool DefinitionImpl::hasSources() const } /*! Write code of this definition into the documentation */ -void DefinitionImpl::writeInlineCode(OutputList &ol,const char *scopeName) +void DefinitionImpl::writeInlineCode(OutputList &ol,const char *scopeName) const { static bool inlineSources = Config_getBool(INLINE_SOURCES); ol.pushGeneratorState(); @@ -1278,8 +1278,8 @@ void DefinitionImpl::writeInlineCode(OutputList &ol,const char *scopeName) ParserInterface *pIntf = Doxygen::parserManager->getParser(m_impl->defFileExt); pIntf->resetCodeParserState(); //printf("Read:\n`%s'\n\n",codeFragment.data()); - MemberDef *thisMd = 0; - if (definitionType()==TypeMember) thisMd = dynamic_cast <MemberDef*>(this); + const MemberDef *thisMd = 0; + if (definitionType()==TypeMember) thisMd = dynamic_cast <const MemberDef*>(this); ol.startCodeFragment(); pIntf->parseCode(ol, // codeOutIntf @@ -1305,7 +1305,7 @@ void DefinitionImpl::writeInlineCode(OutputList &ol,const char *scopeName) * definition is used. */ void DefinitionImpl::_writeSourceRefList(OutputList &ol,const char *scopeName, - const QCString &text,MemberSDict *members,bool /*funcOnly*/) + const QCString &text,MemberSDict *members,bool /*funcOnly*/) const { static bool latexSourceCode = Config_getBool(LATEX_SOURCE_CODE); static bool docbookSourceCode = Config_getBool(DOCBOOK_PROGRAMLISTING); @@ -1456,12 +1456,12 @@ void DefinitionImpl::_writeSourceRefList(OutputList &ol,const char *scopeName, ol.popGeneratorState(); } -void DefinitionImpl::writeSourceReffedBy(OutputList &ol,const char *scopeName) +void DefinitionImpl::writeSourceReffedBy(OutputList &ol,const char *scopeName) const { _writeSourceRefList(ol,scopeName,theTranslator->trReferencedBy(),m_impl->sourceRefByDict,FALSE); } -void DefinitionImpl::writeSourceRefs(OutputList &ol,const char *scopeName) +void DefinitionImpl::writeSourceRefs(OutputList &ol,const char *scopeName) const { _writeSourceRefList(ol,scopeName,theTranslator->trReferences(),m_impl->sourceRefsDict,TRUE); } @@ -1491,7 +1491,7 @@ bool DefinitionImpl::hasUserDocumentation() const } -void DefinitionImpl::addSourceReferencedBy(MemberDef *md) +void DefinitionImpl::addSourceReferencedBy(const MemberDef *md) { if (md) { @@ -1514,7 +1514,7 @@ void DefinitionImpl::addSourceReferencedBy(MemberDef *md) } } -void DefinitionImpl::addSourceReferences(MemberDef *md) +void DefinitionImpl::addSourceReferences(const MemberDef *md) { if (md) { @@ -1542,7 +1542,7 @@ Definition *DefinitionImpl::findInnerCompound(const char *) const return 0; } -void DefinitionImpl::addInnerCompound(Definition *) +void DefinitionImpl::addInnerCompound(const Definition *) { err("DefinitionImpl::addInnerCompound() called\n"); } @@ -1796,7 +1796,7 @@ void DefinitionImpl::writeNavigationPath(OutputList &ol) const } // TODO: move to htmlgen -void DefinitionImpl::writeToc(OutputList &ol, const LocalToc &localToc) +void DefinitionImpl::writeToc(OutputList &ol, const LocalToc &localToc) const { SectionDict *sectionDict = m_impl->sectionDict; if (sectionDict==0) return; @@ -1936,7 +1936,7 @@ void DefinitionImpl::writeToc(OutputList &ol, const LocalToc &localToc) //---------------------------------------------------------------------------------------- -SectionDict * DefinitionImpl::getSectionDict(void) +SectionDict * DefinitionImpl::getSectionDict() const { return m_impl->sectionDict; } @@ -2251,7 +2251,7 @@ int DefinitionImpl::getDefColumn() const return m_impl->defColumn; } -void DefinitionImpl::setCookie(Cookie *cookie) +void DefinitionImpl::setCookie(Cookie *cookie) const { delete m_impl->cookie; m_impl->cookie = cookie; @@ -2262,11 +2262,26 @@ Definition::Cookie *DefinitionImpl::cookie() const return m_impl->cookie; } -void DefinitionImpl::writeQuickMemberLinks(OutputList &,MemberDef *) const +void DefinitionImpl::writeQuickMemberLinks(OutputList &,const MemberDef *) const { } -void DefinitionImpl::writeSummaryLinks(OutputList &) +void DefinitionImpl::writeSummaryLinks(OutputList &) const { } +//--------------------------------------------------------------------------------- + +DefinitionAliasImpl::DefinitionAliasImpl(const Definition *scope,const Definition *alias) + : m_scope(scope), m_def(alias), m_cookie(0) +{ + //printf("%s::addToMap(%s)\n",qPrint(name()),qPrint(alias->name())); + addToMap(alias->name(),this); +} + +DefinitionAliasImpl::~DefinitionAliasImpl() +{ + //printf("~DefinitionAliasImpl()\n"); + removeFromMap(this); +} + diff --git a/src/definition.h b/src/definition.h index a2307f7..db9bbbc 100644 --- a/src/definition.h +++ b/src/definition.h @@ -105,6 +105,8 @@ class Definition : public DefinitionIntf //----------------------------------------------------------------------------------- // ---- getters ----- //----------------------------------------------------------------------------------- + /*! Returns TRUE if this is an alias of another definition */ + virtual bool isAlias() const = 0; /*! Returns the name of the definition */ virtual QCString name() const = 0; @@ -272,7 +274,10 @@ class Definition : public DefinitionIntf virtual QCString id() const = 0; /** returns the section dictionary, only of importance for pagedef */ - virtual SectionDict * getSectionDict(void) = 0; + virtual SectionDict * getSectionDict() const = 0; + + virtual QCString navigationPathAsString() const = 0; + virtual QCString pathFragment() const = 0; //----------------------------------------------------------------------------------- // ---- setters ----- @@ -304,54 +309,57 @@ class Definition : public DefinitionIntf /*! Sets the tag file id via which this definition was imported. */ virtual void setReference(const char *r) = 0; - /*! Add the list of anchors that mark the sections that are found in the - * documentation. - */ - virtual void addSectionsToDefinition(QList<SectionInfo> *anchorList) = 0; - // source references virtual void setBodySegment(int bls,int ble) = 0; virtual void setBodyDef(FileDef *fd) = 0; - virtual void addSourceReferencedBy(MemberDef *d) = 0; - virtual void addSourceReferences(MemberDef *d) = 0; virtual void setRefItems(const QList<ListItemInfo> *sli) = 0; - virtual void mergeRefItems(Definition *d) = 0; - virtual void addInnerCompound(Definition *d) = 0; virtual void setOuterScope(Definition *d) = 0; virtual void setHidden(bool b) = 0; virtual void setArtificial(bool b) = 0; virtual void setLanguage(SrcLangExt lang) = 0; + virtual void setLocalName(const QCString name) = 0; //----------------------------------------------------------------------------------- // --- actions ---- //----------------------------------------------------------------------------------- - virtual void writeSourceDef(OutputList &ol,const char *scopeName) = 0; - virtual void writeInlineCode(OutputList &ol,const char *scopeName) = 0; - virtual void writeSourceRefs(OutputList &ol,const char *scopeName) = 0; - virtual void writeSourceReffedBy(OutputList &ol,const char *scopeName) = 0; virtual void makePartOfGroup(GroupDef *gd) = 0; - virtual void writeNavigationPath(OutputList &ol) const = 0; - virtual QCString navigationPathAsString() const = 0; - virtual void writeQuickMemberLinks(OutputList &,MemberDef *) const = 0; - virtual void writeSummaryLinks(OutputList &) = 0; - virtual QCString pathFragment() const = 0; - /*! Writes the documentation anchors of the definition to - * the Doxygen::tagFile stream. + /*! Add the list of anchors that mark the sections that are found in the + * documentation. */ - virtual void writeDocAnchorsToTagFile(FTextStream &) = 0; - virtual void setLocalName(const QCString name) = 0; - + virtual void addSectionsToDefinition(QList<SectionInfo> *anchorList) = 0; + virtual void addSourceReferencedBy(const MemberDef *d) = 0; + virtual void addSourceReferences(const MemberDef *d) = 0; + virtual void mergeRefItems(Definition *d) = 0; + virtual void addInnerCompound(const Definition *d) = 0; virtual void addSectionsToIndex() = 0; - virtual void writeToc(OutputList &ol, const LocalToc <) = 0; - virtual void setCookie(Cookie *cookie) = 0; + //----------------------------------------------------------------------------------- + // --- writing output ---- + //----------------------------------------------------------------------------------- + virtual void writeSourceDef(OutputList &ol,const char *scopeName) const = 0; + virtual void writeInlineCode(OutputList &ol,const char *scopeName) const = 0; + virtual void writeSourceRefs(OutputList &ol,const char *scopeName) const = 0; + virtual void writeSourceReffedBy(OutputList &ol,const char *scopeName) const = 0; + virtual void writeNavigationPath(OutputList &ol) const = 0; + virtual void writeQuickMemberLinks(OutputList &,const MemberDef *) const = 0; + virtual void writeSummaryLinks(OutputList &) const = 0; + virtual void writeDocAnchorsToTagFile(FTextStream &) const = 0; + virtual void writeToc(OutputList &ol, const LocalToc <) const = 0; + + //----------------------------------------------------------------------------------- + // --- cookie storage ---- + //----------------------------------------------------------------------------------- + virtual void setCookie(Cookie *cookie) const = 0; virtual Cookie *cookie() const = 0; + //----------------------------------------------------------------------------------- + // --- symbol name ---- + //----------------------------------------------------------------------------------- virtual void _setSymbolName(const QCString &name) = 0; virtual QCString _symbolName() const = 0; }; diff --git a/src/definitionimpl.h b/src/definitionimpl.h index 864d35b..4dd324b 100644 --- a/src/definitionimpl.h +++ b/src/definitionimpl.h @@ -30,13 +30,11 @@ class DefinitionImpl : virtual public Definition bool isSymbol=TRUE); virtual ~DefinitionImpl(); + virtual bool isAlias() const { return FALSE; } virtual QCString name() const; - virtual QCString displayName(bool includeScope=TRUE) const = 0; virtual QCString localName() const; virtual QCString qualifiedName() const; virtual QCString symbolName() const; - virtual QCString getOutputFileBase() const = 0; - virtual QCString anchor() const = 0; virtual QCString getSourceFileBase() const; virtual QCString getSourceAnchor() const; virtual QCString documentation() const; @@ -55,8 +53,6 @@ class DefinitionImpl : virtual public Definition virtual int getDefColumn() const; virtual bool hasDocumentation() const; virtual bool hasUserDocumentation() const; - virtual bool isLinkableInProject() const = 0; - virtual bool isLinkable() const = 0; virtual bool isVisibleInProject() const; virtual bool isVisible() const; virtual bool isHidden() const; @@ -79,7 +75,7 @@ class DefinitionImpl : virtual public Definition virtual bool hasSources() const; virtual bool hasBriefDescription() const; virtual QCString id() const; - virtual SectionDict * getSectionDict(void); + virtual SectionDict * getSectionDict() const; virtual void setName(const char *name); virtual void setId(const char *name); virtual void setDefFile(const QCString& df,int defLine,int defColumn); @@ -90,30 +86,30 @@ class DefinitionImpl : virtual public Definition virtual void addSectionsToDefinition(QList<SectionInfo> *anchorList); virtual void setBodySegment(int bls,int ble); virtual void setBodyDef(FileDef *fd); - virtual void addSourceReferencedBy(MemberDef *d); - virtual void addSourceReferences(MemberDef *d); + virtual void addSourceReferencedBy(const MemberDef *d); + virtual void addSourceReferences(const MemberDef *d); virtual void setRefItems(const QList<ListItemInfo> *sli); virtual void mergeRefItems(Definition *d); - virtual void addInnerCompound(Definition *d); + virtual void addInnerCompound(const Definition *d); virtual void setOuterScope(Definition *d); virtual void setHidden(bool b); virtual void setArtificial(bool b); virtual void setLanguage(SrcLangExt lang); - virtual void writeSourceDef(OutputList &ol,const char *scopeName); - virtual void writeInlineCode(OutputList &ol,const char *scopeName); - virtual void writeSourceRefs(OutputList &ol,const char *scopeName); - virtual void writeSourceReffedBy(OutputList &ol,const char *scopeName); + virtual void writeSourceDef(OutputList &ol,const char *scopeName) const; + virtual void writeInlineCode(OutputList &ol,const char *scopeName) const; + virtual void writeSourceRefs(OutputList &ol,const char *scopeName) const; + virtual void writeSourceReffedBy(OutputList &ol,const char *scopeName) const; virtual void makePartOfGroup(GroupDef *gd); virtual void writeNavigationPath(OutputList &ol) const; virtual QCString navigationPathAsString() const; - virtual void writeQuickMemberLinks(OutputList &,MemberDef *) const; - virtual void writeSummaryLinks(OutputList &); + virtual void writeQuickMemberLinks(OutputList &,const MemberDef *) const; + virtual void writeSummaryLinks(OutputList &) const; virtual QCString pathFragment() const; - virtual void writeDocAnchorsToTagFile(FTextStream &); + virtual void writeDocAnchorsToTagFile(FTextStream &) const; virtual void setLocalName(const QCString name); virtual void addSectionsToIndex(); - virtual void writeToc(OutputList &ol, const LocalToc <); - virtual void setCookie(Cookie *cookie); + virtual void writeToc(OutputList &ol, const LocalToc <) const; + virtual void setCookie(Cookie *cookie) const; virtual Cookie *cookie() const; protected: @@ -121,15 +117,12 @@ class DefinitionImpl : virtual public Definition DefinitionImpl(const DefinitionImpl &d); private: - static void addToMap(const char *name,Definition *d); - static void removeFromMap(Definition *d); - virtual void _setSymbolName(const QCString &name); virtual QCString _symbolName() const ; int _getXRefListId(const char *listName) const; void _writeSourceRefList(OutputList &ol,const char *scopeName, - const QCString &text,MemberSDict *members,bool); + const QCString &text,MemberSDict *members,bool) const; void _setBriefDescription(const char *b,const char *briefFile,int briefLine); void _setDocumentation(const char *d,const char *docFile,int docLine,bool stripWhiteSpace,bool atTop); void _setInbodyDocumentation(const char *d,const char *docFile,int docLine); @@ -140,5 +133,152 @@ class DefinitionImpl : virtual public Definition IMPL *m_impl; // internal structure holding all private data }; +class DefinitionAliasImpl : virtual public Definition +{ + public: + DefinitionAliasImpl(const Definition *scope,const Definition *alias); + virtual ~DefinitionAliasImpl(); + + virtual bool isAlias() const { return TRUE; } + virtual QCString name() const + { return m_def->name(); } + virtual QCString localName() const + { return m_def->localName(); } + virtual QCString qualifiedName() const + { return m_def->qualifiedName(); } + virtual QCString symbolName() const + { return m_def->symbolName(); } + virtual QCString getSourceFileBase() const + { return m_def->getSourceFileBase(); } + virtual QCString getSourceAnchor() const + { return m_def->getSourceAnchor(); } + virtual QCString documentation() const + { return m_def->documentation(); } + virtual int docLine() const + { return m_def->docLine(); } + virtual QCString docFile() const + { return m_def->docFile(); } + virtual QCString briefDescription(bool abbreviate=FALSE) const + { return m_def->briefDescription(abbreviate); } + virtual QCString briefDescriptionAsTooltip() const + { return m_def->briefDescriptionAsTooltip(); } + virtual int briefLine() const + { return m_def->briefLine(); } + virtual QCString inbodyDocumentation() const + { return m_def->inbodyDocumentation(); } + virtual QCString inbodyFile() const + { return m_def->inbodyFile(); } + virtual int inbodyLine() const + { return m_def->inbodyLine(); } + virtual QCString briefFile() const + { return m_def->briefFile(); } + virtual QCString getDefFileName() const + { return m_def->getDefFileName(); } + virtual QCString getDefFileExtension() const + { return m_def->getDefFileExtension(); } + virtual int getDefLine() const + { return m_def->getDefLine(); } + virtual int getDefColumn() const + { return m_def->getDefColumn(); } + virtual bool hasDocumentation() const + { return m_def->hasDocumentation(); } + virtual bool hasUserDocumentation() const + { return m_def->hasUserDocumentation(); } + virtual bool isVisibleInProject() const + { return m_def->isVisibleInProject(); } + virtual bool isVisible() const + { return m_def->isVisible(); } + virtual bool isHidden() const + { return m_def->isHidden(); } + virtual bool isArtificial() const + { return m_def->isArtificial(); } + virtual QCString getReference() const + { return m_def->getReference(); } + virtual bool isReference() const + { return m_def->isReference(); } + virtual QCString externalReference(const QCString &relPath) const + { return m_def->externalReference(relPath); } + virtual int getStartBodyLine() const + { return m_def->getStartBodyLine(); } + virtual int getEndBodyLine() const + { return m_def->getEndBodyLine(); } + virtual FileDef *getBodyDef() const + { return m_def->getBodyDef(); } + virtual SrcLangExt getLanguage() const + { return m_def->getLanguage(); } + virtual GroupList *partOfGroups() const + { return m_def->partOfGroups(); } + virtual bool isLinkableViaGroup() const + { return m_def->isLinkableViaGroup(); } + virtual QList<ListItemInfo> *xrefListItems() const + { return m_def->xrefListItems(); } + virtual Definition *findInnerCompound(const char *name) const + { return m_def->findInnerCompound(name); } + virtual Definition *getOuterScope() const + { return const_cast<Definition*>(m_scope); } + virtual MemberSDict *getReferencesMembers() const + { return m_def->getReferencesMembers(); } + virtual MemberSDict *getReferencedByMembers() const + { return m_def->getReferencedByMembers(); } + virtual bool hasSections() const + { return m_def->hasSections(); } + virtual bool hasSources() const + { return m_def->hasSources(); } + virtual bool hasBriefDescription() const + { return m_def->hasBriefDescription(); } + virtual QCString id() const + { return m_def->id(); } + virtual SectionDict * getSectionDict() const + { return m_def->getSectionDict(); } + virtual QCString navigationPathAsString() const + { return m_def->navigationPathAsString(); } + virtual QCString pathFragment() const + { return m_def->pathFragment(); } + virtual void setName(const char *name) { } + virtual void setId(const char *name) { } + virtual void setDefFile(const QCString& df,int defLine,int defColumn) {} + virtual void setDocumentation(const char *d,const char *docFile,int docLine,bool stripWhiteSpace=TRUE) {} + virtual void setBriefDescription(const char *b,const char *briefFile,int briefLine) {} + virtual void setInbodyDocumentation(const char *d,const char *docFile,int docLine) {} + virtual void setReference(const char *r) {} + virtual void addSectionsToDefinition(QList<SectionInfo> *anchorList) {} + virtual void setBodySegment(int bls,int ble) {} + virtual void setBodyDef(FileDef *fd) {} + virtual void addSourceReferencedBy(const MemberDef *d) {} + virtual void addSourceReferences(const MemberDef *d) {} + virtual void setRefItems(const QList<ListItemInfo> *sli) {} + virtual void mergeRefItems(Definition *d) {} + virtual void addInnerCompound(const Definition *d) {} + virtual void setOuterScope(Definition *d) {} + virtual void setHidden(bool b) {} + virtual void setArtificial(bool b) {} + virtual void setLanguage(SrcLangExt lang) {} + virtual void writeSourceDef(OutputList &ol,const char *scopeName) const {} + virtual void writeInlineCode(OutputList &ol,const char *scopeName) const {} + virtual void writeSourceRefs(OutputList &ol,const char *scopeName) const {} + virtual void writeSourceReffedBy(OutputList &ol,const char *scopeName) const {} + virtual void makePartOfGroup(GroupDef *gd) {} + virtual void writeNavigationPath(OutputList &ol) const {} + virtual void writeQuickMemberLinks(OutputList &,const MemberDef *) const {} + virtual void writeSummaryLinks(OutputList &) const {} + virtual void writeDocAnchorsToTagFile(FTextStream &) const {} + virtual void setLocalName(const QCString name) {} + virtual void addSectionsToIndex() {} + virtual void writeToc(OutputList &ol, const LocalToc <) const {} + virtual void setCookie(Cookie *cookie) const { delete m_cookie; m_cookie = cookie; } + virtual Cookie *cookie() const { return m_cookie; } + protected: + const Definition *getAlias() const { return m_def; } + const Definition *getScope() const { return m_scope; } + + private: + virtual void _setSymbolName(const QCString &name) { m_symbolName = name; } + virtual QCString _symbolName() const { return m_symbolName; } + const Definition *m_scope; + const Definition *m_def; + mutable Cookie *m_cookie; + QCString m_symbolName; +}; + #endif diff --git a/src/diagram.cpp b/src/diagram.cpp index 808191e..06480fc 100644 --- a/src/diagram.cpp +++ b/src/diagram.cpp @@ -42,7 +42,7 @@ class DiagramItemList; class DiagramItem { public: - DiagramItem(DiagramItem *p,int number,ClassDef *cd, + DiagramItem(DiagramItem *p,int number,const ClassDef *cd, Protection prot,Specifier virt,const char *ts); ~DiagramItem(); QCString label() const; @@ -60,7 +60,7 @@ class DiagramItem Specifier virtualness() const { return virt; } void putInList() { inList=TRUE; } bool isInList() const { return inList; } - ClassDef *getClassDef() const { return classDef; } + const ClassDef *getClassDef() const { return classDef; } private: DiagramItemList *children; DiagramItem *parent; @@ -70,7 +70,7 @@ class DiagramItem Specifier virt; QCString templSpec; bool inList; - ClassDef *classDef; + const ClassDef *classDef; }; /** Class representing a list of DiagramItem object. */ @@ -91,7 +91,7 @@ class DiagramRow : public QList<DiagramItem> level=l; setAutoDelete(TRUE); } - void insertClass(DiagramItem *parent,ClassDef *cd,bool doBases, + void insertClass(DiagramItem *parent,const ClassDef *cd,bool doBases, Protection prot,Specifier virt,const char *ts); uint number() { return level; } private: @@ -111,7 +111,7 @@ class DiagramRowIterator : public QListIterator<DiagramRow> class TreeDiagram : public QList<DiagramRow> { public: - TreeDiagram(ClassDef *root,bool doBases); + TreeDiagram(const ClassDef *root,bool doBases); ~TreeDiagram(); void computeLayout(); uint computeRows(); @@ -252,7 +252,7 @@ static void writeVectorBox(FTextStream &t,DiagramItem *di, if (di->virtualness()==Virtual) t << "solid\n"; } -static void writeMapArea(FTextStream &t,ClassDef *cd,QCString relPath, +static void writeMapArea(FTextStream &t,const ClassDef *cd,QCString relPath, int x,int y,int w,int h) { if (cd->isLinkable()) @@ -283,7 +283,7 @@ static void writeMapArea(FTextStream &t,ClassDef *cd,QCString relPath, } //----------------------------------------------------------------------------- -DiagramItem::DiagramItem(DiagramItem *p,int number,ClassDef *cd, +DiagramItem::DiagramItem(DiagramItem *p,int number,const ClassDef *cd, Protection pr,Specifier vi,const char *ts) { parent=p; @@ -354,7 +354,7 @@ void DiagramItem::addChild(DiagramItem *di) children->append(di); } -void DiagramRow::insertClass(DiagramItem *parent,ClassDef *cd,bool doBases, +void DiagramRow::insertClass(DiagramItem *parent,const ClassDef *cd,bool doBases, Protection prot,Specifier virt,const char *ts) { //if (cd->visited) return; // the visit check does not work in case of @@ -406,7 +406,7 @@ void DiagramRow::insertClass(DiagramItem *parent,ClassDef *cd,bool doBases, } } -TreeDiagram::TreeDiagram(ClassDef *root,bool doBases) +TreeDiagram::TreeDiagram(const ClassDef *root,bool doBases) { setAutoDelete(TRUE); DiagramRow *row=new DiagramRow(this,0); @@ -1024,7 +1024,7 @@ void clearVisitFlags() } } -ClassDiagram::ClassDiagram(ClassDef *root) +ClassDiagram::ClassDiagram(const ClassDef *root) { clearVisitFlags(); base = new TreeDiagram(root,TRUE); diff --git a/src/diagram.h b/src/diagram.h index 2922657..05af28e 100644 --- a/src/diagram.h +++ b/src/diagram.h @@ -29,7 +29,7 @@ class FTextStream; class ClassDiagram { public: - ClassDiagram(ClassDef *root); + ClassDiagram(const ClassDef *root); ~ClassDiagram(); void writeFigure(FTextStream &t,const char *path, const char *file) const; diff --git a/src/dirdef.cpp b/src/dirdef.cpp index ae3a6a3..3803335 100644 --- a/src/dirdef.cpp +++ b/src/dirdef.cpp @@ -38,7 +38,7 @@ class DirDefImpl : public DefinitionImpl, public DirDef virtual DirDef *parent() const { return m_parent; } virtual int dirCount() const { return m_dirCount; } virtual const QDict<UsedDir> *usedDirs() const { return m_usedDirs; } - virtual bool isParentOf(DirDef *dir) const; + virtual bool isParentOf(const DirDef *dir) const; virtual bool depGraphIsTrivial() const; virtual QCString shortTitle() const; virtual bool hasDetailedDescription() const; @@ -726,7 +726,7 @@ void DirDefImpl::computeDependencies() } } -bool DirDefImpl::isParentOf(DirDef *dir) const +bool DirDefImpl::isParentOf(const DirDef *dir) const { if (dir->parent()==this) // this is a parent of dir return TRUE; diff --git a/src/dirdef.h b/src/dirdef.h index 2bca93e..2ea54af 100644 --- a/src/dirdef.h +++ b/src/dirdef.h @@ -63,7 +63,7 @@ class DirDef : virtual public Definition virtual DirDef *parent() const = 0; virtual int dirCount() const = 0; virtual const QDict<UsedDir> *usedDirs() const = 0; - virtual bool isParentOf(DirDef *dir) const = 0; + virtual bool isParentOf(const DirDef *dir) const = 0; virtual bool depGraphIsTrivial() const = 0; virtual QCString shortTitle() const = 0; virtual bool hasDetailedDescription() const = 0; @@ -125,16 +125,16 @@ class UsedDir class DirRelation { public: - DirRelation(const QCString &name,DirDef *src,UsedDir *dst) + DirRelation(const QCString &name,const DirDef *src,UsedDir *dst) : m_name(name), m_src(src), m_dst(dst) {} - DirDef *source() const { return m_src; } + const DirDef *source() const { return m_src; } UsedDir *destination() const { return m_dst; } void writeDocumentation(OutputList &ol); QCString getOutputFileBase() const { return m_name; } private: QCString m_name; - DirDef *m_src; + const DirDef *m_src; UsedDir *m_dst; }; diff --git a/src/docbookgen.cpp b/src/docbookgen.cpp index adf36b0..8a062fc 100644 --- a/src/docbookgen.cpp +++ b/src/docbookgen.cpp @@ -230,7 +230,7 @@ void DocbookCodeGenerator::writeLineNumber(const char *ref,const char *fileName, } } -void DocbookCodeGenerator::setCurrentDoc(Definition *,const char *,bool) +void DocbookCodeGenerator::setCurrentDoc(const Definition *,const char *,bool) { } void DocbookCodeGenerator::addWord(const char *,bool) @@ -537,7 +537,7 @@ DB_GEN_C2("IndexSections " << is) { t << "</title>" << endl; ClassSDict::Iterator cli(*Doxygen::classSDict); - ClassDef *cd=0; + const ClassDef *cd=0; bool found=FALSE; for (cli.toFirst();(cd=cli.current()) && !found;++cli) { @@ -572,7 +572,7 @@ DB_GEN_C2("IndexSections " << is) for (fnli.toFirst();(fn=fnli.current());++fnli) { FileNameIterator fni(*fn); - FileDef *fd; + const FileDef *fd; for (;(fd=fni.current());++fni) { if (fd->isLinkableInProject()) @@ -648,7 +648,7 @@ DB_GEN_C } } } -void DocbookGenerator::writeDoc(DocNode *n,Definition *ctx,MemberDef *) +void DocbookGenerator::writeDoc(DocNode *n,const Definition *ctx,const MemberDef *) { DB_GEN_C DocbookDocVisitor *visitor = diff --git a/src/docbookgen.h b/src/docbookgen.h index 08255a1..8674150 100644 --- a/src/docbookgen.h +++ b/src/docbookgen.h @@ -49,7 +49,7 @@ class DocbookCodeGenerator : public CodeOutputInterface void writeCodeAnchor(const char *); void writeLineNumber(const char *extRef,const char *compId, const char *anchorId,int l); - void setCurrentDoc(Definition *,const char *,bool); + void setCurrentDoc(const Definition *,const char *,bool); void addWord(const char *,bool); void finish(); void startCodeFragment(); @@ -137,7 +137,7 @@ class DocbookGenerator : public OutputGenerator { m_codeGen.writeCodeAnchor(anchor); } // --------------------------- - void writeDoc(DocNode *,Definition *ctx,MemberDef *md); + void writeDoc(DocNode *,const Definition *ctx,const MemberDef *md); /////////////////////////////////////////////////////////////// // structural output interface @@ -339,7 +339,7 @@ class DocbookGenerator : public OutputGenerator void writeLabel(const char *,bool); void endLabels(); - void setCurrentDoc(Definition *,const char *,bool) {DB_GEN_EMPTY} + void setCurrentDoc(const Definition *,const char *,bool) {DB_GEN_EMPTY} void addWord(const char *,bool) {DB_GEN_EMPTY} private: diff --git a/src/docparser.cpp b/src/docparser.cpp index 1c8479b..61a1031 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -87,7 +87,7 @@ static const char *sectionLevelToName[] = //--------------------------------------------------------------------------- // Parser state: global variables during a call to validatingParseDoc -static Definition * g_scope; +static const Definition * g_scope; static QCString g_context; static bool g_inSeeBlock; static bool g_xmlComment; @@ -102,7 +102,7 @@ static QCString g_relPath; static bool g_hasParamCommand; static bool g_hasReturnCommand; static QDict<void> g_paramsFound; -static MemberDef * g_memberDef; +static const MemberDef * g_memberDef; static bool g_isExample; static QCString g_exampleName; static SectionDict * g_sectionDict; @@ -120,7 +120,7 @@ static bool g_includeFileShowLineNo; */ struct DocParserContext { - Definition *scope; + const Definition *scope; QCString context; bool inSeeBlock; bool xmlComment; @@ -135,7 +135,7 @@ struct DocParserContext bool hasParamCommand; bool hasReturnCommand; - MemberDef * memberDef; + const MemberDef * memberDef; QDict<void> paramsFound; bool isExample; QCString exampleName; @@ -558,106 +558,6 @@ static void checkUnOrMultipleDocumentedParams() } } -/*! Check if a member has documentation for its parameter and or return - * type, if applicable. If found this will be stored in the member, this - * is needed as a member can have brief and detailed documentation, while - * only one of these needs to document the parameters. - */ -static void detectNoDocumentedParams() -{ - if (g_memberDef && Config_getBool(WARN_NO_PARAMDOC)) - { - ArgumentList *al = g_memberDef->argumentList(); - ArgumentList *declAl = g_memberDef->declArgumentList(); - QCString returnType = g_memberDef->typeString(); - bool isPython = g_memberDef->getLanguage()==SrcLangExt_Python; - - if (!g_memberDef->hasDocumentedParams() && - g_hasParamCommand) - { - //printf("%s->setHasDocumentedParams(TRUE);\n",g_memberDef->name().data()); - g_memberDef->setHasDocumentedParams(TRUE); - } - else if (!g_memberDef->hasDocumentedParams()) - { - bool allDoc=TRUE; // no parameter => all parameters are documented - if ( // member has parameters - al!=0 && // but the member has a parameter list - al->count()>0 // with at least one parameter (that is not void) - ) - { - ArgumentListIterator ali(*al); - Argument *a; - - // see if all parameters have documentation - for (ali.toFirst();(a=ali.current()) && allDoc;++ali) - { - if (!a->name.isEmpty() && a->type!="void" && - !(isPython && (a->name=="self" || a->name=="cls")) - ) - { - allDoc = !a->docs.isEmpty(); - } - //printf("a->type=%s a->name=%s doc=%s\n", - // a->type.data(),a->name.data(),a->docs.data()); - } - if (!allDoc && declAl!=0) // try declaration arguments as well - { - allDoc=TRUE; - ArgumentListIterator ali(*declAl); - Argument *a; - for (ali.toFirst();(a=ali.current()) && allDoc;++ali) - { - if (!a->name.isEmpty() && a->type!="void" && - !(isPython && (a->name=="self" || a->name=="cls")) - ) - { - allDoc = !a->docs.isEmpty(); - } - //printf("a->name=%s doc=%s\n",a->name.data(),a->docs.data()); - } - } - } - if (allDoc) - { - //printf("%s->setHasDocumentedParams(TRUE);\n",g_memberDef->name().data()); - g_memberDef->setHasDocumentedParams(TRUE); - } - } - //printf("Member %s hasDocumentedReturnType()=%d hasReturnCommand=%d\n", - // g_memberDef->name().data(),g_memberDef->hasDocumentedReturnType(),g_hasReturnCommand); - if (!g_memberDef->hasDocumentedReturnType() && // docs not yet found - g_hasReturnCommand) - { - g_memberDef->setHasDocumentedReturnType(TRUE); - } - else if ( // see if return type is documented in a function w/o return type - g_hasReturnCommand && - (//returnType.isEmpty() || // empty return type - returnType.find("void")!=-1 || // void return type - returnType.find("subroutine")!=-1 || // fortran subroutine - g_memberDef->isConstructor() || // a constructor - g_memberDef->isDestructor() // or destructor - ) - ) - { - warn_doc_error(g_fileName,doctokenizerYYlineno,"documented empty return type of %s",g_memberDef->qualifiedName().data()); - } - else if ( // see if return needs to documented - g_memberDef->hasDocumentedReturnType() || - //returnType.isEmpty() || // empty return type - returnType.find("void")!=-1 || // void return type - returnType.find("subroutine")!=-1 || // fortran subroutine - g_memberDef->isConstructor() || // a constructor - g_memberDef->isDestructor() // or destructor - ) - { - g_memberDef->setHasDocumentedReturnType(TRUE); - } - } -} - - //--------------------------------------------------------------------------- /*! Strips known html and tex extensions from \a text. */ @@ -755,7 +655,7 @@ static bool insideTable(DocNode *n) static bool findDocsForMemberOrCompound(const char *commandName, QCString *pDoc, QCString *pBrief, - Definition **pDef) + const Definition **pDef) { //printf("findDocsForMemberOrCompound(%s)\n",commandName); *pDoc=""; @@ -790,11 +690,11 @@ static bool findDocsForMemberOrCompound(const char *commandName, // try if the link is to a member MemberDef *md=0; - ClassDef *cd=0; - FileDef *fd=0; - NamespaceDef *nd=0; - GroupDef *gd=0; - PageDef *pd=0; + const ClassDef *cd=0; + const FileDef *fd=0; + const NamespaceDef *nd=0; + const GroupDef *gd=0; + const PageDef *pd=0; bool found = getDefs( g_context.find('.')==-1?g_context.data():"", // `find('.') is a hack to detect files name, @@ -1125,8 +1025,8 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children,bool ignor // ------- try to turn the word 'name' into a link - Definition *compound=0; - MemberDef *member=0; + const Definition *compound=0; + const MemberDef *member=0; int len = g_token->name.length(); ClassDef *cd=0; bool ambig; @@ -1165,7 +1065,7 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children,bool ignor } else if (compound->definitionType()==Definition::TypeGroup) { - name=(dynamic_cast<GroupDef*>(compound))->groupTitle(); + name=(dynamic_cast<const GroupDef*>(compound))->groupTitle(); } children.append(new DocLinkedWord(parent,name, @@ -1177,7 +1077,7 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children,bool ignor ); } else if (compound->definitionType()==Definition::TypeFile && - (dynamic_cast<FileDef*>(compound))->generateSourceFile() + (dynamic_cast<const FileDef*>(compound))->generateSourceFile() ) // undocumented file that has source code we can link to { children.append(new @@ -2201,7 +2101,7 @@ void DocIncOperator::parse() void DocCopy::parse(QList<DocNode> &children) { QCString doc,brief; - Definition *def; + const Definition *def = 0; if (findDocsForMemberOrCompound(m_link,&doc,&brief,&def)) { if (g_copyStack.findRef(def)==-1) // definition not parsed earlier @@ -2547,7 +2447,7 @@ DocRef::DocRef(DocNode *parent,const QCString &target,const QCString &context) : m_refType(Unknown), m_isSubPage(FALSE) { m_parent = parent; - Definition *compound = 0; + const Definition *compound = 0; QCString anchor; //printf("DocRef::DocRef(target=%s,context=%s)\n",target.data(),context.data()); ASSERT(!target.isEmpty()); @@ -2600,16 +2500,16 @@ DocRef::DocRef(DocNode *parent,const QCString &target,const QCString &context) : { if (anchor.isEmpty() && /* compound link */ compound->definitionType()==Definition::TypeGroup && /* is group */ - (dynamic_cast<GroupDef *>(compound))->groupTitle() /* with title */ + (dynamic_cast<const GroupDef *>(compound))->groupTitle() /* with title */ ) { - m_text=(dynamic_cast<GroupDef *>(compound))->groupTitle(); // use group's title as link + m_text=(dynamic_cast<const GroupDef *>(compound))->groupTitle(); // use group's title as link } else if (compound->definitionType()==Definition::TypeMember && - (dynamic_cast<MemberDef*>(compound))->isObjCMethod()) + (dynamic_cast<const MemberDef*>(compound))->isObjCMethod()) { // Objective C Method - MemberDef *member = dynamic_cast<MemberDef*>(compound); + const MemberDef *member = dynamic_cast<const MemberDef*>(compound); bool localLink = g_memberDef ? member->getClassDef()==g_memberDef->getClassDef() : FALSE; m_text = member->objCMethodName(localLink,g_inSeeBlock); } @@ -2621,7 +2521,7 @@ DocRef::DocRef(DocNode *parent,const QCString &target,const QCString &context) : return; } else if (compound && compound->definitionType()==Definition::TypeFile && - (dynamic_cast<FileDef*>(compound))->generateSourceFile() + (dynamic_cast<const FileDef*>(compound))->generateSourceFile() ) // undocumented file that has source code we can link to { m_file = compound->getSourceFileBase(); @@ -2743,7 +2643,7 @@ DocCite::DocCite(DocNode *parent,const QCString &target,const QCString &) //cont DocLink::DocLink(DocNode *parent,const QCString &target) { m_parent = parent; - Definition *compound = 0; + const Definition *compound = 0; QCString anchor; m_refText = target; m_relPath = g_relPath; @@ -2761,7 +2661,7 @@ DocLink::DocLink(DocNode *parent,const QCString &target) m_ref = compound->getReference(); } else if (compound && compound->definitionType()==Definition::TypeFile && - (dynamic_cast<FileDef*>(compound))->generateSourceFile() + (dynamic_cast<const FileDef*>(compound))->generateSourceFile() ) // undocumented file that has source code we can link to { m_file = compound->getSourceFileBase(); @@ -5464,7 +5364,7 @@ void DocPara::handleInheritDoc() MemberDef *reMd = g_memberDef->reimplements(); if (reMd) // member from which was inherited. { - MemberDef *thisMd = g_memberDef; + const MemberDef *thisMd = g_memberDef; //printf("{InheritDocs:%s=>%s}\n",g_memberDef->qualifiedName().data(),reMd->qualifiedName().data()); docParserPushContext(); g_scope=reMd->getOuterScope(); @@ -7366,7 +7266,7 @@ static QCString processCopyDoc(const char *data,uint &len) while (j<len && (data[j]==' ' || data[j]=='\t')) j++; // extract the argument QCString id = extractCopyDocId(data,j,len); - Definition *def; + const Definition *def = 0; QCString doc,brief; //printf("resolving docs='%s'\n",id.data()); if (findDocsForMemberOrCompound(id,&doc,&brief,&def)) @@ -7555,7 +7455,7 @@ QCString getJsDirEmbedingChar(QString::Direction textDir) //--------------------------------------------------------------------------- DocRoot *validatingParseDoc(const char *fileName,int startLine, - Definition *ctx,MemberDef *md, + const Definition *ctx,const MemberDef *md, const char *input,bool indexWords, bool isExample, const char *exampleName, bool singleLine, bool linkFromIndex) @@ -7581,12 +7481,12 @@ DocRoot *validatingParseDoc(const char *fileName,int startLine, } else if (ctx && ctx->definitionType()==Definition::TypePage) { - Definition *scope = (dynamic_cast<PageDef*>(ctx))->getPageScope(); + const Definition *scope = (dynamic_cast<const PageDef*>(ctx))->getPageScope(); if (scope && scope!=Doxygen::globalScope) g_context = scope->name(); } else if (ctx && ctx->definitionType()==Definition::TypeGroup) { - Definition *scope = (dynamic_cast<GroupDef*>(ctx))->getGroupScope(); + const Definition *scope = (dynamic_cast<const GroupDef*>(ctx))->getGroupScope(); if (scope && scope!=Doxygen::globalScope) g_context = scope->name(); } else @@ -7740,7 +7640,7 @@ DocRoot *validatingParseDoc(const char *fileName,int startLine, } checkUnOrMultipleDocumentedParams(); - detectNoDocumentedParams(); + if (g_memberDef) g_memberDef->detectUndocumentedParams(g_hasParamCommand,g_hasReturnCommand); // TODO: These should be called at the end of the program. //doctokenizerYYcleanup(); diff --git a/src/docparser.h b/src/docparser.h index 15180f9..ef01089 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -65,7 +65,7 @@ QCString getJsDirEmbedingChar(QString::Direction textDir); * pointer is handed over to the caller. */ DocRoot *validatingParseDoc(const char *fileName,int startLine, - Definition *context, MemberDef *md, + const Definition *context, const MemberDef *md, const char *input,bool indexWords, bool isExample,const char *exampleName=0, bool singleLine=FALSE,bool linkFromIndex=FALSE); @@ -677,19 +677,19 @@ class DocFormula : public DocNode class DocIndexEntry : public DocNode { public: - DocIndexEntry(DocNode *parent,Definition *scope,MemberDef *md) + DocIndexEntry(DocNode *parent,const Definition *scope,const MemberDef *md) : m_scope(scope), m_member(md){ m_parent = parent; } Kind kind() const { return Kind_IndexEntry; } int parse(); - Definition *scope() const { return m_scope; } - MemberDef *member() const { return m_member; } + const Definition *scope() const { return m_scope; } + const MemberDef *member() const { return m_member; } QCString entry() const { return m_entry; } void accept(DocVisitor *v) { v->visit(this); } private: QCString m_entry; - Definition *m_scope; - MemberDef *m_member; + const Definition *m_scope; + const MemberDef *m_member; }; //----------------------------------------------------------------------- diff --git a/src/docsets.cpp b/src/docsets.cpp index 1d79c9d..055532a 100644 --- a/src/docsets.cpp +++ b/src/docsets.cpp @@ -236,7 +236,7 @@ void DocSets::addContentsItem(bool isDir, const char *anchor, bool /* separateIndex */, bool /* addToNavIndex */, - Definition * /*def*/) + const Definition * /*def*/) { (void)isDir; //printf("DocSets::addContentsItem(%s) m_dc=%d\n",name,m_dc); @@ -274,14 +274,14 @@ void DocSets::addContentsItem(bool isDir, } } -void DocSets::addIndexItem(Definition *context,MemberDef *md, +void DocSets::addIndexItem(const Definition *context,const MemberDef *md, const char *,const char *) { if (md==0 && context==0) return; - FileDef *fd = 0; - ClassDef *cd = 0; - NamespaceDef *nd = 0; + const FileDef *fd = 0; + const ClassDef *cd = 0; + const NamespaceDef *nd = 0; if (md) { @@ -417,7 +417,7 @@ void DocSets::addIndexItem(Definition *context,MemberDef *md, { scope = nd->name(); } - MemberDef *declMd = md->memberDeclaration(); + const MemberDef *declMd = md->memberDeclaration(); if (declMd==0) declMd = md; { fd = md->getFileDef(); @@ -432,15 +432,15 @@ void DocSets::addIndexItem(Definition *context,MemberDef *md, { if (fd==0 && context->definitionType()==Definition::TypeFile) { - fd = dynamic_cast<FileDef*>(context); + fd = dynamic_cast<const FileDef*>(context); } if (cd==0 && context->definitionType()==Definition::TypeClass) { - cd = dynamic_cast<ClassDef*>(context); + cd = dynamic_cast<const ClassDef*>(context); } if (nd==0 && context->definitionType()==Definition::TypeNamespace) { - nd = dynamic_cast<NamespaceDef*>(context); + nd = dynamic_cast<const NamespaceDef*>(context); } if (fd) { diff --git a/src/docsets.h b/src/docsets.h index 548ba75..0d75bfd 100644 --- a/src/docsets.h +++ b/src/docsets.h @@ -45,9 +45,9 @@ class DocSets : public IndexIntf const char *anchor, bool separateIndex, bool addToNavIndex, - Definition *def + const Definition *def ); - void addIndexItem(Definition *context,MemberDef *md, + void addIndexItem(const Definition *context,const MemberDef *md, const char *sectionAnchor,const char *title); void addIndexFile(const char *name); void addImageFile(const char *) {} diff --git a/src/doctokenizer.h b/src/doctokenizer.h index 8b8ca97..b59fc09 100644 --- a/src/doctokenizer.h +++ b/src/doctokenizer.h @@ -71,9 +71,7 @@ enum Tokens /** @brief Data associated with a token used by the comment block parser. */ struct TokenInfo { - // unknown token - char unknownChar; - + TokenInfo() : isEnumList(FALSE), indent(0), id(-1), endTag(FALSE), emptyTag(FALSE), paramDir(Unspecified) {} // command token QCString name; diff --git a/src/dot.cpp b/src/dot.cpp index 40a7210..f61acec 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -1506,7 +1506,7 @@ static void deleteNodes(DotNode *node,SDict<DotNode> *skipNodes=0) } DotNode::DotNode(int n,const char *lab,const char *tip, const char *url, - bool isRoot,ClassDef *cd) + bool isRoot,const ClassDef *cd) : m_subgraphId(-1) , m_number(n) , m_label(lab) @@ -1706,7 +1706,7 @@ static QCString escapeTooltip(const QCString &tooltip) } static void writeBoxMemberList(FTextStream &t, - char prot,MemberList *ml,ClassDef *scope, + char prot,MemberList *ml,const ClassDef *scope, bool isStatic=FALSE,const QDict<void> *skipNames=0) { (void)isStatic; @@ -2468,7 +2468,7 @@ void DotGfxHierarchyTable::writeGraph(FTextStream &out, out << "</table>" << endl; } -void DotGfxHierarchyTable::addHierarchy(DotNode *n,ClassDef *cd,bool hideSuper) +void DotGfxHierarchyTable::addHierarchy(DotNode *n,const ClassDef *cd,bool hideSuper) { //printf("addHierarchy `%s' baseClasses=%d\n",cd->name().data(),cd->baseClasses()->count()); if (cd->subClasses()) @@ -2542,7 +2542,7 @@ void DotGfxHierarchyTable::addHierarchy(DotNode *n,ClassDef *cd,bool hideSuper) //printf("end addHierarchy\n"); } -void DotGfxHierarchyTable::addClassList(ClassSDict *cl) +void DotGfxHierarchyTable::addClassList(const ClassSDict *cl) { static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE); ClassSDict::Iterator cli(*cl); @@ -2669,7 +2669,7 @@ DotGfxHierarchyTable::~DotGfxHierarchyTable() //-------------------------------------------------------------------- -void DotClassGraph::addClass(ClassDef *cd,DotNode *n,int prot, +void DotClassGraph::addClass(const ClassDef *cd,DotNode *n,int prot, const char *label,const char *usedName,const char *templSpec,bool base,int distance) { if (Config_getBool(HIDE_UNDOC_CLASSES) && !cd->isLinkable()) return; @@ -2883,7 +2883,7 @@ bool DotClassGraph::determineVisibleNodes(DotNode *rootNode, // left to right order. } -void DotClassGraph::buildGraph(ClassDef *cd,DotNode *n,bool base,int distance) +void DotClassGraph::buildGraph(const ClassDef *cd,DotNode *n,bool base,int distance) { static bool templateRelations = Config_getBool(TEMPLATE_RELATIONS); //printf("DocClassGraph::buildGraph(%s,distance=%d,base=%d)\n", @@ -2986,11 +2986,11 @@ void DotClassGraph::buildGraph(ClassDef *cd,DotNode *n,bool base,int distance) { if (base) // template relations for base classes { - ClassDef *templMaster=cd->templateMaster(); + const ClassDef *templMaster=cd->templateMaster(); if (templMaster) { QDictIterator<ClassDef> cli(*templMaster->getTemplateInstances()); - ClassDef *templInstance; + const ClassDef *templInstance; for (;(templInstance=cli.current());++cli) { if (templInstance==cd) @@ -3003,11 +3003,11 @@ void DotClassGraph::buildGraph(ClassDef *cd,DotNode *n,bool base,int distance) } else // template relations for super classes { - QDict<ClassDef> *templInstances = cd->getTemplateInstances(); + const QDict<ClassDef> *templInstances = cd->getTemplateInstances(); if (templInstances) { QDictIterator<ClassDef> cli(*templInstances); - ClassDef *templInstance; + const ClassDef *templInstance; for (;(templInstance=cli.current());++cli) { addClass(templInstance,n,EdgeInfo::Orange,cli.currentKey(),0, @@ -3025,7 +3025,7 @@ void DotClassGraph::resetNumbering() m_curNodeNumber = 0; } -DotClassGraph::DotClassGraph(ClassDef *cd,DotNode::GraphType t) +DotClassGraph::DotClassGraph(const ClassDef *cd,DotNode::GraphType t) { //printf("--------------- DotClassGraph::DotClassGraph `%s'\n",cd->displayName().data()); m_graphType = t; @@ -3383,7 +3383,7 @@ void DotClassGraph::writeDEF(FTextStream &t) //-------------------------------------------------------------------- -void DotInclDepGraph::buildGraph(DotNode *n,FileDef *fd,int distance) +void DotInclDepGraph::buildGraph(DotNode *n,const FileDef *fd,int distance) { QList<IncludeInfo> *includeFiles = m_inverse ? fd->includedByFileList() : fd->includeFileList(); @@ -3393,7 +3393,7 @@ void DotInclDepGraph::buildGraph(DotNode *n,FileDef *fd,int distance) IncludeInfo *ii; for (;(ii=ili.current());++ili) { - FileDef *bfd = ii->fileDef; + const FileDef *bfd = ii->fileDef; QCString in = ii->includeName; //printf(">>>> in=`%s' bfd=%p\n",ii->includeName.data(),bfd); bool doc=TRUE,src=FALSE; @@ -3503,7 +3503,7 @@ void DotInclDepGraph::resetNumbering() m_curNodeNumber = 0; } -DotInclDepGraph::DotInclDepGraph(FileDef *fd,bool inverse) +DotInclDepGraph::DotInclDepGraph(const FileDef *fd,bool inverse) { m_inverse = inverse; ASSERT(fd!=0); @@ -3712,7 +3712,7 @@ void DotInclDepGraph::writeDocbook(FTextStream &t) //------------------------------------------------------------- -void DotCallGraph::buildGraph(DotNode *n,MemberDef *md,int distance) +void DotCallGraph::buildGraph(DotNode *n,const MemberDef *md,int distance) { MemberSDict *refs = m_inverse ? md->getReferencedByMembers() : md->getReferencesMembers(); if (refs) @@ -3821,7 +3821,7 @@ void DotCallGraph::resetNumbering() m_curNodeNumber = 0; } -DotCallGraph::DotCallGraph(MemberDef *md,bool inverse) +DotCallGraph::DotCallGraph(const MemberDef *md,bool inverse) { m_inverse = inverse; m_diskName = md->getOutputFileBase()+"_"+md->anchor(); @@ -4012,9 +4012,9 @@ bool DotCallGraph::isTooBig() const } //------------------------------------------------------------- -static void writeDotDirDepGraph(FTextStream &t,DirDef *dd,bool linkRelations); +static void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations); -DotDirDeps::DotDirDeps(DirDef *dir) : m_dir(dir) +DotDirDeps::DotDirDeps(const DirDef *dir) : m_dir(dir) { } @@ -4361,7 +4361,7 @@ void DotGroupCollaboration::resetNumbering() m_curNodeNumber = 0; } -DotGroupCollaboration::DotGroupCollaboration(GroupDef* gd) +DotGroupCollaboration::DotGroupCollaboration(const GroupDef* gd) { QCString tmp_url = gd->getReference()+"$"+gd->getOutputFileBase(); m_usedNodes = new QDict<DotNode>(1009); @@ -4381,18 +4381,18 @@ DotGroupCollaboration::~DotGroupCollaboration() delete m_usedNodes; } -void DotGroupCollaboration::buildGraph(GroupDef* gd) +void DotGroupCollaboration::buildGraph(const GroupDef* gd) { QCString tmp_url; //=========================== // hierarchy. // Write parents - GroupList *groups = gd->partOfGroups(); + const GroupList *groups = gd->partOfGroups(); if ( groups ) { GroupListIterator gli(*groups); - GroupDef *d; + const GroupDef *d; for (gli.toFirst();(d=gli.current());++gli) { DotNode* nnode = m_usedNodes->find(d->name()); @@ -4413,7 +4413,7 @@ void DotGroupCollaboration::buildGraph(GroupDef* gd) if ( gd->getSubGroups() && gd->getSubGroups()->count() ) { QListIterator<GroupDef> defli(*gd->getSubGroups()); - GroupDef *def; + const GroupDef *def; for (;(def=defli.current());++defli) { DotNode* nnode = m_usedNodes->find(def->name()); @@ -4468,7 +4468,7 @@ void DotGroupCollaboration::buildGraph(GroupDef* gd) if ( gd->getFiles() && gd->getFiles()->count() ) { QListIterator<FileDef> defli(*gd->getFiles()); - FileDef *def; + const FileDef *def; for (;(def=defli.current());++defli) { tmp_url = def->getReference()+"$"+def->getOutputFileBase()+Doxygen::htmlFileExtension; @@ -4492,7 +4492,7 @@ void DotGroupCollaboration::buildGraph(GroupDef* gd) if ( gd->getDirs() && gd->getDirs()->count() ) { QListIterator<DirDef> defli(*gd->getDirs()); - DirDef *def; + const DirDef *def; for (;(def=defli.current());++defli) { tmp_url = def->getReference()+"$"+def->getOutputFileBase()+Doxygen::htmlFileExtension; @@ -4546,7 +4546,7 @@ DotGroupCollaboration::Edge* DotGroupCollaboration::addEdge( } void DotGroupCollaboration::addCollaborationMember( - Definition* def, QCString& url, EdgeType eType ) + const Definition* def, QCString& url, EdgeType eType ) { // Create group nodes if ( !def->partOfGroups() ) @@ -4821,7 +4821,7 @@ void DotGroupCollaboration::writeGraphHeader(FTextStream &t, t << " rankdir=LR;\n"; } -void writeDotDirDepGraph(FTextStream &t,DirDef *dd,bool linkRelations) +void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations) { t << "digraph \"" << dd->displayName() << "\" {\n"; if (Config_getBool(DOT_TRANSPARENT)) @@ -4855,7 +4855,7 @@ void writeDotDirDepGraph(FTextStream &t,DirDef *dd,bool linkRelations) // add nodes for sub directories QListIterator<DirDef> sdi(dd->subDirs()); - DirDef *sdir; + const DirDef *sdir; for (sdi.toFirst();(sdir=sdi.current());++sdi) { t << " " << sdir->getOutputFileBase() << " [shape=box label=\"" @@ -4896,7 +4896,7 @@ void writeDotDirDepGraph(FTextStream &t,DirDef *dd,bool linkRelations) // for each used dir (=directly used or a parent of a directly used dir) { const DirDef *usedDir=udir->dir(); - DirDef *dir=dd; + const DirDef *dir=dd; while (dir) { //printf("*** check relation %s->%s same_parent=%d !%s->isParentOf(%s)=%d\n", @@ -4930,7 +4930,7 @@ void writeDotDirDepGraph(FTextStream &t,DirDef *dd,bool linkRelations) } // add relations between all selected directories - DirDef *dir; + const DirDef *dir; QDictIterator<DirDef> di(dirsInGraph); for (di.toFirst();(dir=di.current());++di) // foreach dir in the graph { @@ -69,7 +69,7 @@ class DotNode enum GraphType { Dependency, Inheritance, Collaboration, Hierarchy, CallGraph }; enum TruncState { Unknown, Truncated, Untruncated }; DotNode(int n,const char *lab,const char *tip,const char *url, - bool rootNode=FALSE,ClassDef *cd=0); + bool rootNode=FALSE,const ClassDef *cd=0); ~DotNode(); void addChild(DotNode *n, int edgeColor=EdgeInfo::Purple, @@ -118,7 +118,7 @@ class DotNode bool m_written; //!< used to mark a node as written bool m_hasDoc; //!< used to mark a node as documented bool m_isRoot; //!< indicates if this is a root node - ClassDef * m_classDef; //!< class representing this node (can be 0) + const ClassDef * m_classDef; //!< class representing this node (can be 0) bool m_visible; //!< is the node visible in the output TruncState m_truncated; //!< does the node have non-visible children/parents int m_distance; //!< shortest path to the root node @@ -164,8 +164,8 @@ class DotGfxHierarchyTable const DotNodeList *subGraphs() const { return m_rootSubgraphs; } private: - void addHierarchy(DotNode *n,ClassDef *cd,bool hide); - void addClassList(ClassSDict *cl); + void addHierarchy(DotNode *n,const ClassDef *cd,bool hide); + void addClassList(const ClassSDict *cl); QCString m_prefix; ClassDef::CompoundType m_classType; @@ -179,7 +179,7 @@ class DotGfxHierarchyTable class DotClassGraph { public: - DotClassGraph(ClassDef *cd,DotNode::GraphType t); + DotClassGraph(const ClassDef *cd,DotNode::GraphType t); ~DotClassGraph(); bool isTrivial() const; bool isTooBig() const; @@ -193,10 +193,10 @@ class DotClassGraph static void resetNumbering(); private: - void buildGraph(ClassDef *cd,DotNode *n,bool base,int distance); + void buildGraph(const ClassDef *cd,DotNode *n,bool base,int distance); bool determineVisibleNodes(DotNode *rootNode,int maxNodes,bool includeParents); void determineTruncatedNodes(QList<DotNode> &queue,bool includeParents); - void addClass(ClassDef *cd,DotNode *n,int prot,const char *label, + void addClass(const ClassDef *cd,DotNode *n,int prot,const char *label, const char *usedName,const char *templSpec, bool base,int distance); @@ -213,7 +213,7 @@ class DotClassGraph class DotInclDepGraph { public: - DotInclDepGraph(FileDef *fd,bool inverse); + DotInclDepGraph(const FileDef *fd,bool inverse); ~DotInclDepGraph(); QCString writeGraph(FTextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const char *path,const char *fileName,const char *relPath, @@ -226,7 +226,7 @@ class DotInclDepGraph static void resetNumbering(); private: - void buildGraph(DotNode *n,FileDef *fd,int distance); + void buildGraph(DotNode *n,const FileDef *fd,int distance); void determineVisibleNodes(QList<DotNode> &queue,int &maxNodes); void determineTruncatedNodes(QList<DotNode> &queue); @@ -242,13 +242,13 @@ class DotInclDepGraph class DotCallGraph { public: - DotCallGraph(MemberDef *md,bool inverse); + DotCallGraph(const MemberDef *md,bool inverse); ~DotCallGraph(); QCString writeGraph(FTextStream &t, GraphOutputFormat gf, EmbeddedOutputFormat ef, const char *path,const char *fileName, const char *relPath,bool writeImageMap=TRUE, int graphId=-1) const; - void buildGraph(DotNode *n,MemberDef *md,int distance); + void buildGraph(DotNode *n,const MemberDef *md,int distance); bool isTrivial() const; bool isTooBig() const; void determineVisibleNodes(QList<DotNode> &queue, int &maxNodes); @@ -257,18 +257,18 @@ class DotCallGraph private: DotNode *m_startNode; - static int m_curNodeNumber; + static int m_curNodeNumber; QDict<DotNode> *m_usedNodes; bool m_inverse; QCString m_diskName; - Definition * m_scope; + const Definition * m_scope; }; /** Representation of an directory dependency graph */ class DotDirDeps { public: - DotDirDeps(DirDef *dir); + DotDirDeps(const DirDef *dir); ~DotDirDeps(); bool isTrivial() const; QCString writeGraph(FTextStream &out, @@ -281,7 +281,7 @@ class DotDirDeps int graphId=-1, bool linkRelations=TRUE) const; private: - DirDef *m_dir; + const DirDef *m_dir; }; /** Representation of a group collaboration graph */ @@ -321,17 +321,17 @@ class DotGroupCollaboration void write( FTextStream &t ) const; }; - DotGroupCollaboration(GroupDef* gd); + DotGroupCollaboration(const GroupDef* gd); ~DotGroupCollaboration(); QCString writeGraph(FTextStream &t, GraphOutputFormat gf,EmbeddedOutputFormat ef, const char *path,const char *fileName,const char *relPath, bool writeImageMap=TRUE,int graphId=-1) const; - void buildGraph(GroupDef* gd); + void buildGraph(const GroupDef* gd); bool isTrivial() const; static void resetNumbering(); private : - void addCollaborationMember( Definition* def, QCString& url, EdgeType eType ); + void addCollaborationMember(const Definition* def, QCString& url, EdgeType eType ); void addMemberList( class MemberList* ml ); void writeGraphHeader(FTextStream &t,const QCString &title) const; Edge* addEdge( DotNode* _pNStart, DotNode* _pNEnd, EdgeType _eType, diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 99878a5..2900f49 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -1209,7 +1209,6 @@ ClassDef::CompoundType convertToCompoundType(int section,uint64 specifier) static void addClassToContext(Entry *root) { - //printf("Loading entry for rootNav=%p name=%s\n",rootNav,rootNav->name().data()); FileDef *fd = root->fileDef(); QCString scName; @@ -1423,6 +1422,31 @@ static void resolveClassNestingRelations() //printf("****** adding %s to scope %s in iteration %d\n",cd->name().data(),d->name().data(),iteration); d->addInnerCompound(cd); cd->setOuterScope(d); + + // for inline namespace add an alias of the class to the outer scope + while (d->definitionType()==DefinitionIntf::TypeNamespace) + { + NamespaceDef *nd = dynamic_cast<NamespaceDef*>(d); + //printf("d->isInline()=%d\n",nd->isInline()); + if (nd->isInline()) + { + d = d->getOuterScope(); + if (d) + { + ClassDef *aliasCd = createClassDefAlias(d,cd); + d->addInnerCompound(aliasCd); + QCString aliasFullName = d->qualifiedName()+"::"+aliasCd->localName(); + Doxygen::classSDict->append(aliasFullName,aliasCd); + printf("adding %s to %s as %s\n",qPrint(aliasCd->name()),qPrint(d->name()),qPrint(aliasFullName)); + aliasCd->setVisited(TRUE); + } + } + else + { + break; + } + } + cd->setVisited(TRUE); done=FALSE; } @@ -1752,6 +1776,7 @@ static void buildNamespaceList(Entry *root) nd->setLanguage(root->lang); nd->setId(root->id); nd->setMetaData(root->metaData); + nd->setInline((root->spec&Entry::Inline)!=0); //printf("Adding namespace to group\n"); addNamespaceToGroups(root,nd); @@ -1786,6 +1811,25 @@ static void buildNamespaceList(Entry *root) { d->addInnerCompound(nd); nd->setOuterScope(d); + // in case of d is an inline namespace, alias insert nd in the part scope of d. + while (d->definitionType()==DefinitionIntf::TypeNamespace) + { + NamespaceDef *pnd = dynamic_cast<NamespaceDef*>(d); + if (pnd->isInline()) + { + d = d->getOuterScope(); + if (d) + { + NamespaceDef *aliasNd = createNamespaceDefAlias(d,nd); + //printf("adding %s to %s\n",qPrint(aliasNd->name()),qPrint(d->name())); + d->addInnerCompound(aliasNd); + } + } + else + { + break; + } + } } } } @@ -1795,15 +1839,15 @@ static void buildNamespaceList(Entry *root) //---------------------------------------------------------------------- -static NamespaceDef *findUsedNamespace(NamespaceSDict *unl, +static const NamespaceDef *findUsedNamespace(const NamespaceSDict *unl, const QCString &name) { - NamespaceDef *usingNd =0; + const NamespaceDef *usingNd =0; if (unl) { //printf("Found namespace dict %d\n",unl->count()); NamespaceSDict::Iterator unli(*unl); - NamespaceDef *und; + const NamespaceDef *und; for (unli.toFirst();(und=unli.current());++unli) { QCString uScope=und->name()+"::"; @@ -1827,7 +1871,7 @@ static void findUsingDirectives(Entry *root) } if (!name.isEmpty()) { - NamespaceDef *usingNd = 0; + const NamespaceDef *usingNd = 0; NamespaceDef *nd = 0; FileDef *fd = root->fileDef(); QCString nsName; @@ -1869,17 +1913,17 @@ static void findUsingDirectives(Entry *root) if (usingNd==0 && nd) // not found, try used namespaces in this scope // or in one of the parent namespace scopes { - NamespaceDef *pnd = nd; + const NamespaceDef *pnd = nd; while (pnd && usingNd==0) { // also try with one of the used namespaces found earlier usingNd = findUsedNamespace(pnd->getUsedNamespaces(),name); // goto the parent - Definition *s = pnd->getOuterScope(); + const Definition *s = pnd->getOuterScope(); if (s && s->definitionType()==Definition::TypeNamespace) { - pnd = dynamic_cast<NamespaceDef*>(s); + pnd = dynamic_cast<const NamespaceDef*>(s); } else { @@ -1923,6 +1967,7 @@ static void findUsingDirectives(Entry *root) nd->setLanguage(root->lang); nd->setId(root->id); nd->setMetaData(root->metaData); + nd->setInline((root->spec&Entry::Inline)!=0); QListIterator<Grouping> gli(*root->groups); Grouping *g; @@ -3541,7 +3586,7 @@ static void buildFunctionList(Entry *root) MemberNameIterator mni(*mn); for (mni.toFirst();(!found && (md=mni.current()));++mni) { - NamespaceDef *mnd = md->getNamespaceDef(); + const NamespaceDef *mnd = md->getNamespaceDef(); NamespaceDef *rnd = 0; //printf("root namespace=%s\n",rootNav->parent()->name().data()); QCString fullScope = scope; @@ -3553,7 +3598,7 @@ static void buildFunctionList(Entry *root) } //printf("fullScope=%s\n",fullScope.data()); rnd = getResolvedNamespace(fullScope); - FileDef *mfd = md->getFileDef(); + const FileDef *mfd = md->getFileDef(); QCString nsName,rnsName; if (mnd) nsName = mnd->name().copy(); if (rnd) rnsName = rnd->name().copy(); @@ -5183,7 +5228,10 @@ static void addListReferences() ClassDef *cd=0; for (cli.toFirst();(cd=cli.current());++cli) { - cd->addListReferences(); + if (!cd->isAlias()) + { + cd->addListReferences(); + } } FileNameListIterator fnli(*Doxygen::inputNameList); @@ -5202,7 +5250,10 @@ static void addListReferences() NamespaceDef *nd=0; for (nli.toFirst();(nd=nli.current());++nli) { - nd->addListReferences(); + if (!nd->isAlias()) + { + nd->addListReferences(); + } } GroupSDict::Iterator gli(*Doxygen::groupSDict); @@ -5281,8 +5332,8 @@ static void addMemberDocs(Entry *root, md->enableCallerGraph(root->callerGraph); md->enableReferencedByRelation(root->referencedByRelation); md->enableReferencesRelation(root->referencesRelation); - ClassDef *cd=md->getClassDef(); - NamespaceDef *nd=md->getNamespaceDef(); + ClassDef *cd=md->getClassDef(); + const NamespaceDef *nd=md->getNamespaceDef(); QCString fullName; if (cd) fullName = cd->name(); @@ -5448,12 +5499,20 @@ static bool findGlobalMember(Entry *root, bool found=FALSE; for (mni.toFirst();(md=mni.current()) && !found;++mni) { - NamespaceDef *nd=md->getNamespaceDef(); - - //printf("Namespace namespaceName=%s nd=%s\n", - // namespaceName.data(),nd ? nd->name().data() : "<none>"); + const NamespaceDef *nd=0; + if (md->isAlias() && md->getOuterScope() && + md->getOuterScope()->definitionType()==Definition::TypeNamespace) + { + nd = dynamic_cast<const NamespaceDef *>(md->getOuterScope()); + } + else + { + nd = md->getNamespaceDef(); + } + //const Definition *scope=md->getOuterScope(); + //md = md->resolveAlias(); - FileDef *fd=root->fileDef(); + const FileDef *fd=root->fileDef(); //printf("File %s\n",fd ? fd->name().data() : "<none>"); NamespaceSDict *nl = fd ? fd->getUsedNamespaces() : 0; //SDict<Definition> *cl = fd ? fd->getUsedClasses() : 0; @@ -5478,7 +5537,7 @@ static bool findGlobalMember(Entry *root, bool matching= (mdAl==0 && root->argList->count()==0) || md->isVariable() || md->isTypedef() || /* in case of function pointers */ - matchArguments2(md->getOuterScope(),md->getFileDef(),mdAl, + matchArguments2(md->getOuterScope(),const_cast<const MemberDef *>(md)->getFileDef(),mdAl, rnd ? rnd : Doxygen::globalScope,fd,root->argList, FALSE); @@ -5528,7 +5587,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(root,md->resolveAlias(),decl,root->argList,FALSE); found=TRUE; } } @@ -5587,12 +5646,12 @@ static bool isSpecialization( return FALSE; } -static bool scopeIsTemplate(Definition *d) +static bool scopeIsTemplate(const Definition *d) { bool result=FALSE; if (d && d->definitionType()==Definition::TypeClass) { - result = (dynamic_cast<ClassDef*>(d))->templateArguments() || scopeIsTemplate(d->getOuterScope()); + result = (dynamic_cast<const ClassDef*>(d))->templateArguments() || scopeIsTemplate(d->getOuterScope()); } return result; } @@ -6089,7 +6148,7 @@ static void findMember(Entry *root, //printf("scopeName %s->%s\n",scopeName.data(), // stripTemplateSpecifiersFromScope(scopeName,FALSE).data()); - ClassDef *tcd=findClassDefinition(fd,nd,scopeName); + const ClassDef *tcd=findClassDefinition(fd,nd,scopeName); if (tcd==0 && cd && stripAnonymousNamespaceScope(cd->name())==scopeName) { // don't be fooled by anonymous scopes @@ -6251,7 +6310,7 @@ static void findMember(Entry *root, if (count==0 && !(isFriend && funcType=="class")) { int candidates=0; - ClassDef *ecd = 0, *ucd = 0; + const ClassDef *ecd = 0, *ucd = 0; MemberDef *emd = 0, *umd = 0; if (mn->count()>0) { @@ -6337,7 +6396,7 @@ static void findMember(Entry *root, warnMsg+="Possible candidates:\n"; for (mni.toFirst();(md=mni.current());++mni) { - ClassDef *cd=md->getClassDef(); + const ClassDef *cd=md->getClassDef(); if (cd!=0 && rightScopeMatch(cd->name(),className)) { ArgumentList *templAl = md->templateArguments(); @@ -6443,7 +6502,7 @@ static void findMember(Entry *root, bool unique=TRUE; for (;(md=mni.current());++mni) { - ClassDef *cd=md->getClassDef(); + const ClassDef *cd=md->getClassDef(); if (className!=cd->name()) unique=FALSE; } if (unique) @@ -7335,7 +7394,7 @@ static void addEnumValuesToEnums(Entry *root) // fmd->name().data(),fmd->getOuterScope()->name().data()); if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') { - NamespaceDef *fnd=fmd->getNamespaceDef(); + const NamespaceDef *fnd=fmd->getNamespaceDef(); if (fnd==nd) // enum value is inside a namespace { md->insertEnumField(fmd); @@ -7344,7 +7403,7 @@ static void addEnumValuesToEnums(Entry *root) } else if (isGlobal) { - FileDef *ffd=fmd->getFileDef(); + const FileDef *ffd=fmd->getFileDef(); if (ffd==fd) // enum value has file scope { md->insertEnumField(fmd); @@ -7363,7 +7422,7 @@ static void addEnumValuesToEnums(Entry *root) } else { - ClassDef *fcd=fmd->getClassDef(); + const ClassDef *fcd=fmd->getClassDef(); if (fcd==cd) // enum value is inside a class { //printf("Inserting enum field %s in enum scope %s\n", @@ -7437,7 +7496,7 @@ static void findEnumDocumentation(Entry *root) MemberDef *md; for (mni.toFirst();(md=mni.current()) && !found;++mni) { - ClassDef *cd=md->getClassDef(); + const ClassDef *cd=md->getClassDef(); if (cd && cd->name()==className && md->isEnumerate()) { // documentation outside a compound overrides the documentation inside it @@ -7471,7 +7530,7 @@ static void findEnumDocumentation(Entry *root) md->addSectionsToDefinition(root->anchors); md->setRefItems(root->sli); - GroupDef *gd=md->getGroupDef(); + const GroupDef *gd=md->getGroupDef(); if (gd==0 &&root->groups->getFirst()!=0) // member not grouped but out-of-line documentation is { addMemberToGroups(root,md); @@ -7505,7 +7564,7 @@ static void findEnumDocumentation(Entry *root) md->addSectionsToDefinition(root->anchors); md->setMemberGroupId(root->mGrpId); - GroupDef *gd=md->getGroupDef(); + const GroupDef *gd=md->getGroupDef(); if (gd==0 && root->groups->getFirst()!=0) // member not grouped but out-of-line documentation is { addMemberToGroups(root,md); @@ -7544,7 +7603,7 @@ static void findDEV(const MemberNameSDict &mnsd) { if (md->isEnumerate()) // member is an enum { - MemberList *fmdl = md->enumFieldList(); + const MemberList *fmdl = md->enumFieldList(); int documentedEnumValues=0; if (fmdl) // enum has values { @@ -7597,19 +7656,54 @@ static void addMembersToIndex() // for each member definition for (mni.toFirst();(md=mni.current());++mni) { - if (md->getNamespaceDef()) + if (!md->isAlias()) { - addNamespaceMemberNameToIndex(md); - } - else - { - addFileMemberNameToIndex(md); + if (md->getNamespaceDef()) + { + addNamespaceMemberNameToIndex(md); + } + else + { + addFileMemberNameToIndex(md); + } } } } } //---------------------------------------------------------------------- + +static void vhdlCorrectMemberProperties() +{ + MemberName *mn; + MemberNameSDict::Iterator mnli(*Doxygen::memberNameSDict); + // for each member name + for (mnli.toFirst();(mn=mnli.current());++mnli) + { + MemberDef *md; + MemberNameIterator mni(*mn); + // for each member definition + for (mni.toFirst();(md=mni.current());++mni) + { + VhdlDocGen::correctMemberProperties(md); + } + } + MemberNameSDict::Iterator fnli(*Doxygen::functionNameSDict); + // for each member name + for (fnli.toFirst();(mn=fnli.current());++fnli) + { + MemberDef *md; + MemberNameIterator mni(*mn); + // for each member definition + for (mni.toFirst();(md=mni.current());++mni) + { + VhdlDocGen::correctMemberProperties(md); + } + } +} + + +//---------------------------------------------------------------------- // computes the relation between all members. For each member `m' // the members that override the implementation of `m' are searched and // the member that `m' overrides is searched. @@ -7628,10 +7722,10 @@ static void computeMemberRelations() { for ( bmdi.toFirst() ; (bmd=bmdi.current()); ++bmdi ) // for each other member with the same name { - ClassDef *mcd = md->getClassDef(); + const ClassDef *mcd = md->getClassDef(); if (mcd && mcd->baseClasses()) { - ClassDef *bmcd = bmd->getClassDef(); + const ClassDef *bmcd = bmd->getClassDef(); //printf("Check relation between `%s'::`%s' (%p) and `%s'::`%s' (%p)\n", // mcd->name().data(),md->name().data(),md, // bmcd->name().data(),bmd->name().data(),bmd @@ -8055,6 +8149,85 @@ static void sortMemberLists() } //---------------------------------------------------------------------------- + +static void setAnonymousEnumType() +{ + ClassSDict::Iterator cli(*Doxygen::classSDict); + ClassDef *cd=0; + for (cli.toFirst();(cd=cli.current());++cli) + { + cd->setAnonymousEnumType(); + } + +#if 0 + NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict); + NamespaceDef *nd=0; + for (nli.toFirst();(nd=nli.current());++nli) + { + nd->setAnonymousEnumType(); + } + + FileNameListIterator fnli(*Doxygen::inputNameList); + FileName *fn; + for (;(fn=fnli.current());++fnli) + { + FileNameIterator fni(*fn); + FileDef *fd; + for (;(fd=fni.current());++fni) + { + fd->setAnonymousEnumType(); + } + } + + GroupSDict::Iterator gli(*Doxygen::groupSDict); + GroupDef *gd; + for (gli.toFirst();(gd=gli.current());++gli) + { + gd->setAnonymousEnumType(); + } +#endif +} + +//---------------------------------------------------------------------------- + +static void countMembers() +{ + ClassSDict::Iterator cli(*Doxygen::classSDict); + ClassDef *cd=0; + for (cli.toFirst();(cd=cli.current());++cli) + { + cd->countMembers(); + } + + NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict); + NamespaceDef *nd=0; + for (nli.toFirst();(nd=nli.current());++nli) + { + nd->countMembers(); + } + + FileNameListIterator fnli(*Doxygen::inputNameList); + FileName *fn; + for (;(fn=fnli.current());++fnli) + { + FileNameIterator fni(*fn); + FileDef *fd; + for (;(fd=fni.current());++fni) + { + fd->countMembers(); + } + } + + GroupSDict::Iterator gli(*Doxygen::groupSDict); + GroupDef *gd; + for (gli.toFirst();(gd=gli.current());++gli) + { + gd->countMembers(); + } +} + + +//---------------------------------------------------------------------------- // generate the documentation of all classes static void generateClassList(ClassSDict &classSDict) @@ -8469,7 +8642,7 @@ static void findDefineDocumentation(Entry *root) { if (md->memberType()==MemberType_Define) { - FileDef *fd=md->getFileDef(); + const FileDef *fd=md->getFileDef(); if (fd && fd->absFilePath()==root->fileName) // doc and define in the same file assume they belong together. { @@ -8792,7 +8965,7 @@ static void resolveUserReferences() { // TODO: there should be one function in Definition that returns // the file to link to, so we can avoid the following tests. - GroupDef *gd=0; + const GroupDef *gd=0; if (si->definition->definitionType()==Definition::TypeMember) { gd = (dynamic_cast<MemberDef *>(si->definition))->getGroupDef(); @@ -11177,9 +11350,6 @@ void parseInput() buildClassList(root); g_s.end(); - g_s.begin("Associating documentation with classes...\n"); - buildClassDocList(root); - // build list of using declarations here (global list) buildListOfUsingDecls(root); g_s.end(); @@ -11197,6 +11367,9 @@ void parseInput() // we don't need the list of using declaration anymore g_usingDeclarations.clear(); + g_s.begin("Associating documentation with classes...\n"); + buildClassDocList(root); + g_s.begin("Building example list...\n"); buildExampleList(root); g_s.end(); @@ -11386,6 +11559,10 @@ void parseInput() sortMemberLists(); g_s.end(); + g_s.begin("Setting anonymous enum type...\n"); + setAnonymousEnumType(); + g_s.end(); + if (Config_getBool(DIRECTORY_GRAPH)) { g_s.begin("Computing dependencies between directories...\n"); @@ -11400,6 +11577,10 @@ void parseInput() Doxygen::citeDict->generatePage(); g_s.end(); + g_s.begin("Counting members...\n"); + countMembers(); + g_s.end(); + g_s.begin("Counting data structures...\n"); countDataStructures(); g_s.end(); @@ -11423,6 +11604,11 @@ void parseInput() g_s.begin("Adding members to index pages...\n"); addMembersToIndex(); g_s.end(); + + g_s.begin("Correcting members for VHDL...\n"); + vhdlCorrectMemberProperties(); + g_s.end(); + } void generateOutput() diff --git a/src/eclipsehelp.cpp b/src/eclipsehelp.cpp index bf150b4..dab001a 100644 --- a/src/eclipsehelp.cpp +++ b/src/eclipsehelp.cpp @@ -174,7 +174,7 @@ void EclipseHelp::addContentsItem( const char *anchor, bool /* separateIndex */, bool /* addToNavIndex */, - Definition * /*def*/) + const Definition * /*def*/) { // -- write the topic tag closedTag(); @@ -216,8 +216,8 @@ void EclipseHelp::addContentsItem( } void EclipseHelp::addIndexItem( - Definition * /* context */, - MemberDef * /* md */, + const Definition * /* context */, + const MemberDef * /* md */, const char * /* sectionAnchor */, const char * /* title */) { diff --git a/src/eclipsehelp.h b/src/eclipsehelp.h index a7cde1e..5d63768 100644 --- a/src/eclipsehelp.h +++ b/src/eclipsehelp.h @@ -50,8 +50,8 @@ class EclipseHelp : public IndexIntf virtual void decContentsDepth(); virtual void addContentsItem(bool isDir, const char *name, const char *ref, const char *file, const char *anchor,bool separateIndex,bool addToNavIndex, - Definition *def); - virtual void addIndexItem(Definition *context,MemberDef *md, + const Definition *def); + virtual void addIndexItem(const Definition *context,const MemberDef *md, const char *sectionAnchor,const char *title); virtual void addIndexFile(const char *name); virtual void addImageFile(const char *name); diff --git a/src/entry.h b/src/entry.h index 8810c18..6dfa0c6 100644 --- a/src/entry.h +++ b/src/entry.h @@ -186,7 +186,7 @@ class Entry enum GroupDocType { GROUPDOC_NORMAL, //!< defgroup - GROUPDOC_ADD, //!< addgroup + GROUPDOC_ADD, //!< addtogroup GROUPDOC_WEAK //!< weakgroup }; //!< kind of group @@ -301,7 +301,7 @@ class Entry switch( groupDocType ) { case GROUPDOC_NORMAL: return "\\defgroup"; - case GROUPDOC_ADD: return "\\addgroup"; + case GROUPDOC_ADD: return "\\addtogroup"; case GROUPDOC_WEAK: return "\\weakgroup"; default: return "unknown group command"; } diff --git a/src/filedef.cpp b/src/filedef.cpp index 130679e..f721c9f 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -90,11 +90,14 @@ class FileDefImpl : public DefinitionImpl, public FileDef virtual bool hasDetailedDescription() const; virtual QCString fileVersion() const; virtual bool subGrouping() const { return m_subGrouping; } + virtual void countMembers(); + virtual int numDocMembers() const; + virtual int numDecMembers() const; virtual void addSourceRef(int line,Definition *d,MemberDef *md); virtual void writeDocumentation(OutputList &ol); virtual void writeMemberPages(OutputList &ol); - virtual void writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const; - virtual void writeSummaryLinks(OutputList &ol); + virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const; + virtual void writeSummaryLinks(OutputList &ol) const; virtual void writeTagFile(FTextStream &t); virtual void startParsing(); virtual void writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu); @@ -107,7 +110,7 @@ class FileDefImpl : public DefinitionImpl, public FileDef virtual void computeAnchors(); virtual void setPackageDef(PackageDef *pd) { m_package=pd; } virtual void setDirDef(DirDef *dd) { m_dir=dd; } - virtual void addUsingDirective(NamespaceDef *nd); + virtual void addUsingDirective(const NamespaceDef *nd); virtual void addUsingDeclaration(Definition *def); virtual void combineUsingRelations(); virtual bool generateSourceFile() const; @@ -203,7 +206,7 @@ class DevNullCodeDocInterface : public CodeOutputInterface virtual void endFontClass() {} virtual void writeCodeAnchor(const char *) {} virtual void linkableSymbol(int, const char *,Definition *,Definition *) {} - virtual void setCurrentDoc(Definition *,const char *,bool) {} + virtual void setCurrentDoc(const Definition *,const char *,bool) {} virtual void addWord(const char *,bool) {} }; @@ -801,7 +804,7 @@ void FileDefImpl::writeAuthorSection(OutputList &ol) ol.popGeneratorState(); } -void FileDefImpl::writeSummaryLinks(OutputList &ol) +void FileDefImpl::writeSummaryLinks(OutputList &ol) const { ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); @@ -1103,7 +1106,7 @@ void FileDefImpl::writeMemberPages(OutputList &ol) ol.popGeneratorState(); } -void FileDefImpl::writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const +void FileDefImpl::writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const { static bool createSubDirs=Config_getBool(CREATE_SUBDIRS); @@ -1503,7 +1506,7 @@ MemberDef *FileDefImpl::getSourceMember(int lineNr) const } -void FileDefImpl::addUsingDirective(NamespaceDef *nd) +void FileDefImpl::addUsingDirective(const NamespaceDef *nd) { if (m_usingDirList==0) { @@ -2210,3 +2213,36 @@ QCString FileDefImpl::includedByDependencyGraphFileName() const return m_inclByDepFileName; } +void FileDefImpl::countMembers() +{ + QListIterator<MemberList> mli(m_memberLists); + MemberList *ml; + for (mli.toFirst();(ml=mli.current());++mli) + { + ml->countDecMembers(); + ml->countDocMembers(); + } + if (m_memberGroupSDict) + { + MemberGroupSDict::Iterator mgli(*m_memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->countDecMembers(); + mg->countDocMembers(); + } + } +} + +int FileDefImpl::numDocMembers() const +{ + MemberList *ml = getMemberList(MemberListType_allMembersList); + return ml ? ml->numDocMembers() : 0; +} + +int FileDefImpl::numDecMembers() const +{ + MemberList *ml = getMemberList(MemberListType_allMembersList); + return ml ? ml->numDecMembers() : 0; +} + diff --git a/src/filedef.h b/src/filedef.h index 63cacf5..b66d7be 100644 --- a/src/filedef.h +++ b/src/filedef.h @@ -135,14 +135,18 @@ class FileDef : virtual public Definition virtual bool subGrouping() const = 0; + virtual void countMembers() = 0; + virtual int numDocMembers() const = 0; + virtual int numDecMembers() const = 0; + //--------------------------------- virtual void addSourceRef(int line,Definition *d,MemberDef *md) = 0; virtual void writeDocumentation(OutputList &ol) = 0; virtual void writeMemberPages(OutputList &ol) = 0; - virtual void writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const = 0; - virtual void writeSummaryLinks(OutputList &ol) = 0; + virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const = 0; + virtual void writeSummaryLinks(OutputList &ol) const = 0; virtual void writeTagFile(FTextStream &t) = 0; virtual void startParsing() = 0; @@ -159,7 +163,7 @@ class FileDef : virtual public Definition virtual void setPackageDef(PackageDef *pd) = 0; virtual void setDirDef(DirDef *dd) = 0; - virtual void addUsingDirective(NamespaceDef *nd) = 0; + virtual void addUsingDirective(const NamespaceDef *nd) = 0; virtual void addUsingDeclaration(Definition *def) = 0; virtual void combineUsingRelations() = 0; diff --git a/src/fileparser.cpp b/src/fileparser.cpp index 6883622..45bdc81 100644 --- a/src/fileparser.cpp +++ b/src/fileparser.cpp @@ -26,9 +26,9 @@ void FileParser::parseCode(CodeOutputInterface &codeOutIntf, int startLine, int endLine, bool, // inlineFragment - MemberDef *, // memberDef + const MemberDef *, // memberDef bool showLineNumbers, - Definition *, // searchCtx, + const Definition *, // searchCtx, bool // collectXRefs ) { diff --git a/src/fileparser.h b/src/fileparser.h index 4568a39..4b311e6 100644 --- a/src/fileparser.h +++ b/src/fileparser.h @@ -37,9 +37,9 @@ class FileParser : public ParserInterface int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, - MemberDef *memberDef=0, + const MemberDef *memberDef=0, bool showLineNumbers=TRUE, - Definition *searchCtx=0, + const Definition *searchCtx=0, bool collectXRefs=TRUE ); void resetCodeParserState() {} diff --git a/src/fortrancode.h b/src/fortrancode.h index c110852..4df20a9 100644 --- a/src/fortrancode.h +++ b/src/fortrancode.h @@ -29,7 +29,7 @@ class Definition; void parseFortranCode(CodeOutputInterface &,const char *,const QCString &, bool ,const char *,FileDef *fd, int startLine,int endLine,bool inlineFragment, - MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx, + const MemberDef *memberDef,bool showLineNumbers,const Definition *searchCtx, bool collectRefs, FortranFormat format); void resetFortranCodeParserState(); void codeFreeScanner(); diff --git a/src/fortrancode.l b/src/fortrancode.l index 31924fa..926a3ff 100644 --- a/src/fortrancode.l +++ b/src/fortrancode.l @@ -140,7 +140,7 @@ static int g_yyLineNr; //!< current line number static int g_contLineNr; //!< current, local, line number for continuation determination static int *g_hasContLine = NULL; //!< signals whether or not a line has a continuation line (fixed source form) static bool g_needsTermination; -static Definition *g_searchCtx; +static const Definition *g_searchCtx; static bool g_collectXRefs; static bool g_isFixedForm; @@ -452,16 +452,16 @@ static bool getFortranDefs(const QCString &memberName, const QCString &moduleNam MemberNameIterator mli(*mn); for (mli.toFirst();(md=mli.current());++mli) // all found functions with given name { - FileDef *fd=md->getFileDef(); - GroupDef *gd=md->getGroupDef(); - ClassDef *cd=md->getClassDef(); + const FileDef *fd=md->getFileDef(); + const GroupDef *gd=md->getGroupDef(); + const ClassDef *cd=md->getClassDef(); //cout << "found link with same name: " << fd->fileName() << " " << memberName; //if (md->getNamespaceDef() != 0) cout << " in namespace " << md->getNamespaceDef()->name();cout << endl; if ((gd && gd->isLinkable()) || (fd && fd->isLinkable())) { - NamespaceDef *nspace= md->getNamespaceDef(); + const NamespaceDef *nspace= md->getNamespaceDef(); if (nspace == 0) { // found function in global scope @@ -532,8 +532,8 @@ static bool getLink(UseSDict *usedict, // dictonary with used modules if (md->isVariable() && (md->getLanguage()!=SrcLangExt_Fortran)) return FALSE; // Non Fortran variables aren't handled yet, // see also linkifyText in util.cpp - Definition *d = md->getOuterScope()==Doxygen::globalScope ? - md->getBodyDef() : md->getOuterScope(); + const Definition *d = md->getOuterScope()==Doxygen::globalScope ? + md->getBodyDef() : md->getOuterScope(); if (md->getGroupDef()) d = md->getGroupDef(); if (d && d->isLinkable()) { @@ -1313,18 +1313,14 @@ static void checkContLines(const char *s) g_hasContLine[0] = 0; } -void parseFortranCode(CodeOutputInterface &od,const char *className,const QCString &s, +void parseFortranCode(CodeOutputInterface &od,const char *,const QCString &s, bool exBlock, const char *exName,FileDef *fd, int startLine,int endLine,bool inlineFragment, - MemberDef *memberDef,bool,Definition *searchCtx, + const MemberDef *,bool,const Definition *searchCtx, bool collectXRefs, FortranFormat format) { //printf("***parseCode() exBlock=%d exName=%s fd=%p\n",exBlock,exName,fd); - // used parameters - (void)memberDef; - (void)className; - if (s.isEmpty()) return; printlex(yy_flex_debug, TRUE, __FILE__, fd ? fd->fileName().data(): NULL); g_code = &od; diff --git a/src/fortranscanner.h b/src/fortranscanner.h index bc8071b..15a9bf0 100644 --- a/src/fortranscanner.h +++ b/src/fortranscanner.h @@ -47,9 +47,9 @@ class FortranLanguageScanner : public ParserInterface int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, - MemberDef *memberDef=0, + const MemberDef *memberDef=0, bool showLineNumbers=TRUE, - Definition *searchCtx=0, + const Definition *searchCtx=0, bool collectXRefs=TRUE ); void resetCodeParserState(); diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 7d7437d..47da514 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -2770,9 +2770,9 @@ void FortranLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf, int startLine, int endLine, bool inlineFragment, - MemberDef *memberDef, + const MemberDef *memberDef, bool showLineNumbers, - Definition *searchCtx, + const Definition *searchCtx, bool collectXRefs ) { diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp index d66a935..149f43c 100644 --- a/src/ftvhelp.cpp +++ b/src/ftvhelp.cpp @@ -46,7 +46,7 @@ static int folderId=1; struct FTVNode { FTVNode(bool dir,const char *r,const char *f,const char *a, - const char *n,bool sepIndex,bool navIndex,Definition *df) + const char *n,bool sepIndex,bool navIndex,const Definition *df) : isLast(TRUE), isDir(dir),ref(r),file(f),anchor(a),name(n), index(0), parent(0), separateIndex(sepIndex), addToNavIndex(navIndex), def(df) { children.setAutoDelete(TRUE); } @@ -63,7 +63,7 @@ struct FTVNode FTVNode *parent; bool separateIndex; bool addToNavIndex; - Definition *def; + const Definition *def; }; int FTVNode::computeTreeDepth(int level) const @@ -187,7 +187,7 @@ void FTVHelp::addContentsItem(bool isDir, const char *anchor, bool separateIndex, bool addToNavIndex, - Definition *def + const Definition *def ) { //printf("%p: m_indent=%d addContentsItem(%s,%s,%s,%s)\n",this,m_indent,name,ref,file,anchor); @@ -207,7 +207,7 @@ void FTVHelp::addContentsItem(bool isDir, } -static QCString node2URL(FTVNode *n,bool overruleFile=FALSE,bool srcLink=FALSE) +static QCString node2URL(const FTVNode *n,bool overruleFile=FALSE,bool srcLink=FALSE) { QCString url = n->file; if (!url.isEmpty() && url.at(0)=='!') // relative URL @@ -223,7 +223,7 @@ static QCString node2URL(FTVNode *n,bool overruleFile=FALSE,bool srcLink=FALSE) { if (overruleFile && n->def && n->def->definitionType()==Definition::TypeFile) { - FileDef *fd = dynamic_cast<FileDef*>(n->def); + const FileDef *fd = dynamic_cast<const FileDef*>(n->def); if (srcLink) { url = fd->getSourceFileBase(); @@ -315,7 +315,7 @@ void FTVHelp::generateLink(FTextStream &t,FTVNode *n) } } -static void generateBriefDoc(FTextStream &t,Definition *def) +static void generateBriefDoc(FTextStream &t,const Definition *def) { QCString brief = def->briefDescription(TRUE); //printf("*** %p: generateBriefDoc(%s)='%s'\n",def,def->name().data(),brief.data()); @@ -332,7 +332,7 @@ static void generateBriefDoc(FTextStream &t,Definition *def) } } -static char compoundIcon(ClassDef *cd) +static char compoundIcon(const ClassDef *cd) { char icon='C'; if (cd->getLanguage() == SrcLangExt_Slice) @@ -392,7 +392,7 @@ void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,in } else if (n->def && n->def->definitionType()==Definition::TypeClass) { - char icon=compoundIcon(dynamic_cast<ClassDef*>(n->def)); + char icon=compoundIcon(dynamic_cast<const ClassDef*>(n->def)); t << "<span class=\"icona\"><span class=\"icon\">" << icon << "</span></span>"; } else @@ -415,11 +415,11 @@ void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,in } else // leaf node { - FileDef *srcRef=0; + const FileDef *srcRef=0; if (n->def && n->def->definitionType()==Definition::TypeFile && - (dynamic_cast<FileDef*>(n->def))->generateSourceFile()) + (dynamic_cast<const FileDef*>(n->def))->generateSourceFile()) { - srcRef = dynamic_cast<FileDef*>(n->def); + srcRef = dynamic_cast<const FileDef*>(n->def); } if (srcRef) { @@ -448,7 +448,7 @@ void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,in } else if (n->def && n->def->definitionType()==Definition::TypeClass) { - char icon=compoundIcon(dynamic_cast<ClassDef*>(n->def)); + char icon=compoundIcon(dynamic_cast<const ClassDef*>(n->def)); t << "<span class=\"icona\"><span class=\"icon\">" << icon << "</span></span>"; } else @@ -492,7 +492,7 @@ class NavIndexEntryList : public QList<NavIndexEntry> } }; -static QCString pathToNode(FTVNode *leaf,FTVNode *n) +static QCString pathToNode(const FTVNode *leaf,const FTVNode *n) { QCString result; if (n->parent) @@ -511,7 +511,7 @@ static bool dupOfParent(const FTVNode *n) return FALSE; } -static void generateJSLink(FTextStream &t,FTVNode *n) +static void generateJSLink(FTextStream &t,const FTVNode *n) { if (n->file.isEmpty()) // no link { @@ -542,7 +542,7 @@ static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t, indentStr.fill(' ',level*2); bool found=FALSE; QListIterator<FTVNode> nli(nl); - FTVNode *n; + const FTVNode *n; for (nli.toFirst();(n=nli.current());++nli) { // terminate previous entry @@ -560,7 +560,7 @@ static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t, { if (n->def && n->def->definitionType()==Definition::TypeFile) { - FileDef *fd = dynamic_cast<FileDef*>(n->def); + const FileDef *fd = dynamic_cast<const FileDef*>(n->def); bool doc,src; doc = fileVisibleInIndex(fd,src); if (doc) diff --git a/src/ftvhelp.h b/src/ftvhelp.h index eac0367..4c3f986 100644 --- a/src/ftvhelp.h +++ b/src/ftvhelp.h @@ -50,8 +50,8 @@ class FTVHelp : public IndexIntf const char *anchor, bool separateIndex, bool addToNavIndex, - Definition *def); - void addIndexItem(Definition *,MemberDef *,const char *,const char *) {} + const Definition *def); + void addIndexItem(const Definition *,const MemberDef *,const char *,const char *) {} void addIndexFile(const char *) {} void addImageFile(const char *) {} void addStyleSheetFile(const char *) {} diff --git a/src/groupdef.cpp b/src/groupdef.cpp index 31eb7fe..e151f5a 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -69,13 +69,14 @@ class GroupDefImpl : public DefinitionImpl, public GroupDef virtual bool findGroup(const GroupDef *def) const; // true if def is a subgroup of this group virtual void writeDocumentation(OutputList &ol); virtual void writeMemberPages(OutputList &ol); - virtual void writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const; + virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const; virtual void writeTagFile(FTextStream &); - virtual int countMembers() const; + virtual int numDocMembers() const; virtual bool isLinkableInProject() const; virtual bool isLinkable() const; virtual bool isASubGroup() const; virtual void computeAnchors(); + virtual void countMembers(); virtual void addMembersToMemberGroup(); virtual void distributeMemberGroupDocumentation(); @@ -127,7 +128,7 @@ class GroupDefImpl : public DefinitionImpl, public GroupDef void startMemberDocumentation(OutputList &ol); void endMemberDocumentation(OutputList &ol); void writeAuthorSection(OutputList &ol); - void writeSummaryLinks(OutputList &ol); + void writeSummaryLinks(OutputList &ol) const; void updateLanguage(const Definition *); QCString title; // title of the group @@ -662,7 +663,28 @@ bool GroupDefImpl::isASubGroup() const return groups!=0 && groups->count()!=0; } -int GroupDefImpl::countMembers() const +void GroupDefImpl::countMembers() +{ + QListIterator<MemberList> mli(m_memberLists); + MemberList *ml; + for (;(ml=mli.current());++mli) + { + ml->countDecMembers(); + ml->countDocMembers(); + } + if (memberGroupSDict) + { + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->countDecMembers(); + mg->countDocMembers(); + } + } +} + +int GroupDefImpl::numDocMembers() const { return fileList->count()+ classSDict->count()+ @@ -830,7 +852,7 @@ void GroupDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title ) { ol.pushGeneratorState(); - if (pageDict->count()!=countMembers()) // not only pages -> classical layout + if (pageDict->count()!=numDocMembers()) // not only pages -> classical layout { ol.pushGeneratorState(); ol.disable(OutputGenerator::Html); @@ -1154,7 +1176,7 @@ void GroupDefImpl::writeAuthorSection(OutputList &ol) ol.popGeneratorState(); } -void GroupDefImpl::writeSummaryLinks(OutputList &ol) +void GroupDefImpl::writeSummaryLinks(OutputList &ol) const { ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); @@ -1394,7 +1416,7 @@ void GroupDefImpl::writeMemberPages(OutputList &ol) ol.popGeneratorState(); } -void GroupDefImpl::writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const +void GroupDefImpl::writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const { static bool createSubDirs=Config_getBool(CREATE_SUBDIRS); @@ -1557,7 +1579,7 @@ void addMemberToGroups(Entry *root,MemberDef *md) // put member into group defined by this entry? if (fgd) { - GroupDef *mgd = md->getGroupDef(); + GroupDef *mgd = const_cast<GroupDef*>(md->getGroupDef()); //printf("mgd=%p\n",mgd); bool insertit = FALSE; if (mgd==0) diff --git a/src/groupdef.h b/src/groupdef.h index 2649de7..92d524f 100644 --- a/src/groupdef.h +++ b/src/groupdef.h @@ -66,13 +66,14 @@ class GroupDef : virtual public Definition virtual bool findGroup(const GroupDef *def) const = 0; virtual void writeDocumentation(OutputList &ol) = 0; virtual void writeMemberPages(OutputList &ol) = 0; - virtual void writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const = 0; + virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const = 0; virtual void writeTagFile(FTextStream &) = 0; - virtual int countMembers() const = 0; + virtual int numDocMembers() const = 0; virtual bool isLinkableInProject() const = 0; virtual bool isLinkable() const = 0; virtual bool isASubGroup() const = 0; virtual void computeAnchors() = 0; + virtual void countMembers() = 0; virtual void addMembersToMemberGroup() = 0; virtual void distributeMemberGroupDocumentation() = 0; diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index 37f6bd0..212de0a 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -270,7 +270,7 @@ static QCString htmlAttribsToString(const HtmlAttribList &attribs, QCString *pAl //------------------------------------------------------------------------- HtmlDocVisitor::HtmlDocVisitor(FTextStream &t,CodeOutputInterface &ci, - Definition *ctx) + const Definition *ctx) : DocVisitor(DocVisitor_Html), m_t(t), m_ci(ci), m_insidePre(FALSE), m_hide(FALSE), m_ctx(ctx) { diff --git a/src/htmldocvisitor.h b/src/htmldocvisitor.h index 7184f0f..1c08c03 100644 --- a/src/htmldocvisitor.h +++ b/src/htmldocvisitor.h @@ -33,7 +33,7 @@ class CodeOutputInterface; class HtmlDocVisitor : public DocVisitor { public: - HtmlDocVisitor(FTextStream &t,CodeOutputInterface &ci,Definition *ctx); + HtmlDocVisitor(FTextStream &t,CodeOutputInterface &ci,const Definition *ctx); //-------------------------------------- // visitor functions for leaf nodes @@ -171,7 +171,7 @@ class HtmlDocVisitor : public DocVisitor bool m_insidePre; bool m_hide; QStack<bool> m_enabled; - Definition *m_ctx; + const Definition *m_ctx; QCString m_langExt; }; diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index d89bb49..0067fa1 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -1994,7 +1994,7 @@ void HtmlGenerator::endParamList() t << "</dl>"; } -void HtmlGenerator::writeDoc(DocNode *n,Definition *ctx,MemberDef *) +void HtmlGenerator::writeDoc(DocNode *n,const Definition *ctx,const MemberDef *) { HtmlDocVisitor *visitor = new HtmlDocVisitor(t,m_codeGen,ctx); n->accept(visitor); @@ -2819,7 +2819,7 @@ void HtmlGenerator::endMemberDeclaration(const char *anchor,const char *inheritI t << "\"><td class=\"memSeparator\" colspan=\"2\"> </td></tr>\n"; } -void HtmlGenerator::setCurrentDoc(Definition *context,const char *anchor,bool isSourceFile) +void HtmlGenerator::setCurrentDoc(const Definition *context,const char *anchor,bool isSourceFile) { if (Doxygen::searchIndex) { diff --git a/src/htmlgen.h b/src/htmlgen.h index 221269f..4bf975d 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -52,7 +52,7 @@ class HtmlCodeGenerator : public CodeOutputInterface void startFontClass(const char *s); void endFontClass(); void writeCodeAnchor(const char *anchor); - void setCurrentDoc(Definition *,const char *,bool) {} + void setCurrentDoc(const Definition *,const char *,bool) {} void addWord(const char *,bool) {} private: @@ -119,9 +119,9 @@ class HtmlGenerator : public OutputGenerator { m_codeGen.writeCodeAnchor(anchor); } // --------------------------- - void setCurrentDoc(Definition *context,const char *anchor,bool isSourceFile); + void setCurrentDoc(const Definition *context,const char *anchor,bool isSourceFile); void addWord(const char *word,bool hiPriority); - void writeDoc(DocNode *,Definition *,MemberDef *); + void writeDoc(DocNode *,const Definition *,const MemberDef *); void startFile(const char *name,const char *manName,const char *title); void writeFooter(const char *navPath); diff --git a/src/htmlhelp.cpp b/src/htmlhelp.cpp index 3ed3d64..20cb6ca 100644 --- a/src/htmlhelp.cpp +++ b/src/htmlhelp.cpp @@ -632,7 +632,7 @@ void HtmlHelp::addContentsItem(bool isDir, const char *anchor, bool /* separateIndex */, bool /* addToNavIndex */, - Definition * /* def */) + const Definition * /* def */) { // If we're using a binary toc then folders cannot have links. // Tried this and I didn't see any problems, when not using @@ -677,7 +677,7 @@ void HtmlHelp::addContentsItem(bool isDir, } -void HtmlHelp::addIndexItem(Definition *context,MemberDef *md, +void HtmlHelp::addIndexItem(const Definition *context,const MemberDef *md, const char *sectionAnchor,const char *word) { if (md) diff --git a/src/htmlhelp.h b/src/htmlhelp.h index 9c3fa04..184b929 100644 --- a/src/htmlhelp.h +++ b/src/htmlhelp.h @@ -78,8 +78,8 @@ class HtmlHelp : public IndexIntf const char *anchor, bool separateIndex, bool addToNavIndex, - Definition *def); - void addIndexItem(Definition *context,MemberDef *md, + const Definition *def); + void addIndexItem(const Definition *context,const MemberDef *md, const char *sectionAnchor, const char *title); void addIndexFile(const char *name); void addImageFile(const char *); diff --git a/src/index.cpp b/src/index.cpp index b401a0a..744976d 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -146,7 +146,7 @@ static void endIndexHierarchy(OutputList &ol,int level) class MemberIndexList : public QList<MemberDef> { public: - typedef MemberDef ElementType; + typedef const MemberDef ElementType; MemberIndexList(uint letter) : QList<MemberDef>(), m_letter(letter) {} ~MemberIndexList() {} int compareValues(const MemberDef *md1, const MemberDef *md2) const @@ -252,7 +252,7 @@ QCString fixSpaces(const QCString &s) return substitute(s," "," "); } -void startTitle(OutputList &ol,const char *fileName,Definition *def) +void startTitle(OutputList &ol,const char *fileName,const Definition *def) { ol.startHeaderSection(); if (def) def->writeSummaryLinks(ol); @@ -309,7 +309,7 @@ void endFile(OutputList &ol,bool skipNavIndex,bool skipEndContents, TooltipManager::instance()->clearTooltips(); // Only clear after the last is written } -void endFileWithNavPath(Definition *d,OutputList &ol) +void endFileWithNavPath(const Definition *d,OutputList &ol) { static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW); QCString navPath; @@ -365,7 +365,7 @@ void addMembersToIndex(T *def,LayoutDocManager::LayoutPart part, MemberDef *md; for (mi.toFirst();(md=mi.current());++mi) { - MemberList *enumList = md->enumFieldList(); + const MemberList *enumList = md->enumFieldList(); bool isDir = enumList!=0 && md->isEnumerate(); bool isAnonymous = md->name().find('@')!=-1; static bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS); @@ -1649,14 +1649,14 @@ void writeClassTree(ClassSDict *clDict,FTVHelp *ftv,bool addToIndex,bool globalO } } -static void writeNamespaceTree(NamespaceSDict *nsDict,FTVHelp *ftv, +static void writeNamespaceTree(const NamespaceSDict *nsDict,FTVHelp *ftv, bool rootOnly,bool showClasses,bool addToIndex,ClassDef::CompoundType ct) { static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE); if (nsDict) { NamespaceSDict::Iterator nli(*nsDict); - NamespaceDef *nd; + const NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) { if (nd->localName().find('@')==-1 && @@ -1985,7 +1985,7 @@ static QCString letterToLabel(uint startLetter) class PrefixIgnoreClassList : public ClassList { public: - typedef ClassDef ElementType; + typedef const ClassDef ElementType; PrefixIgnoreClassList(uint letter) : m_letter(letter) {} uint letter() const { return m_letter; } private: @@ -2071,7 +2071,7 @@ static void writeAlphabeticalClassList(OutputList &ol, ClassDef::CompoundType ct // first count the number of headers ClassSDict::Iterator cli(*Doxygen::classSDict); - ClassDef *cd; + const ClassDef *cd; uint startLetter=0; int headerItems=0; for (;(cd=cli.current());++cli) @@ -2748,7 +2748,7 @@ static void writeAnnotatedExceptionIndex(OutputList &ol) static void writeClassLinkForMember(OutputList &ol,MemberDef *md,const char *separator, QCString &prevClassName) { - ClassDef *cd=md->getClassDef(); + const ClassDef *cd=md->getClassDef(); if ( cd && prevClassName!=cd->displayName()) { ol.docify(separator); @@ -2762,7 +2762,7 @@ static void writeClassLinkForMember(OutputList &ol,MemberDef *md,const char *sep static void writeFileLinkForMember(OutputList &ol,MemberDef *md,const char *separator, QCString &prevFileName) { - FileDef *fd=md->getFileDef(); + const FileDef *fd=md->getFileDef(); if (fd && prevFileName!=fd->name()) { ol.docify(separator); @@ -2776,7 +2776,7 @@ static void writeFileLinkForMember(OutputList &ol,MemberDef *md,const char *sepa static void writeNamespaceLinkForMember(OutputList &ol,MemberDef *md,const char *separator, QCString &prevNamespaceName) { - NamespaceDef *nd=md->getNamespaceDef(); + const NamespaceDef *nd=md->getNamespaceDef(); if (nd && prevNamespaceName!=nd->displayName()) { ol.docify(separator); @@ -2898,9 +2898,7 @@ void initClassMemberIndices() void addClassMemberNameToIndex(MemberDef *md) { static bool hideFriendCompounds = Config_getBool(HIDE_FRIEND_COMPOUNDS); - ClassDef *cd=0; - - + const ClassDef *cd=0; if (md->isLinkableInProject() && (cd=md->getClassDef()) && @@ -2982,7 +2980,7 @@ void initNamespaceMemberIndices() void addNamespaceMemberNameToIndex(MemberDef *md) { - NamespaceDef *nd=md->getNamespaceDef(); + const NamespaceDef *nd=md->getNamespaceDef(); if (nd && nd->isLinkableInProject() && md->isLinkableInProject()) { QCString n = md->name(); @@ -3049,7 +3047,7 @@ void initFileMemberIndices() void addFileMemberNameToIndex(MemberDef *md) { - FileDef *fd=md->getFileDef(); + const FileDef *fd=md->getFileDef(); if (fd && fd->isLinkableInProject() && md->isLinkableInProject()) { QCString n = md->name(); @@ -4052,7 +4050,7 @@ static void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* MemberDef *md; for (mi.toFirst();(md=mi.current());++mi) { - MemberList *enumList = md->enumFieldList(); + const MemberList *enumList = md->enumFieldList(); bool isDir = enumList!=0 && md->isEnumerate(); if (md->isVisible() && md->name().find('@')==-1) { diff --git a/src/index.h b/src/index.h index f3e0241..c6baba5 100644 --- a/src/index.h +++ b/src/index.h @@ -37,8 +37,8 @@ class IndexIntf virtual void decContentsDepth() = 0; virtual void addContentsItem(bool isDir, const char *name, const char *ref, const char *file, const char *anchor, bool separateIndex, - bool addToNavIndex,Definition *def) = 0; - virtual void addIndexItem(Definition *context,MemberDef *md, + bool addToNavIndex,const Definition *def) = 0; + virtual void addIndexItem(const Definition *context,const MemberDef *md, const char *sectionAnchor,const char *title) = 0; virtual void addIndexFile(const char *name) = 0; virtual void addImageFile(const char *name) = 0; @@ -136,11 +136,11 @@ class IndexList : public IndexIntf { if (m_enabled) foreach(&IndexIntf::decContentsDepth); } void addContentsItem(bool isDir, const char *name, const char *ref, const char *file, const char *anchor,bool separateIndex=FALSE,bool addToNavIndex=FALSE, - Definition *def=0) - { if (m_enabled) foreach<bool,const char *,const char *,const char *,const char*,bool,bool,Definition *> + const Definition *def=0) + { if (m_enabled) foreach<bool,const char *,const char *,const char *,const char*,bool,bool,const Definition *> (&IndexIntf::addContentsItem,isDir,name,ref,file,anchor,separateIndex,addToNavIndex,def); } - void addIndexItem(Definition *context,MemberDef *md,const char *sectionAnchor=0,const char *title=0) - { if (m_enabled) foreach<Definition *,MemberDef *,const char *,const char *> + void addIndexItem(const Definition *context,const MemberDef *md,const char *sectionAnchor=0,const char *title=0) + { if (m_enabled) foreach<const Definition *,const MemberDef *,const char *,const char *> (&IndexIntf::addIndexItem,context,md,sectionAnchor,title); } void addIndexFile(const char *name) { if (m_enabled) foreach<const char *>(&IndexIntf::addIndexFile,name); } @@ -289,14 +289,14 @@ extern int documentedDirs; extern int documentedHtmlFiles; extern int documentedPages; -void startTitle(OutputList &ol,const char *fileName,Definition *def=0); +void startTitle(OutputList &ol,const char *fileName,const Definition *def=0); void endTitle(OutputList &ol,const char *fileName,const char *name); void startFile(OutputList &ol,const char *name,const char *manName, const char *title,HighlightedItem hli=HLI_None, bool additionalIndices=FALSE,const char *altSidebarName=0); void endFile(OutputList &ol,bool skipNavIndex=FALSE,bool skipEndContents=FALSE, const QCString &navPath=QCString()); -void endFileWithNavPath(Definition *d,OutputList &ol); +void endFileWithNavPath(const Definition *d,OutputList &ol); void initClassMemberIndices(); void initFileMemberIndices(); diff --git a/src/latexgen.cpp b/src/latexgen.cpp index de20e15..ad983a2 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -2175,7 +2175,7 @@ void LatexGenerator::exceptionEntry(const char* prefix,bool closeBracket) t << " "; } -void LatexGenerator::writeDoc(DocNode *n,Definition *ctx,MemberDef *) +void LatexGenerator::writeDoc(DocNode *n,const Definition *ctx,const MemberDef *) { LatexDocVisitor *visitor = new LatexDocVisitor(t,*this,ctx?ctx->getDefFileExtension():QCString(""),insideTabbing); diff --git a/src/latexgen.h b/src/latexgen.h index 1460000..b06a382 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -49,7 +49,7 @@ class LatexCodeGenerator : public CodeOutputInterface void startFontClass(const char *); void endFontClass(); void writeCodeAnchor(const char *) {} - void setCurrentDoc(Definition *,const char *,bool) {} + void setCurrentDoc(const Definition *,const char *,bool) {} void addWord(const char *,bool) {} static void setDoxyCodeOpen(bool val); @@ -116,7 +116,7 @@ class LatexGenerator : public OutputGenerator // --------------------------- - void writeDoc(DocNode *,Definition *ctx,MemberDef *); + void writeDoc(DocNode *,const Definition *ctx,const MemberDef *); void startFile(const char *name,const char *manName,const char *title); void writeSearchInfo() {} @@ -321,7 +321,7 @@ class LatexGenerator : public OutputGenerator void writeLabel(const char *l,bool isLast); void endLabels(); - void setCurrentDoc(Definition *,const char *,bool) {} + void setCurrentDoc(const Definition *,const char *,bool) {} void addWord(const char *,bool) {} diff --git a/src/layout.cpp b/src/layout.cpp index 393e05d..a5df6f4 100644 --- a/src/layout.cpp +++ b/src/layout.cpp @@ -106,7 +106,7 @@ QCString LayoutNavEntry::url() const } else if (url.left(5)=="@ref " || url.left(5)=="\\ref ") { - Definition *d; + const Definition *d = 0; QCString anchor; bool found=FALSE; if (resolveLink(0,url.mid(5).stripWhiteSpace(),TRUE,&d,anchor)) diff --git a/src/mangen.cpp b/src/mangen.cpp index b3ae732..06d3c4a 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -706,7 +706,7 @@ void ManGenerator::endParamList() { } -void ManGenerator::writeDoc(DocNode *n,Definition *ctx,MemberDef *) +void ManGenerator::writeDoc(DocNode *n,const Definition *ctx,const MemberDef *) { ManDocVisitor *visitor = new ManDocVisitor(t,*this,ctx?ctx->getDefFileExtension():QCString("")); n->accept(visitor); diff --git a/src/mangen.h b/src/mangen.h index e109355..959a34c 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -41,7 +41,7 @@ class ManGenerator : public OutputGenerator bool isEnabled(OutputType o) { return (o==Man && active); } OutputGenerator *get(OutputType o) { return (o==Man) ? this : 0; } - void writeDoc(DocNode *,Definition *,MemberDef *); + void writeDoc(DocNode *,const Definition *,const MemberDef *); static void init(); void startFile(const char *name,const char *manName,const char *title); @@ -260,7 +260,7 @@ class ManGenerator : public OutputGenerator void endLabels(); void writeCodeAnchor(const char *) {} - void setCurrentDoc(Definition *,const char *,bool) {} + void setCurrentDoc(const Definition *,const char *,bool) {} void addWord(const char *,bool) {} private: diff --git a/src/markdown.cpp b/src/markdown.cpp index dea2476..6b5a894 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -2629,9 +2629,9 @@ void MarkdownFileParser::parseCode(CodeOutputInterface &codeOutIntf, int startLine, int endLine, bool inlineFragment, - MemberDef *memberDef, + const MemberDef *memberDef, bool showLineNumbers, - Definition *searchCtx, + const Definition *searchCtx, bool collectXRefs ) { diff --git a/src/markdown.h b/src/markdown.h index e2e3a74..1a3895e 100644 --- a/src/markdown.h +++ b/src/markdown.h @@ -47,9 +47,9 @@ class MarkdownFileParser : public ParserInterface int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, - MemberDef *memberDef=0, + const MemberDef *memberDef=0, bool showLineNumbers=TRUE, - Definition *searchCtx=0, + const Definition *searchCtx=0, bool collectXRefs=TRUE ); void resetCodeParserState(); diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 995901a..a40441a 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -58,6 +58,8 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef virtual ~MemberDefImpl(); virtual DefType definitionType() const { return TypeMember; } + virtual MemberDef *resolveAlias() { return this; } + virtual const MemberDef *resolveAlias() const { return this; } virtual MemberDef *deepCopy() const; virtual void moveTo(Definition *); virtual QCString getOutputFileBase() const; @@ -73,15 +75,19 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef virtual const QCString &initializer() const; virtual int initializerLines() const; virtual uint64 getMemberSpecifiers() const; - virtual MemberList *getSectionList(Definition *d) const; + virtual const MemberList *getSectionList(const Definition *d) const; virtual QCString displayDefinition() const; - virtual ClassDef *getClassDef() const; - virtual FileDef *getFileDef() const; - virtual NamespaceDef* getNamespaceDef() const; + virtual const ClassDef *getClassDef() const; + virtual ClassDef *getClassDef(); + virtual const FileDef *getFileDef() const; + virtual FileDef *getFileDef(); + virtual const NamespaceDef* getNamespaceDef() const; + virtual NamespaceDef* getNamespaceDef(); + virtual const GroupDef *getGroupDef() const; + virtual GroupDef *getGroupDef(); virtual ClassDef *accessorClass() const; virtual const char *getReadAccessor() const; virtual const char *getWriteAccessor() const; - virtual GroupDef *getGroupDef() const; virtual Grouping::GroupPri_t getGroupPri() const; virtual const char *getGroupFileName() const; virtual int getGroupStartLine() const; @@ -141,7 +147,7 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef virtual bool isSealed() const; virtual bool isImplementation() const; virtual bool isExternal() const; - virtual bool isAlias() const; + virtual bool isTypeAlias() const; virtual bool isDefault() const; virtual bool isDelete() const; virtual bool isNoExcept() const; @@ -156,8 +162,6 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef virtual bool isMaybeAmbiguous() const; virtual bool isPublished() const; virtual bool isTemplateSpecialization() const; - virtual bool hasDocumentedParams() const; - virtual bool hasDocumentedReturnType() const; virtual bool isObjCMethod() const; virtual bool isObjCProperty() const; virtual bool isConstructor() const; @@ -184,16 +188,16 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef virtual bool isDocumentedFriendClass() const; virtual MemberDef *reimplements() const; virtual MemberList *reimplementedBy() const; - virtual bool isReimplementedBy(ClassDef *cd) const; + virtual bool isReimplementedBy(const ClassDef *cd) const; virtual ClassDef *relatedAlso() const; virtual bool hasDocumentedEnumValues() const; - virtual MemberDef *getAnonymousEnumType() const; + virtual const MemberDef *getAnonymousEnumType() const; virtual bool isDocsForDefinition() const; - virtual MemberDef *getEnumScope() const; - virtual MemberList *enumFieldList() const; + virtual const MemberDef *getEnumScope() const; + virtual const MemberList *enumFieldList() const; virtual void setEnumBaseType(const QCString &type); virtual QCString enumBaseType() const; - virtual bool hasExamples(); + virtual bool hasExamples() const; virtual ExampleSDict *getExamples() const; virtual bool isPrototype() const; virtual ArgumentList *argumentList() const; @@ -207,12 +211,12 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef virtual MemberDef *fromAnonymousMember() const; virtual bool hasCallGraph() const; virtual bool hasCallerGraph() const; - virtual bool visibleMemberGroup(bool hideNoHeader); + virtual bool visibleMemberGroup(bool hideNoHeader) const; virtual bool hasReferencesRelation() const; virtual bool hasReferencedByRelation() const; virtual MemberDef *templateMaster() const; virtual QCString getScopeString() const; - virtual ClassDef *getClassDefOfAnonymousType(); + virtual ClassDef *getClassDefOfAnonymousType() const; virtual bool isTypedefValCached() const; virtual ClassDef *getCachedTypedefVal() const; virtual QCString getCachedTypedefTemplSpec() const; @@ -225,7 +229,7 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef virtual MemberDef *categoryRelation() const; virtual QCString displayName(bool=TRUE) const; virtual QCString getDeclType() const; - virtual void getLabels(QStrList &sl,Definition *container) const; + virtual void getLabels(QStrList &sl,const Definition *container) const; virtual const ArgumentList *typeConstraints() const; virtual QCString documentation() const; virtual QCString briefDescription(bool abbr=FALSE) const; @@ -254,8 +258,6 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef virtual void setTemplateSpecialization(bool b); virtual void makeRelated(); virtual void makeForeign(); - virtual void setHasDocumentedParams(bool b); - virtual void setHasDocumentedReturnType(bool b); virtual void setInheritsDocsFrom(MemberDef *md); virtual void setTagInfo(TagInfo *i); virtual void setArgsString(const char *as); @@ -266,7 +268,7 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef virtual void setEnumScope(MemberDef *md,bool livesInsideEnum=FALSE); virtual void setEnumClassScope(ClassDef *cd); virtual void setDocumentedEnumValues(bool value); - virtual void setAnonymousEnumType(MemberDef *md); + virtual void setAnonymousEnumType(const MemberDef *md); virtual bool addExample(const char *anchor,const char *name,const char *file); virtual void setPrototype(bool p,const QCString &df,int line, int column); virtual void setExplicitExternal(bool b,const QCString &df,int line,int column); @@ -281,7 +283,7 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef virtual void setMemberGroup(MemberGroup *grp); virtual void setMemberGroupId(int id); virtual void makeImplementationDetail(); - virtual void setFromAnonymousScope(bool b); + virtual void setFromAnonymousScope(bool b) const; virtual void setFromAnonymousMember(MemberDef *m); virtual void enableCallGraph(bool e); virtual void enableCallerGraph(bool e); @@ -296,7 +298,7 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef virtual void invalidateCachedArgumentTypes(); virtual void setMemberDefinition(MemberDef *md); virtual void setMemberDeclaration(MemberDef *md); - virtual void setAnonymousUsed(); + virtual void setAnonymousUsed() const; virtual void copyArgumentNames(MemberDef *bmd); virtual void setCategory(ClassDef *); virtual void setCategoryRelation(MemberDef *); @@ -305,42 +307,43 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef virtual void setInbodyDocumentation(const char *d,const char *inbodyFile,int inbodyLine); virtual void setHidden(bool b); virtual void writeDeclaration(OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, - bool inGroup, ClassDef *inheritFrom=0,const char *inheritId=0); - virtual void writeDocumentation(MemberList *ml,int memCount,int memTotal,OutputList &ol, - const char *scopeName,Definition *container, + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd, + bool inGroup, const ClassDef *inheritFrom=0,const char *inheritId=0) const; + virtual void writeDocumentation(const MemberList *ml,int memCount,int memTotal,OutputList &ol, + const char *scopeName,const Definition *container, bool inGroup,bool showEnumValues=FALSE,bool - showInline=FALSE); - virtual void writeMemberDocSimple(OutputList &ol,Definition *container); + showInline=FALSE) const; + virtual void writeMemberDocSimple(OutputList &ol,const Definition *container) const; virtual void writeEnumDeclaration(OutputList &typeDecl, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd); - virtual void writeTagFile(FTextStream &); - virtual void warnIfUndocumented(); - virtual void warnIfUndocumentedParams(); + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd) const; + virtual void writeTagFile(FTextStream &) const; + virtual void warnIfUndocumented() const; + virtual void warnIfUndocumentedParams() const; + virtual void detectUndocumentedParams(bool hasParamCommand,bool hasReturnCommand) const; virtual MemberDef *createTemplateInstanceMember(ArgumentList *formalArgs, - ArgumentList *actualArgs); + ArgumentList *actualArgs) const; virtual void findSectionsInDocumentation(); virtual void writeLink(OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, - bool onlyText=FALSE); - virtual void addToSearchIndex(); + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd, + bool onlyText=FALSE) const; + virtual void addToSearchIndex() const; private: void _computeLinkableInProject(); void _computeIsConstructor(); void _computeIsDestructor(); - void _writeGroupInclude(OutputList &ol,bool inGroup); - void _writeCallGraph(OutputList &ol); - void _writeCallerGraph(OutputList &ol); - void _writeReimplements(OutputList &ol); - void _writeReimplementedBy(OutputList &ol); - void _writeExamples(OutputList &ol); - void _writeTypeConstraints(OutputList &ol); - void _writeEnumValues(OutputList &ol,Definition *container, + void _writeGroupInclude(OutputList &ol,bool inGroup) const; + void _writeCallGraph(OutputList &ol) const; + void _writeCallerGraph(OutputList &ol) const; + void _writeReimplements(OutputList &ol) const; + void _writeReimplementedBy(OutputList &ol) const; + void _writeExamples(OutputList &ol) const; + void _writeTypeConstraints(OutputList &ol) const; + void _writeEnumValues(OutputList &ol,const Definition *container, const QCString &cfname,const QCString &ciname, - const QCString &cname); - void _writeCategoryRelation(OutputList &ol); - void _writeTagData(const DefType); + const QCString &cname) const; + void _writeCategoryRelation(OutputList &ol) const; + void _writeTagData(const DefType) const; static int s_indentLevel; @@ -367,6 +370,483 @@ MemberDef *createMemberDef(const char *defFileName,int defLine,int defColumn, stat,related,t,tal,al,metaData); } +//----------------------------------------------------------------------------- + +class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef +{ + public: + MemberDefAliasImpl(const Definition *newScope,const MemberDef *md) + : DefinitionAliasImpl(newScope,md) {} + virtual ~MemberDefAliasImpl() {} + virtual DefType definitionType() const { return TypeMember; } + + const MemberDef *getMdAlias() const { return dynamic_cast<const MemberDef*>(getAlias()); } + virtual MemberDef *resolveAlias() { return const_cast<MemberDef*>(getMdAlias()); } + virtual const MemberDef *resolveAlias() const { return getMdAlias(); } + + virtual MemberDef *deepCopy() const { + return createMemberDefAlias(getScope(),getMdAlias()); + } + virtual void moveTo(Definition *) {} + + virtual QCString getOutputFileBase() const + { return getMdAlias()->getOutputFileBase(); } + virtual QCString getReference() const + { return getMdAlias()->getReference(); } + virtual QCString anchor() const + { return getMdAlias()->anchor(); } + virtual const char *declaration() const + { return getMdAlias()->declaration(); } + virtual const char *definition() const + { return getMdAlias()->definition(); } + virtual const char *typeString() const + { return getMdAlias()->typeString(); } + virtual const char *argsString() const + { return getMdAlias()->argsString(); } + virtual const char *excpString() const + { return getMdAlias()->excpString(); } + virtual const char *bitfieldString() const + { return getMdAlias()->bitfieldString(); } + virtual const char *extraTypeChars() const + { return getMdAlias()->extraTypeChars(); } + virtual const QCString &initializer() const + { return getMdAlias()->initializer(); } + virtual int initializerLines() const + { return getMdAlias()->initializerLines(); } + virtual uint64 getMemberSpecifiers() const + { return getMdAlias()->getMemberSpecifiers(); } + virtual const MemberList *getSectionList(const Definition *d) const + { return getMdAlias()->getSectionList(d); } + virtual QCString displayDefinition() const + { return getMdAlias()->displayDefinition(); } + virtual const ClassDef *getClassDef() const + { return getMdAlias()->getClassDef(); } + virtual const FileDef *getFileDef() const + { return getMdAlias()->getFileDef(); } + virtual const NamespaceDef* getNamespaceDef() const + { return getMdAlias()->getNamespaceDef(); } + virtual ClassDef *accessorClass() const + { return getMdAlias()->accessorClass(); } + virtual const char *getReadAccessor() const + { return getMdAlias()->getReadAccessor(); } + virtual const char *getWriteAccessor() const + { return getMdAlias()->getWriteAccessor(); } + virtual const GroupDef *getGroupDef() const + { return getMdAlias()->getGroupDef(); } + virtual Grouping::GroupPri_t getGroupPri() const + { return getMdAlias()->getGroupPri(); } + virtual const char *getGroupFileName() const + { return getMdAlias()->getGroupFileName(); } + virtual int getGroupStartLine() const + { return getMdAlias()->getGroupStartLine(); } + virtual bool getGroupHasDocs() const + { return getMdAlias()->getGroupHasDocs(); } + virtual QCString qualifiedName() const + { return getMdAlias()->qualifiedName(); } + virtual QCString objCMethodName(bool localLink,bool showStatic) const + { return getMdAlias()->objCMethodName(localLink,showStatic); } + virtual Protection protection() const + { return getMdAlias()->protection(); } + virtual Specifier virtualness(int count) const + { return getMdAlias()->virtualness(); } + virtual MemberType memberType() const + { return getMdAlias()->memberType(); } + virtual QCString memberTypeName() const + { return getMdAlias()->memberTypeName(); } + virtual bool isSignal() const + { return getMdAlias()->isSignal(); } + virtual bool isSlot() const + { return getMdAlias()->isSlot(); } + virtual bool isVariable() const + { return getMdAlias()->isVariable(); } + virtual bool isEnumerate() const + { return getMdAlias()->isEnumerate(); } + virtual bool isEnumValue() const + { return getMdAlias()->isEnumValue(); } + virtual bool isTypedef() const + { return getMdAlias()->isTypedef(); } + virtual bool isSequence() const + { return getMdAlias()->isSequence(); } + virtual bool isDictionary() const + { return getMdAlias()->isDictionary(); } + virtual bool isFunction() const + { return getMdAlias()->isFunction(); } + virtual bool isFunctionPtr() const + { return getMdAlias()->isFunctionPtr(); } + virtual bool isDefine() const + { return getMdAlias()->isDefine(); } + virtual bool isFriend() const + { return getMdAlias()->isFriend(); } + virtual bool isDCOP() const + { return getMdAlias()->isDCOP(); } + virtual bool isProperty() const + { return getMdAlias()->isProperty(); } + virtual bool isEvent() const + { return getMdAlias()->isEvent(); } + virtual bool isRelated() const + { return getMdAlias()->isRelated(); } + virtual bool isForeign() const + { return getMdAlias()->isForeign(); } + virtual bool isStatic() const + { return getMdAlias()->isStatic(); } + virtual bool isInline() const + { return getMdAlias()->isInline(); } + virtual bool isExplicit() const + { return getMdAlias()->isExplicit(); } + virtual bool isMutable() const + { return getMdAlias()->isMutable(); } + virtual bool isGettable() const + { return getMdAlias()->isGettable(); } + virtual bool isPrivateGettable() const + { return getMdAlias()->isPrivateGettable(); } + virtual bool isProtectedGettable() const + { return getMdAlias()->isProtectedGettable(); } + virtual bool isSettable() const + { return getMdAlias()->isSettable(); } + virtual bool isPrivateSettable() const + { return getMdAlias()->isPrivateSettable(); } + virtual bool isProtectedSettable() const + { return getMdAlias()->isProtectedSettable(); } + virtual bool isReadable() const + { return getMdAlias()->isReadable(); } + virtual bool isWritable() const + { return getMdAlias()->isWritable(); } + virtual bool isAddable() const + { return getMdAlias()->isAddable(); } + virtual bool isRemovable() const + { return getMdAlias()->isRemovable(); } + virtual bool isRaisable() const + { return getMdAlias()->isRaisable(); } + virtual bool isFinal() const + { return getMdAlias()->isFinal(); } + virtual bool isAbstract() const + { return getMdAlias()->isAbstract(); } + virtual bool isOverride() const + { return getMdAlias()->isOverride(); } + virtual bool isInitonly() const + { return getMdAlias()->isInitonly(); } + virtual bool isOptional() const + { return getMdAlias()->isOptional(); } + virtual bool isRequired() const + { return getMdAlias()->isRequired(); } + virtual bool isNonAtomic() const + { return getMdAlias()->isNonAtomic(); } + virtual bool isCopy() const + { return getMdAlias()->isCopy(); } + virtual bool isAssign() const + { return getMdAlias()->isAssign(); } + virtual bool isRetain() const + { return getMdAlias()->isRetain(); } + virtual bool isWeak() const + { return getMdAlias()->isWeak(); } + virtual bool isStrong() const + { return getMdAlias()->isStrong(); } + virtual bool isUnretained() const + { return getMdAlias()->isUnretained(); } + virtual bool isNew() const + { return getMdAlias()->isNew(); } + virtual bool isSealed() const + { return getMdAlias()->isSealed(); } + virtual bool isImplementation() const + { return getMdAlias()->isImplementation(); } + virtual bool isExternal() const + { return getMdAlias()->isExternal(); } + virtual bool isTypeAlias() const + { return getMdAlias()->isTypeAlias(); } + virtual bool isDefault() const + { return getMdAlias()->isDefault(); } + virtual bool isDelete() const + { return getMdAlias()->isDelete(); } + virtual bool isNoExcept() const + { return getMdAlias()->isNoExcept(); } + virtual bool isAttribute() const + { return getMdAlias()->isAttribute(); } + virtual bool isUNOProperty() const + { return getMdAlias()->isUNOProperty(); } + virtual bool isReadonly() const + { return getMdAlias()->isReadable(); } + virtual bool isBound() const + { return getMdAlias()->isBound(); } + virtual bool isConstrained() const + { return getMdAlias()->isConstrained(); } + virtual bool isTransient() const + { return getMdAlias()->isTransient(); } + virtual bool isMaybeVoid() const + { return getMdAlias()->isMaybeVoid(); } + virtual bool isMaybeDefault() const + { return getMdAlias()->isMaybeDefault(); } + virtual bool isMaybeAmbiguous() const + { return getMdAlias()->isMaybeAmbiguous(); } + virtual bool isPublished() const + { return getMdAlias()->isPublished(); } + virtual bool isTemplateSpecialization() const + { return getMdAlias()->isTemplateSpecialization(); } + virtual bool isObjCMethod() const + { return getMdAlias()->isObjCMethod(); } + virtual bool isObjCProperty() const + { return getMdAlias()->isObjCProperty(); } + virtual bool isConstructor() const + { return getMdAlias()->isConstructor(); } + virtual bool isDestructor() const + { return getMdAlias()->isDestructor(); } + virtual bool hasOneLineInitializer() const + { return getMdAlias()->hasOneLineInitializer(); } + virtual bool hasMultiLineInitializer() const + { return getMdAlias()->hasMultiLineInitializer(); } + virtual bool showInCallGraph() const + { return getMdAlias()->showInCallGraph(); } + virtual bool isStrongEnumValue() const + { return getMdAlias()->isStrongEnumValue(); } + virtual bool livesInsideEnum() const + { return getMdAlias()->livesInsideEnum(); } + virtual bool isSliceLocal() const + { return getMdAlias()->isSliceLocal(); } + virtual bool isConstExpr() const + { return getMdAlias()->isConstExpr(); } + virtual bool isFriendToHide() const + { return getMdAlias()->isFriendToHide(); } + virtual bool isNotFriend() const + { return getMdAlias()->isNotFriend(); } + virtual bool isFunctionOrSignalSlot() const + { return getMdAlias()->isFunctionOrSignalSlot(); } + virtual bool isRelatedOrFriend() const + { return getMdAlias()->isRelatedOrFriend(); } + virtual bool isLinkableInProject() const + { return getMdAlias()->isLinkableInProject(); } + virtual bool isLinkable() const + { return getMdAlias()->isLinkable(); } + virtual bool hasDocumentation() const + { return getMdAlias()->hasDocumentation(); } + virtual bool isDeleted() const + { return getMdAlias()->isDeleted(); } + virtual bool isBriefSectionVisible() const + { return getMdAlias()->isBriefSectionVisible(); } + virtual bool isDetailedSectionVisible(bool inGroup,bool inFile) const + { return getMdAlias()->isDetailedSectionVisible(inGroup,inFile); } + virtual bool isDetailedSectionLinkable() const + { return getMdAlias()->isDetailedSectionLinkable(); } + virtual bool isFriendClass() const + { return getMdAlias()->isFriendClass(); } + virtual bool isDocumentedFriendClass() const + { return getMdAlias()->isDocumentedFriendClass(); } + virtual MemberDef *reimplements() const + { return getMdAlias()->reimplements(); } + virtual MemberList *reimplementedBy() const + { return getMdAlias()->reimplementedBy(); } + virtual bool isReimplementedBy(const ClassDef *cd) const + { return getMdAlias()->isReimplementedBy(cd); } + virtual ClassDef *relatedAlso() const + { return getMdAlias()->relatedAlso(); } + virtual bool hasDocumentedEnumValues() const + { return getMdAlias()->hasDocumentedEnumValues(); } + virtual const MemberDef *getAnonymousEnumType() const + { return getMdAlias()->getAnonymousEnumType(); } + virtual bool isDocsForDefinition() const + { return getMdAlias()->isDocsForDefinition(); } + virtual const MemberDef *getEnumScope() const + { return getMdAlias()->getEnumScope(); } + virtual const MemberList *enumFieldList() const + { return getMdAlias()->enumFieldList(); } + virtual QCString enumBaseType() const + { return getMdAlias()->enumBaseType(); } + virtual bool hasExamples() const + { return getMdAlias()->hasExamples(); } + virtual ExampleSDict *getExamples() const + { return getMdAlias()->getExamples(); } + virtual bool isPrototype() const + { return getMdAlias()->isPrototype(); } + virtual ArgumentList *argumentList() const + { return getMdAlias()->argumentList(); } + virtual ArgumentList *declArgumentList() const + { return getMdAlias()->declArgumentList(); } + virtual ArgumentList *templateArguments() const + { return getMdAlias()->templateArguments(); } + virtual QList<ArgumentList> *definitionTemplateParameterLists() const + { return getMdAlias()->definitionTemplateParameterLists(); } + virtual int getMemberGroupId() const + { return getMdAlias()->getMemberGroupId(); } + virtual MemberGroup *getMemberGroup() const + { return getMdAlias()->getMemberGroup(); } + virtual bool fromAnonymousScope() const + { return getMdAlias()->fromAnonymousScope(); } + virtual bool anonymousDeclShown() const + { return getMdAlias()->anonymousDeclShown(); } + virtual MemberDef *fromAnonymousMember() const + { return getMdAlias()->fromAnonymousMember(); } + virtual bool hasCallGraph() const + { return getMdAlias()->hasCallGraph(); } + virtual bool hasCallerGraph() const + { return getMdAlias()->hasCallerGraph(); } + virtual bool visibleMemberGroup(bool hideNoHeader) const + { return getMdAlias()->visibleMemberGroup(hideNoHeader); } + virtual bool hasReferencesRelation() const + { return getMdAlias()->hasReferencesRelation(); } + virtual bool hasReferencedByRelation() const + { return getMdAlias()->hasReferencedByRelation(); } + virtual MemberDef *templateMaster() const + { return getMdAlias()->templateMaster(); } + virtual QCString getScopeString() const + { return getMdAlias()->getScopeString(); } + virtual ClassDef *getClassDefOfAnonymousType() const + { return getMdAlias()->getClassDefOfAnonymousType(); } + virtual bool isTypedefValCached() const + { return getMdAlias()->isTypedefValCached(); } + virtual ClassDef *getCachedTypedefVal() const + { return getMdAlias()->getCachedTypedefVal(); } + virtual QCString getCachedTypedefTemplSpec() const + { return getMdAlias()->getCachedTypedefTemplSpec(); } + virtual QCString getCachedResolvedTypedef() const + { return getMdAlias()->getCachedResolvedTypedef(); } + virtual MemberDef *memberDefinition() const + { return getMdAlias()->memberDefinition(); } + virtual MemberDef *memberDeclaration() const + { return getMdAlias()->memberDeclaration(); } + virtual MemberDef *inheritsDocsFrom() const + { return getMdAlias()->inheritsDocsFrom(); } + virtual MemberDef *getGroupAlias() const + { return getMdAlias()->getGroupAlias(); } + virtual ClassDef *category() const + { return getMdAlias()->category(); } + virtual MemberDef *categoryRelation() const + { return getMdAlias()->categoryRelation(); } + virtual QCString displayName(bool b=TRUE) const + { return getMdAlias()->displayName(b); } + virtual QCString getDeclType() const + { return getMdAlias()->getDeclType(); } + virtual void getLabels(QStrList &sl,const Definition *container) const + { return getMdAlias()->getLabels(sl,container); } + virtual const ArgumentList *typeConstraints() const + { return getMdAlias()->typeConstraints(); } + virtual QCString documentation() const + { return getMdAlias()->documentation(); } + virtual QCString briefDescription(bool abbr=FALSE) const + { return getMdAlias()->briefDescription(); } + virtual QCString fieldType() const + { return getMdAlias()->fieldType(); } + virtual bool isReference() const + { return getMdAlias()->isReference(); } + virtual QCString getDeclFileName() const + { return getMdAlias()->getDeclFileName(); } + virtual int getDeclLine() const + { return getMdAlias()->getDeclLine(); } + virtual int getDeclColumn() const + { return getMdAlias()->getDeclColumn(); } + + // non-const getters should not be called + virtual ClassDef *getClassDef() + { err("non-const getClassDef() called on aliased member. Please report as a bug."); return 0; } + virtual FileDef *getFileDef() + { err("non-const getFileDef() called on aliased member. Please report as a bug."); return 0; } + virtual NamespaceDef* getNamespaceDef() + { err("non-const getNamespaceDef() called on aliased member. Please report as a bug."); return 0; } + virtual GroupDef *getGroupDef() + { err("non-const getGroupDef() called on aliased member. Please report as a bug."); return 0; } + + virtual void setEnumBaseType(const QCString &type) {} + virtual void setMemberType(MemberType t) {} + virtual void setDefinition(const char *d) {} + virtual void setFileDef(FileDef *fd) {} + virtual void setAnchor() {} + virtual void setProtection(Protection p) {} + virtual void setMemberSpecifiers(uint64 s) {} + virtual void mergeMemberSpecifiers(uint64 s) {} + virtual void setInitializer(const char *i) {} + virtual void setBitfields(const char *s) {} + virtual void setMaxInitLines(int lines) {} + virtual void setMemberClass(ClassDef *cd) {} + virtual void setSectionList(Definition *d,MemberList *sl) {} + virtual void setGroupDef(GroupDef *gd,Grouping::GroupPri_t pri, + const QCString &fileName,int startLine,bool hasDocs, + MemberDef *member=0) {} + virtual void setReadAccessor(const char *r) {} + virtual void setWriteAccessor(const char *w) {} + virtual void setTemplateSpecialization(bool b) {} + virtual void makeRelated() {} + virtual void makeForeign() {} + virtual void setInheritsDocsFrom(MemberDef *md) {} + virtual void setTagInfo(TagInfo *i) {} + virtual void setArgsString(const char *as) {} + virtual void setReimplements(MemberDef *md) {} + virtual void insertReimplementedBy(MemberDef *md) {} + virtual void setRelatedAlso(ClassDef *cd) {} + virtual void insertEnumField(MemberDef *md) {} + virtual void setEnumScope(MemberDef *md,bool livesInsideEnum=FALSE) {} + virtual void setEnumClassScope(ClassDef *cd) {} + virtual void setDocumentedEnumValues(bool value) {} + virtual void setAnonymousEnumType(const MemberDef *md) {} + virtual bool addExample(const char *anchor,const char *name,const char *file) { return FALSE; } + virtual void setPrototype(bool p,const QCString &df,int line, int column) {} + virtual void setExplicitExternal(bool b,const QCString &df,int line,int column) {} + virtual void setDeclFile(const QCString &df,int line,int column) {} + virtual void setArgumentList(ArgumentList *al) {} + virtual void setDeclArgumentList(ArgumentList *al) {} + virtual void setDefinitionTemplateParameterLists(QList<ArgumentList> *lists) {} + virtual void setTypeConstraints(ArgumentList *al) {} + virtual void setType(const char *t) {} + virtual void setAccessorType(ClassDef *cd,const char *t) {} + virtual void setNamespace(NamespaceDef *nd) {} + virtual void setMemberGroup(MemberGroup *grp) {} + virtual void setMemberGroupId(int id) {} + virtual void makeImplementationDetail() {} + virtual void setFromAnonymousScope(bool b) const {} + virtual void setFromAnonymousMember(MemberDef *m) {} + virtual void enableCallGraph(bool e) {} + virtual void enableCallerGraph(bool e) {} + virtual void enableReferencedByRelation(bool e) {} + virtual void enableReferencesRelation(bool e) {} + virtual void setTemplateMaster(MemberDef *mt) {} + virtual void addListReference(Definition *d) {} + virtual void setDocsForDefinition(bool b) {} + virtual void setGroupAlias(MemberDef *md) {} + virtual void cacheTypedefVal(ClassDef *val,const QCString &templSpec,const QCString &resolvedType) {} + virtual void invalidateTypedefValCache() {} + virtual void invalidateCachedArgumentTypes() {} + virtual void setMemberDefinition(MemberDef *md) {} + virtual void setMemberDeclaration(MemberDef *md) {} + virtual void setAnonymousUsed() const {} + virtual void copyArgumentNames(MemberDef *bmd) {} + virtual void setCategory(ClassDef *) {} + virtual void setCategoryRelation(MemberDef *) {} + virtual void setDocumentation(const char *d,const char *docFile,int docLine,bool stripWhiteSpace=TRUE) {} + virtual void setBriefDescription(const char *b,const char *briefFile,int briefLine) {} + virtual void setInbodyDocumentation(const char *d,const char *inbodyFile,int inbodyLine) {} + virtual void setHidden(bool b) {} + virtual void addToSearchIndex() const {} + virtual void findSectionsInDocumentation() {} + virtual MemberDef *createTemplateInstanceMember(ArgumentList *formalArgs, + ArgumentList *actualArgs) const + { return getMdAlias()->createTemplateInstanceMember(formalArgs,actualArgs); } + + virtual void writeDeclaration(OutputList &ol, + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd, + bool inGroup, const ClassDef *inheritFrom=0,const char *inheritId=0) const + { + getMdAlias()->writeDeclaration(ol,cd,nd,fd,gd,inGroup,inheritFrom,inheritId); + } + virtual void writeEnumDeclaration(OutputList &typeDecl, + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd) const + { + getMdAlias()->writeEnumDeclaration(typeDecl,cd,nd,fd,gd); + } + virtual void writeDocumentation(const MemberList *ml,int memCount,int memTotal,OutputList &ol, + const char *scopeName,const Definition *container, + bool inGroup,bool showEnumValues=FALSE,bool + showInline=FALSE) const {} + virtual void writeMemberDocSimple(OutputList &ol,const Definition *container) const {} + virtual void writeLink(OutputList &ol, + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd, + bool onlyText=FALSE) const {} + virtual void writeTagFile(FTextStream &) const {} + virtual void warnIfUndocumented() const {} + virtual void warnIfUndocumentedParams() const {} + virtual void detectUndocumentedParams(bool hasParamCommand,bool hasReturnCommand) const {} +}; + + +MemberDef *createMemberDefAlias(const Definition *newScope,const MemberDef *aliasMd) +{ + return new MemberDefAliasImpl(newScope,aliasMd); +} //----------------------------------------------------------------------------- @@ -441,7 +921,7 @@ static QCString addTemplateNames(const QCString &s,const QCString &n,const QCStr // ol.endMemberDoc(hasArgs=FALSE); // -static bool writeDefArgumentList(OutputList &ol,Definition *scope,MemberDef *md) +static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const MemberDef *md) { ArgumentList *defArgList=(md->isDocsForDefinition()) ? md->argumentList() : md->declArgumentList(); @@ -517,9 +997,9 @@ static bool writeDefArgumentList(OutputList &ol,Definition *scope,MemberDef *md) cName=cName.mid(il,ir-il+1); //printf("1. cName=%s\n",cName.data()); } - else if (scope->definitionType()==Definition::TypeClass && (dynamic_cast<ClassDef*>(scope))->templateArguments()) + else if (scope->definitionType()==Definition::TypeClass && (dynamic_cast<const ClassDef*>(scope))->templateArguments()) { - cName=tempArgListToString((dynamic_cast<ClassDef*>(scope))->templateArguments(),scope->getLanguage()); + cName=tempArgListToString((dynamic_cast<const ClassDef*>(scope))->templateArguments(),scope->getLanguage()); //printf("2. cName=%s\n",cName.data()); } else // no template specifier @@ -712,7 +1192,7 @@ static bool writeDefArgumentList(OutputList &ol,Definition *scope,MemberDef *md) } static void writeExceptionListImpl( - OutputList &ol, ClassDef *cd, MemberDef *md, QCString const& exception) + OutputList &ol, const ClassDef *cd, const MemberDef *md, QCString const& exception) { // this is ordinary exception spec - there must be a '(' //printf("exception='%s'\n",exception.data()); @@ -750,7 +1230,7 @@ static void writeExceptionListImpl( } } -static void writeExceptionList(OutputList &ol, ClassDef *cd, MemberDef *md) +static void writeExceptionList(OutputList &ol, const ClassDef *cd, const MemberDef *md) { QCString exception(QCString(md->excpString()).stripWhiteSpace()); if ('{'==exception.at(0)) @@ -773,7 +1253,7 @@ static void writeExceptionList(OutputList &ol, ClassDef *cd, MemberDef *md) } } -static void writeTemplatePrefix(OutputList &ol,ArgumentList *al) +static void writeTemplatePrefix(OutputList &ol,const ArgumentList *al) { ol.docify("template<"); ArgumentListIterator ali(*al); @@ -816,7 +1296,7 @@ class MemberDefImpl::IMPL MemberDef *enumScope; // the enclosing scope, if this is an enum field bool livesInsideEnum; - MemberDef *annEnumType; // the anonymous enum that is the type of this member + const MemberDef *annEnumType; // the anonymous enum that is the type of this member MemberList *enumFields; // enumeration fields MemberDef *redefines; // the members that this member redefines @@ -898,15 +1378,17 @@ class MemberDefImpl::IMPL // objective-c bool implOnly; // function found in implementation but not // in the interface - bool hasDocumentedParams; - bool hasDocumentedReturnType; + mutable bool hasDocumentedParams; + mutable bool hasDocumentedReturnType; bool isDMember; Relationship related; // relationship of this to the 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 anonymous scope - bool annUsed; + + mutable bool annScope; // member is part of an anonymous scope + mutable bool annUsed; // ugly: needs to be mutable to allow setAnonymousUsed to act as a + // const member. bool hasCallGraph; bool hasCallerGraph; bool hasReferencedByRelation; @@ -1238,7 +1720,7 @@ MemberList *MemberDefImpl::reimplementedBy() const return m_impl->redefinedBy; } -bool MemberDefImpl::isReimplementedBy(ClassDef *cd) const +bool MemberDefImpl::isReimplementedBy(const ClassDef *cd) const { if (cd && m_impl->redefinedBy) { @@ -1246,7 +1728,7 @@ bool MemberDefImpl::isReimplementedBy(ClassDef *cd) const MemberDef *md; for (mi.toFirst();(md=mi.current());++mi) { - ClassDef *mcd = md->getClassDef(); + const ClassDef *mcd = md->getClassDef(); if (mcd) { if (cd==mcd || cd->isBaseClass(mcd,TRUE)) @@ -1283,7 +1765,7 @@ bool MemberDefImpl::addExample(const char *anchor,const char *nameStr, return FALSE; } -bool MemberDefImpl::hasExamples() +bool MemberDefImpl::hasExamples() const { if (m_impl->exampleSDict==0) return FALSE; @@ -1300,33 +1782,37 @@ QCString MemberDefImpl::getOutputFileBase() const //printf("Member: %s: templateMaster=%p group=%p classDef=%p nspace=%p fileDef=%p\n", // name().data(),m_impl->templateMaster,m_impl->group,m_impl->classDef, // m_impl->nspace,m_impl->fileDef); + const NamespaceDef *nspace = getNamespaceDef(); + const FileDef *fileDef = getFileDef(); + const ClassDef *classDef = getClassDef(); + const GroupDef *groupDef = getGroupDef(); if (!m_impl->explicitOutputFileBase.isEmpty()) { return m_impl->explicitOutputFileBase; } - else if (m_impl->templateMaster) + else if (templateMaster()) { - return m_impl->templateMaster->getOutputFileBase(); + return templateMaster()->getOutputFileBase(); } - else if (m_impl->group) + else if (groupDef) { - baseName=m_impl->group->getOutputFileBase(); + baseName=groupDef->getOutputFileBase(); } - else if (m_impl->classDef) + else if (classDef) { - baseName=m_impl->classDef->getOutputFileBase(); - if (inlineSimpleClasses && m_impl->classDef->isSimple()) + baseName=classDef->getOutputFileBase(); + if (inlineSimpleClasses && classDef->isSimple()) { return baseName; } } - else if (m_impl->nspace && m_impl->nspace->isLinkableInProject()) + else if (nspace && nspace->isLinkableInProject()) { - baseName=m_impl->nspace->getOutputFileBase(); + baseName=nspace->getOutputFileBase(); } - else if (m_impl->fileDef) + else if (fileDef) { - baseName=m_impl->fileDef->getOutputFileBase(); + baseName=fileDef->getOutputFileBase(); } if (baseName.isEmpty()) @@ -1358,25 +1844,29 @@ QCString MemberDefImpl::getReference() const { return ref; } - if (m_impl->templateMaster) + const NamespaceDef *nspace = getNamespaceDef(); + const FileDef *fileDef = getFileDef(); + const ClassDef *classDef = getClassDef(); + const GroupDef *groupDef = getGroupDef(); + if (templateMaster()) { - return m_impl->templateMaster->getReference(); + return templateMaster()->getReference(); } - else if (m_impl->group) + else if (groupDef) { - return m_impl->group->getReference(); + return groupDef->getReference(); } - else if (m_impl->classDef) + else if (classDef) { - return m_impl->classDef->getReference(); + return classDef->getReference(); } - else if (m_impl->nspace) + else if (nspace) { - return m_impl->nspace->getReference(); + return nspace->getReference(); } - else if (m_impl->fileDef) + else if (fileDef) { - return m_impl->fileDef->getReference(); + return fileDef->getReference(); } return ""; } @@ -1390,7 +1880,7 @@ QCString MemberDefImpl::anchor() const { result.prepend(m_impl->enumScope->anchor()); } - if (m_impl->group) + if (getGroupDef()) { if (m_impl->groupMember) { @@ -1416,10 +1906,10 @@ void MemberDefImpl::_computeLinkableInProject() m_isLinkableCached = 1; return; } - if (m_impl->templateMaster) + if (templateMaster()) { //printf("has template master\n"); - m_isLinkableCached = m_impl->templateMaster->isLinkableInProject() ? 2 : 1; + m_isLinkableCached = templateMaster()->isLinkableInProject() ? 2 : 1; return; } if (name().isEmpty() || name().at(0)=='@') @@ -1434,28 +1924,32 @@ void MemberDefImpl::_computeLinkableInProject() m_isLinkableCached = 1; // no documentation return; } - if (m_impl->group && !m_impl->group->isLinkableInProject()) + const GroupDef *groupDef = getGroupDef(); + const ClassDef *classDef = getClassDef(); + if (groupDef && !groupDef->isLinkableInProject()) { //printf("group but group not linkable!\n"); m_isLinkableCached = 1; // group but group not linkable return; } - if (!m_impl->group && m_impl->classDef && !m_impl->classDef->isLinkableInProject()) + if (!groupDef && classDef && !classDef->isLinkableInProject()) { //printf("in a class but class not linkable!\n"); m_isLinkableCached = 1; // in class but class not linkable return; } - if (!m_impl->group && m_impl->nspace && !m_impl->related && !m_impl->nspace->isLinkableInProject() - && (m_impl->fileDef==0 || !m_impl->fileDef->isLinkableInProject())) + const NamespaceDef *nspace = getNamespaceDef(); + const FileDef *fileDef = getFileDef(); + if (!groupDef && nspace && !m_impl->related && !nspace->isLinkableInProject() + && (fileDef==0 || !fileDef->isLinkableInProject())) { //printf("in a namespace but namespace not linkable!\n"); m_isLinkableCached = 1; // in namespace but namespace not linkable return; } - if (!m_impl->group && !m_impl->nspace && - !m_impl->related && !m_impl->classDef && - m_impl->fileDef && !m_impl->fileDef->isLinkableInProject()) + if (!groupDef && !nspace && + !m_impl->related && !classDef && + fileDef && !fileDef->isLinkableInProject()) { //printf("in a file but file not linkable!\n"); m_isLinkableCached = 1; // in file (and not in namespace) but file not linkable @@ -1468,7 +1962,7 @@ void MemberDefImpl::_computeLinkableInProject() m_isLinkableCached = 1; // hidden due to protection return; } - if (m_impl->stat && m_impl->classDef==0 && !extractStatic) + if (m_impl->stat && classDef==0 && !extractStatic) { //printf("static and invisible!\n"); m_isLinkableCached = 1; // hidden due to staticness @@ -1535,26 +2029,29 @@ void MemberDefImpl::setDefinitionTemplateParameterLists(QList<ArgumentList> *lis } } -void MemberDefImpl::writeLink(OutputList &ol,ClassDef *,NamespaceDef *, - FileDef *fd,GroupDef *gd,bool onlyText) +void MemberDefImpl::writeLink(OutputList &ol, + const ClassDef *,const NamespaceDef *,const FileDef *fd,const GroupDef *gd, + bool onlyText) const { SrcLangExt lang = getLanguage(); static bool hideScopeNames = Config_getBool(HIDE_SCOPE_NAMES); QCString sep = getLanguageSpecificSeparator(lang,TRUE); QCString n = name(); + const ClassDef *classDef = getClassDef(); + const NamespaceDef *nspace = getNamespaceDef(); if (!hideScopeNames) { if (m_impl->enumScope && m_impl->livesInsideEnum) { n.prepend(m_impl->enumScope->displayName()+sep); } - if (m_impl->classDef && gd && !isRelated()) + if (classDef && gd && !isRelated()) { - n.prepend(m_impl->classDef->displayName()+sep); + n.prepend(classDef->displayName()+sep); } - else if (m_impl->nspace && (gd || fd)) + else if (nspace && (gd || fd)) { - n.prepend(m_impl->nspace->displayName()+sep); + n.prepend(nspace->displayName()+sep); } } @@ -1567,7 +2064,7 @@ void MemberDefImpl::writeLink(OutputList &ol,ClassDef *,NamespaceDef *, if (m_impl->mtype==MemberType_EnumValue && getGroupDef()==0 && // enum value is not grouped getEnumScope() && getEnumScope()->getGroupDef()) // but its container is { - GroupDef *enumValGroup = getEnumScope()->getGroupDef(); + const GroupDef *enumValGroup = getEnumScope()->getGroupDef(); ol.writeObjectLink(enumValGroup->getReference(), enumValGroup->getOutputFileBase(), anchor(),n); @@ -1588,18 +2085,18 @@ void MemberDefImpl::writeLink(OutputList &ol,ClassDef *,NamespaceDef *, /*! If this member has an anonymous class/struct/union as its type, then * this method will return the ClassDef that describes this return type. */ -ClassDef *MemberDefImpl::getClassDefOfAnonymousType() +ClassDef *MemberDefImpl::getClassDefOfAnonymousType() const { if (m_impl->cachedAnonymousType) return m_impl->cachedAnonymousType; QCString cname; if (getClassDef()!=0) { - cname=getClassDef()->name().copy(); + cname=getClassDef()->name(); } else if (getNamespaceDef()!=0) { - cname=getNamespaceDef()->name().copy(); + cname=getNamespaceDef()->name(); } QCString ltype(m_impl->type); // strip `static' keyword from ltype @@ -1746,7 +2243,7 @@ QCString MemberDefImpl::getDeclType() const { ltype.prepend("typedef "); } - if (isAlias()) + if (isTypeAlias()) { ltype="using"; } @@ -1768,8 +2265,8 @@ QCString MemberDefImpl::getDeclType() const } void MemberDefImpl::writeDeclaration(OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, - bool inGroup, ClassDef *inheritedFrom,const char *inheritId) + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd, + bool inGroup, const ClassDef *inheritedFrom,const char *inheritId) const { //printf("%s MemberDefImpl::writeDeclaration() inGroup=%d\n",qualifiedName().data(),inGroup); @@ -1778,7 +2275,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol, if (!inGroup && m_impl->mtype==MemberType_EnumValue) return; - Definition *d=0; + const Definition *d=0; ASSERT (cd!=0 || nd!=0 || fd!=0 || gd!=0); // member should belong to something if (cd) d=cd; else if (nd) d=nd; else if (fd) d=fd; else d=gd; if (d==gd) // see bug 753608 @@ -1788,7 +2285,6 @@ void MemberDefImpl::writeDeclaration(OutputList &ol, else if (getFileDef()) d = getFileDef(); } - //_writeTagData(compoundType); addToSearchIndex(); QCString cname = d->name(); @@ -1810,7 +2306,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol, // If there is no detailed description we need to write the anchor here. bool detailsVisible = isDetailedSectionLinkable(); - bool writeAnchor = (inGroup || m_impl->group==0) && // only write anchors for member that have no details and are + bool writeAnchor = (inGroup || getGroupDef()==0) && // only write anchors for member that have no details and are !detailsVisible && !m_impl->annMemb; // rendered inside the group page or are not grouped at all if (writeAnchor) { @@ -1856,7 +2352,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol, { ltype.prepend("typedef "); } - if (isAlias()) + if (isTypeAlias()) { ltype="using"; } @@ -1911,7 +2407,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol, ); getAnonymousEnumType()->writeEnumDeclaration(ol,cd,nd,fd,gd); //ol+=*getAnonymousEnumType()->enumDecl(); - linkifyText(TextGeneratorOLImpl(ol),d,m_impl->fileDef,this,ltype.right(ltype.length()-i-l),TRUE); + linkifyText(TextGeneratorOLImpl(ol),d,getFileDef(),this,ltype.right(ltype.length()-i-l),TRUE); } else { @@ -1978,7 +2474,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol, if (!(name().isEmpty() || name().at(0)=='@') && // name valid (hasDocumentation() || isReference()) && // has docs !(m_impl->prot==Private && !extractPrivate && (m_impl->virt==Normal || !extractPrivateVirtual) && m_impl->mtype!=MemberType_Friend) && // hidden due to protection - !(isStatic() && m_impl->classDef==0 && !extractStatic) // hidden due to static-ness + !(isStatic() && getClassDef()==0 && !extractStatic) // hidden due to static-ness ) { if (m_impl->annMemb) @@ -1996,8 +2492,8 @@ void MemberDefImpl::writeDeclaration(OutputList &ol, else { //printf("writeLink %s->%d\n",name.data(),hasDocumentation()); - ClassDef *rcd = cd; - if (isReference() && m_impl->classDef) rcd = m_impl->classDef; + const ClassDef *rcd = cd; + if (isReference() && getClassDef()) rcd = getClassDef(); writeLink(ol,rcd,nd,fd,gd); } } @@ -2016,8 +2512,8 @@ void MemberDefImpl::writeDeclaration(OutputList &ol, m_impl->annMemb->setAnonymousUsed(); setAnonymousUsed(); } - ClassDef *rcd = cd; - if (isReference() && m_impl->classDef) rcd = m_impl->classDef; + const ClassDef *rcd = cd; + if (isReference() && getClassDef()) rcd = getClassDef(); writeLink(ol,rcd,nd,fd,gd,TRUE); } } @@ -2090,7 +2586,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol, linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),this,m_impl->initializer); } } - else if (isAlias()) // using template alias + else if (isTypeAlias()) // using template alias { ol.writeString(" = "); linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),this,m_impl->type); @@ -2189,18 +2685,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol, ol.disableAllBut(OutputGenerator::Html); //ol.endEmphasis(); ol.docify(" "); - if (inheritedFrom || - separateMemberPages || - (m_impl->group!=0 && gd==0) || - (m_impl->nspace!=0 && nd==0) - ) // forward link to the page or group or namespace - { - ol.startTextLink(getOutputFileBase(),anchor()); - } - else // local link - { - ol.startTextLink(0,anchor()); - } + ol.startTextLink(getOutputFileBase(),anchor()); ol.parseText(theTranslator->trMore()); ol.endTextLink(); //ol.startEmphasis(); @@ -2271,11 +2756,6 @@ bool MemberDefImpl::isDetailedSectionLinkable() const bool privateFilter = protectionLevelVisible(protection()) || m_impl->mtype==MemberType_Friend || (m_impl->prot==Private && m_impl->virt!=Normal && extractPrivateVirtual); - // member is part of an anonymous scope that is the type of - // another member in the list. - // - //bool inAnonymousScope = !briefDescription().isEmpty() && annUsed; - // hide friend (class|struct|union) member if HIDE_FRIEND_COMPOUNDS // is true bool friendCompoundFilter = !(Config_getBool(HIDE_FRIEND_COMPOUNDS) && @@ -2287,8 +2767,7 @@ bool MemberDefImpl::isDetailedSectionLinkable() const ); - bool result = ((docFilter && staticFilter && privateFilter && friendCompoundFilter && !isHidden())); - //printf("%s::isDetailedSectionLinkable: %d\n",name().data(),result); + bool result = (docFilter && staticFilter && privateFilter && friendCompoundFilter && !isHidden()); return result; } @@ -2310,7 +2789,7 @@ bool MemberDefImpl::isDetailedSectionVisible(bool inGroup,bool inFile) const return result; } -void MemberDefImpl::getLabels(QStrList &sl,Definition *container) const +void MemberDefImpl::getLabels(QStrList &sl,const Definition *container) const { static bool inlineInfo = Config_getBool(INLINE_INFO); @@ -2321,7 +2800,7 @@ void MemberDefImpl::getLabels(QStrList &sl,Definition *container) const (isInline() && inlineInfo) || isSignal() || isSlot() || isStatic() || - (m_impl->classDef && m_impl->classDef!=container && container->definitionType()==TypeClass) || + (getClassDef() && getClassDef()!=container && container->definitionType()==TypeClass) || (m_impl->memSpec & ~Entry::Inline)!=0 ) ) @@ -2412,9 +2891,9 @@ void MemberDefImpl::getLabels(QStrList &sl,Definition *container) const sl.append("implementation"); } } - if (m_impl->classDef && + if (getClassDef() && container->definitionType()==TypeClass && - m_impl->classDef!=container && + getClassDef()!=container && !isRelated() ) { @@ -2428,7 +2907,7 @@ void MemberDefImpl::getLabels(QStrList &sl,Definition *container) const } } -void MemberDefImpl::_writeCallGraph(OutputList &ol) +void MemberDefImpl::_writeCallGraph(OutputList &ol) const { // write call graph if (m_impl->hasCallGraph @@ -2452,7 +2931,7 @@ void MemberDefImpl::_writeCallGraph(OutputList &ol) } } -void MemberDefImpl::_writeCallerGraph(OutputList &ol) +void MemberDefImpl::_writeCallerGraph(OutputList &ol) const { if (m_impl->hasCallerGraph && (isFunction() || isSlot() || isSignal()) && Config_getBool(HAVE_DOT) @@ -2475,10 +2954,10 @@ void MemberDefImpl::_writeCallerGraph(OutputList &ol) } } -void MemberDefImpl::_writeReimplements(OutputList &ol) +void MemberDefImpl::_writeReimplements(OutputList &ol) const { MemberDef *bmd=reimplements(); - ClassDef *bcd=0; + const ClassDef *bcd=0; if (bmd && (bcd=bmd->getClassDef())) { // write class that contains a member that is reimplemented by this one @@ -2534,7 +3013,7 @@ void MemberDefImpl::_writeReimplements(OutputList &ol) } } -void MemberDefImpl::_writeReimplementedBy(OutputList &ol) +void MemberDefImpl::_writeReimplementedBy(OutputList &ol) const { MemberList *bml=reimplementedBy(); if (bml) @@ -2542,7 +3021,7 @@ void MemberDefImpl::_writeReimplementedBy(OutputList &ol) MemberListIterator mli(*bml); MemberDef *bmd=0; uint count=0; - ClassDef *bcd=0; + const ClassDef *bcd=0; for (mli.toFirst();(bmd=mli.current()) && (bcd=bmd->getClassDef());++mli) { // count the members that directly inherit from md and for @@ -2559,7 +3038,7 @@ void MemberDefImpl::_writeReimplementedBy(OutputList &ol) ol.startParagraph(); QCString reimplInLine; - if (m_impl->virt==Pure || (m_impl->classDef && m_impl->classDef->compoundType()==ClassDef::Interface)) + if (m_impl->virt==Pure || (getClassDef() && getClassDef()->compoundType()==ClassDef::Interface)) { reimplInLine = theTranslator->trImplementedInList(count); } @@ -2609,9 +3088,9 @@ void MemberDefImpl::_writeReimplementedBy(OutputList &ol) } } -void MemberDefImpl::_writeCategoryRelation(OutputList &ol) +void MemberDefImpl::_writeCategoryRelation(OutputList &ol) const { - if (m_impl->classDef) // this should be a member of a class/category + if (getClassDef()) // this should be a member of a class/category { //printf("%s: category %s relation %s class=%s categoryOf=%s\n", // name().data(), @@ -2635,12 +3114,12 @@ void MemberDefImpl::_writeCategoryRelation(OutputList &ol) text = theTranslator->trProvidedByCategory(); name = m_impl->category->displayName(); } - else if (m_impl->classDef->categoryOf()) + else if (getClassDef()->categoryOf()) { // this member is part of a category so link to the corresponding class member of the class we extend // so link to method 'categoryRelation' with 'extends class 'classDef->categoryOf()' text = theTranslator->trExtendsClass(); - name = m_impl->classDef->categoryOf()->displayName(); + name = getClassDef()->categoryOf()->displayName(); } i=text.find("@0"); if (i!=-1) @@ -2662,7 +3141,7 @@ void MemberDefImpl::_writeCategoryRelation(OutputList &ol) } } -void MemberDefImpl::_writeExamples(OutputList &ol) +void MemberDefImpl::_writeExamples(OutputList &ol) const { // write the list of examples that use this member if (hasExamples()) @@ -2675,7 +3154,7 @@ void MemberDefImpl::_writeExamples(OutputList &ol) } } -void MemberDefImpl::_writeTypeConstraints(OutputList &ol) +void MemberDefImpl::_writeTypeConstraints(OutputList &ol) const { if (m_impl->typeConstraints) { @@ -2683,15 +3162,15 @@ void MemberDefImpl::_writeTypeConstraints(OutputList &ol) } } -void MemberDefImpl::_writeEnumValues(OutputList &ol,Definition *container, +void MemberDefImpl::_writeEnumValues(OutputList &ol,const Definition *container, const QCString &cfname,const QCString &ciname, - const QCString &cname) + const QCString &cname) const { // For enum, we also write the documented enum values if (isEnumerate()) { bool first=TRUE; - MemberList *fmdl=enumFieldList(); + const MemberList *fmdl=enumFieldList(); //printf("** %s: enum values=%d\n",name().data(),fmdl!=0 ? fmdl->count() : 0); if (fmdl) { @@ -2802,7 +3281,7 @@ QCString MemberDefImpl::displayDefinition() const if (ni>=ei) ei=ni+2; ldef = ldef.left(si) + " { ... } " + ldef.right(ldef.length()-ei); } - ClassDef *cd=getClassDef(); + const ClassDef *cd=getClassDef(); if (cd && cd->isObjectiveC()) { // strip scope name @@ -2840,12 +3319,12 @@ QCString MemberDefImpl::displayDefinition() const return substitute(ldef,"::",sep); } -void MemberDefImpl::_writeGroupInclude(OutputList &ol,bool inGroup) +void MemberDefImpl::_writeGroupInclude(OutputList &ol,bool inGroup) const { // only write out the include file if this is not part of a class or file // definition static bool showGroupedMembInc = Config_getBool(SHOW_GROUPED_MEMB_INC); - FileDef *fd = getFileDef(); + const FileDef *fd = getFileDef(); QCString nm; if (fd) nm = getFileDef()->docName(); if (inGroup && fd && showGroupedMembInc && !nm.isEmpty()) @@ -2884,15 +3363,15 @@ void MemberDefImpl::_writeGroupInclude(OutputList &ol,bool inGroup) /*! Writes the "detailed documentation" section of this member to * all active output formats. */ -void MemberDefImpl::writeDocumentation(MemberList *ml, +void MemberDefImpl::writeDocumentation(const MemberList *ml, int memCount,int memTotal, OutputList &ol, const char *scName, - Definition *container, + const Definition *container, bool inGroup, bool showEnumValues, bool showInline - ) + ) const { // if this member is in a group find the real scope name. bool hasParameterList = FALSE; @@ -2913,13 +3392,13 @@ void MemberDefImpl::writeDocumentation(MemberList *ml, QCString scopeName = scName; QCString memAnchor = anchor(); QCString ciname = container->displayName(); - Definition *scopedContainer = container; // see bug 753608 + const Definition *scopedContainer = container; // see bug 753608 if (container->definitionType()==TypeGroup) { if (getClassDef()) { scopeName=getClassDef()->displayName(); scopedContainer=getClassDef(); } else if (getNamespaceDef()) { scopeName=getNamespaceDef()->displayName(); scopedContainer=getNamespaceDef(); } else if (getFileDef()) { scopeName=getFileDef()->displayName(); scopedContainer=getFileDef(); } - ciname = (dynamic_cast<GroupDef *>(container))->groupTitle(); + ciname = (dynamic_cast<const GroupDef *>(container))->groupTitle(); } else if (container->definitionType()==TypeFile && getNamespaceDef() && lang != SrcLangExt_Python) { // member is in a namespace, but is written as part of the file documentation @@ -3048,8 +3527,8 @@ void MemberDefImpl::writeDocumentation(MemberList *ml, ol.endMemberDocPrefixItem(); } - ClassDef *cd=getClassDef(); - NamespaceDef *nd=getNamespaceDef(); + const ClassDef *cd=getClassDef(); + const NamespaceDef *nd=getNamespaceDef(); if (!Config_getBool(HIDE_SCOPE_NAMES)) { bool first=TRUE; @@ -3163,7 +3642,7 @@ void MemberDefImpl::writeDocumentation(MemberList *ml, ldef.left(pos) ); ol.docify(ldef.mid(pos)); - Definition *scope = cd; + const Definition *scope = cd; if (scope==0) scope = nd; hasParameterList=writeDefArgumentList(ol,scope,this); } @@ -3175,7 +3654,7 @@ void MemberDefImpl::writeDocumentation(MemberList *ml, this, substitute(ldef,"::",sep) ); - Definition *scope = cd; + const Definition *scope = cd; if (scope==0) scope = nd; hasParameterList=writeDefArgumentList(ol,scope,this); } @@ -3276,7 +3755,7 @@ void MemberDefImpl::writeDocumentation(MemberList *ml, ParserInterface *pIntf = Doxygen::parserManager->getParser(getDefFileExtension()); pIntf->resetCodeParserState(); ol.startCodeFragment(); - pIntf->parseCode(ol,scopeName,m_impl->initializer,lang,FALSE,0,getFileDef(), + pIntf->parseCode(ol,scopeName,m_impl->initializer,lang,FALSE,0,const_cast<FileDef*>(getFileDef()), -1,-1,TRUE,this,FALSE,this); ol.endCodeFragment(); } @@ -3475,7 +3954,7 @@ QCString MemberDefImpl::fieldType() const return simplifyTypeForTable(type); } -void MemberDefImpl::writeMemberDocSimple(OutputList &ol, Definition *container) +void MemberDefImpl::writeMemberDocSimple(OutputList &ol, const Definition *container) const { Definition *scope = getOuterScope(); QCString doxyName = name(); @@ -3493,7 +3972,7 @@ void MemberDefImpl::writeMemberDocSimple(OutputList &ol, Definition *container) //printf("===> %s::anonymous: %s\n",name().data(),cd?cd->name().data():"<none>"); if (container && container->definitionType()==Definition::TypeClass && - !(dynamic_cast<ClassDef*>(container))->isJavaEnum()) + !(dynamic_cast<const ClassDef*>(container))->isJavaEnum()) { ol.startInlineMemberType(); ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs); @@ -3594,17 +4073,17 @@ QCString MemberDefImpl::memberTypeName() const } } -void MemberDefImpl::warnIfUndocumented() +void MemberDefImpl::warnIfUndocumented() const { /* * Removed bug_303020: * if (m_impl->memberGroup) return; */ - ClassDef *cd = getClassDef(); - NamespaceDef *nd = getNamespaceDef(); - FileDef *fd = getFileDef(); - GroupDef *gd = getGroupDef(); - Definition *d=0; + const ClassDef *cd = getClassDef(); + const NamespaceDef *nd = getNamespaceDef(); + const FileDef *fd = getFileDef(); + const GroupDef *gd = getGroupDef(); + const Definition *d=0; const char *t=0; if (cd) t="class", d=cd; @@ -3641,22 +4120,114 @@ void MemberDefImpl::warnIfUndocumented() } } +void MemberDefImpl::detectUndocumentedParams(bool hasParamCommand,bool hasReturnCommand) const +{ + if (!Config_getBool(WARN_NO_PARAMDOC)) return; + QCString returnType = typeString(); + bool isPython = getLanguage()==SrcLangExt_Python; + + if (!m_impl->hasDocumentedParams && hasParamCommand) + { + //printf("%s:hasDocumentedParams=TRUE;\n",name().data()); + m_impl->hasDocumentedParams = TRUE; + } + else if (!m_impl->hasDocumentedParams) + { + ArgumentList *al = argumentList(); + ArgumentList *declAl = declArgumentList(); + bool allDoc=TRUE; // no parameter => all parameters are documented + if ( // member has parameters + al!=0 && // but the member has a parameter list + al->count()>0 // with at least one parameter (that is not void) + ) + { + ArgumentListIterator ali(*al); + Argument *a; -void MemberDefImpl::warnIfUndocumentedParams() + // see if all parameters have documentation + for (ali.toFirst();(a=ali.current()) && allDoc;++ali) + { + if (!a->name.isEmpty() && a->type!="void" && + !(isPython && (a->name=="self" || a->name=="cls")) + ) + { + allDoc = !a->docs.isEmpty(); + } + //printf("a->type=%s a->name=%s doc=%s\n", + // a->type.data(),a->name.data(),a->docs.data()); + } + if (!allDoc && declAl!=0) // try declaration arguments as well + { + allDoc=TRUE; + ArgumentListIterator ali(*declAl); + Argument *a; + for (ali.toFirst();(a=ali.current()) && allDoc;++ali) + { + if (!a->name.isEmpty() && a->type!="void" && + !(isPython && (a->name=="self" || a->name=="cls")) + ) + { + allDoc = !a->docs.isEmpty(); + } + //printf("a->name=%s doc=%s\n",a->name.data(),a->docs.data()); + } + } + } + if (allDoc) + { + //printf("%s:hasDocumentedParams=TRUE;\n",name().data()); + m_impl->hasDocumentedParams = TRUE; + } + } + + //printf("Member %s hasDocumentedReturnType=%d hasReturnCommand=%d\n", + // name().data(),m_impl->hasDocumentedReturnType,hasReturnCommand); + if (!m_impl->hasDocumentedReturnType && // docs not yet found + hasReturnCommand) + { + m_impl->hasDocumentedReturnType = TRUE; + } + else if ( // see if return type is documented in a function w/o return type + hasReturnCommand && + ( + returnType.find("void")!=-1 || // void return type + returnType.find("subroutine")!=-1 || // fortran subroutine + isConstructor() || // a constructor + isDestructor() // or destructor + ) + ) + { + warn_doc_error(getDefFileName(),getDefLine(),"documented empty return type of %s", + qualifiedName().data()); + } + else if ( // see if return needs to documented + m_impl->hasDocumentedReturnType || + returnType.find("void")!=-1 || // void return type + returnType.find("subroutine")!=-1 || // fortran subroutine + isConstructor() || // a constructor + isDestructor() // or destructor + ) + { + m_impl->hasDocumentedReturnType = TRUE; + } +} + +void MemberDefImpl::warnIfUndocumentedParams() const { if (!Config_getBool(EXTRACT_ALL) && Config_getBool(WARN_IF_UNDOCUMENTED) && Config_getBool(WARN_NO_PARAMDOC) && + !isDeleted() && !isReference() && !Doxygen::suppressDocWarnings) { - if (!hasDocumentedParams()) + if (!m_impl->hasDocumentedParams) { warn_doc_error(getDefFileName(),getDefLine(), "parameters of member %s are not (all) documented", qPrint(qualifiedName())); } - if (!hasDocumentedReturnType() && + if (!m_impl->hasDocumentedReturnType && isFunction() && hasDocumentation()) { warn_doc_error(getDefFileName(),getDefLine(), @@ -3709,7 +4280,7 @@ void MemberDefImpl::setMemberGroup(MemberGroup *grp) m_impl->memberGroup = grp; } -bool MemberDefImpl::visibleMemberGroup(bool hideNoHeader) +bool MemberDefImpl::visibleMemberGroup(bool hideNoHeader) const { return m_impl->memberGroup!=0 && (!hideNoHeader || m_impl->memberGroup->header()!="[NOHEADER]"); @@ -3821,7 +4392,7 @@ void MemberDefImpl::setNamespace(NamespaceDef *nd) } MemberDef *MemberDefImpl::createTemplateInstanceMember( - ArgumentList *formalArgs,ArgumentList *actualArgs) + ArgumentList *formalArgs,ArgumentList *actualArgs) const { //printf(" Member %s %s %s\n",typeString(),name().data(),argsString()); ArgumentList *actualArgList = 0; @@ -3954,7 +4525,7 @@ void MemberDefImpl::addListReference(Definition *) } } -MemberList *MemberDefImpl::getSectionList(Definition *d) const +const MemberList *MemberDefImpl::getSectionList(const Definition *d) const { char key[20]; sprintf(key,"%p",d); @@ -3993,7 +4564,7 @@ Specifier MemberDefImpl::virtualness(int count) const return v; } -void MemberDefImpl::writeTagFile(FTextStream &tagFile) +void MemberDefImpl::writeTagFile(FTextStream &tagFile) const { if (!isLinkableInProject()) return; tagFile << " <member kind=\""; @@ -4077,7 +4648,7 @@ void MemberDefImpl::writeTagFile(FTextStream &tagFile) void MemberDefImpl::_computeIsConstructor() { m_isConstructorCached=1; // FALSE - if (m_impl->classDef) + if (getClassDef()) { if (m_impl->isDMember) // for D { @@ -4102,7 +4673,7 @@ void MemberDefImpl::_computeIsConstructor() } else // for other languages { - QCString locName = m_impl->classDef->localName(); + QCString locName = getClassDef()->localName(); int i=locName.find('<'); if (i==-1) // not a template class { @@ -4170,7 +4741,7 @@ bool MemberDefImpl::isDestructor() const } void MemberDefImpl::writeEnumDeclaration(OutputList &typeDecl, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd) + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd) const { int enumMemCount=0; @@ -4387,13 +4958,13 @@ void MemberDefImpl::setInbodyDocumentation(const char *docs, bool MemberDefImpl::isObjCMethod() const { - if (m_impl->classDef && m_impl->classDef->isObjectiveC() && isFunction()) return TRUE; + if (getClassDef() && getClassDef()->isObjectiveC() && isFunction()) return TRUE; return FALSE; } bool MemberDefImpl::isObjCProperty() const { - if (m_impl->classDef && m_impl->classDef->isObjectiveC() && isProperty()) return TRUE; + if (getClassDef() && getClassDef()->isObjectiveC() && isProperty()) return TRUE; return FALSE; } @@ -4404,7 +4975,7 @@ QCString MemberDefImpl::qualifiedName() const QCString qm; if (isStatic()) qm="+"; else qm="-"; qm+="["; - qm+=m_impl->classDef->name()+" "; + qm+=getClassDef()->name()+" "; qm+=name(); qm+="]"; return qm; @@ -4443,7 +5014,7 @@ QCString MemberDefImpl::objCMethodName(bool localLink,bool showStatic) const if (!localLink) // link to method of same class { qm+=" ("; - qm+=m_impl->classDef->name(); + qm+=getClassDef()->name(); qm+=")"; } return qm; @@ -4499,17 +5070,32 @@ uint64 MemberDefImpl::getMemberSpecifiers() const return m_impl->memSpec; } -ClassDef *MemberDefImpl::getClassDef() const +const ClassDef *MemberDefImpl::getClassDef() const +{ + return m_impl->classDef; +} + +ClassDef *MemberDefImpl::getClassDef() { return m_impl->classDef; } -FileDef *MemberDefImpl::getFileDef() const +const FileDef *MemberDefImpl::getFileDef() const { return m_impl->fileDef; } -NamespaceDef* MemberDefImpl::getNamespaceDef() const +FileDef *MemberDefImpl::getFileDef() +{ + return m_impl->fileDef; +} + +const NamespaceDef* MemberDefImpl::getNamespaceDef() const +{ + return m_impl->nspace; +} + +NamespaceDef* MemberDefImpl::getNamespaceDef() { return m_impl->nspace; } @@ -4524,7 +5110,12 @@ const char *MemberDefImpl::getWriteAccessor() const return m_impl->write; } -GroupDef *MemberDefImpl::getGroupDef() const +const GroupDef *MemberDefImpl::getGroupDef() const +{ + return m_impl->group; +} + +GroupDef *MemberDefImpl::getGroupDef() { return m_impl->group; } @@ -4801,7 +5392,7 @@ bool MemberDefImpl::isUnretained() const return (m_impl->memSpec&Entry::Unretained)!=0; } -bool MemberDefImpl::isAlias() const +bool MemberDefImpl::isTypeAlias() const { return (m_impl->memSpec&Entry::Alias)!=0; } @@ -4887,16 +5478,6 @@ bool MemberDefImpl::isTemplateSpecialization() const return m_impl->tspec; } -bool MemberDefImpl::hasDocumentedParams() const -{ - return m_impl->hasDocumentedParams; -} - -bool MemberDefImpl::hasDocumentedReturnType() const -{ - return m_impl->hasDocumentedReturnType; -} - bool MemberDefImpl::showInCallGraph() const { return isFunction() || @@ -4916,7 +5497,7 @@ bool MemberDefImpl::hasDocumentedEnumValues() const return m_impl->docEnumValues; } -MemberDef *MemberDefImpl::getAnonymousEnumType() const +const MemberDef *MemberDefImpl::getAnonymousEnumType() const { return m_impl->annEnumType; } @@ -4926,7 +5507,7 @@ bool MemberDefImpl::isDocsForDefinition() const return m_impl->docsForDefinition; } -MemberDef *MemberDefImpl::getEnumScope() const +const MemberDef *MemberDefImpl::getEnumScope() const { return m_impl->enumScope; } @@ -4946,7 +5527,7 @@ bool MemberDefImpl::isConstExpr() const return (m_impl->memSpec&Entry::ConstExpr)!=0; } -MemberList *MemberDefImpl::enumFieldList() const +const MemberList *MemberDefImpl::enumFieldList() const { return m_impl->enumFields; } @@ -5001,7 +5582,7 @@ bool MemberDefImpl::anonymousDeclShown() const return m_impl->annUsed; } -void MemberDefImpl::setAnonymousUsed() +void MemberDefImpl::setAnonymousUsed() const { m_impl->annUsed = TRUE; } @@ -5165,16 +5746,6 @@ void MemberDefImpl::makeForeign() m_isLinkableCached = 0; } -void MemberDefImpl::setHasDocumentedParams(bool b) -{ - m_impl->hasDocumentedParams = b; -} - -void MemberDefImpl::setHasDocumentedReturnType(bool b) -{ - m_impl->hasDocumentedReturnType = b; -} - void MemberDefImpl::setInheritsDocsFrom(MemberDef *md) { m_impl->docProvider = md; @@ -5202,7 +5773,7 @@ void MemberDefImpl::setDocumentedEnumValues(bool value) m_impl->docEnumValues=value; } -void MemberDefImpl::setAnonymousEnumType(MemberDef *md) +void MemberDefImpl::setAnonymousEnumType(const MemberDef *md) { m_impl->annEnumType = md; } @@ -5251,7 +5822,7 @@ void MemberDefImpl::makeImplementationDetail() m_impl->implOnly=TRUE; } -void MemberDefImpl::setFromAnonymousScope(bool b) +void MemberDefImpl::setFromAnonymousScope(bool b) const { m_impl->annScope=b; } @@ -5393,7 +5964,7 @@ QCString MemberDefImpl::displayName(bool) const return DefinitionImpl::name(); } -void MemberDefImpl::addToSearchIndex() +void MemberDefImpl::addToSearchIndex() const { // write search index info if (Doxygen::searchIndex && isLinkableInProject()) diff --git a/src/memberdef.h b/src/memberdef.h index 555935a..ecaebcd 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -47,6 +47,9 @@ class MemberDef : virtual public Definition // move this member into a different scope virtual MemberDef *deepCopy() const =0; virtual void moveTo(Definition *) = 0; + + virtual MemberDef *resolveAlias() = 0; + virtual const MemberDef *resolveAlias() const = 0; //----------------------------------------------------------------------------------- // ---- getters ----- @@ -67,13 +70,22 @@ class MemberDef : virtual public Definition virtual const QCString &initializer() const = 0; virtual int initializerLines() const = 0; virtual uint64 getMemberSpecifiers() const = 0; - virtual MemberList *getSectionList(Definition *d) const = 0; + virtual const MemberList *getSectionList(const Definition *d) const = 0; virtual QCString displayDefinition() const = 0; // scope query members - virtual ClassDef *getClassDef() const = 0; - virtual FileDef *getFileDef() const = 0; - virtual NamespaceDef* getNamespaceDef() const = 0; + virtual const ClassDef *getClassDef() const = 0; + virtual ClassDef *getClassDef() = 0; + + virtual const FileDef *getFileDef() const = 0; + virtual FileDef *getFileDef() = 0; + + virtual const NamespaceDef* getNamespaceDef() const = 0; + virtual NamespaceDef* getNamespaceDef() = 0; + + virtual const GroupDef *getGroupDef() const = 0; + virtual GroupDef *getGroupDef() = 0; + virtual ClassDef *accessorClass() const = 0; // grabbing the property read/write accessor names @@ -81,7 +93,6 @@ class MemberDef : virtual public Definition virtual const char *getWriteAccessor() const = 0; // querying the grouping definition - virtual GroupDef *getGroupDef() const = 0; virtual Grouping::GroupPri_t getGroupPri() const = 0; virtual const char *getGroupFileName() const = 0; virtual int getGroupStartLine() const = 0; @@ -145,7 +156,7 @@ class MemberDef : virtual public Definition virtual bool isSealed() const = 0; virtual bool isImplementation() const = 0; virtual bool isExternal() const = 0; - virtual bool isAlias() const = 0; + virtual bool isTypeAlias() const = 0; virtual bool isDefault() const = 0; virtual bool isDelete() const = 0; virtual bool isNoExcept() const = 0; @@ -160,8 +171,6 @@ class MemberDef : virtual public Definition virtual bool isMaybeAmbiguous() const = 0; virtual bool isPublished() const = 0; // UNO IDL published virtual bool isTemplateSpecialization() const = 0; - virtual bool hasDocumentedParams() const = 0; - virtual bool hasDocumentedReturnType() const = 0; virtual bool isObjCMethod() const = 0; virtual bool isObjCProperty() const = 0; virtual bool isConstructor() const = 0; @@ -194,19 +203,19 @@ class MemberDef : virtual public Definition virtual MemberDef *reimplements() const = 0; virtual MemberList *reimplementedBy() const = 0; - virtual bool isReimplementedBy(ClassDef *cd) const = 0; + virtual bool isReimplementedBy(const ClassDef *cd) const = 0; virtual ClassDef *relatedAlso() const = 0; virtual bool hasDocumentedEnumValues() const = 0; - virtual MemberDef *getAnonymousEnumType() const = 0; + virtual const MemberDef *getAnonymousEnumType() const = 0; virtual bool isDocsForDefinition() const = 0; - virtual MemberDef *getEnumScope() const = 0; - virtual MemberList *enumFieldList() const = 0; + virtual const MemberDef *getEnumScope() const = 0; + virtual const MemberList *enumFieldList() const = 0; virtual void setEnumBaseType(const QCString &type) = 0; virtual QCString enumBaseType() const = 0; - virtual bool hasExamples() = 0; + virtual bool hasExamples() const = 0; virtual ExampleSDict *getExamples() const = 0; virtual bool isPrototype() const = 0; @@ -227,14 +236,14 @@ class MemberDef : virtual public Definition // callgraph related members virtual bool hasCallGraph() const = 0; virtual bool hasCallerGraph() const = 0; - virtual bool visibleMemberGroup(bool hideNoHeader) = 0; + virtual bool visibleMemberGroup(bool hideNoHeader) const = 0; // refrenced related members virtual bool hasReferencesRelation() const = 0; virtual bool hasReferencedByRelation() const = 0; virtual MemberDef *templateMaster() const = 0; virtual QCString getScopeString() const = 0; - virtual ClassDef *getClassDefOfAnonymousType() = 0; + virtual ClassDef *getClassDefOfAnonymousType() const = 0; // cached typedef functions virtual bool isTypedefValCached() const = 0; @@ -252,7 +261,7 @@ class MemberDef : virtual public Definition virtual QCString displayName(bool=TRUE) const = 0; virtual QCString getDeclType() const = 0; - virtual void getLabels(QStrList &sl,Definition *container) const = 0; + virtual void getLabels(QStrList &sl,const Definition *container) const = 0; virtual const ArgumentList *typeConstraints() const = 0; @@ -292,8 +301,6 @@ class MemberDef : virtual public Definition virtual void makeRelated() = 0; virtual void makeForeign() = 0; - virtual void setHasDocumentedParams(bool b) = 0; - virtual void setHasDocumentedReturnType(bool b) = 0; virtual void setInheritsDocsFrom(MemberDef *md) = 0; virtual void setTagInfo(TagInfo *i) = 0; virtual void setArgsString(const char *as) = 0; @@ -309,7 +316,7 @@ class MemberDef : virtual public Definition virtual void setEnumScope(MemberDef *md,bool livesInsideEnum=FALSE) = 0; virtual void setEnumClassScope(ClassDef *cd) = 0; virtual void setDocumentedEnumValues(bool value) = 0; - virtual void setAnonymousEnumType(MemberDef *md) = 0; + virtual void setAnonymousEnumType(const MemberDef *md) = 0; // example related members virtual bool addExample(const char *anchor,const char *name,const char *file) = 0; @@ -336,7 +343,6 @@ class MemberDef : virtual public Definition virtual void makeImplementationDetail() = 0; // anonymous scope members - virtual void setFromAnonymousScope(bool b) = 0; virtual void setFromAnonymousMember(MemberDef *m) = 0; virtual void enableCallGraph(bool e) = 0; @@ -354,12 +360,11 @@ class MemberDef : virtual public Definition virtual void invalidateTypedefValCache() = 0; virtual void invalidateCachedArgumentTypes() = 0; - + // declaration <-> definition relation virtual void setMemberDefinition(MemberDef *md) = 0; virtual void setMemberDeclaration(MemberDef *md) = 0; - - virtual void setAnonymousUsed() = 0; + virtual void copyArgumentNames(MemberDef *bmd) = 0; virtual void setCategory(ClassDef *) = 0; @@ -375,29 +380,36 @@ class MemberDef : virtual public Definition // --- actions ---- //----------------------------------------------------------------------------------- - // output generation - virtual void writeDeclaration(OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, - bool inGroup, ClassDef *inheritFrom=0,const char *inheritId=0) = 0; - virtual void writeDocumentation(MemberList *ml,int memCount,int memTotal,OutputList &ol, - const char *scopeName,Definition *container, - bool inGroup,bool showEnumValues=FALSE,bool - showInline=FALSE) = 0; - virtual void writeMemberDocSimple(OutputList &ol,Definition *container) = 0; - virtual void writeEnumDeclaration(OutputList &typeDecl, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd) = 0; - virtual void writeTagFile(FTextStream &) = 0; - virtual void warnIfUndocumented() = 0; - virtual void warnIfUndocumentedParams() = 0; - virtual MemberDef *createTemplateInstanceMember(ArgumentList *formalArgs, - ArgumentList *actualArgs) = 0; - + ArgumentList *actualArgs) const = 0; virtual void findSectionsInDocumentation() = 0; + virtual void addToSearchIndex() const = 0; + + //----------------------------------------------------------------------------------- + // --- write output ---- + //----------------------------------------------------------------------------------- + + virtual void writeDeclaration(OutputList &ol, + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd, + bool inGroup, const ClassDef *inheritFrom=0,const char *inheritId=0) const = 0; + virtual void writeDocumentation(const MemberList *ml,int memCount,int memTotal,OutputList &ol, + const char *scopeName,const Definition *container, + bool inGroup,bool showEnumValues=FALSE,bool + showInline=FALSE) const = 0; + virtual void writeMemberDocSimple(OutputList &ol,const Definition *container) const = 0; + virtual void writeEnumDeclaration(OutputList &typeDecl, const ClassDef *cd, + const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd) const = 0; + virtual void writeTagFile(FTextStream &) const = 0; virtual void writeLink(OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, - bool onlyText=FALSE) = 0; - virtual void addToSearchIndex() = 0; + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd, + bool onlyText=FALSE) const = 0; + + // write helpers + virtual void warnIfUndocumented() const = 0; + virtual void warnIfUndocumentedParams() const = 0; + virtual void detectUndocumentedParams(bool hasParamCommand,bool hasReturnCommand) const = 0; + virtual void setAnonymousUsed() const = 0; + virtual void setFromAnonymousScope(bool b) const = 0; }; @@ -408,6 +420,8 @@ MemberDef *createMemberDef(const char *defFileName,int defLine,int defColumn, Relationship related,MemberType t,const ArgumentList *tal, const ArgumentList *al,const char *metaData); +MemberDef *createMemberDefAlias(const Definition *newScope,const MemberDef *aliasMd); + void combineDeclarationAndDefinition(MemberDef *mdec,MemberDef *mdef); #endif diff --git a/src/membergroup.cpp b/src/membergroup.cpp index 9c48668..71729c3 100644 --- a/src/membergroup.cpp +++ b/src/membergroup.cpp @@ -40,7 +40,7 @@ MemberGroup::MemberGroup() { } -MemberGroup::MemberGroup(Definition *parent, +MemberGroup::MemberGroup(const Definition *parent, int id,const char *hdr,const char *d,const char *docFile,int docLine) { static bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS); @@ -51,7 +51,6 @@ MemberGroup::MemberGroup(Definition *parent, grpId = id; grpHeader = hdr; doc = d; - scope = 0; inSameSection = TRUE; inDeclSection = 0; m_numDecMembers = -1; @@ -86,14 +85,14 @@ void MemberGroup::insertMember(MemberDef *md) } else if (inDeclSection==0) { - inDeclSection = md->getSectionList(m_parent); + inDeclSection = const_cast<MemberList*>(md->getSectionList(m_parent)); //printf("inDeclSection=%p type=%d\n",inDeclSection,inDeclSection->listType()); } memberList->append(md); // copy the group of the first member in the memberGroup GroupDef *gd; - if (firstMd && (gd=firstMd->getGroupDef())) + if (firstMd && (gd=const_cast<GroupDef*>(firstMd->getGroupDef()))) { md->setGroupDef(gd, firstMd->getGroupPri(), firstMd->getGroupFileName(), firstMd->getGroupStartLine(), @@ -109,8 +108,8 @@ void MemberGroup::setAnchors() } void MemberGroup::writeDeclarations(OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, - bool showInline) + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd, + bool showInline) const { //printf("MemberGroup::writeDeclarations() %s\n",grpHeader.data()); QCString ldoc = doc; @@ -119,29 +118,34 @@ void MemberGroup::writeDeclarations(OutputList &ol, } void MemberGroup::writePlainDeclarations(OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, - ClassDef *inheritedFrom,const char *inheritId - ) + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd, + const ClassDef *inheritedFrom,const char *inheritId + ) const { //printf("MemberGroup::writePlainDeclarations() memberList->count()=%d\n",memberList->count()); memberList->writePlainDeclarations(ol,cd,nd,fd,gd,inheritedFrom,inheritId); } void MemberGroup::writeDocumentation(OutputList &ol,const char *scopeName, - Definition *container,bool showEnumValues,bool showInline) + const Definition *container,bool showEnumValues,bool showInline) const { memberList->writeDocumentation(ol,scopeName,container,0,showEnumValues,showInline); } void MemberGroup::writeDocumentationPage(OutputList &ol,const char *scopeName, - Definition *container) + const Definition *container) const { memberList->writeDocumentationPage(ol,scopeName,container); } -void MemberGroup::addGroupedInheritedMembers(OutputList &ol,ClassDef *cd, +void MemberGroup::setAnonymousEnumType() +{ + memberList->setAnonymousEnumType(); +} + +void MemberGroup::addGroupedInheritedMembers(OutputList &ol,const ClassDef *cd, MemberListType lt, - ClassDef *inheritedFrom,const QCString &inheritId) + const ClassDef *inheritedFrom,const QCString &inheritId) const { //printf("** addGroupedInheritedMembers()\n"); MemberListIterator li(*memberList); @@ -149,7 +153,7 @@ void MemberGroup::addGroupedInheritedMembers(OutputList &ol,ClassDef *cd, for (li.toFirst();(md=li.current());++li) { //printf("matching %d == %d\n",lt,md->getSectionList(m_parent)->listType()); - MemberList *ml = md->getSectionList(m_parent); + const MemberList *ml = md->getSectionList(m_parent); if (ml && lt==ml->listType()) { MemberList ml(lt); @@ -168,7 +172,7 @@ int MemberGroup::countGroupedInheritedMembers(MemberListType lt) for (li.toFirst();(md=li.current());++li) { //printf("matching %d == %d\n",lt,md->getSectionList(m_parent)->listType()); - MemberList *ml = md->getSectionList(m_parent); + const MemberList *ml = md->getSectionList(m_parent); if (ml && lt==ml->listType()) { count++; @@ -185,33 +189,24 @@ void MemberGroup::addToDeclarationSection() { if (inDeclSection) { - //printf("Adding group %p to list %p (type=%d)\n",this, - // inDeclSection,inDeclSection->listType()); + //printf("Adding group %p to list %p (type=%d) memberList=%p\n",this, + // inDeclSection,inDeclSection->listType(),memberList); inDeclSection->addMemberGroup(this); } } -int MemberGroup::countDecMembers(GroupDef *gd) +void MemberGroup::countDecMembers() { - if (m_numDecMembers==-1) /* number of member not cached */ - { - memberList->countDecMembers(gd); - m_numDecMembers = memberList->numDecMembers(); - } - return m_numDecMembers; + memberList->countDecMembers(); } -int MemberGroup::countDocMembers() +void MemberGroup::countDocMembers() { - if (m_numDocMembers==-1) - { - memberList->countDocMembers(); - m_numDocMembers = memberList->numDocMembers(); - } - return m_numDocMembers; + memberList->countDocMembers(); } -int MemberGroup::countInheritableMembers(ClassDef *inheritedFrom) const + +int MemberGroup::countInheritableMembers(const ClassDef *inheritedFrom) const { return memberList->countInheritableMembers(inheritedFrom); } @@ -255,6 +250,7 @@ void MemberGroup::distributeMemberGroupDocumentation() } } +#if 0 int MemberGroup::varCount() const { return memberList->varCount(); @@ -304,15 +300,26 @@ int MemberGroup::friendCount() const { return memberList->friendCount(); } +#endif -int MemberGroup::numDecMembers() const -{ - return memberList->numDecMembers(); +int MemberGroup::numDecMembers() const +{ + return memberList->numDecMembers(); } -int MemberGroup::numDocMembers() const -{ - return memberList->numDocMembers(); +int MemberGroup::numDecEnumValues() const +{ + return memberList->numDecEnumValues(); +} + +int MemberGroup::numDocMembers() const +{ + return memberList->numDocMembers(); +} + +int MemberGroup::numDocEnumValues() const +{ + return memberList->numDocEnumValues(); } void MemberGroup::setInGroup(bool b) @@ -320,6 +327,7 @@ void MemberGroup::setInGroup(bool b) memberList->setInGroup(b); } + QCString MemberGroup::anchor() const { uchar md5_sig[16]; diff --git a/src/membergroup.h b/src/membergroup.h index 51123bb..c07d025 100644 --- a/src/membergroup.h +++ b/src/membergroup.h @@ -41,7 +41,7 @@ class MemberGroup { public: MemberGroup(); - MemberGroup(Definition *parent,int id,const char *header, + MemberGroup(const Definition *parent,int id,const char *header, const char *docs,const char *docFile,int docLine); ~MemberGroup(); QCString header() const { return grpHeader; } @@ -49,28 +49,30 @@ class MemberGroup void insertMember(MemberDef *md); void setAnchors(); void writePlainDeclarations(OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, - ClassDef *inheritedFrom,const char *inheritId); + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd, + const ClassDef *inheritedFrom,const char *inheritId) const; void writeDeclarations(OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, - bool showInline=FALSE); + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd, + bool showInline=FALSE) const; void writeDocumentation(OutputList &ol,const char *scopeName, - Definition *container,bool showEnumValues,bool showInline); + const Definition *container,bool showEnumValues,bool showInline) const; void writeDocumentationPage(OutputList &ol,const char *scopeName, - Definition *container); + const Definition *container) const; void writeTagFile(FTextStream &); - void addGroupedInheritedMembers(OutputList &ol,ClassDef *cd, + void addGroupedInheritedMembers(OutputList &ol,const ClassDef *cd, MemberListType lt, - ClassDef *inheritedFrom,const QCString &inheritId); + const ClassDef *inheritedFrom,const QCString &inheritId) const; + void setAnonymousEnumType(); const QCString &documentation() const { return doc; } bool allMembersInSameSection() const { return inSameSection; } void addToDeclarationSection(); - int countDecMembers(GroupDef *gd=0); - int countDocMembers(); + void countDecMembers(); + void countDocMembers(); int countGroupedInheritedMembers(MemberListType lt); void distributeMemberGroupDocumentation(); void findSectionsInDocumentation(); + /* int varCount() const; int funcCount() const; int enumCount() const; @@ -81,14 +83,18 @@ class MemberGroup int protoCount() const; int defineCount() const; int friendCount() const; + */ int numDecMembers() const; + int numDecEnumValues() const; int numDocMembers() const; - int countInheritableMembers(ClassDef *inheritedFrom) const; + int numDocEnumValues() const; + + int countInheritableMembers(const ClassDef *inheritedFrom) const; void setInGroup(bool b); void addListReferences(Definition *d); void setRefItems(const QList<ListItemInfo> *sli); MemberList *members() const { return memberList; } - Definition *parent() const { return m_parent; } + const Definition *parent() const { return m_parent; } QCString anchor() const; QCString docFile() const { return m_docFile; } @@ -100,12 +106,11 @@ class MemberGroup int grpId; QCString grpHeader; QCString fileName; // base name of the generated file - Definition *scope; QCString doc; bool inSameSection; int m_numDecMembers; int m_numDocMembers; - Definition *m_parent; + const Definition *m_parent; QCString m_docFile; int m_docLine; QList<ListItemInfo> *m_xrefListItems; diff --git a/src/memberlist.cpp b/src/memberlist.cpp index 418b24a..62bebf6 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -34,19 +34,12 @@ MemberList::MemberList() : m_listType(MemberListType_pubMethods) { + //printf("%p: MemberList::MemberList()\n",this); memberGroupList=0; - m_varCnt=0; - m_funcCnt=0; - m_enumCnt=0; - m_enumValCnt=0; - m_typeCnt=0; - m_seqCnt=0; - m_dictCnt=0; - m_protoCnt=0; - m_defCnt=0; - m_friendCnt=0; m_numDecMembers=-1; // special value indicating that value needs to be computed + m_numDecEnumValues=0; m_numDocMembers=-1; // special value indicating that value needs to be computed + m_numDocEnumValues=0; m_inGroup=FALSE; m_inFile=FALSE; m_needsSorting=FALSE; @@ -54,19 +47,12 @@ MemberList::MemberList() : m_listType(MemberListType_pubMethods) MemberList::MemberList(MemberListType lt) : m_listType(lt) { + //printf("%p: MemberList::MemberList(%d)\n",this,lt); memberGroupList=0; - m_varCnt=0; - m_funcCnt=0; - m_enumCnt=0; - m_enumValCnt=0; - m_typeCnt=0; - m_seqCnt=0; - m_dictCnt=0; - m_protoCnt=0; - m_defCnt=0; - m_friendCnt=0; m_numDecMembers=-1; // special value indicating that value needs to be computed + m_numDecEnumValues=0; m_numDocMembers=-1; // special value indicating that value needs to be computed + m_numDocEnumValues=0; m_inGroup=FALSE; m_inFile=FALSE; m_needsSorting=FALSE; @@ -93,11 +79,11 @@ int MemberList::compareValues(const MemberDef *c1, const MemberDef *c2) const return cmp!=0 ? cmp : c1->getDefLine()-c2->getDefLine(); } -int MemberList::countInheritableMembers(ClassDef *inheritedFrom) const +int MemberList::countInheritableMembers(const ClassDef *inheritedFrom) const { int count=0; QListIterator<MemberDef> mli(*this); - MemberDef *md; + const MemberDef *md; for (mli.toFirst();(md=mli.current());++mli) { if (md->isBriefSectionVisible()) @@ -137,13 +123,15 @@ int MemberList::countInheritableMembers(ClassDef *inheritedFrom) const /*! Count the number of members in this list that are visible in * the declaration part of a compound's documentation page. */ -void MemberList::countDecMembers(bool countEnumValues,GroupDef *gd) +void MemberList::countDecMembers() { - if (m_numDecMembers!=-1) return; - + if (m_numDecMembers!=-1) return; + //printf("----- countDecMembers count=%d ----\n",count()); + /* m_varCnt=m_funcCnt=m_enumCnt=m_enumValCnt=0; m_typeCnt=m_seqCnt=m_dictCnt=m_protoCnt=m_defCnt=m_friendCnt=0; + */ m_numDecMembers=0; QListIterator<MemberDef> mli(*this); MemberDef *md; @@ -156,7 +144,8 @@ void MemberList::countDecMembers(bool countEnumValues,GroupDef *gd) { case MemberType_Variable: // fall through case MemberType_Event: // fall through - case MemberType_Property: m_varCnt++,m_numDecMembers++; + case MemberType_Property: /*m_varCnt++,*/ + m_numDecMembers++; break; // apparently necessary to get this to show up in declarations section? case MemberType_Interface: // fall through @@ -165,23 +154,33 @@ void MemberList::countDecMembers(bool countEnumValues,GroupDef *gd) case MemberType_Signal: // fall through case MemberType_DCOP: // fall through case MemberType_Slot: if (!md->isRelated() || md->getClassDef()) - m_funcCnt++,m_numDecMembers++; + /*m_funcCnt++,*/ + m_numDecMembers++; + break; + case MemberType_Enumeration: /*m_enumCnt++,*/ + m_numDecMembers++; + break; + case MemberType_EnumValue: m_numDecEnumValues++; + m_numDecMembers++; + break; + case MemberType_Typedef: /*m_typeCnt++,*/ + m_numDecMembers++; break; - case MemberType_Enumeration: m_enumCnt++,m_numDecMembers++; break; - case MemberType_EnumValue: if (countEnumValues) - m_enumValCnt++,m_numDecMembers++; + case MemberType_Sequence: /*m_seqCnt++,*/ + m_numDecMembers++; + break; + case MemberType_Dictionary: /*m_dictCnt++,*/ + m_numDecMembers++; break; - case MemberType_Typedef: m_typeCnt++,m_numDecMembers++; break; - case MemberType_Sequence: m_seqCnt++,m_numDecMembers++; break; - case MemberType_Dictionary: m_dictCnt++,m_numDecMembers++; break; //case MemberType_Prototype: m_protoCnt++,m_numDecMembers++; break; - case MemberType_Define: if (Config_getBool(EXTRACT_ALL) || - md->argsString() || + case MemberType_Define: if (Config_getBool(EXTRACT_ALL) || + md->argsString() || !md->initializer().isEmpty() || - md->hasDocumentation() - ) m_defCnt++,m_numDecMembers++; + md->hasDocumentation() + ) /*m_defCnt++,*/ m_numDecMembers++; break; - case MemberType_Friend: m_friendCnt++,m_numDecMembers++; + case MemberType_Friend: /*m_friendCnt++,*/ + m_numDecMembers++; break; default: err("Unknown member type found for member `%s'\n!",md->name().data()); @@ -194,7 +193,8 @@ void MemberList::countDecMembers(bool countEnumValues,GroupDef *gd) MemberGroup *mg; for (;(mg=mgli.current());++mgli) { - mg->countDecMembers(gd); + mg->countDecMembers(); + /* m_varCnt+=mg->varCount(); m_funcCnt+=mg->funcCount(); m_enumCnt+=mg->enumCount(); @@ -205,7 +205,9 @@ void MemberList::countDecMembers(bool countEnumValues,GroupDef *gd) m_protoCnt+=mg->protoCount(); m_defCnt+=mg->defineCount(); m_friendCnt+=mg->friendCount(); + */ m_numDecMembers+=mg->numDecMembers(); + m_numDecEnumValues+=mg->numDecEnumValues(); } } //printf("----- end countDecMembers ----\n"); @@ -213,7 +215,7 @@ void MemberList::countDecMembers(bool countEnumValues,GroupDef *gd) //printf("MemberList::countDecMembers()=%d\n",m_numDecMembers); } -void MemberList::countDocMembers(bool countEnumValues) +void MemberList::countDocMembers() { if (m_numDocMembers!=-1) return; // used cached value m_numDocMembers=0; @@ -221,11 +223,14 @@ void MemberList::countDocMembers(bool countEnumValues) MemberDef *md; for (mli.toFirst();(md=mli.current());++mli) { - if (md->isDetailedSectionVisible(m_inGroup,m_inFile)) + if (md->isDetailedSectionVisible(m_inGroup,m_inFile) && !md->isAlias()) { // do not count enum values, since they do not produce entries of their own - if (countEnumValues || md->memberType()!=MemberType_EnumValue) - m_numDocMembers++; + if (md->memberType()==MemberType_EnumValue) + { + m_numDocEnumValues++; + } + m_numDocMembers++; } } if (memberGroupList) @@ -236,6 +241,7 @@ void MemberList::countDocMembers(bool countEnumValues) { mg->countDocMembers(); m_numDocMembers+=mg->numDocMembers(); + m_numDocEnumValues+=mg->numDocEnumValues(); } } //printf("MemberList::countDocMembers()=%d memberGroupList=%p\n",m_numDocMembers,memberGroupList); @@ -286,36 +292,74 @@ MemberListIterator::MemberListIterator(const MemberList &l) : { } -int MemberList::countEnumValues(MemberDef *md,bool setAnonEnumType) const +void MemberList::setAnonymousEnumType() { - int enumVars=0; + //printf("MemberList(%p)::setAnonymousEnumType()\n",this); + MemberListIterator mli(*this); + const MemberDef *md; + for ( ; (md=mli.current()); ++mli ) + { + if (md->isBriefSectionVisible()) + { + QCString name(md->name()); + int i=name.findRev("::"); + if (i!=-1) name=name.right(name.length()-i-2); + if (md->memberType()==MemberType_Enumeration && name[0]=='@') + { + const MemberList *mfl = md->enumFieldList(); + if (mfl) + { + MemberListIterator vmli(*mfl); + MemberDef *vmd; + for ( ; (vmd=vmli.current()) ; ++vmli) + { + QCString vtype=vmd->typeString(); + if ((vtype.find(name))!=-1) + { + vmd->setAnonymousEnumType(md); + } + } + } + } + } + } + if (memberGroupList) + { + MemberGroupListIterator mgli(*memberGroupList); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->setAnonymousEnumType(); + } + } +} + +int MemberList::countEnumValues(const MemberDef *md) const +{ + int numEnumValues=0; MemberListIterator vmli(*this); - MemberDef *vmd; + const MemberDef *vmd; QCString name(md->name()); int i=name.findRev("::"); - if (i!=-1) name=name.right(name.length()-i-2); // strip scope (TODO: is this needed?) - if (name[0]=='@') // anonymous enum => append variables + if (i!=-1) name=name.right(name.length()-i-2); + if (name[0]=='@') { for ( ; (vmd=vmli.current()) ; ++vmli) { QCString vtype=vmd->typeString(); - if ((vtype.find(name))!=-1) + if ((vtype.find(name))!=-1) { - enumVars++; - if (setAnonEnumType) - { - vmd->setAnonymousEnumType(md); - } + numEnumValues++; } } } - return enumVars; + return numEnumValues; } bool MemberList::declVisible() const { MemberListIterator mli(*this); - MemberDef *md; + const MemberDef *md; for ( ; (md=mli.current()); ++mli ) { if (md->isBriefSectionVisible()) @@ -340,7 +384,7 @@ bool MemberList::declVisible() const { // if this is an anonymous enum and there are variables of this // enum type (i.e. enumVars>0), then we do not show the enum here. - if (countEnumValues(md,FALSE)==0) // show enum here + if (countEnumValues(md)==0) // show enum here { return TRUE; } @@ -363,14 +407,17 @@ bool MemberList::declVisible() const } void MemberList::writePlainDeclarations(OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd, - GroupDef *gd,ClassDef *inheritedFrom,const char *inheritId - ) + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd, + const GroupDef *gd,const ClassDef *inheritedFrom,const char *inheritId + ) const { //printf("----- writePlainDeclaration() ----\n"); static bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS); - countDecMembers(); - if (numDecMembers()==0) + if (numDecMembers()==-1) + { + err("MemberList::numDecMembers()==-1, so the members of this list have not been counted. Please report as a bug."); + } + if (numDecMembers()<=numDecEnumValues()) { //printf(" --> no members!\n"); return; // no members in this list @@ -381,7 +428,7 @@ void MemberList::writePlainDeclarations(OutputList &ol, ol.pushGeneratorState(); bool first=TRUE; - MemberDef *md; + const MemberDef *md; MemberListIterator mli(*this); for ( ; (md=mli.current()); ++mli ) { @@ -416,7 +463,7 @@ void MemberList::writePlainDeclarations(OutputList &ol, { // if this is an anonymous enum and there are variables of this // enum type (i.e. enumVars>0), then we do not show the enum here. - if (countEnumValues(md,TRUE)==0) // show enum here + if (countEnumValues(md)==0) // show enum here { //printf("Enum!!\n"); if (first) @@ -549,9 +596,9 @@ void MemberList::writePlainDeclarations(OutputList &ol, * @param lt Type of list that is inherited from. */ void MemberList::writeDeclarations(OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd, const char *title,const char *subtitle, bool showEnumValues, - bool showInline,ClassDef *inheritedFrom,MemberListType lt) + bool showInline,const ClassDef *inheritedFrom,MemberListType lt) const { (void)showEnumValues; // unused @@ -559,8 +606,7 @@ void MemberList::writeDeclarations(OutputList &ol, static bool optimizeVhdl = Config_getBool(OPTIMIZE_OUTPUT_VHDL); QCString inheritId; - countDecMembers(/*showEnumValues*/FALSE,gd); // count members shown in this section - Definition *ctx = cd; + const Definition *ctx = cd; if (ctx==0 && nd) ctx = nd; if (ctx==0 && gd) ctx = gd; if (ctx==0 && fd) ctx = fd; @@ -569,6 +615,7 @@ void MemberList::writeDeclarations(OutputList &ol, // this,title,subtitle,numDecMembers(),inheritedFrom); int num = numDecMembers(); + int numEnumValues = numDecEnumValues(); if (inheritedFrom) { //if ( cd && !optimizeVhdl && countInheritableMembers(inheritedFrom)>0 ) @@ -588,7 +635,7 @@ void MemberList::writeDeclarations(OutputList &ol, ol.popGeneratorState(); } } - else if (num>0) + else if (num>numEnumValues) { if (title) { @@ -622,7 +669,7 @@ void MemberList::writeDeclarations(OutputList &ol, } } } - if (num>0) + if (num>numEnumValues) { // TODO: Two things need to be worked out for proper VHDL output: // 1. Signals and types under the group need to be @@ -685,13 +732,16 @@ void MemberList::writeDeclarations(OutputList &ol, } void MemberList::writeDocumentation(OutputList &ol, - const char *scopeName, Definition *container, - const char *title,bool showEnumValues,bool showInline) + const char *scopeName, const Definition *container, + const char *title,bool showEnumValues,bool showInline) const { - //printf("MemberList::writeDocumentation()\n"); + if (numDocMembers()==-1) + { + err("MemberList::numDocMembers()==-1, so the members of this list have not been counted. Please report as a bug."); + } - countDocMembers(showEnumValues); if (numDocMembers()==0) return; + if (!showEnumValues && numDocMembers()<=numDocEnumValues()) return; if (title) { @@ -706,7 +756,7 @@ void MemberList::writeDocumentation(OutputList &ol, ol.startMemberDocList(); MemberListIterator mli(*this); - MemberDef *md; + const MemberDef *md; // count the number of overloaded members QDict<uint> overloadTotalDict(67); @@ -758,20 +808,19 @@ void MemberList::writeDocumentation(OutputList &ol, // members in a table void MemberList::writeSimpleDocumentation(OutputList &ol, - Definition *container) + const Definition *container) const { - countDocMembers(FALSE); - //printf("MemberList count=%d\n",numDocMembers()); - if (numDocMembers()==0) return; + //printf("MemberList count=%d enumValues=%d\n",numDocMembers(),numDocEnumValues()); + if (numDocMembers()<=numDocEnumValues()) return; // only enum values and they should be excluded - ClassDef *cd = 0; + const ClassDef *cd = 0; if (container && container->definitionType()==Definition::TypeClass) { - cd = dynamic_cast<ClassDef*>(container); + cd = dynamic_cast<const ClassDef*>(container); } ol.startMemberDocSimple(cd && cd->isJavaEnum()); MemberListIterator mli(*this); - MemberDef *md; + const MemberDef *md; for ( ; (md=mli.current()) ; ++mli) { md->writeMemberDocSimple(ol,container); @@ -781,7 +830,7 @@ void MemberList::writeSimpleDocumentation(OutputList &ol, // separate member pages void MemberList::writeDocumentationPage(OutputList &ol, - const char *scopeName, Definition *container) + const char *scopeName, const Definition *container) const { static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW); @@ -791,7 +840,7 @@ void MemberList::writeDocumentationPage(OutputList &ol, overloadTotalDict.setAutoDelete(TRUE); overloadCountDict.setAutoDelete(TRUE); MemberListIterator mli(*this); - MemberDef *md; + const MemberDef *md; for (mli.toFirst() ; (md=mli.current()) ; ++mli) { if (md->isDetailedSectionLinkable()) @@ -882,10 +931,10 @@ void MemberList::addListReferences(Definition *def) MemberDef *md; for ( ; (md=mli.current()) ; ++mli) { - if (md->getGroupDef()==0 || def->definitionType()==Definition::TypeGroup) + if (!md->isAlias() && (md->getGroupDef()==0 || def->definitionType()==Definition::TypeGroup)) { md->addListReference(def); - MemberList *enumFields = md->enumFieldList(); + const MemberList *enumFields = md->enumFieldList(); if (md->memberType()==MemberType_Enumeration && enumFields) { //printf(" Adding enum values!\n"); diff --git a/src/memberlist.h b/src/memberlist.h index f0cc63d..3c227be 100644 --- a/src/memberlist.h +++ b/src/memberlist.h @@ -49,7 +49,7 @@ class MemberList : private QList<MemberDef> MemberDef *getFirst() const; MemberDef *take(uint index); - +/* int varCount() const { ASSERT(m_numDecMembers!=-1); return m_varCnt; } int funcCount() const { ASSERT(m_numDecMembers!=-1); return m_funcCnt; } int enumCount() const { ASSERT(m_numDecMembers!=-1); return m_enumCnt; } @@ -60,25 +60,29 @@ class MemberList : private QList<MemberDef> int protoCount() const { ASSERT(m_numDecMembers!=-1); return m_protoCnt; } int defineCount() const { ASSERT(m_numDecMembers!=-1); return m_defCnt; } int friendCount() const { ASSERT(m_numDecMembers!=-1); return m_friendCnt; } +*/ int numDecMembers() const { ASSERT(m_numDecMembers!=-1); return m_numDecMembers; } + int numDecEnumValues() const { return m_numDecEnumValues; } int numDocMembers() const { ASSERT(m_numDocMembers!=-1); return m_numDocMembers; } + int numDocEnumValues() const { return m_numDocEnumValues; } bool needsSorting() const { return m_needsSorting; } - void countDecMembers(bool countEnumValues=FALSE,GroupDef *gd=0); - void countDocMembers(bool countEnumValues=FALSE); - int countInheritableMembers(ClassDef *inheritedFrom) const; + void countDecMembers(); + void countDocMembers(); + int countInheritableMembers(const ClassDef *inheritedFrom) const; void writePlainDeclarations(OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd, GroupDef *gd, - ClassDef *inheritedFrom,const char *inheritId); + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd, const GroupDef *gd, + const ClassDef *inheritedFrom,const char *inheritId) const; void writeDeclarations(OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd, const char *title,const char *subtitle, bool showEnumValues=FALSE,bool showInline=FALSE, - ClassDef *inheritedFrom=0,MemberListType lt=MemberListType_pubMethods); + const ClassDef *inheritedFrom=0,MemberListType lt=MemberListType_pubMethods) const; void writeDocumentation(OutputList &ol,const char *scopeName, - Definition *container,const char *title,bool showEnumValues=FALSE,bool showInline=FALSE); - void writeSimpleDocumentation(OutputList &ol,Definition *container); + const Definition *container,const char *title, + bool showEnumValues=FALSE,bool showInline=FALSE) const; + void writeSimpleDocumentation(OutputList &ol,const Definition *container) const; void writeDocumentationPage(OutputList &ol, - const char *scopeName, Definition *container); + const char *scopeName, const Definition *container) const; void writeTagFile(FTextStream &); bool declVisible() const; void addMemberGroup(MemberGroup *mg); @@ -88,22 +92,26 @@ class MemberList : private QList<MemberDef> void findSectionsInDocumentation(); void setNeedsSorting(bool b); MemberGroupList *getMemberGroupList() const { return memberGroupList; } + void setAnonymousEnumType(); private: int compareValues(const MemberDef *item1,const MemberDef *item2) const; - int countEnumValues(MemberDef *md,bool setAnonEnumType) const; + int countEnumValues(const MemberDef *md) const; + /* int m_varCnt; int m_funcCnt; int m_enumCnt; - int m_enumValCnt; int m_typeCnt; int m_seqCnt; int m_dictCnt; int m_protoCnt; int m_defCnt; int m_friendCnt; + */ int m_numDecMembers; // number of members in the brief part of the memberlist + int m_numDecEnumValues; int m_numDocMembers; // number of members in the detailed part of the memberlist + int m_numDocEnumValues; MemberGroupList *memberGroupList; bool m_inGroup; // is this list part of a group definition bool m_inFile; // is this list part of a file definition diff --git a/src/membername.cpp b/src/membername.cpp index a5248c3..72809b3 100644 --- a/src/membername.cpp +++ b/src/membername.cpp @@ -32,10 +32,10 @@ MemberName::~MemberName() int MemberName::compareValues(const MemberDef *m1, const MemberDef *m2) const { - ClassDef *c1=m1->getClassDef(); - ClassDef *c2=m2->getClassDef(); - FileDef *f1=m1->getFileDef(); - FileDef *f2=m2->getFileDef(); + const ClassDef *c1=m1->getClassDef(); + const ClassDef *c2=m2->getClassDef(); + const FileDef *f1=m1->getFileDef(); + const FileDef *f2=m2->getFileDef(); if (c1 && c2) return qstrcmp(c1->name(),c2->name()); else if (f1 && f2) @@ -52,10 +52,10 @@ MemberNameInfo::MemberNameInfo(const char *n) : QList<MemberInfo>() int MemberNameInfo::compareValues(const MemberInfo *m1,const MemberInfo *m2) const { - ClassDef *c1=m1->memberDef->getClassDef(); - ClassDef *c2=m2->memberDef->getClassDef(); - FileDef *f1=m1->memberDef->getFileDef(); - FileDef *f2=m2->memberDef->getFileDef(); + const ClassDef *c1=m1->memberDef->getClassDef(); + const ClassDef *c2=m2->memberDef->getClassDef(); + const FileDef *f1=m1->memberDef->getFileDef(); + const FileDef *f2=m2->memberDef->getFileDef(); if (c1 && c2) return qstrcmp(c1->name(),c2->name()); else if (f1 && f2) diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index 0740512..1e526ae 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -31,6 +31,7 @@ #include "membergroup.h" #include "config.h" #include "definitionimpl.h" +#include "membername.h" //------------------------------------------------------------------ @@ -48,17 +49,18 @@ class NamespaceDefImpl : public DefinitionImpl, public NamespaceDef virtual void insertUsedFile(FileDef *fd); virtual void writeDocumentation(OutputList &ol); virtual void writeMemberPages(OutputList &ol); - virtual void writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const; + virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const; virtual void writeTagFile(FTextStream &); - virtual void insertClass(ClassDef *cd); - virtual void insertNamespace(NamespaceDef *nd); + virtual void insertClass(const ClassDef *cd); + virtual void insertNamespace(const NamespaceDef *nd); virtual void insertMember(MemberDef *md); virtual void computeAnchors(); - virtual int countMembers(); - virtual void addUsingDirective(NamespaceDef *nd); - virtual NamespaceSDict *getUsedNamespaces() const; - virtual void addUsingDeclaration(Definition *def); - virtual SDict<Definition> *getUsedClasses() const { return usingDeclList; } + virtual void countMembers(); + virtual int numDocMembers() const; + virtual void addUsingDirective(const NamespaceDef *nd); + virtual const NamespaceSDict *getUsedNamespaces() const; + virtual void addUsingDeclaration(const Definition *def); + virtual const SDict<Definition> *getUsedClasses() const { return usingDeclList; } virtual void combineUsingRelations(); virtual QCString displayName(bool=TRUE) const; virtual QCString localName() const; @@ -75,7 +77,7 @@ class NamespaceDefImpl : public DefinitionImpl, public NamespaceDef virtual void findSectionsInDocumentation(); virtual void sortMemberLists(); virtual Definition *findInnerCompound(const char *name) const; - virtual void addInnerCompound(Definition *d); + virtual void addInnerCompound(const Definition *d); virtual void addListReferences(); virtual void setFileName(const QCString &fn); virtual bool subGrouping() const { return m_subGrouping; } @@ -87,7 +89,7 @@ class NamespaceDefImpl : public DefinitionImpl, public NamespaceDef virtual ClassSDict *getInterfaceSDict() const { return interfaceSDict; } virtual ClassSDict *getStructSDict() const { return structSDict; } virtual ClassSDict *getExceptionSDict() const { return exceptionSDict; } - virtual NamespaceSDict *getNamespaceSDict() const { return namespaceSDict; } + virtual const NamespaceSDict *getNamespaceSDict() const { return namespaceSDict; } virtual QCString title() const; virtual QCString compoundTypeString() const; @@ -108,21 +110,22 @@ class NamespaceDefImpl : public DefinitionImpl, public NamespaceDef void endMemberDeclarations(OutputList &ol); void writeClassDeclarations(OutputList &ol,const QCString &title,ClassSDict *d); void writeInlineClasses(OutputList &ol); - void writeNamespaceDeclarations(OutputList &ol,const QCString &title, - bool isConstantGroup=false); void writeMemberGroups(OutputList &ol); void writeAuthorSection(OutputList &ol); void startMemberDocumentation(OutputList &ol); void endMemberDocumentation(OutputList &ol); - void writeSummaryLinks(OutputList &ol); + void writeSummaryLinks(OutputList &ol) const; void addNamespaceAttributes(OutputList &ol); void writeClassesToTagFile(FTextStream &,ClassSDict *d); + void writeNamespaceDeclarations(OutputList &ol,const QCString &title, + bool isConstantGroup=false); + QCString fileName; FileList files; NamespaceSDict *usingDirList; - SDict<Definition> *usingDeclList; + SDict<Definition> *usingDeclList; SDict<Definition> *m_innerCompounds; MemberSDict *m_allMembersDict; @@ -150,6 +153,109 @@ NamespaceDef *createNamespaceDef(const char *defFileName,int defLine,int defColu //------------------------------------------------------------------ +class NamespaceDefAliasImpl : public DefinitionAliasImpl, public NamespaceDef +{ + public: + NamespaceDefAliasImpl(const Definition *newScope,const NamespaceDef *nd) : DefinitionAliasImpl(newScope,nd) {} + virtual ~NamespaceDefAliasImpl() {} + virtual DefType definitionType() const { return TypeNamespace; } + + const NamespaceDef *getNSAlias() const { return dynamic_cast<const NamespaceDef*>(getAlias()); } + + // ---- getters + virtual QCString getOutputFileBase() const + { return getNSAlias()->getOutputFileBase(); } + virtual QCString anchor() const + { return getNSAlias()->anchor(); } + virtual int numDocMembers() const + { return getNSAlias()->numDocMembers(); } + virtual void addUsingDirective(const NamespaceDef *nd) {} + virtual const NamespaceSDict *getUsedNamespaces() const + { return getNSAlias()->getUsedNamespaces(); } + virtual void addUsingDeclaration(const Definition *def) {} + virtual const SDict<Definition> *getUsedClasses() const + { return getNSAlias()->getUsedClasses(); } + virtual void combineUsingRelations() {} + virtual QCString displayName(bool b=TRUE) const + { return getNSAlias()->displayName(b); } + virtual QCString localName() const + { return getNSAlias()->localName(); } + virtual void setInline(bool isInline) { } + virtual bool isConstantGroup() const + { return getNSAlias()->isConstantGroup(); } + virtual bool isModule() const + { return getNSAlias()->isModule(); } + virtual bool isLibrary() const + { return getNSAlias()->isLibrary(); } + virtual bool isInline() const + { return getNSAlias()->isInline(); } + virtual bool isLinkableInProject() const + { return getNSAlias()->isLinkableInProject(); } + virtual bool isLinkable() const + { return getNSAlias()->isLinkable(); } + virtual bool hasDetailedDescription() const + { return getNSAlias()->hasDetailedDescription(); } + virtual Definition *findInnerCompound(const char *name) const + { return getNSAlias()->findInnerCompound(name); } + virtual bool subGrouping() const + { return getNSAlias()->subGrouping(); } + virtual MemberList *getMemberList(MemberListType lt) const + { return getNSAlias()->getMemberList(lt); } + virtual const QList<MemberList> &getMemberLists() const + { return getNSAlias()->getMemberLists(); } + virtual MemberDef *getMemberByName(const QCString &name) const + { return getNSAlias()->getMemberByName(name); } + virtual MemberGroupSDict *getMemberGroupSDict() const + { return getNSAlias()->getMemberGroupSDict(); } + virtual ClassSDict *getClassSDict() const + { return getNSAlias()->getClassSDict(); } + virtual ClassSDict *getInterfaceSDict() const + { return getNSAlias()->getInterfaceSDict(); } + virtual ClassSDict *getStructSDict() const + { return getNSAlias()->getStructSDict(); } + virtual ClassSDict *getExceptionSDict() const + { return getNSAlias()->getExceptionSDict(); } + virtual const NamespaceSDict *getNamespaceSDict() const + { return getNSAlias()->getNamespaceSDict(); } + virtual QCString title() const + { return getNSAlias()->title(); } + virtual QCString compoundTypeString() const + { return getNSAlias()->compoundTypeString(); } + + // --- setters/actions + virtual void setMetaData(const QCString &m) {} + virtual void insertUsedFile(FileDef *fd) { } + virtual void writeDocumentation(OutputList &ol) {} + virtual void writeMemberPages(OutputList &ol) {} + virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const {} + virtual void writeTagFile(FTextStream &) {} + virtual void insertClass(const ClassDef *cd) {} + virtual void insertNamespace(const NamespaceDef *nd) {} + virtual void insertMember(MemberDef *md) {} + virtual void computeAnchors() {} + virtual void countMembers() {} + virtual void addMembersToMemberGroup() {} + virtual void distributeMemberGroupDocumentation() {} + virtual void findSectionsInDocumentation() {} + virtual void sortMemberLists() {} + virtual void addInnerCompound(const Definition *d) {} + virtual void addListReferences() {} + virtual void setFileName(const QCString &fn) {} + + void setVisited(bool v) { m_visited = v; } + bool isVisited() const { return m_visited; } + + private: + bool m_visited; +}; + +NamespaceDef *createNamespaceDefAlias(const Definition *newScope,const NamespaceDef *nd) +{ + return new NamespaceDefAliasImpl(newScope,nd); +} + +//------------------------------------------------------------------ + NamespaceDefImpl::NamespaceDefImpl(const char *df,int dl,int dc, const char *name,const char *lref, const char *fName, const char*type, @@ -185,6 +291,7 @@ NamespaceDefImpl::NamespaceDefImpl(const char *df,int dl,int dc, memberGroupSDict = new MemberGroupSDict; memberGroupSDict->setAutoDelete(TRUE); m_visited=FALSE; + m_inline=FALSE; m_subGrouping=Config_getBool(SUBGROUPING); if (type && !strcmp("module", type)) { @@ -272,20 +379,20 @@ void NamespaceDefImpl::insertUsedFile(FileDef *fd) } } -void NamespaceDefImpl::addInnerCompound(Definition *d) +void NamespaceDefImpl::addInnerCompound(const Definition *d) { m_innerCompounds->append(d->localName(),d); if (d->definitionType()==Definition::TypeNamespace) { - insertNamespace(dynamic_cast<NamespaceDef *>(d)); + insertNamespace(dynamic_cast<const NamespaceDef *>(d)); } else if (d->definitionType()==Definition::TypeClass) { - insertClass(dynamic_cast<ClassDef *>(d)); + insertClass(dynamic_cast<const ClassDef *>(d)); } } -void NamespaceDefImpl::insertClass(ClassDef *cd) +void NamespaceDefImpl::insertClass(const ClassDef *cd) { ClassSDict *d = classSDict; @@ -318,7 +425,7 @@ void NamespaceDefImpl::insertClass(ClassDef *cd) } } -void NamespaceDefImpl::insertNamespace(NamespaceDef *nd) +void NamespaceDefImpl::insertNamespace(const NamespaceDef *nd) { if (namespaceSDict->find(nd->name())==0) { @@ -360,6 +467,7 @@ void NamespaceDefImpl::addMembersToMemberGroup() void NamespaceDefImpl::insertMember(MemberDef *md) { + //printf("%s::insertMember(%s)\n",qPrint(name()),qPrint(md->name())); if (md->isHidden()) return; MemberList *allMemberList = getMemberList(MemberListType_allMembersList); if (allMemberList==0) @@ -415,6 +523,40 @@ void NamespaceDefImpl::insertMember(MemberDef *md) md->getClassDef() ? md->getClassDef()->name().data() : "", name().data()); } + // if this is an inline namespace, then insert an alias of this member in the outer scope. + if (isInline()) + { + Definition *outerScope = getOuterScope(); + if (outerScope) + { + MemberDef *aliasMd = 0; + if (outerScope->definitionType()==Definition::TypeNamespace) + { + aliasMd = createMemberDefAlias(outerScope,md); + dynamic_cast<NamespaceDef*>(outerScope)->insertMember(aliasMd); + } + else if (outerScope->definitionType()==Definition::TypeFile) + { + aliasMd = createMemberDefAlias(outerScope,md); + dynamic_cast<FileDef*>(outerScope)->insertMember(aliasMd); + } + if (aliasMd) + { + MemberName *mn; + QCString name = md->name(); + if ((mn=Doxygen::functionNameSDict->find(name))) + { + mn->append(aliasMd); + } + else + { + mn = new MemberName(name); + mn->append(aliasMd); + Doxygen::functionNameSDict->append(name,mn); + } + } + } + } } void NamespaceDefImpl::computeAnchors() @@ -582,7 +724,7 @@ void NamespaceDefImpl::writeBriefDescription(OutputList &ol) if (hasDetailedDescription()) { ol.disableAllBut(OutputGenerator::Html); - ol.startTextLink(0,"details"); + ol.startTextLink(getOutputFileBase(),"details"); ol.parseText(theTranslator->trMore()); ol.endTextLink(); } @@ -693,7 +835,7 @@ void NamespaceDefImpl::writeAuthorSection(OutputList &ol) ol.popGeneratorState(); } -void NamespaceDefImpl::writeSummaryLinks(OutputList &ol) +void NamespaceDefImpl::writeSummaryLinks(OutputList &ol) const { ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); @@ -972,7 +1114,7 @@ void NamespaceDefImpl::writeMemberPages(OutputList &ol) ol.popGeneratorState(); } -void NamespaceDefImpl::writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const +void NamespaceDefImpl::writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const { static bool createSubDirs=Config_getBool(CREATE_SUBDIRS); @@ -1015,15 +1157,34 @@ void NamespaceDefImpl::writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd ol.writeString(" </div>\n"); } -int NamespaceDefImpl::countMembers() +void NamespaceDefImpl::countMembers() +{ + QListIterator<MemberList> mli(m_memberLists); + MemberList *ml; + for (mli.toFirst();(ml=mli.current());++mli) + { + ml->countDecMembers(); + ml->countDocMembers(); + } + if (memberGroupSDict) + { + MemberGroupSDict::Iterator mgli(*memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->countDecMembers(); + mg->countDocMembers(); + } + } +} + +int NamespaceDefImpl::numDocMembers() const { MemberList *allMemberList = getMemberList(MemberListType_allMembersList); - if (allMemberList) allMemberList->countDocMembers(); - return (allMemberList ? allMemberList->numDocMembers() : 0) + - classSDict->count() + interfaceSDict->count() + structSDict->count() + exceptionSDict->count(); + return (allMemberList ? allMemberList->numDocMembers() : 0) + m_innerCompounds->count(); } -void NamespaceDefImpl::addUsingDirective(NamespaceDef *nd) +void NamespaceDefImpl::addUsingDirective(const NamespaceDef *nd) { if (usingDirList==0) { @@ -1036,13 +1197,13 @@ void NamespaceDefImpl::addUsingDirective(NamespaceDef *nd) //printf("%p: NamespaceDefImpl::addUsingDirective: %s:%d\n",this,name().data(),usingDirList->count()); } -NamespaceSDict *NamespaceDefImpl::getUsedNamespaces() const +const NamespaceSDict *NamespaceDefImpl::getUsedNamespaces() const { //printf("%p: NamespaceDefImpl::getUsedNamespace: %s:%d\n",this,name().data(),usingDirList?usingDirList->count():0); return usingDirList; } -void NamespaceDefImpl::addUsingDeclaration(Definition *d) +void NamespaceDefImpl::addUsingDeclaration(const Definition *d) { if (usingDeclList==0) { @@ -1297,14 +1458,10 @@ void NamespaceDefImpl::addMemberToList(MemberListType lt,MemberDef *md) ((ml->listType()&MemberListType_documentationLists) && sortMemberDocs)); ml->append(md); -#if 0 - if (ml->needsSorting()) - ml->inSort(md); - else - ml->append(md); -#endif - - if (ml->listType()&MemberListType_declarationLists) md->setSectionList(this,ml); + if (ml->listType()&MemberListType_declarationLists) + { + md->setSectionList(this,ml); + } } void NamespaceDefImpl::sortMemberLists() diff --git a/src/namespacedef.h b/src/namespacedef.h index bfa8c42..3be54f2 100644 --- a/src/namespacedef.h +++ b/src/namespacedef.h @@ -45,19 +45,20 @@ class NamespaceDef : virtual public Definition virtual void writeDocumentation(OutputList &ol) = 0; virtual void writeMemberPages(OutputList &ol) = 0; - virtual void writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const = 0; + virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const = 0; virtual void writeTagFile(FTextStream &) = 0; - virtual void insertClass(ClassDef *cd) = 0; - virtual void insertNamespace(NamespaceDef *nd) = 0; - virtual void insertMember(MemberDef *md) = 0; + virtual void insertClass(const ClassDef *cd) = 0; + virtual void insertNamespace(const NamespaceDef *nd) = 0; + virtual void insertMember(MemberDef *md) = 0; // md cannot be const, since setSectionList is called on it virtual void computeAnchors() = 0; - virtual int countMembers() = 0; - virtual void addUsingDirective(NamespaceDef *nd) = 0; - virtual NamespaceSDict *getUsedNamespaces() const = 0; - virtual void addUsingDeclaration(Definition *def) = 0; - virtual SDict<Definition> *getUsedClasses() const = 0; + virtual void countMembers() = 0; + virtual int numDocMembers() const = 0; + virtual void addUsingDirective(const NamespaceDef *nd) = 0; + virtual const NamespaceSDict *getUsedNamespaces() const = 0; + virtual void addUsingDeclaration(const Definition *def) = 0; + virtual const SDict<Definition> *getUsedClasses() const = 0; virtual void combineUsingRelations() = 0; virtual QCString displayName(bool=TRUE) const = 0; virtual QCString localName() const = 0; @@ -77,7 +78,7 @@ class NamespaceDef : virtual public Definition virtual void sortMemberLists() = 0; virtual Definition *findInnerCompound(const char *name) const = 0; - virtual void addInnerCompound(Definition *d) = 0; + virtual void addInnerCompound(const Definition *d) = 0; virtual void addListReferences() = 0; virtual void setFileName(const QCString &fn) = 0; @@ -103,7 +104,7 @@ class NamespaceDef : virtual public Definition virtual ClassSDict *getExceptionSDict() const = 0; /*! Returns the namespaces contained in this namespace */ - virtual NamespaceSDict *getNamespaceSDict() const = 0; + virtual const NamespaceSDict *getNamespaceSDict() const = 0; virtual QCString title() const = 0; virtual QCString compoundTypeString() const = 0; @@ -119,6 +120,9 @@ NamespaceDef *createNamespaceDef(const char *defFileName,int defLine,int defColu const char *refFile=0,const char*type=0, bool isPublished=false); +/** Factory method to create an alias of an existing namespace. Used for inline namespaces. */ +NamespaceDef *createNamespaceDefAlias(const Definition *newScope, const NamespaceDef *nd); + /** A list of NamespaceDef objects. */ class NamespaceList : public QList<NamespaceDef> { diff --git a/src/outputgen.h b/src/outputgen.h index a99cff3..8d9db65 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -124,7 +124,7 @@ class CodeOutputInterface */ virtual void writeCodeAnchor(const char *name) = 0; - virtual void setCurrentDoc(Definition *context,const char *anchor,bool isSourceFile) = 0; + virtual void setCurrentDoc(const Definition *context,const char *anchor,bool isSourceFile) = 0; virtual void addWord(const char *word,bool hiPriority) = 0; }; @@ -346,7 +346,7 @@ class OutputGenerator : public BaseOutputDocInterface //void setEncoding(const QCString &enc) { encoding = enc; } //virtual void postProcess(QByteArray &) { } - virtual void writeDoc(DocNode *,Definition *ctx,MemberDef *md) = 0; + virtual void writeDoc(DocNode *,const Definition *ctx,const MemberDef *md) = 0; /////////////////////////////////////////////////////////////// // structural output interface diff --git a/src/outputlist.cpp b/src/outputlist.cpp index 93a1b6e..1d6db55 100644 --- a/src/outputlist.cpp +++ b/src/outputlist.cpp @@ -129,7 +129,7 @@ void OutputList::popGeneratorState() } bool OutputList::generateDoc(const char *fileName,int startLine, - Definition *ctx,MemberDef * md, + const Definition *ctx,const MemberDef * md, const QCString &docStr,bool indexWords, bool isExample,const char *exampleName, bool singleLine,bool linkFromIndex) @@ -159,7 +159,7 @@ bool OutputList::generateDoc(const char *fileName,int startLine, return isEmpty; } -void OutputList::writeDoc(DocRoot *root,Definition *ctx,MemberDef *md) +void OutputList::writeDoc(DocRoot *root,const Definition *ctx,const MemberDef *md) { QListIterator<OutputGenerator> it(m_outputs); OutputGenerator *og; @@ -345,7 +345,7 @@ FORALL3(const char *a1,const char *a2,bool a3,a1,a2,a3) FORALL3(const char *a1,int a2,const char *a3,a1,a2,a3) FORALL3(const char *a1,const char *a2,SectionInfo::SectionType a3,a1,a2,a3) FORALL3(uchar a1,uchar a2,uchar a3,a1,a2,a3) -FORALL3(Definition *a1,const char *a2,bool a3,a1,a2,a3) +FORALL3(const Definition *a1,const char *a2,bool a3,a1,a2,a3) FORALL4(SectionTypes a1,const char *a2,const char *a3,const char *a4,a1,a2,a3,a4) FORALL4(const char *a1,const char *a2,const char *a3,const char *a4,a1,a2,a3,a4) FORALL4(const char *a1,const char *a2,const char *a3,int a4,a1,a2,a3,a4) diff --git a/src/outputlist.h b/src/outputlist.h index 5fd8017..1371b3a 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -75,10 +75,10 @@ class OutputList : public OutputDocInterface ////////////////////////////////////////////////// bool generateDoc(const char *fileName,int startLine, - Definition *ctx,MemberDef *md,const QCString &docStr, + const Definition *ctx,const MemberDef *md,const QCString &docStr, bool indexWords,bool isExample,const char *exampleName=0, bool singleLine=FALSE,bool linkFromIndex=FALSE); - void writeDoc(DocRoot *root,Definition *ctx,MemberDef *md); + void writeDoc(DocRoot *root,const Definition *ctx,const MemberDef *md); bool parseText(const QCString &textStr); @@ -487,7 +487,7 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::endFontClass); } void writeCodeAnchor(const char *name) { forall(&OutputGenerator::writeCodeAnchor,name); } - void setCurrentDoc(Definition *context,const char *anchor,bool isSourceFile) + void setCurrentDoc(const Definition *context,const char *anchor,bool isSourceFile) { forall(&OutputGenerator::setCurrentDoc,context,anchor,isSourceFile); } void addWord(const char *word,bool hiPriority) { forall(&OutputGenerator::addWord,word,hiPriority); } @@ -548,7 +548,7 @@ class OutputList : public OutputDocInterface FORALLPROTO3(uchar,uchar,uchar); FORALLPROTO3(const char *,const char *,const char *); FORALLPROTO3(const ClassDiagram &,const char *,const char *); - FORALLPROTO3(Definition*,const char *,bool); + FORALLPROTO3(const Definition*,const char *,bool); FORALLPROTO4(SectionTypes,const char *,const char *,const char *); FORALLPROTO4(const char *,const char *,const char *,const char *); FORALLPROTO4(const char *,const char *,const char *,bool); diff --git a/src/parserintf.h b/src/parserintf.h index 0942106..f03aac7 100644 --- a/src/parserintf.h +++ b/src/parserintf.h @@ -110,9 +110,9 @@ class ParserInterface int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, - MemberDef *memberDef=0, + const MemberDef *memberDef=0, bool showLineNumbers=TRUE, - Definition *searchCtx=0, + const Definition *searchCtx=0, bool collectXRefs=TRUE ) = 0; diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index 1ec4bf3..d6e2af6 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -1462,7 +1462,7 @@ static void addMemberTemplateLists(MemberDef *md,PerlModOutput &output) } #endif -static void addTemplateList(ClassDef *cd,PerlModOutput &output) +static void addTemplateList(const ClassDef *cd,PerlModOutput &output) { addTemplateArgumentList(cd->templateArguments(),output,cd->name()); } @@ -1471,8 +1471,8 @@ static void addPerlModDocBlock(PerlModOutput &output, const char *name, const QCString &fileName, int lineNr, - Definition *scope, - MemberDef *md, + const Definition *scope, + const MemberDef *md, const QCString &text) { QCString stext = text.stripWhiteSpace(); @@ -1543,14 +1543,14 @@ public: inline PerlModGenerator(bool pretty) : m_output(pretty) { } - void generatePerlModForMember(MemberDef *md, Definition *); - void generatePerlModSection(Definition *d, MemberList *ml, + void generatePerlModForMember(const MemberDef *md, const Definition *); + void generatePerlModSection(const Definition *d, MemberList *ml, const char *name, const char *header=0); - void addListOfAllMembers(ClassDef *cd); - void generatePerlModForClass(ClassDef *cd); - void generatePerlModForNamespace(NamespaceDef *nd); - void generatePerlModForFile(FileDef *fd); - void generatePerlModForGroup(GroupDef *gd); + void addListOfAllMembers(const ClassDef *cd); + void generatePerlModForClass(const ClassDef *cd); + void generatePerlModForNamespace(const NamespaceDef *nd); + void generatePerlModForFile(const FileDef *fd); + void generatePerlModForGroup(const GroupDef *gd); void generatePerlModForPage(PageDef *pi); bool createOutputFile(QFile &f, const char *s); @@ -1567,7 +1567,7 @@ public: void generate(); }; -void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *) +void PerlModGenerator::generatePerlModForMember(const MemberDef *md,const Definition *) { // + declaration/definition arg lists // + reimplements @@ -1687,12 +1687,12 @@ void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *) if (md->memberType()==MemberType_Enumeration) // enum { - MemberList *enumFields = md->enumFieldList(); + const MemberList *enumFields = md->enumFieldList(); if (enumFields) { m_output.openList("values"); MemberListIterator emli(*enumFields); - MemberDef *emd; + const MemberDef *emd; for (emli.toFirst();(emd=emli.current());++emli) { m_output.openHash() @@ -1711,7 +1711,7 @@ void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *) } } - MemberDef *rmd = md->reimplements(); + const MemberDef *rmd = md->reimplements(); if (rmd) m_output.openHash("reimplements") .addFieldQuotedString("name", rmd->name()) @@ -1732,7 +1732,7 @@ void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *) m_output.closeHash(); } -void PerlModGenerator::generatePerlModSection(Definition *d, +void PerlModGenerator::generatePerlModSection(const Definition *d, MemberList *ml,const char *name,const char *header) { if (ml==0) return; // empty list @@ -1744,7 +1744,7 @@ void PerlModGenerator::generatePerlModSection(Definition *d, m_output.openList("members"); MemberListIterator mli(*ml); - MemberDef *md; + const MemberDef *md; for (mli.toFirst();(md=mli.current());++mli) { generatePerlModForMember(md,d); @@ -1753,7 +1753,7 @@ void PerlModGenerator::generatePerlModSection(Definition *d, .closeHash(); } -void PerlModGenerator::addListOfAllMembers(ClassDef *cd) +void PerlModGenerator::addListOfAllMembers(const ClassDef *cd) { m_output.openList("all_members"); if (cd->memberNameInfoSDict()) @@ -1766,9 +1766,9 @@ void PerlModGenerator::addListOfAllMembers(ClassDef *cd) MemberInfo *mi; for (mii.toFirst();(mi=mii.current());++mii) { - MemberDef *md=mi->memberDef; - ClassDef *cd=md->getClassDef(); - Definition *d=md->getGroupDef(); + const MemberDef *md=mi->memberDef; + const ClassDef *cd=md->getClassDef(); + const Definition *d=md->getGroupDef(); if (d==0) d = cd; m_output.openHash() @@ -1787,7 +1787,7 @@ void PerlModGenerator::addListOfAllMembers(ClassDef *cd) m_output.closeList(); } -void PerlModGenerator::generatePerlModForClass(ClassDef *cd) +void PerlModGenerator::generatePerlModForClass(const ClassDef *cd) { // + brief description // + detailed description @@ -1845,7 +1845,7 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd) { m_output.openList("inner"); ClassSDict::Iterator cli(*cl); - ClassDef *cd; + const ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) m_output.openHash() .addFieldQuotedString("name", cd->name()) @@ -1937,7 +1937,7 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd) m_output.closeHash(); } -void PerlModGenerator::generatePerlModForNamespace(NamespaceDef *nd) +void PerlModGenerator::generatePerlModForNamespace(const NamespaceDef *nd) { // + contained class definitions // + contained namespace definitions @@ -1958,7 +1958,7 @@ void PerlModGenerator::generatePerlModForNamespace(NamespaceDef *nd) { m_output.openList("classes"); ClassSDict::Iterator cli(*cl); - ClassDef *cd; + const ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) m_output.openHash() .addFieldQuotedString("name", cd->name()) @@ -1966,12 +1966,12 @@ void PerlModGenerator::generatePerlModForNamespace(NamespaceDef *nd) m_output.closeList(); } - NamespaceSDict *nl = nd->getNamespaceSDict(); + const NamespaceSDict *nl = nd->getNamespaceSDict(); if (nl) { m_output.openList("namespaces"); NamespaceSDict::Iterator nli(*nl); - NamespaceDef *nd; + const NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) m_output.openHash() .addFieldQuotedString("name", nd->name()) @@ -1982,7 +1982,7 @@ void PerlModGenerator::generatePerlModForNamespace(NamespaceDef *nd) if (nd->getMemberGroupSDict()) { MemberGroupSDict::Iterator mgli(*nd->getMemberGroupSDict()); - MemberGroup *mg; + const MemberGroup *mg; for (;(mg=mgli.current());++mgli) generatePerlModSection(nd,mg->members(),"user-defined",mg->header()); } @@ -2000,7 +2000,7 @@ void PerlModGenerator::generatePerlModForNamespace(NamespaceDef *nd) m_output.closeHash(); } -void PerlModGenerator::generatePerlModForFile(FileDef *fd) +void PerlModGenerator::generatePerlModForFile(const FileDef *fd) { // + includes files // + includedby files @@ -2069,7 +2069,7 @@ void PerlModGenerator::generatePerlModForFile(FileDef *fd) m_output.closeHash(); } -void PerlModGenerator::generatePerlModForGroup(GroupDef *gd) +void PerlModGenerator::generatePerlModForGroup(const GroupDef *gd) { // + members // + member groups @@ -2094,7 +2094,7 @@ void PerlModGenerator::generatePerlModForGroup(GroupDef *gd) { m_output.openList("files"); QListIterator<FileDef> fli(*fl); - FileDef *fd; + const FileDef *fd; for (fli.toFirst();(fd=fli.current());++fli) m_output.openHash() .addFieldQuotedString("name", fd->name()) @@ -2107,7 +2107,7 @@ void PerlModGenerator::generatePerlModForGroup(GroupDef *gd) { m_output.openList("classes"); ClassSDict::Iterator cli(*cl); - ClassDef *cd; + const ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) m_output.openHash() .addFieldQuotedString("name", cd->name()) @@ -2120,7 +2120,7 @@ void PerlModGenerator::generatePerlModForGroup(GroupDef *gd) { m_output.openList("namespaces"); NamespaceSDict::Iterator nli(*nl); - NamespaceDef *nd; + const NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) m_output.openHash() .addFieldQuotedString("name", nd->name()) @@ -2146,7 +2146,7 @@ void PerlModGenerator::generatePerlModForGroup(GroupDef *gd) { m_output.openList("groups"); GroupListIterator gli(*gl); - GroupDef *sgd; + const GroupDef *sgd; for (gli.toFirst();(sgd=gli.current());++gli) m_output.openHash() .addFieldQuotedString("title", sgd->groupTitle()) @@ -2207,14 +2207,14 @@ bool PerlModGenerator::generatePerlModOutput() m_output.openList("classes"); ClassSDict::Iterator cli(*Doxygen::classSDict); - ClassDef *cd; + const ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) generatePerlModForClass(cd); m_output.closeList(); m_output.openList("namespaces"); NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict); - NamespaceDef *nd; + const NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) generatePerlModForNamespace(nd); m_output.closeList(); @@ -2225,7 +2225,7 @@ bool PerlModGenerator::generatePerlModOutput() for (;(fn=fnli.current());++fnli) { FileNameIterator fni(*fn); - FileDef *fd; + const FileDef *fd; for (;(fd=fni.current());++fni) generatePerlModForFile(fd); } @@ -2233,7 +2233,7 @@ bool PerlModGenerator::generatePerlModOutput() m_output.openList("groups"); GroupSDict::Iterator gli(*Doxygen::groupSDict); - GroupDef *gd; + const GroupDef *gd; for (;(gd=gli.current());++gli) { generatePerlModForGroup(gd); diff --git a/src/pycode.h b/src/pycode.h index 9817c39..de0a8a9 100644 --- a/src/pycode.h +++ b/src/pycode.h @@ -36,7 +36,7 @@ class Definition; extern void parsePythonCode(CodeOutputInterface &,const char *,const QCString &, bool ,const char *,FileDef *fd, int startLine,int endLine,bool inlineFragment, - MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx, + const MemberDef *memberDef,bool showLineNumbers,const Definition *searchCtx, bool collectXRefs); extern void resetPythonCodeParserState(); diff --git a/src/pycode.l b/src/pycode.l index 4fb27f1..b0ec68e 100644 --- a/src/pycode.l +++ b/src/pycode.l @@ -63,7 +63,7 @@ static const char * g_inputString; //!< the code fragment as text static int g_inputPosition; //!< read offset during parsing static const char * g_currentFontClass; static bool g_needsTermination; -static Definition *g_searchCtx; +static const Definition *g_searchCtx; static bool g_collectXRefs; static int g_inputLines; //!< number of line in the code fragment static int g_yyLineNr; //!< current line number @@ -437,7 +437,7 @@ static void nextCodeLine() * split into multiple links with the same destination, one for each line. */ static void writeMultiLineCodeLink(CodeOutputInterface &ol, - Definition *d, + const Definition *d, const char *text) { static bool sourceTooltips = Config_getBool(SOURCE_TOOLTIPS); @@ -544,11 +544,11 @@ static bool getLinkInScope(const QCString &c, // scope const char *text ) { - MemberDef *md; - ClassDef *cd; - FileDef *fd; - NamespaceDef *nd; - GroupDef *gd; + MemberDef *md = 0; + const ClassDef *cd = 0; + const FileDef *fd = 0; + const NamespaceDef *nd = 0; + const GroupDef *gd = 0; //printf("Trying `%s'::`%s'\n",c.data(),m.data()); if (getDefs(c,m,"()",md,cd,fd,nd,gd,FALSE,g_sourceFileDef) && md->isLinkable()) @@ -556,8 +556,8 @@ static bool getLinkInScope(const QCString &c, // scope //Definition *d=0; //if (cd) d=cd; else if (nd) d=nd; else if (fd) d=fd; else d=gd; - Definition *d = md->getOuterScope()==Doxygen::globalScope ? - md->getBodyDef() : md->getOuterScope(); + const Definition *d = md->getOuterScope()==Doxygen::globalScope ? + md->getBodyDef() : md->getOuterScope(); //printf("Found! d=%s\n",d?d->name().data():"<none>"); if (md->getGroupDef()) d = md->getGroupDef(); if (d && d->isLinkable()) @@ -634,7 +634,7 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName, if (cd==0 && md==0) // also see if it is variable or enum or enum value { - NamespaceDef *nd = getResolvedNamespace(scope); + const NamespaceDef *nd = getResolvedNamespace(scope); if (nd) { writeMultiLineCodeLink(ol,nd,clName); @@ -663,8 +663,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName, addToSearchIndex(className); if (md) { - Definition *d = md->getOuterScope()==Doxygen::globalScope ? - md->getBodyDef() : md->getOuterScope(); + const Definition *d = md->getOuterScope()==Doxygen::globalScope ? + md->getBodyDef() : md->getOuterScope(); if (md->getGroupDef()) d = md->getGroupDef(); if (d && d->isLinkable() && md->isLinkable() && g_currentMemberDef && g_collectXRefs) @@ -690,8 +690,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName, g_theCallContext.setClass(stripClassName(md->typeString(),md->getOuterScope())); writeMultiLineCodeLink(ol,md,clName); addToSearchIndex(className); - Definition *d = md->getOuterScope()==Doxygen::globalScope ? - md->getBodyDef() : md->getOuterScope(); + const Definition *d = md->getOuterScope()==Doxygen::globalScope ? + md->getBodyDef() : md->getOuterScope(); if (md->getGroupDef()) d = md->getGroupDef(); if (d && d->isLinkable() && md->isLinkable() && g_currentMemberDef && g_collectXRefs) @@ -703,7 +703,7 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName, } else // check namespace as well { - NamespaceDef *mnd = getResolvedNamespace(scope); + const NamespaceDef *mnd = getResolvedNamespace(scope); if (mnd) { MemberDef *md=mnd->getMemberByName(locName); @@ -713,8 +713,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName, g_theCallContext.setClass(stripClassName(md->typeString(),md->getOuterScope())); writeMultiLineCodeLink(ol,md,clName); addToSearchIndex(className); - Definition *d = md->getOuterScope()==Doxygen::globalScope ? - md->getBodyDef() : md->getOuterScope(); + const Definition *d = md->getOuterScope()==Doxygen::globalScope ? + md->getBodyDef() : md->getOuterScope(); if (md->getGroupDef()) d = md->getGroupDef(); if (d && d->isLinkable() && md->isLinkable() && g_currentMemberDef && g_collectXRefs) @@ -1560,7 +1560,7 @@ static void adjustScopesAndSuites(unsigned indentLength) void parsePythonCode(CodeOutputInterface &od,const char * /*className*/, const QCString &s,bool exBlock, const char *exName, FileDef *fd,int startLine,int endLine,bool inlineFragment, - MemberDef *,bool,Definition *searchCtx,bool collectXRefs) + const MemberDef *,bool,const Definition *searchCtx,bool collectXRefs) { //printf("***parseCode()\n"); diff --git a/src/pyscanner.h b/src/pyscanner.h index affa7ca..01235ee 100644 --- a/src/pyscanner.h +++ b/src/pyscanner.h @@ -53,9 +53,9 @@ class PythonLanguageScanner : public ParserInterface int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, - MemberDef *memberDef=0, + const MemberDef *memberDef=0, bool showLineNumbers=TRUE, - Definition *searchCtx=0, + const Definition *searchCtx=0, bool collectXrefs=TRUE ); void resetCodeParserState(); diff --git a/src/pyscanner.l b/src/pyscanner.l index 655b6e2..41422bd 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -1926,9 +1926,9 @@ void PythonLanguageScanner::parseCode(CodeOutputInterface &codeOutIntf, int startLine, int endLine, bool inlineFragment, - MemberDef *memberDef, + const MemberDef *memberDef, bool showLineNumbers, - Definition *searchCtx, + const Definition *searchCtx, bool collectXRefs ) { diff --git a/src/qhp.cpp b/src/qhp.cpp index 6ce6b06..6260d09 100644 --- a/src/qhp.cpp +++ b/src/qhp.cpp @@ -193,7 +193,7 @@ void Qhp::addContentsItem(bool /*isDir*/, const char * name, const char * /*ref*/, const char * file, const char *anchor, bool /* separateIndex */, bool /* addToNavIndex */, - Definition * /*def*/) + const Definition * /*def*/) { //printf("Qhp::addContentsItem(%s) %d\n",name,m_sectionLevel); // Backup difference before modification @@ -214,7 +214,7 @@ void Qhp::addContentsItem(bool /*isDir*/, const char * name, } } -void Qhp::addIndexItem(Definition *context,MemberDef *md, +void Qhp::addIndexItem(const Definition *context,const MemberDef *md, const char *sectionAnchor,const char *word) { (void)word; @@ -34,8 +34,8 @@ class Qhp : public IndexIntf void addContentsItem(bool isDir, const char * name, const char * ref, const char * file, const char * anchor, bool separateIndex,bool addToNavIndex, - Definition *def); - void addIndexItem(Definition *context, MemberDef *md, + const Definition *def); + void addIndexItem(const Definition *context, const MemberDef *md, const char *sectionAnchor, const char *title); void addIndexFile(const char * name); void addImageFile(const char * name); diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index b42780f..bb2075b 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -2803,7 +2803,7 @@ void RTFGenerator::exceptionEntry(const char* prefix,bool closeBracket) t << " "; } -void RTFGenerator::writeDoc(DocNode *n,Definition *ctx,MemberDef *) +void RTFGenerator::writeDoc(DocNode *n,const Definition *ctx,const MemberDef *) { RTFDocVisitor *visitor = new RTFDocVisitor(t,*this,ctx?ctx->getDefFileExtension():QCString("")); n->accept(visitor); diff --git a/src/rtfgen.h b/src/rtfgen.h index b6b32c7..3f05821 100644 --- a/src/rtfgen.h +++ b/src/rtfgen.h @@ -41,7 +41,7 @@ class RTFGenerator : public OutputGenerator bool isEnabled(OutputType o) { return (o==RTF && active); } OutputGenerator *get(OutputType o) { return (o==RTF) ? this : 0; } - void writeDoc(DocNode *,Definition *,MemberDef *); + void writeDoc(DocNode *,const Definition *,const MemberDef *); void startFile(const char *name,const char *manName,const char *title); void writeSearchInfo() {} @@ -262,7 +262,7 @@ class RTFGenerator : public OutputGenerator void endFontClass(); void writeCodeAnchor(const char *) {} - void setCurrentDoc(Definition *,const char *,bool) {} + void setCurrentDoc(const Definition *,const char *,bool) {} void addWord(const char *,bool) {} static bool preProcessFileInplace(const char *path,const char *name); diff --git a/src/scanner.h b/src/scanner.h index ac574e2..c0d3dff 100644 --- a/src/scanner.h +++ b/src/scanner.h @@ -48,9 +48,9 @@ class CLanguageScanner : public ParserInterface int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, - MemberDef *memberDef=0, + const MemberDef *memberDef=0, bool showLineNumbers=TRUE, - Definition *searchCtx=0, + const Definition *searchCtx=0, bool collectXRefs=TRUE ); void resetCodeParserState(); diff --git a/src/scanner.l b/src/scanner.l index 3d3c109..d3902b3 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -4625,7 +4625,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) unput(lastCopyArgChar); BEGIN( lastCommentInArgContext ); } -<CopyArgCommentLine>{CMD}("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"dot"|"code")/[^a-z_A-Z0-9] { // verbatim command (which could contain nested comments!) +<CopyArgCommentLine>{CMD}("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"dot"|"code")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!) docBlockName=&yytext[1]; fullArgString+=yytext; BEGIN(CopyArgVerbatim); @@ -4643,7 +4643,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) fullArgString+=yytext; BEGIN(CopyArgVerbatim); } -<CopyArgVerbatim>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"enddot"|"endcode"|"f$"|"f]"|"f}")/[^a-z_A-Z0-9] { // end of verbatim block +<CopyArgVerbatim>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"enddot"|"endcode"|"f$"|"f]"|"f}")/[^a-z_A-Z0-9\-] { // end of verbatim block fullArgString+=yytext; if (yytext[1]=='f') // end of formula { @@ -6563,7 +6563,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) g_nestedComment=FALSE; BEGIN(DocCopyBlock); } -<DocBlock>{CMD}("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"dot"|"code")/[^a-z_A-Z0-9] { // verbatim command (which could contain nested comments!) +<DocBlock>{CMD}("verbatim"|"latexonly"|"htmlonly"|"xmlonly"|"manonly"|"dot"|"code")/[^a-z_A-Z0-9\-] { // verbatim command (which could contain nested comments!) docBlock+=yytext; docBlockName=&yytext[1]; g_fencedSize=0; @@ -7368,9 +7368,9 @@ void CLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf, int startLine, int endLine, bool inlineFragment, - MemberDef *memberDef, + const MemberDef *memberDef, bool showLineNumbers, - Definition *searchCtx, + const Definition *searchCtx, bool collectXRefs ) { diff --git a/src/searchindex.cpp b/src/searchindex.cpp index cfa8ed2..babefe9 100644 --- a/src/searchindex.cpp +++ b/src/searchindex.cpp @@ -86,12 +86,12 @@ SearchIndex::SearchIndex() : SearchIndexIntf(Internal), for (i=0;i<numIndexEntries;i++) m_index.insert(i,new QList<IndexWord>); } -void SearchIndex::setCurrentDoc(Definition *ctx,const char *anchor,bool isSourceFile) +void SearchIndex::setCurrentDoc(const Definition *ctx,const char *anchor,bool isSourceFile) { if (ctx==0) return; assert(!isSourceFile || ctx->definitionType()==Definition::TypeFile); //printf("SearchIndex::setCurrentDoc(%s,%s,%s)\n",name,baseName,anchor); - QCString url=isSourceFile ? (dynamic_cast<FileDef*>(ctx))->getSourceFileBase() : ctx->getOutputFileBase(); + QCString url=isSourceFile ? (dynamic_cast<const FileDef*>(ctx))->getSourceFileBase() : ctx->getOutputFileBase(); url+=Config_getString(HTML_FILE_EXTENSION); QCString baseUrl = url; if (anchor) url+=QCString("#")+anchor; @@ -99,7 +99,7 @@ void SearchIndex::setCurrentDoc(Definition *ctx,const char *anchor,bool isSource QCString name=ctx->qualifiedName(); if (ctx->definitionType()==Definition::TypeMember) { - MemberDef *md = dynamic_cast<MemberDef *>(ctx); + const MemberDef *md = dynamic_cast<const MemberDef *>(ctx); name.prepend((md->getLanguage()==SrcLangExt_Fortran ? theTranslator->trSubprogram(TRUE,TRUE) : theTranslator->trMember(TRUE,TRUE))+" "); @@ -116,7 +116,7 @@ void SearchIndex::setCurrentDoc(Definition *ctx,const char *anchor,bool isSource { case Definition::TypePage: { - PageDef *pd = dynamic_cast<PageDef *>(ctx); + const PageDef *pd = dynamic_cast<const PageDef *>(ctx); if (pd->hasTitle()) { name = theTranslator->trPage(TRUE,TRUE)+" "+pd->title(); @@ -129,7 +129,7 @@ void SearchIndex::setCurrentDoc(Definition *ctx,const char *anchor,bool isSource break; case Definition::TypeClass: { - ClassDef *cd = dynamic_cast<ClassDef *>(ctx); + const ClassDef *cd = dynamic_cast<const ClassDef *>(ctx); name.prepend(cd->compoundTypeString()+" "); } break; @@ -151,7 +151,7 @@ void SearchIndex::setCurrentDoc(Definition *ctx,const char *anchor,bool isSource break; case Definition::TypeGroup: { - GroupDef *gd = dynamic_cast<GroupDef *>(ctx); + const GroupDef *gd = dynamic_cast<const GroupDef *>(ctx); if (gd->groupTitle()) { name = theTranslator->trGroup(TRUE,TRUE)+" "+gd->groupTitle(); @@ -442,11 +442,11 @@ SearchIndexExternal::~SearchIndexExternal() delete p; } -static QCString definitionToName(Definition *ctx) +static QCString definitionToName(const Definition *ctx) { if (ctx && ctx->definitionType()==Definition::TypeMember) { - MemberDef *md = dynamic_cast<MemberDef*>(ctx); + const MemberDef *md = dynamic_cast<const MemberDef*>(ctx); if (md->isFunction()) return "function"; else if (md->isSlot()) @@ -477,7 +477,7 @@ static QCString definitionToName(Definition *ctx) switch(ctx->definitionType()) { case Definition::TypeClass: - return (dynamic_cast<ClassDef*>(ctx))->compoundTypeString(); + return (dynamic_cast<const ClassDef*>(ctx))->compoundTypeString(); case Definition::TypeFile: return "file"; case Definition::TypeNamespace: @@ -497,10 +497,10 @@ static QCString definitionToName(Definition *ctx) return "unknown"; } -void SearchIndexExternal::setCurrentDoc(Definition *ctx,const char *anchor,bool isSourceFile) +void SearchIndexExternal::setCurrentDoc(const Definition *ctx,const char *anchor,bool isSourceFile) { QCString extId = stripPath(Config_getString(EXTERNAL_SEARCH_ID)); - QCString baseName = isSourceFile ? (dynamic_cast<FileDef*>(ctx))->getSourceFileBase() : ctx->getOutputFileBase(); + QCString baseName = isSourceFile ? (dynamic_cast<const FileDef*>(ctx))->getSourceFileBase() : ctx->getOutputFileBase(); QCString url = baseName + Doxygen::htmlFileExtension; if (anchor) url+=QCString("#")+anchor; QCString key = extId+";"+url; @@ -514,7 +514,7 @@ void SearchIndexExternal::setCurrentDoc(Definition *ctx,const char *anchor,bool e->name = ctx->qualifiedName(); if (ctx->definitionType()==Definition::TypeMember) { - e->args = (dynamic_cast<MemberDef*>(ctx))->argsString(); + e->args = (dynamic_cast<const MemberDef*>(ctx))->argsString(); } e->extId = extId; e->url = url; @@ -585,14 +585,14 @@ void SearchIndexExternal::write(const char *fileName) static SearchIndexInfo g_searchIndexInfo[NUM_SEARCH_INDICES]; -static void addMemberToSearchIndex(MemberDef *md) +static void addMemberToSearchIndex(const MemberDef *md) { static bool hideFriendCompounds = Config_getBool(HIDE_FRIEND_COMPOUNDS); bool isLinkable = md->isLinkable(); - ClassDef *cd=0; - NamespaceDef *nd=0; - FileDef *fd=0; - GroupDef *gd=0; + const ClassDef *cd=0; + const NamespaceDef *nd=0; + const FileDef *fd=0; + const GroupDef *gd=0; if (isLinkable && ( ((cd=md->getClassDef()) && cd->isLinkable() && cd->templateMaster()==0) || @@ -1074,7 +1074,7 @@ void writeJavascriptSearchIndex() } else if (md) { - FileDef *fd = md->getBodyDef(); + const FileDef *fd = md->getBodyDef(); if (fd==0) fd = md->getFileDef(); if (fd) { @@ -1155,8 +1155,8 @@ void writeJavascriptSearchIndex() { if (md) { - FileDef *fd = md->getBodyDef(); - if (fd==0) fd = md->getFileDef(); + const FileDef *fd = md->getBodyDef(); + if (fd==0) fd = md->resolveAlias()->getFileDef(); if (fd) { if (!prefix.isEmpty()) prefix+=": "; @@ -1165,7 +1165,7 @@ void writeJavascriptSearchIndex() } } } - else if (md && (md->getClassDef() || md->getNamespaceDef())) + else if (md && (md->resolveAlias()->getClassDef() || md->resolveAlias()->getNamespaceDef())) // member in class or namespace scope { SrcLangExt lang = md->getLanguage(); @@ -1315,7 +1315,7 @@ SearchIndexList::~SearchIndexList() { } -void SearchIndexList::append(Definition *d) +void SearchIndexList::append(const Definition *d) { QCString dispName = d->localName(); SearchDefinitionList *l = find(dispName); @@ -1323,11 +1323,11 @@ void SearchIndexList::append(Definition *d) { if (d->definitionType()==Definition::TypeGroup) { - dispName = (dynamic_cast<GroupDef*>(d))->groupTitle(); + dispName = (dynamic_cast<const GroupDef*>(d))->groupTitle(); } else if (d->definitionType()==Definition::TypePage) { - dispName = (dynamic_cast<PageDef*>(d))->title(); + dispName = (dynamic_cast<const PageDef*>(d))->title(); } l=new SearchDefinitionList(searchId(dispName),dispName); SDict< SearchDefinitionList >::append(dispName,l); diff --git a/src/searchindex.h b/src/searchindex.h index 0345b41..9a612ad 100644 --- a/src/searchindex.h +++ b/src/searchindex.h @@ -72,7 +72,7 @@ class SearchIndexIntf enum Kind { Internal, External }; SearchIndexIntf(Kind k) : m_kind(k) {} virtual ~SearchIndexIntf() {} - virtual void setCurrentDoc(Definition *ctx,const char *anchor,bool isSourceFile) = 0; + virtual void setCurrentDoc(const Definition *ctx,const char *anchor,bool isSourceFile) = 0; virtual void addWord(const char *word,bool hiPriority) = 0; virtual void write(const char *file) = 0; Kind kind() const { return m_kind; } @@ -84,7 +84,7 @@ class SearchIndex : public SearchIndexIntf { public: SearchIndex(); - void setCurrentDoc(Definition *ctx,const char *anchor,bool isSourceFile); + void setCurrentDoc(const Definition *ctx,const char *anchor,bool isSourceFile); void addWord(const char *word,bool hiPriority); void write(const char *file); private: @@ -103,7 +103,7 @@ class SearchIndexExternal : public SearchIndexIntf public: SearchIndexExternal(); ~SearchIndexExternal(); - void setCurrentDoc(Definition *ctx,const char *anchor,bool isSourceFile); + void setCurrentDoc(const Definition *ctx,const char *anchor,bool isSourceFile); void addWord(const char *word,bool hiPriority); void write(const char *file); private: @@ -148,10 +148,10 @@ class SearchDefinitionList : public QList<Definition> class SearchIndexList : public SDict< SearchDefinitionList > { public: - typedef Definition ElementType; + typedef const Definition ElementType; SearchIndexList(uint letter); ~SearchIndexList(); - void append(Definition *d); + void append(const Definition *d); uint letter() const; private: int compareValues(const SearchDefinitionList *md1, const SearchDefinitionList *md2) const; diff --git a/src/sqlcode.h b/src/sqlcode.h index 9c1f7e0..d8a09b7 100644 --- a/src/sqlcode.h +++ b/src/sqlcode.h @@ -30,7 +30,7 @@ class Definition; extern void parseSqlCode(CodeOutputInterface &,const char *,const QCString &, bool ,const char *,FileDef *fd, int startLine,int endLine,bool inlineFragment, - MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx, + const MemberDef *memberDef,bool showLineNumbers,const Definition *searchCtx, bool collectXRefs); extern void resetSqlCodeParserState(); diff --git a/src/sqlcode.l b/src/sqlcode.l index 5e45083..33579b0 100644 --- a/src/sqlcode.l +++ b/src/sqlcode.l @@ -45,7 +45,7 @@ static int g_inputPosition; //!< read offset during parsing static int g_inputLines; //!< number of line in the code fragment static int g_yyLineNr; //!< current line number static bool g_needsTermination; -static Definition *g_searchCtx; +static const Definition *g_searchCtx; static bool g_exampleBlock; static QCString g_exampleName; @@ -348,8 +348,8 @@ void parseSqlCode( int startLine, int endLine, bool inlineFragment, - MemberDef *, - bool,Definition *searchCtx, + const MemberDef *, + bool,const Definition *searchCtx, bool /*collectXRefs*/ ) { diff --git a/src/sqlscanner.h b/src/sqlscanner.h index 7afa869..3ca6fe3 100644 --- a/src/sqlscanner.h +++ b/src/sqlscanner.h @@ -41,9 +41,9 @@ public: int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, - MemberDef *memberDef=0, + const MemberDef *memberDef=0, bool showLineNumbers=TRUE, - Definition *searchCtx=0, + const Definition *searchCtx=0, bool collectXRefs=TRUE ) { diff --git a/src/tclscanner.h b/src/tclscanner.h index aa1673c..0e56bdd 100644 --- a/src/tclscanner.h +++ b/src/tclscanner.h @@ -47,9 +47,9 @@ class TclLanguageScanner : public ParserInterface int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, - MemberDef *memberDef=0, + const MemberDef *memberDef=0, bool showLineNumbers=TRUE, - Definition *searchCtx=0, + const Definition *searchCtx=0, bool collectXRefs=TRUE ); void resetCodeParserState(); diff --git a/src/tclscanner.l b/src/tclscanner.l index 88714ce..df52201 100644 --- a/src/tclscanner.l +++ b/src/tclscanner.l @@ -456,7 +456,7 @@ static struct QAsciiDict<Entry> fn; // all read function entries QList<Entry> entry; // list of all created entries, will be deleted after codifying Protection protection; // current protections state - MemberDef *memberdef; // contain current MemberDef when codifying + const MemberDef *memberdef; // contain current MemberDef when codifying bool collectXRefs; } tcl; @@ -1722,7 +1722,7 @@ static void tcl_codify_link(QCString name) if (tcl.memberdef) { myDef->addSourceReferencedBy(tcl.memberdef); - tcl.memberdef->addSourceReferences(myDef); + //tcl.memberdef->addSourceReferences(myDef); } else { Entry* callerEntry; unsigned int i; @@ -2975,9 +2975,9 @@ void TclLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf, int startLine, int endLine, bool inlineFragment, - MemberDef *memberDef, + const MemberDef *memberDef, bool showLineNumbers, - Definition *searchCtx, + const Definition *searchCtx, bool collectXRefs ) { diff --git a/src/tooltip.cpp b/src/tooltip.cpp index 2c6f6e1..a30a85c 100644 --- a/src/tooltip.cpp +++ b/src/tooltip.cpp @@ -68,7 +68,7 @@ static QCString escapeId(const char *s) return res; } -void TooltipManager::addTooltip(Definition *d) +void TooltipManager::addTooltip(const Definition *d) { static bool sourceTooltips = Config_getBool(SOURCE_TOOLTIPS); if (!sourceTooltips) return; diff --git a/src/tooltip.h b/src/tooltip.h index 34a578a..170ea3c 100644 --- a/src/tooltip.h +++ b/src/tooltip.h @@ -23,7 +23,7 @@ class TooltipManager public: static TooltipManager *instance(); void clearTooltips(); - void addTooltip(Definition *d); + void addTooltip(const Definition *d); void writeTooltips(CodeOutputInterface &ol); private: diff --git a/src/util.cpp b/src/util.cpp index f63e742..5a69bcb 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -346,8 +346,8 @@ int guessSection(const char *name) return 0; } -QCString resolveTypeDef(Definition *context,const QCString &qualifiedName, - Definition **typedefContext) +QCString resolveTypeDef(const Definition *context,const QCString &qualifiedName, + const Definition **typedefContext) { //printf("<<resolveTypeDef(%s,%s)\n", // context ? context->name().data() : "<none>",qualifiedName.data()); @@ -358,7 +358,7 @@ QCString resolveTypeDef(Definition *context,const QCString &qualifiedName, return result; } - Definition *mContext=context; + const Definition *mContext=context; if (typedefContext) *typedefContext=context; // see if the qualified name has a scope part @@ -378,7 +378,7 @@ QCString resolveTypeDef(Definition *context,const QCString &qualifiedName, while (mContext && md==0) { // step 1: get the right scope - Definition *resScope=mContext; + const Definition *resScope=mContext; if (scopeIndex!=-1) { // split-off scope part @@ -559,7 +559,7 @@ ClassDef *newResolveTypedef(const FileDef *fileScope,MemberDef *md, g_resolvedTypedefs.insert(qname,md); // put on the trace list - ClassDef *typeClass = md->getClassDef(); + const ClassDef *typeClass = md->getClassDef(); QCString type = md->typeString(); // get the "value" of the typedef if (typeClass && typeClass->isTemplate() && actTemplParams && actTemplParams->count()>0) @@ -730,7 +730,7 @@ static QCString substTypedef(const Definition *scope,const FileDef *fileScope,co return result; } -static Definition *endOfPathIsUsedClass(SDict<Definition> *cl,const QCString &localName) +static const Definition *endOfPathIsUsedClass(const SDict<Definition> *cl,const QCString &localName) { if (cl) { @@ -1011,13 +1011,13 @@ int isAccessibleFrom(const Definition *scope,const FileDef *fileScope,const Defi { const NamespaceDef *nscope = dynamic_cast<const NamespaceDef*>(scope); //printf(" %s is namespace with %d used classes\n",nscope->name().data(),nscope->getUsedClasses()); - SDict<Definition> *cl = nscope->getUsedClasses(); + const SDict<Definition> *cl = nscope->getUsedClasses(); if (accessibleViaUsingClass(cl,fileScope,item)) { //printf("> found via used class\n"); goto done; } - NamespaceSDict *nl = nscope->getUsedNamespaces(); + const NamespaceSDict *nl = nscope->getUsedNamespaces(); if (accessibleViaUsingNamespace(nl,fileScope,item)) { //printf("> found via used namespace\n"); @@ -1115,11 +1115,11 @@ int isAccessibleFromWithExpScope(const Definition *scope,const FileDef *fileScop // in A via a using directive. //printf("newScope is a namespace: %s!\n",newScope->name().data()); const NamespaceDef *nscope = dynamic_cast<const NamespaceDef*>(newScope); - SDict<Definition> *cl = nscope->getUsedClasses(); + const SDict<Definition> *cl = nscope->getUsedClasses(); if (cl) { SDict<Definition>::Iterator cli(*cl); - Definition *cd; + const Definition *cd; for (cli.toFirst();(cd=cli.current());++cli) { //printf("Trying for class %s\n",cd->name().data()); @@ -1130,11 +1130,11 @@ int isAccessibleFromWithExpScope(const Definition *scope,const FileDef *fileScop } } } - NamespaceSDict *nl = nscope->getUsedNamespaces(); + const NamespaceSDict *nl = nscope->getUsedNamespaces(); if (nl) { NamespaceSDict::Iterator nli(*nl); - NamespaceDef *nd; + const NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) { if (g_visitedNamespaces.find(nd->name())==0) @@ -1166,7 +1166,7 @@ int isAccessibleFromWithExpScope(const Definition *scope,const FileDef *fileScop if (scope->definitionType()==Definition::TypeNamespace) { const NamespaceDef *nscope = dynamic_cast<const NamespaceDef*>(scope); - NamespaceSDict *nl = nscope->getUsedNamespaces(); + const NamespaceSDict *nl = nscope->getUsedNamespaces(); if (accessibleViaUsingNamespace(nl,fileScope,item,explicitScopePart)) { //printf("> found in used namespace\n"); @@ -1177,7 +1177,7 @@ int isAccessibleFromWithExpScope(const Definition *scope,const FileDef *fileScop { if (fileScope) { - NamespaceSDict *nl = fileScope->getUsedNamespaces(); + const NamespaceSDict *nl = fileScope->getUsedNamespaces(); if (accessibleViaUsingNamespace(nl,fileScope,item,explicitScopePart)) { //printf("> found in used namespace\n"); @@ -2077,11 +2077,11 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope, bool found=FALSE; if (!insideString) { - ClassDef *cd=0; - FileDef *fd=0; MemberDef *md=0; - NamespaceDef *nd=0; - GroupDef *gd=0; + const ClassDef *cd=0; + const FileDef *fd=0; + const NamespaceDef *nd=0; + const GroupDef *gd=0; //printf("** Match word '%s'\n",matchWord.data()); MemberDef *typeDef=0; @@ -2249,12 +2249,12 @@ void writeExample(OutputList &ol,ExampleSDict *ed) } -QCString argListToString(ArgumentList *al,bool useCanonicalType,bool showDefVals) +QCString argListToString(const ArgumentList *al,bool useCanonicalType,bool showDefVals) { QCString result; if (al==0) return result; ArgumentListIterator ali(*al); - Argument *a=ali.current(); + const Argument *a=ali.current(); result+="("; while (a) { @@ -2297,13 +2297,13 @@ QCString argListToString(ArgumentList *al,bool useCanonicalType,bool showDefVals return removeRedundantWhiteSpace(result); } -QCString tempArgListToString(ArgumentList *al,SrcLangExt lang) +QCString tempArgListToString(const ArgumentList *al,SrcLangExt lang) { QCString result; if (al==0) return result; result="<"; ArgumentListIterator ali(*al); - Argument *a=ali.current(); + const Argument *a=ali.current(); while (a) { if (!a->name.isEmpty()) // add template argument name @@ -2662,7 +2662,7 @@ int minClassDistance(const ClassDef *cd,const ClassDef *bcd,int level) return m; } -Protection classInheritedProtectionLevel(ClassDef *cd,ClassDef *bcd,Protection prot,int level) +Protection classInheritedProtectionLevel(const ClassDef *cd,const ClassDef *bcd,Protection prot,int level) { if (bcd->categoryOf()) // use class that is being extended in case of // an Objective-C category @@ -2681,7 +2681,7 @@ Protection classInheritedProtectionLevel(ClassDef *cd,ClassDef *bcd,Protection p else if (cd->baseClasses()) { BaseClassListIterator bcli(*cd->baseClasses()); - BaseClassDef *bcdi; + const BaseClassDef *bcdi; for (;(bcdi=bcli.current()) && prot!=Private;++bcli) { Protection baseProt = classInheritedProtectionLevel(bcdi->classDef,bcd,bcdi->prot,level+1); @@ -3448,9 +3448,9 @@ static QCString stripDeclKeywords(const QCString &s) } // forward decl for circular dependencies -static QCString extractCanonicalType(Definition *d,FileDef *fs,QCString type); +static QCString extractCanonicalType(const Definition *d,const FileDef *fs,QCString type); -QCString getCanonicalTemplateSpec(Definition *d,FileDef *fs,const QCString& spec) +QCString getCanonicalTemplateSpec(const Definition *d,const FileDef *fs,const QCString& spec) { QCString templSpec = spec.stripWhiteSpace(); @@ -3471,7 +3471,7 @@ QCString getCanonicalTemplateSpec(Definition *d,FileDef *fs,const QCString& spec static QCString getCanonicalTypeForIdentifier( - Definition *d,FileDef *fs,const QCString &word, + const Definition *d,const FileDef *fs,const QCString &word, QCString *tSpec,int count=0) { if (count>10) return word; // oops recursion @@ -3607,7 +3607,7 @@ static QCString getCanonicalTypeForIdentifier( return result; } -static QCString extractCanonicalType(Definition *d,FileDef *fs,QCString type) +static QCString extractCanonicalType(const Definition *d,const FileDef *fs,QCString type) { type = type.stripWhiteSpace(); @@ -3677,7 +3677,7 @@ static QCString extractCanonicalType(Definition *d,FileDef *fs,QCString type) return removeRedundantWhiteSpace(canType); } -static QCString extractCanonicalArgType(Definition *d,FileDef *fs,const Argument *arg) +static QCString extractCanonicalArgType(const Definition *d,const FileDef *fs,const Argument *arg) { QCString type = arg->type.stripWhiteSpace(); QCString name = arg->name; @@ -3701,8 +3701,8 @@ static QCString extractCanonicalArgType(Definition *d,FileDef *fs,const Argument } static bool matchArgument2( - Definition *srcScope,FileDef *srcFileScope,Argument *srcA, - Definition *dstScope,FileDef *dstFileScope,Argument *dstA + const Definition *srcScope,const FileDef *srcFileScope,Argument *srcA, + const Definition *dstScope,const FileDef *dstFileScope,Argument *dstA ) { //printf(">> match argument: %s::`%s|%s' (%s) <-> %s::`%s|%s' (%s)\n", @@ -3762,10 +3762,9 @@ static bool matchArgument2( // new algorithm for argument matching -bool matchArguments2(Definition *srcScope,FileDef *srcFileScope,ArgumentList *srcAl, - Definition *dstScope,FileDef *dstFileScope,ArgumentList *dstAl, - bool checkCV - ) +bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,ArgumentList *srcAl, + const Definition *dstScope,const FileDef *dstFileScope,ArgumentList *dstAl, + bool checkCV) { //printf("*** matchArguments2\n"); ASSERT(srcScope!=0 && dstScope!=0); @@ -3987,7 +3986,7 @@ void mergeArguments(ArgumentList *srcAl,ArgumentList *dstAl,bool forceNameOverwr static void findMembersWithSpecificName(MemberName *mn, const char *args, bool checkStatics, - FileDef *currentFile, + const FileDef *currentFile, bool checkCV, const char *forceTagFile, QList<MemberDef> &members) @@ -3995,11 +3994,11 @@ static void findMembersWithSpecificName(MemberName *mn, //printf(" Function with global scope name `%s' args=`%s'\n", // mn->memberName(),args); MemberNameIterator mli(*mn); - MemberDef *md; + const MemberDef *md = 0; for (mli.toFirst();(md=mli.current());++mli) { - FileDef *fd=md->getFileDef(); - GroupDef *gd=md->getGroupDef(); + const FileDef *fd=md->getFileDef(); + const GroupDef *gd=md->getGroupDef(); //printf(" md->name()=`%s' md->args=`%s' fd=%p gd=%p current=%p ref=%s\n", // md->name().data(),args,fd,gd,currentFile,md->getReference().data()); if ( @@ -4057,12 +4056,12 @@ bool getDefs(const QCString &scName, const QCString &mbName, const char *args, MemberDef *&md, - ClassDef *&cd, - FileDef *&fd, - NamespaceDef *&nd, - GroupDef *&gd, + const ClassDef *&cd, + const FileDef *&fd, + const NamespaceDef *&nd, + const GroupDef *&gd, bool forceEmptyScope, - FileDef *currentFile, + const FileDef *currentFile, bool checkCV, const char *forceTagFile ) @@ -4225,7 +4224,7 @@ bool getDefs(const QCString &scName, if (tmd && tmd->isEnumerate() && tmd->isStrong()) // scoped enum { //printf("Found scoped enum!\n"); - MemberList *tml = tmd->enumFieldList(); + const MemberList *tml = tmd->enumFieldList(); if (tml) { MemberListIterator tmi(*tml); @@ -4339,7 +4338,7 @@ bool getDefs(const QCString &scName, { //printf("mmd->getNamespaceDef()=%p fnd=%p\n", // mmd->getNamespaceDef(),fnd); - MemberDef *emd = mmd->getEnumScope(); + const MemberDef *emd = mmd->getEnumScope(); if (emd && emd->isStrong()) { //printf("yes match %s<->%s!\n",mScope.data(),emd->localName().data()); @@ -4358,7 +4357,7 @@ bool getDefs(const QCString &scName, return FALSE; } } - else if (mmd->getNamespaceDef()==fnd /* && mmd->isLinkable() */ ) + else if (mmd->getOuterScope()==fnd /* && mmd->isLinkable() */ ) { // namespace is found bool match=TRUE; ArgumentList *argList=0; @@ -4408,7 +4407,7 @@ bool getDefs(const QCString &scName, } else { - gd=md->getGroupDef(); + gd=md->resolveAlias()->getGroupDef(); if (gd && gd->isLinkable()) nd=0; else gd=0; return TRUE; } @@ -4421,7 +4420,7 @@ bool getDefs(const QCString &scName, MemberDef *mmd; for (mmli.toFirst();(mmd=mmli.current());++mmli) { - MemberDef *tmd = mmd->getEnumScope(); + const MemberDef *tmd = mmd->getEnumScope(); //printf("try member %s tmd=%s\n",mmd->name().data(),tmd?tmd->name().data():"<none>"); int ni=namespaceName.findRev("::"); //printf("namespaceName=%s ni=%d\n",namespaceName.data(),ni); @@ -4475,7 +4474,7 @@ bool getDefs(const QCString &scName, //printf("member is linkable md->name()=`%s'\n",md->name().data()); fd=md->getFileDef(); gd=md->getGroupDef(); - MemberDef *tmd = md->getEnumScope(); + const MemberDef *tmd = md->getEnumScope(); if ( (gd && gd->isLinkable()) || (fd && fd->isLinkable()) || (tmd && tmd->isStrong()) @@ -4602,10 +4601,10 @@ static bool isLowerCase(QCString &s) bool resolveRef(/* in */ const char *scName, /* in */ const char *name, /* in */ bool inSeeBlock, - /* out */ Definition **resContext, - /* out */ MemberDef **resMember, + /* out */ const Definition **resContext, + /* out */ const MemberDef **resMember, bool lookForSpecialization, - FileDef *currentFile, + const FileDef *currentFile, bool checkScope ) { @@ -4705,10 +4704,10 @@ bool resolveRef(/* in */ const char *scName, QCString scopeStr=scName; MemberDef *md = 0; - ClassDef *cd = 0; - FileDef *fd = 0; - NamespaceDef *nd = 0; - GroupDef *gd = 0; + const ClassDef *cd = 0; + const FileDef *fd = 0; + const NamespaceDef *nd = 0; + const GroupDef *gd = 0; // check if nameStr is a member or global. //printf("getDefs(scope=%s,name=%s,args=%s checkScope=%d)\n", @@ -4876,7 +4875,7 @@ bool generateRef(OutputDocInterface &od,const char *scName, bool resolveLink(/* in */ const char *scName, /* in */ const char *lr, /* in */ bool /*inSeeBlock*/, - /* out */ Definition **resContext, + /* out */ const Definition **resContext, /* out */ QCString &resAnchor ) { @@ -4885,12 +4884,12 @@ bool resolveLink(/* in */ const char *scName, QCString linkRef=lr; QCString linkRefWithoutTemplates = stripTemplateSpecifiersFromScope(linkRef,FALSE); //printf("ResolveLink linkRef=%s\n",lr); - FileDef *fd; - GroupDef *gd; - PageDef *pd; - ClassDef *cd; - DirDef *dir; - NamespaceDef *nd; + const FileDef *fd; + const GroupDef *gd; + const PageDef *pd; + const ClassDef *cd; + const DirDef *dir; + const NamespaceDef *nd; SectionInfo *si=0; bool ambig; if (linkRef.isEmpty()) // no reference name! @@ -4899,7 +4898,7 @@ bool resolveLink(/* in */ const char *scName, } else if ((pd=Doxygen::pageSDict->find(linkRef))) // link to a page { - GroupDef *gd = pd->getGroupDef(); + const GroupDef *gd = pd->getGroupDef(); if (gd) { if (!pd->name().isEmpty()) si=Doxygen::sectionDict->find(pd->name()); @@ -4971,7 +4970,7 @@ bool resolveLink(/* in */ const char *scName, } else // probably a member reference { - MemberDef *md; + const MemberDef *md = 0; bool res = resolveRef(scName,lr,TRUE,resContext,&md); if (md) resAnchor=md->anchor(); return res; @@ -4990,7 +4989,7 @@ bool generateLink(OutputDocInterface &od,const char *clName, const char *lr,bool inSeeBlock,const char *lt) { //printf("generateLink(clName=%s,lr=%s,lr=%s)\n",clName,lr,lt); - Definition *compound; + const Definition *compound = 0; //PageDef *pageDef=0; QCString anchor,linkText=linkToText(SrcLangExt_Unknown,lt,FALSE); //printf("generateLink linkText=%s\n",linkText.data()); @@ -5002,7 +5001,7 @@ bool generateLink(OutputDocInterface &od,const char *clName, compound->definitionType()==Definition::TypeGroup /* is group */ ) { - linkText=(dynamic_cast<GroupDef *>(compound))->groupTitle(); // use group's title as link + linkText=(dynamic_cast<const GroupDef *>(compound))->groupTitle(); // use group's title as link } else if (compound->definitionType()==Definition::TypeFile) { @@ -5379,7 +5378,7 @@ static void initBaseClassHierarchy(BaseClassList *bcl) } //---------------------------------------------------------------------------- -bool classHasVisibleChildren(ClassDef *cd) +bool classHasVisibleChildren(const ClassDef *cd) { BaseClassList *bcl; @@ -5421,14 +5420,14 @@ void initClassHierarchy(ClassSDict *cl) //---------------------------------------------------------------------------- -bool hasVisibleRoot(BaseClassList *bcl) +bool hasVisibleRoot(const BaseClassList *bcl) { if (bcl) { BaseClassListIterator bcli(*bcl); for ( ; bcli.current(); ++bcli) { - ClassDef *cd=bcli.current()->classDef; + const ClassDef *cd=bcli.current()->classDef; if (cd->isVisibleInHierarchy()) return TRUE; hasVisibleRoot(cd->baseClasses()); } @@ -6154,7 +6153,7 @@ QCString getOverloadDocs() void addMembersToMemberGroup(MemberList *ml, MemberGroupSDict **ppMemberGroupSDict, - Definition *context) + const Definition *context) { ASSERT(context!=0); //printf("addMemberToMemberGroup()\n"); @@ -6166,7 +6165,7 @@ void addMembersToMemberGroup(MemberList *ml, { if (md->isEnumerate()) // insert enum value of this enum into groups { - MemberList *fmdl=md->enumFieldList(); + const MemberList *fmdl=md->enumFieldList(); if (fmdl!=0) { MemberListIterator fmli(*fmdl); @@ -6324,7 +6323,7 @@ int extractClassNameFromType(const QCString &type,int &pos,QCString &name,QCStri QCString normalizeNonTemplateArgumentsInString( const QCString &name, - Definition *context, + const Definition *context, const ArgumentList * formalArgs) { // skip until < @@ -6656,7 +6655,7 @@ found: PageDef *addRelatedPage(const char *name,const QCString &ptitle, const QCString &doc, - QList<SectionInfo> * /*anchors*/, + const QList<SectionInfo> * /*anchors*/, const char *fileName,int startLine, const QList<ListItemInfo> *sli, GroupDef *gd, @@ -6782,7 +6781,7 @@ void addRefItem(const QList<ListItemInfo> *sli, } } -bool recursivelyAddGroupListToTitle(OutputList &ol,Definition *d,bool root) +bool recursivelyAddGroupListToTitle(OutputList &ol,const Definition *d,bool root) { GroupList *groups = d->partOfGroups(); if (groups) // write list of group to which this definition belongs @@ -6815,7 +6814,7 @@ bool recursivelyAddGroupListToTitle(OutputList &ol,Definition *d,bool root) return false; } -void addGroupListToTitle(OutputList &ol,Definition *d) +void addGroupListToTitle(OutputList &ol,const Definition *d) { recursivelyAddGroupListToTitle(ol,d,TRUE); } @@ -7432,7 +7431,7 @@ SrcLangExt getLanguageFromFileName(const QCString& fileName) //-------------------------------------------------------------------------- -MemberDef *getMemberFromSymbol(Definition *scope,FileDef *fileScope, +MemberDef *getMemberFromSymbol(const Definition *scope,const FileDef *fileScope, const char *n) { if (scope==0 || @@ -7504,7 +7503,7 @@ MemberDef *getMemberFromSymbol(Definition *scope,FileDef *fileScope, } /*! Returns true iff the given name string appears to be a typedef in scope. */ -bool checkIfTypedef(Definition *scope,FileDef *fileScope,const char *n) +bool checkIfTypedef(const Definition *scope,const FileDef *fileScope,const char *n) { MemberDef *bestMatch = getMemberFromSymbol(scope,fileScope,n); @@ -7931,7 +7930,7 @@ QCString expandAlias(const QCString &aliasName,const QCString &aliasValue) return result; } -void writeTypeConstraints(OutputList &ol,Definition *d,ArgumentList *al) +void writeTypeConstraints(OutputList &ol,const Definition *d,ArgumentList *al) { if (al==0) return; ol.startConstraintList(theTranslator->trTypeConstraints()); @@ -8549,7 +8548,7 @@ QCString stripIndentation(const QCString &s) } -bool fileVisibleInIndex(FileDef *fd,bool &genSourceFile) +bool fileVisibleInIndex(const FileDef *fd,bool &genSourceFile) { static bool allExternals = Config_getBool(ALLEXTERNALS); bool isDocFile = fd->isDocumentationFile(); @@ -8668,12 +8667,12 @@ uint getUtf8CodeToUpper( const QCString& s, int idx ) //-------------------------------------------------------------------------------------- -bool namespaceHasVisibleChild(NamespaceDef *nd,bool includeClasses,bool filterClasses,ClassDef::CompoundType ct) +bool namespaceHasVisibleChild(const NamespaceDef *nd,bool includeClasses,bool filterClasses,ClassDef::CompoundType ct) { if (nd->getNamespaceSDict()) { NamespaceSDict::Iterator cnli(*nd->getNamespaceSDict()); - NamespaceDef *cnd; + const NamespaceDef *cnd; for (cnli.toFirst();(cnd=cnli.current());++cnli) { if (cnd->isLinkableInProject() && cnd->localName().find('@')==-1) @@ -8688,7 +8687,7 @@ bool namespaceHasVisibleChild(NamespaceDef *nd,bool includeClasses,bool filterCl } if (includeClasses) { - ClassSDict *d = nd->getClassSDict(); + const ClassSDict *d = nd->getClassSDict(); if (filterClasses) { if (ct == ClassDef::Interface) @@ -8708,7 +8707,7 @@ bool namespaceHasVisibleChild(NamespaceDef *nd,bool includeClasses,bool filterCl if (d) { ClassSDict::Iterator cli(*d); - ClassDef *cd; + const ClassDef *cd; for (;(cd=cli.current());++cli) { if (cd->isLinkableInProject() && cd->templateMaster()==0) @@ -8723,7 +8722,7 @@ bool namespaceHasVisibleChild(NamespaceDef *nd,bool includeClasses,bool filterCl //---------------------------------------------------------------------------- -bool classVisibleInIndex(ClassDef *cd) +bool classVisibleInIndex(const ClassDef *cd) { static bool allExternals = Config_getBool(ALLEXTERNALS); return (allExternals && cd->isLinkable()) || cd->isLinkableInProject(); @@ -143,12 +143,12 @@ bool getDefs(const QCString &scopeName, const QCString &memberName, const char *, MemberDef *&md, - ClassDef *&cd, - FileDef *&fd, - NamespaceDef *&nd, - GroupDef *&gd, + const ClassDef *&cd, + const FileDef *&fd, + const NamespaceDef *&nd, + const GroupDef *&gd, bool forceEmptyScope=FALSE, - FileDef *currentFile=0, + const FileDef *currentFile=0, bool checkCV=FALSE, const char *forceTagFile=0 ); @@ -158,17 +158,17 @@ QCString getFileFilter(const char* name,bool isSourceCode); bool resolveRef(/* in */ const char *scName, /* in */ const char *name, /* in */ bool inSeeBlock, - /* out */ Definition **resContext, - /* out */ MemberDef **resMember, + /* out */ const Definition **resContext, + /* out */ const MemberDef **resMember, /* in */ bool lookForSpecializations = TRUE, - /* in */ FileDef *currentFile = 0, + /* in */ const FileDef *currentFile = 0, /* in */ bool checkScope = FALSE ); bool resolveLink(/* in */ const char *scName, /* in */ const char *lr, /* in */ bool inSeeBlock, - /* out */ Definition **resContext, + /* out */ const Definition **resContext, /* out */ QCString &resAnchor ); @@ -183,10 +183,10 @@ void generateFileRef(OutputDocInterface &od,const char *, void writePageRef(OutputDocInterface &od,const char *cn,const char *mn); -QCString getCanonicalTemplateSpec(Definition *d,FileDef *fs,const QCString& spec); +QCString getCanonicalTemplateSpec(const Definition *d,const FileDef *fs,const QCString& spec); -bool matchArguments2(Definition *srcScope,FileDef *srcFileScope,ArgumentList *srcAl, - Definition *dstScope,FileDef *dstFileScope,ArgumentList *dstAl, +bool matchArguments2(const Definition *srcScope,const FileDef *srcFileScope,ArgumentList *srcAl, + const Definition *dstScope,const FileDef *dstFileScope,ArgumentList *dstAl, bool checkCV ); @@ -231,9 +231,9 @@ inline bool isId(int c) QCString removeRedundantWhiteSpace(const QCString &s); -QCString argListToString(ArgumentList *al,bool useCanonicalType=FALSE,bool showDefVals=TRUE); +QCString argListToString(const ArgumentList *al,bool useCanonicalType=FALSE,bool showDefVals=TRUE); -QCString tempArgListToString(ArgumentList *al,SrcLangExt lang); +QCString tempArgListToString(const ArgumentList *al,SrcLangExt lang); QCString generateMarker(int id); @@ -260,13 +260,13 @@ QCString replaceAnonymousScopes(const QCString &s,const char *replacement=0); void initClassHierarchy(ClassSDict *cl); -bool hasVisibleRoot(BaseClassList *bcl); -bool classHasVisibleChildren(ClassDef *cd); -bool namespaceHasVisibleChild(NamespaceDef *nd,bool includeClasses,bool filterClasses,ClassDef::CompoundType ct); -bool classVisibleInIndex(ClassDef *cd); +bool hasVisibleRoot(const BaseClassList *bcl); +bool classHasVisibleChildren(const ClassDef *cd); +bool namespaceHasVisibleChild(const NamespaceDef *nd,bool includeClasses,bool filterClasses,ClassDef::CompoundType ct); +bool classVisibleInIndex(const ClassDef *cd); int minClassDistance(const ClassDef *cd,const ClassDef *bcd,int level=0); -Protection classInheritedProtectionLevel(ClassDef *cd,ClassDef *bcd,Protection prot=Public,int level=0); +Protection classInheritedProtectionLevel(const ClassDef *cd,const ClassDef *bcd,Protection prot=Public,int level=0); QCString convertNameToFile(const char *name,bool allowDots=FALSE,bool allowUnderscore=FALSE); @@ -292,16 +292,16 @@ QCString convertToJSString(const char *s, bool applyTextDir = true); QCString getOverloadDocs(); -void addMembersToMemberGroup(/* in */ MemberList *ml, +void addMembersToMemberGroup(/* in,out */ MemberList *ml, /* in,out */ MemberGroupSDict **ppMemberGroupSDict, - /* in */ Definition *context); + /* in */ const Definition *context); int extractClassNameFromType(const QCString &type,int &pos, QCString &name,QCString &templSpec,SrcLangExt=SrcLangExt_Unknown); QCString normalizeNonTemplateArgumentsInString( const QCString &name, - Definition *context, + const Definition *context, const ArgumentList *formalArgs); QCString substituteTemplateArgumentsInString( @@ -315,8 +315,8 @@ QCString stripTemplateSpecifiersFromScope(const QCString &fullName, bool parentOnly=TRUE, QCString *lastScopeStripped=0); -QCString resolveTypeDef(Definition *d,const QCString &name, - Definition **typedefContext=0); +QCString resolveTypeDef(const Definition *d,const QCString &name, + const Definition **typedefContext=0); QCString mergeScopes(const QCString &leftScope,const QCString &rightScope); @@ -328,18 +328,20 @@ void addRefItem(const QList<ListItemInfo> *sli,const char *prefix, const char *key, const char *name,const char *title,const char *args,Definition *scope); -PageDef *addRelatedPage(const char *name,const QCString &ptitle, - const QCString &doc,QList<SectionInfo> *anchors, - const char *fileName,int startLine, - const QList<ListItemInfo> *sli, - GroupDef *gd=0, - TagInfo *tagInfo=0, - SrcLangExt lang=SrcLangExt_Unknown - ); +PageDef *addRelatedPage(const char *name, + const QCString &ptitle, + const QCString &doc, + const QList<SectionInfo> *anchors, + const char *fileName,int startLine, + const QList<ListItemInfo> *sli, + GroupDef *gd=0, + TagInfo *tagInfo=0, + SrcLangExt lang=SrcLangExt_Unknown + ); QCString escapeCharsInString(const char *name,bool allowDots,bool allowUnderscore=FALSE); -void addGroupListToTitle(OutputList &ol,Definition *d); +void addGroupListToTitle(OutputList &ol,const Definition *d); void filterLatexString(FTextStream &t,const char *str, bool insideTabbing=FALSE, @@ -385,18 +387,14 @@ bool findAndRemoveWord(QCString &s,const QCString &word); QCString stripLeadingAndTrailingEmptyLines(const QCString &s,int &docLine); -//void stringToSearchIndex(const QCString &docUrlBase,const QCString &title, -// const QCString &str, bool priority=FALSE, -// const QCString &anchor=""); - bool updateLanguageMapping(const QCString &extension,const QCString &parser); SrcLangExt getLanguageFromFileName(const QCString& fileName); void initDefaultExtensionMapping(); void addCodeOnlyMappings(); -MemberDef *getMemberFromSymbol(Definition *scope,FileDef *fileScope, +MemberDef *getMemberFromSymbol(const Definition *scope,const FileDef *fileScope, const char *n); -bool checkIfTypedef(Definition *scope,FileDef *fileScope,const char *n); +bool checkIfTypedef(const Definition *scope,const FileDef *fileScope,const char *n); ClassDef *newResolveTypedef(const FileDef *fileScope,MemberDef *md, MemberDef **pMemType=0,QCString *pTemplSpec=0, @@ -418,7 +416,7 @@ int countAliasArguments(const QCString argList); QCString resolveAliasCmd(const QCString aliasCmd); QCString expandAlias(const QCString &aliasName,const QCString &aliasValue); -void writeTypeConstraints(OutputList &ol,Definition *d,ArgumentList *al); +void writeTypeConstraints(OutputList &ol,const Definition *d,ArgumentList *al); QCString convertCharEntitiesToUTF8(const QCString &s); @@ -463,7 +461,7 @@ QCString stripIndentation(const QCString &s); QCString getDotImageExtension(void); -bool fileVisibleInIndex(FileDef *fd,bool &genSourceFile); +bool fileVisibleInIndex(const FileDef *fd,bool &genSourceFile); void addDocCrossReference(MemberDef *src,MemberDef *dst); diff --git a/src/vhdlcode.h b/src/vhdlcode.h index e21ddea..a7b4687 100644 --- a/src/vhdlcode.h +++ b/src/vhdlcode.h @@ -8,7 +8,7 @@ class MemberDef; void parseVhdlCode(CodeOutputInterface &,const char *,const QCString &, bool ,const char *,FileDef *fd, int startLine,int endLine,bool inlineFragment, - MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx, + const MemberDef *memberDef,bool showLineNumbers,const Definition *searchCtx, bool collectXRefs); void resetVhdlCodeParserState(); void codeFreeVhdlScanner(); diff --git a/src/vhdlcode.l b/src/vhdlcode.l index 9e296cc..f52a539 100644 --- a/src/vhdlcode.l +++ b/src/vhdlcode.l @@ -86,7 +86,7 @@ static int g_inputPosition; //!< read offset during parsing static int g_inputLines; //!< number of line in the code fragment static int g_yyLineNr; //!< current line number static bool g_needsTermination; -static Definition *g_searchCtx; +static const Definition *g_searchCtx; static bool g_exampleBlock; static QCString g_exampleName; @@ -430,7 +430,7 @@ static void writeMultiLineCodeLink(CodeOutputInterface &ol, } } -static void setParameterList(MemberDef *md) +static void setParameterList(const MemberDef *md) { g_classScope = md->getClassDef() ? md->getClassDef()->name().data() : ""; ArgumentList *al = md->argumentList(); @@ -1543,7 +1543,7 @@ void resetVhdlCodeParserState() void parseVhdlCode(CodeOutputInterface &od,const char *className,const QCString &s, bool exBlock, const char *exName,FileDef *fd, int startLine,int endLine,bool inlineFragment, - MemberDef *memberDef,bool,Definition *searchCtx, + const MemberDef *memberDef,bool,const Definition *searchCtx, bool /* collectXRefs */) { //printf("***parseCode() exBlock=%d exName=%s fd=%p\n",exBlock,exName,fd); @@ -1551,7 +1551,7 @@ void parseVhdlCode(CodeOutputInterface &od,const char *className,const QCString printlex(yy_flex_debug, TRUE, __FILE__, fd ? fd->fileName().data(): NULL); if (memberDef) { - ClassDef *dd=memberDef->getClassDef(); + const ClassDef *dd=memberDef->getClassDef(); if (dd) g_CurrClass=dd->name(); } resetVhdlCodeParserState(); diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index e70f099..55c1c17 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -1730,8 +1730,8 @@ QCString VhdlDocGen::convertArgumentListToString(const ArgumentList* al,bool fun } -void VhdlDocGen::writeVhdlDeclarations(MemberList* ml, - OutputList& ol,GroupDef* gd,ClassDef* cd,FileDef *fd,NamespaceDef* nd) +void VhdlDocGen::writeVhdlDeclarations(const MemberList* ml, + OutputList& ol,const GroupDef* gd,const ClassDef* cd,const FileDef *fd,const NamespaceDef* nd) { VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::LIBRARY,FALSE),0,FALSE,VhdlDocGen::LIBRARY); VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::USE,FALSE),0,FALSE,VhdlDocGen::USE); @@ -1761,36 +1761,49 @@ void VhdlDocGen::writeVhdlDeclarations(MemberList* ml, } -static void setGlobalType(MemberList *ml) +void VhdlDocGen::correctMemberProperties(MemberDef *md) { - if (ml==0) return; - MemberDef *mdd=0; - MemberListIterator mmli(*ml); - for ( ; (mdd=mmli.current()); ++mmli ) + if (qstrcmp(md->argsString(),"package")==0) { - if (qstrcmp(mdd->argsString(),"package")==0) - { - mdd->setMemberSpecifiers(VhdlDocGen::INSTANTIATION); - } - else if (qstrcmp(mdd->argsString(),"configuration")==0) - { - mdd->setMemberSpecifiers(VhdlDocGen::CONFIG); - } - else if (qstrcmp(mdd->typeString(),"library")==0) - { - mdd->setMemberSpecifiers(VhdlDocGen::LIBRARY); - } - else if (qstrcmp(mdd->typeString(),"use")==0) - { - mdd->setMemberSpecifiers(VhdlDocGen::USE); - } - else if (qstricmp(mdd->typeString(),"misc")==0) + md->setMemberSpecifiers(VhdlDocGen::INSTANTIATION); + } + else if (qstrcmp(md->argsString(),"configuration")==0) + { + md->setMemberSpecifiers(VhdlDocGen::CONFIG); + } + else if (qstrcmp(md->typeString(),"library")==0) + { + md->setMemberSpecifiers(VhdlDocGen::LIBRARY); + } + else if (qstrcmp(md->typeString(),"use")==0) + { + md->setMemberSpecifiers(VhdlDocGen::USE); + } + else if (qstricmp(md->typeString(),"misc")==0) + { + md->setMemberSpecifiers(VhdlDocGen::MISCELLANEOUS); + } + else if (qstricmp(md->typeString(),"ucf_const")==0) + { + md->setMemberSpecifiers(VhdlDocGen::UCF_CONST); + } + + if (md->getMemberSpecifiers()==VhdlDocGen::UCF_CONST) + { + int mm=md->name().findRev('_'); + if (mm>0) { - mdd->setMemberSpecifiers(VhdlDocGen::MISCELLANEOUS); + md->setName(md->name().left(mm)); } - else if (qstricmp(mdd->typeString(),"ucf_const")==0) + } + else if (md->getMemberSpecifiers()==VhdlDocGen::TYPE) + { + QCString largs=md->argsString(); + bool bRec=largs.stripPrefix("record") ; + bool bUnit=largs.stripPrefix("units") ; + if (bRec || bUnit) { - mdd->setMemberSpecifiers(VhdlDocGen::UCF_CONST); + md->setType(""); } } } @@ -1924,11 +1937,11 @@ void VhdlDocGen::writeTagFile(MemberDef *mdef,FTextStream &tagFile) /* writes a vhdl type declaration */ -void VhdlDocGen::writeVHDLDeclaration(MemberDef* mdef,OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, +void VhdlDocGen::writeVHDLDeclaration(const MemberDef* mdef,OutputList &ol, + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd, bool /*inGroup*/) { - Definition *d=0; + const Definition *d=0; ASSERT(cd!=0 || nd!=0 || fd!=0 || gd!=0 || mdef->getMemberSpecifiers()==VhdlDocGen::LIBRARY || @@ -1987,12 +2000,7 @@ void VhdlDocGen::writeVHDLDeclaration(MemberDef* mdef,OutputList &ol, /*VHDL CHANGE */ bool bRec,bUnit; QCString ltype(mdef->typeString()); - // ltype=ltype.replace(reg," "); QCString largs(mdef->argsString()); - // largs=largs.replace(reg," "); - mdef->setType(ltype.data()); - mdef->setArgsString(largs.data()); - //ClassDef * plo=mdef->getClassDef(); ClassDef *kl=0; ArgumentList *alp = mdef->argumentList(); QCString nn; @@ -2153,11 +2161,6 @@ void VhdlDocGen::writeVHDLDeclaration(MemberDef* mdef,OutputList &ol, } break; case VhdlDocGen::UCF_CONST: - mm=mdef->name().findRev('_'); - if (mm>0) - { - mdef->setName(mdef->name().left(mm)); - } writeUCFLink(mdef,ol); break; case VhdlDocGen::SIGNAL: @@ -2198,7 +2201,6 @@ void VhdlDocGen::writeVHDLDeclaration(MemberDef* mdef,OutputList &ol, if (bRec || bUnit) { writeRecorUnit(largs,ol,mdef); - mdef->setType(""); } ol.endBold(); break; @@ -2260,8 +2262,8 @@ void VhdlDocGen::writeVHDLDeclaration(MemberDef* mdef,OutputList &ol, void VhdlDocGen::writePlainVHDLDeclarations( - MemberList* mlist,OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd,int specifier) + const MemberList* mlist,OutputList &ol, + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,int specifier) { SDict<QCString> pack(1009); @@ -2292,7 +2294,7 @@ void VhdlDocGen::writePlainVHDLDeclarations( pack.clear(); }//plainDeclaration -static bool membersHaveSpecificType(MemberList *ml,uint64 type) +static bool membersHaveSpecificType(const MemberList *ml,uint64 type) { if (ml==0) return FALSE; MemberDef *mdd=0; @@ -2320,11 +2322,10 @@ static bool membersHaveSpecificType(MemberList *ml,uint64 type) return FALSE; } -void VhdlDocGen::writeVHDLDeclarations(MemberList* ml,OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, +void VhdlDocGen::writeVHDLDeclarations(const MemberList* ml,OutputList &ol, + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd, const char *title,const char *subtitle,bool /*showEnumValues*/,int type) { - setGlobalType(ml); if (!membersHaveSpecificType(ml,type)) return; if (title) @@ -2377,7 +2378,7 @@ void VhdlDocGen::writeVHDLDeclarations(MemberList* ml,OutputList &ol, }// writeVHDLDeclarations -bool VhdlDocGen::writeClassType( ClassDef *& cd, +bool VhdlDocGen::writeClassType( const ClassDef * cd, OutputList &ol ,QCString & cname) { int id=cd->protection(); @@ -2398,7 +2399,7 @@ void VhdlDocGen::writeStringLink(const MemberDef *mdef,QCString mem, OutputList& { if (mdef) { - ClassDef *cd=mdef->getClassDef(); + const ClassDef *cd=mdef->getClassDef(); if (cd) { QCString n=cd->name(); @@ -2418,7 +2419,7 @@ void VhdlDocGen::writeStringLink(const MemberDef *mdef,QCString mem, OutputList& -void VhdlDocGen::writeSource(MemberDef *mdef,OutputList& ol,QCString & cname) +void VhdlDocGen::writeSource(const MemberDef *mdef,OutputList& ol,const QCString & cname) { ParserInterface *pIntf = Doxygen::parserManager->getParser(".vhd"); // pIntf->resetCodeParserState(); @@ -2452,7 +2453,7 @@ void VhdlDocGen::writeSource(MemberDef *mdef,OutputList& ol,QCString & cname) SrcLangExt_VHDL, // lang FALSE, // isExample 0, // exampleName - mdef->getFileDef(), // fileDef + const_cast<FileDef*>(mdef->getFileDef()), // fileDef mdef->getStartBodyLine(), // startLine mdef->getEndBodyLine(), // endLine TRUE, // inlineFragment @@ -3091,7 +3092,7 @@ bool VhdlDocGen::isSubClass(ClassDef* cd,ClassDef *scd, bool followInstances,int BaseClassListIterator bcli(*cd->subClasses()); for ( ; bcli.current() && !found ; ++bcli) { - ClassDef *ccd=bcli.current()->classDef; + const ClassDef *ccd=bcli.current()->classDef; if (!followInstances && ccd->templateMaster()) ccd=ccd->templateMaster(); //printf("isSubClass() subclass %s\n",ccd->name().data()); if (ccd==scd) @@ -3178,7 +3179,7 @@ void VhdlDocGen::createFlowChart(const MemberDef *mdef) int actualStart= mdef->getStartBodyLine(); int actualEnd=mdef->getEndBodyLine(); - FileDef* fd=mdef->getFileDef(); + const FileDef* fd=mdef->getFileDef(); bool b=readCodeFragment( fd->absFilePath().data(), actualStart,actualEnd,codeFragment); if (!b) return; @@ -4374,9 +4375,9 @@ void VHDLLanguageScanner::parseCode(CodeOutputInterface &codeOutIntf, int startLine, int endLine, bool inlineFragment, - MemberDef *memberDef, + const MemberDef *memberDef, bool showLineNumbers, - Definition *searchCtx, + const Definition *searchCtx, bool collectXRefs ) { diff --git a/src/vhdldocgen.h b/src/vhdldocgen.h index 9dd8417..e2c843c 100644 --- a/src/vhdldocgen.h +++ b/src/vhdldocgen.h @@ -163,20 +163,21 @@ class VhdlDocGen static bool writeVHDLTypeDocumentation(const MemberDef* mdef, const Definition* d, OutputList &ol); - static void writeVhdlDeclarations(MemberList*,OutputList&,GroupDef*,ClassDef*,FileDef*,NamespaceDef*); + static void writeVhdlDeclarations(const MemberList*,OutputList&,const GroupDef*,const ClassDef*,const FileDef*,const NamespaceDef*); - static void writeVHDLDeclaration(MemberDef* mdef,OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, + static void writeVHDLDeclaration(const MemberDef* mdef,OutputList &ol, + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd, bool inGroup); - static void writePlainVHDLDeclarations(MemberList* ml,OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd,int specifier); + static void writePlainVHDLDeclarations(const MemberList* ml,OutputList &ol, + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd, + int specifier); - static void writeVHDLDeclarations(MemberList* ml,OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, + static void writeVHDLDeclarations(const MemberList* ml,OutputList &ol, + const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd, const char *title,const char *subtitle,bool showEnumValues,int type); - static bool writeClassType(ClassDef *&,OutputList &ol ,QCString & cname); + static bool writeClassType(const ClassDef *,OutputList &ol ,QCString & cname); static QCString convertArgumentListToString(const ArgumentList* al,bool f); static QCString getProcessNumber(); @@ -192,8 +193,9 @@ class VhdlDocGen static ClassDef* findArchitecture(const ClassDef *cd); static ClassDef* findArchitecture(QCString identifier, QCString entity_name); + static void correctMemberProperties(MemberDef *md); - static void writeSource(MemberDef *mdef,OutputList& ol,QCString & cname); + static void writeSource(const MemberDef *mdef,OutputList& ol,const QCString & cname); static void writeAlphbeticalClass(OutputList& ol,const ClassDef* cd,const QCString &); static QCString parseForConfig(QCString & entity,QCString & arch); diff --git a/src/vhdljjparser.h b/src/vhdljjparser.h index 3a2ed61..fffea47 100644 --- a/src/vhdljjparser.h +++ b/src/vhdljjparser.h @@ -59,9 +59,9 @@ class VHDLLanguageScanner : public ParserInterface int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, - MemberDef *memberDef=0, + const MemberDef *memberDef=0, bool showLineNumbers=TRUE, - Definition *searchCtx=0, + const Definition *searchCtx=0, bool collectXRefs=TRUE ); bool needsPreprocessing(const QCString &) { return TRUE; } diff --git a/src/xmlcode.h b/src/xmlcode.h index 5a9c78c..e463866 100644 --- a/src/xmlcode.h +++ b/src/xmlcode.h @@ -30,7 +30,7 @@ class Definition; extern void parseXmlCode(CodeOutputInterface &,const char *,const QCString &, bool ,const char *,FileDef *fd, int startLine,int endLine,bool inlineFragment, - MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx, + const MemberDef *memberDef,bool showLineNumbers,const Definition *searchCtx, bool collectXRefs); extern void resetXmlCodeParserState(); diff --git a/src/xmlcode.l b/src/xmlcode.l index c9529d6..e792ea9 100644 --- a/src/xmlcode.l +++ b/src/xmlcode.l @@ -49,7 +49,7 @@ static int g_inputPosition; //!< read offset during parsing static int g_inputLines; //!< number of line in the code fragment static int g_yyLineNr; //!< current line number static bool g_needsTermination; -static Definition *g_searchCtx; +static const Definition *g_searchCtx; static bool g_exampleBlock; static QCString g_exampleName; @@ -332,8 +332,8 @@ void parseXmlCode( int startLine, int endLine, bool inlineFragment, - MemberDef *, - bool,Definition *searchCtx, + const MemberDef *, + bool,const Definition *searchCtx, bool /*collectXRefs*/ ) { diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 251dfde..a96b4f9 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -338,8 +338,8 @@ void XMLCodeGenerator::finish() static void writeTemplateArgumentList(ArgumentList *al, FTextStream &t, - Definition *scope, - FileDef *fileScope, + const Definition *scope, + const FileDef *fileScope, int indent) { QCString indentStr; @@ -381,7 +381,7 @@ static void writeTemplateArgumentList(ArgumentList *al, } } -static void writeMemberTemplateLists(MemberDef *md,FTextStream &t) +static void writeMemberTemplateLists(const MemberDef *md,FTextStream &t) { ArgumentList *templMd = md->templateArguments(); if (templMd) // function template prefix @@ -390,7 +390,7 @@ static void writeMemberTemplateLists(MemberDef *md,FTextStream &t) } } -static void writeTemplateList(ClassDef *cd,FTextStream &t) +static void writeTemplateList(const ClassDef *cd,FTextStream &t) { writeTemplateArgumentList(cd->templateArguments(),t,cd,0,4); } @@ -398,8 +398,8 @@ static void writeTemplateList(ClassDef *cd,FTextStream &t) static void writeXMLDocBlock(FTextStream &t, const QCString &fileName, int lineNr, - Definition *scope, - MemberDef * md, + const Definition *scope, + const MemberDef * md, const QCString &text) { QCString stext = text.stripWhiteSpace(); @@ -442,7 +442,7 @@ void writeXMLCodeBlock(FTextStream &t,FileDef *fd) delete xmlGen; } -static void writeMemberReference(FTextStream &t,Definition *def,MemberDef *rmd,const char *tagName) +static void writeMemberReference(FTextStream &t,const Definition *def,const MemberDef *rmd,const char *tagName) { QCString scope = rmd->getScopeString(); QCString name = rmd->name(); @@ -478,7 +478,7 @@ static void stripQualifiers(QCString &typeStr) } } -static QCString classOutputFileBase(ClassDef *cd) +static QCString classOutputFileBase(const ClassDef *cd) { //static bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES); //if (inlineGroupedClasses && cd->partOfGroups()!=0) @@ -487,7 +487,7 @@ static QCString classOutputFileBase(ClassDef *cd) // return cd->getOutputFileBase(); } -static QCString memberOutputFileBase(MemberDef *md) +static QCString memberOutputFileBase(const MemberDef *md) { //static bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES); //if (inlineGroupedClasses && md->getClassDef() && md->getClassDef()->partOfGroups()!=0) @@ -498,7 +498,7 @@ static QCString memberOutputFileBase(MemberDef *md) } -static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,Definition *def) +static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream &t,const Definition *def) { // + declaration/definition arg lists @@ -817,7 +817,7 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De t << " <bitfield>" << convertToXML(bitfield) << "</bitfield>" << endl; } - MemberDef *rmd = md->reimplements(); + const MemberDef *rmd = md->reimplements(); if (rmd) { t << " <reimplements refid=\"" @@ -932,11 +932,11 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De if (md->memberType()==MemberType_Enumeration) // enum { - MemberList *enumFields = md->enumFieldList(); + const MemberList *enumFields = md->enumFieldList(); if (enumFields) { MemberListIterator emli(*enumFields); - MemberDef *emd; + const MemberDef *emd; for (emli.toFirst();(emd=emli.current());++emli) { ti << " <member refid=\"" << memberOutputFileBase(md) @@ -1011,7 +1011,7 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De if (mdict) { MemberSDict::Iterator mdi(*mdict); - MemberDef *rmd; + const MemberDef *rmd; for (mdi.toFirst();(rmd=mdi.current());++mdi) { writeMemberReference(t,def,rmd,"references"); @@ -1021,7 +1021,7 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De if (mdict) { MemberSDict::Iterator mdi(*mdict); - MemberDef *rmd; + const MemberDef *rmd; for (mdi.toFirst();(rmd=mdi.current());++mdi) { writeMemberReference(t,def,rmd,"referencedby"); @@ -1033,20 +1033,20 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De // namespace members are also inserted in the file scope, but // to prevent this duplication in the XML output, we optionally filter those here. -static bool memberVisible(Definition *d,MemberDef *md) +static bool memberVisible(const Definition *d,const MemberDef *md) { return Config_getBool(XML_NS_MEMB_FILE_SCOPE) || d->definitionType()!=Definition::TypeFile || md->getNamespaceDef()==0; } -static void generateXMLSection(Definition *d,FTextStream &ti,FTextStream &t, +static void generateXMLSection(const Definition *d,FTextStream &ti,FTextStream &t, MemberList *ml,const char *kind,const char *header=0, const char *documentation=0) { if (ml==0) return; MemberListIterator mli(*ml); - MemberDef *md; + const MemberDef *md; int count=0; for (mli.toFirst();(md=mli.current());++mli) { @@ -1079,7 +1079,7 @@ static void generateXMLSection(Definition *d,FTextStream &ti,FTextStream &t, t << " </sectiondef>" << endl; } -static void writeListOfAllMembers(ClassDef *cd,FTextStream &t) +static void writeListOfAllMembers(const ClassDef *cd,FTextStream &t) { t << " <listofallmembers>" << endl; if (cd->memberNameInfoSDict()) @@ -1092,7 +1092,7 @@ static void writeListOfAllMembers(ClassDef *cd,FTextStream &t) MemberInfo *mi; for (mii.toFirst();(mi=mii.current());++mii) { - MemberDef *md=mi->memberDef; + const MemberDef *md=mi->memberDef; if (md->name().at(0)!='@') // skip anonymous members { Protection prot = mi->prot; @@ -1132,7 +1132,7 @@ static void writeInnerClasses(const ClassSDict *cl,FTextStream &t) if (cl) { ClassSDict::Iterator cli(*cl); - ClassDef *cd; + const ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) { if (!cd->isHidden() && cd->name().find('@')==-1) // skip anonymous scopes @@ -1157,7 +1157,7 @@ static void writeInnerNamespaces(const NamespaceSDict *nl,FTextStream &t) if (nl) { NamespaceSDict::Iterator nli(*nl); - NamespaceDef *nd; + const NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) { if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymous scopes @@ -1206,7 +1206,7 @@ static void writeInnerGroups(const GroupList *gl,FTextStream &t) if (gl) { GroupListIterator gli(*gl); - GroupDef *sgd; + const GroupDef *sgd; for (gli.toFirst();(sgd=gli.current());++gli) { t << " <innergroup refid=\"" << sgd->getOutputFileBase() @@ -1230,7 +1230,7 @@ static void writeInnerDirs(const DirList *dl,FTextStream &t) } } -static void generateXMLForClass(ClassDef *cd,FTextStream &ti) +static void generateXMLForClass(const ClassDef *cd,FTextStream &ti) { // + brief description // + detailed description @@ -1443,7 +1443,7 @@ static void generateXMLForClass(ClassDef *cd,FTextStream &ti) ti << " </compound>" << endl; } -static void generateXMLForNamespace(NamespaceDef *nd,FTextStream &ti) +static void generateXMLForNamespace(const NamespaceDef *nd,FTextStream &ti) { // + contained class definitions // + contained namespace definitions @@ -1659,7 +1659,7 @@ static void generateXMLForFile(FileDef *fd,FTextStream &ti) ti << " </compound>" << endl; } -static void generateXMLForGroup(GroupDef *gd,FTextStream &ti) +static void generateXMLForGroup(const GroupDef *gd,FTextStream &ti) { // + members // + member groups @@ -1983,7 +1983,7 @@ void generateXML() { ClassSDict::Iterator cli(*Doxygen::classSDict); - ClassDef *cd; + const ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) { generateXMLForClass(cd,t); @@ -1999,7 +1999,7 @@ void generateXML() // } //} NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict); - NamespaceDef *nd; + const NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) { msg("Generating XML output for namespace %s\n",nd->name().data()); @@ -2018,7 +2018,7 @@ void generateXML() } } GroupSDict::Iterator gli(*Doxygen::groupSDict); - GroupDef *gd; + const GroupDef *gd; for (;(gd=gli.current());++gli) { msg("Generating XML output for group %s\n",gd->name().data()); diff --git a/src/xmlgen.h b/src/xmlgen.h index 0555546..4458b9f 100644 --- a/src/xmlgen.h +++ b/src/xmlgen.h @@ -39,7 +39,7 @@ class XMLCodeGenerator : public CodeOutputInterface void writeCodeAnchor(const char *); void writeLineNumber(const char *extRef,const char *compId, const char *anchorId,int l); - void setCurrentDoc(Definition *,const char *,bool){} + void setCurrentDoc(const Definition *,const char *,bool){} void addWord(const char *,bool){} void finish(); diff --git a/src/xmlscanner.h b/src/xmlscanner.h index 6053b96..cb9792c 100644 --- a/src/xmlscanner.h +++ b/src/xmlscanner.h @@ -41,9 +41,9 @@ public: int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, - MemberDef *memberDef=0, + const MemberDef *memberDef=0, bool showLineNumbers=TRUE, - Definition *searchCtx=0, + const Definition *searchCtx=0, bool collectXRefs=TRUE ) { |