diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2001-08-12 16:26:14 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2001-08-12 16:26:14 (GMT) |
commit | b5cbb79d114ed13945bc882ac8eef1c2be967bbf (patch) | |
tree | 4c0dd6f4a7ff503dd3cacaa8e6156c9975645e66 /src | |
parent | 490b7178adcf627892b0686b80016422e64dcfa3 (diff) | |
download | Doxygen-b5cbb79d114ed13945bc882ac8eef1c2be967bbf.zip Doxygen-b5cbb79d114ed13945bc882ac8eef1c2be967bbf.tar.gz Doxygen-b5cbb79d114ed13945bc882ac8eef1c2be967bbf.tar.bz2 |
Release-1.2.9-20010812
Diffstat (limited to 'src')
-rw-r--r-- | src/classdef.cpp | 123 | ||||
-rw-r--r-- | src/classdef.h | 27 | ||||
-rw-r--r-- | src/config.l | 7 | ||||
-rw-r--r-- | src/definition.cpp | 6 | ||||
-rw-r--r-- | src/definition.h | 2 | ||||
-rw-r--r-- | src/doc.l | 6 | ||||
-rw-r--r-- | src/dot.cpp | 232 | ||||
-rw-r--r-- | src/dot.h | 4 | ||||
-rw-r--r-- | src/doxygen.cpp | 161 | ||||
-rw-r--r-- | src/entry.h | 3 | ||||
-rw-r--r-- | src/htmlgen.cpp | 4 | ||||
-rw-r--r-- | src/htmlgen.h | 7 | ||||
-rw-r--r-- | src/index.cpp | 18 | ||||
-rw-r--r-- | src/latexgen.h | 3 | ||||
-rw-r--r-- | src/mangen.h | 2 | ||||
-rw-r--r-- | src/memberdef.cpp | 52 | ||||
-rw-r--r-- | src/memberdef.h | 2 | ||||
-rw-r--r-- | src/outputgen.h | 3 | ||||
-rw-r--r-- | src/outputlist.cpp | 1 | ||||
-rw-r--r-- | src/outputlist.h | 5 | ||||
-rw-r--r-- | src/rtfgen.h | 2 | ||||
-rw-r--r-- | src/scanner.l | 33 | ||||
-rw-r--r-- | src/util.cpp | 9 | ||||
-rw-r--r-- | src/util.h | 4 | ||||
-rw-r--r-- | src/xmlgen.cpp | 13 |
25 files changed, 379 insertions, 350 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp index c0feb10..5f93e7a 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -98,7 +98,7 @@ ClassDef::ClassDef( // m_scopelessName=name().right(name().length()-i-2); //} m_subGrouping=TRUE; - m_isTemplBaseClass=-1; + //m_isTemplBaseClass=-1; m_templateInstances = 0; m_templateMaster =0; m_templBaseClassNames = 0; @@ -1408,13 +1408,34 @@ void ClassDef::setTemplateArguments(ArgumentList *al) } } - +/*! Returns \c TRUE iff this class or a class inheriting from this class + * is \e not defined in an external tag file. + */ bool ClassDef::hasNonReferenceSuperClass() { - bool found=!isReference(); + bool found=!isReference(); + if (found) return TRUE; // we're done if this class is not a reference BaseClassListIterator bcli(*m_inheritedBy); - for ( ; bcli.current() && !found ; ++bcli ) - found=found || bcli.current()->classDef->hasNonReferenceSuperClass(); + for ( ; bcli.current() && !found ; ++bcli ) // for each super class + { + ClassDef *bcd=bcli.current()->classDef; + // recurse into the super class branch + found = found || bcd->hasNonReferenceSuperClass(); + if (!found) + { + // look for template instances that might have non-reference super classes + QDict<ClassDef> *cil = bcd->getTemplateInstances(); + if (cil) + { + QDictIterator<ClassDef> tidi(*cil); + for ( ; tidi.current() && !found ; ++tidi) // for each template instance + { + // recurse into the template instance branch + found = found || tidi.current()->hasNonReferenceSuperClass(); + } + } + } + } return found; } @@ -1512,28 +1533,50 @@ void ClassDef::writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup) /*! a link to this class is possible within this project */ bool ClassDef::isLinkableInProject() const { - return !name().isEmpty() && /* no name */ - m_isTemplBaseClass==-1 && /* template base class */ - name().find('@')==-1 && /* anonymous compound */ - (m_prot!=Private || Config_getBool("EXTRACT_PRIVATE")) && /* private */ - hasDocumentation() && /* documented */ - !isReference(); /* not an external reference */ + if (m_templateMaster) + { + return m_templateMaster->isLinkableInProject(); + } + else + { + return !name().isEmpty() && /* no name */ + //m_isTemplBaseClass==-1 && /* template base class */ + name().find('@')==-1 && /* anonymous compound */ + (m_prot!=Private || Config_getBool("EXTRACT_PRIVATE")) && /* private */ + hasDocumentation() && /* documented */ + !isReference(); /* not an external reference */ + } +} + +bool ClassDef::isLinkable() const +{ + if (m_templateMaster) + { + return m_templateMaster->isLinkable(); + } + else + { + return isLinkableInProject() || isReference(); + } } + /*! the class is visible in a class diagram, or class hierarchy */ bool ClassDef::isVisibleInHierarchy() -{ return // show all classes or a subclass is visible - (Config_getBool("ALLEXTERNALS") || hasNonReferenceSuperClass()) && - // and not an annonymous compound - name().find('@')==-1 && - // not an artifically introduced class - !m_artificial && - // and not an inherited template argument - //m_isTemplBaseClass==-1 && - // and not privately inherited - (m_prot!=Private || Config_getBool("EXTRACT_PRIVATE")) && - // documented or show anyway or documentation is external - (hasDocumentation() || !Config_getBool("HIDE_UNDOC_CLASSES") || isReference()); +{ + return // show all classes or a subclass is visible + (Config_getBool("ALLEXTERNALS") || hasNonReferenceSuperClass()) && + // and not an annonymous compound + name().find('@')==-1 && + // not an artifically introduced class + !m_artificial && + // and not privately inherited + (m_prot!=Private || Config_getBool("EXTRACT_PRIVATE")) && + // documented or shown anyway or documentation is external + (hasDocumentation() || + !Config_getBool("HIDE_UNDOC_CLASSES") || + isReference() + ); } bool ClassDef::hasDocumentation() const @@ -1554,6 +1597,7 @@ bool ClassDef::isBaseClass(ClassDef *bcd) for ( ; bcli.current() && !found ; ++bcli) { ClassDef *ccd=bcli.current()->classDef; + if (ccd->templateMaster()) ccd=ccd->templateMaster(); //printf("isBaseClass() baseclass %s\n",ccd->name().data()); if (ccd==bcd) found=TRUE; @@ -2212,6 +2256,18 @@ QCString ClassDef::getReference() const } } +bool ClassDef::isReference() const +{ + if (m_templateMaster) + { + return m_templateMaster->getReference(); + } + else + { + return Definition::isReference(); + } +} + void ClassDef::getTemplateParameterLists(QList<ArgumentList> &lists) const { Definition *d=getOuterScope(); @@ -2273,4 +2329,23 @@ QCString ClassDef::qualifiedNameWithTemplateParameters( return scName; } - +QCString ClassDef::className() const +{ + if (!m_className.isEmpty()) + { + return m_className; + } + else + { + ClassDef *that = (ClassDef *)this; + // m_className is a cache value, so we fake that this function is "const". + that->m_className=m_localName.copy(); + Definition *p=getOuterScope(); + while (p && p->definitionType()==TypeClass) + { + that->m_className.prepend(p->localName()+"::"); + p=p->getOuterScope(); + } + return m_className; + } +}; diff --git a/src/classdef.h b/src/classdef.h index 939cd90..51d0112 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -72,6 +72,7 @@ class ClassDef : public Definition QCString getFileBase() const; QCString getSourceFileBase() const; QCString getReference() const; + bool isReference() const; bool hasDocumentation() const; @@ -114,10 +115,7 @@ class ClassDef : public Definition /*! return TRUE iff a link to this class is possible (either within * this project, or as a cross-reference to another project). */ - bool isLinkable() const - { - return isLinkableInProject() || isReference(); - } + bool isLinkable() const; /*! the class is visible in a class diagram, or class hierarchy */ bool isVisibleInHierarchy(); @@ -153,12 +151,6 @@ class ClassDef : public Definition */ bool isBaseClass(ClassDef *bcd); - /*! Is this an artificial class that is the template argument of - * a class. If so the argument number is returned, otherwise -1 - * is returned. - */ - int isTemplateBaseClass() const { return m_isTemplBaseClass; } - /*! Returns a sorted dictionary with all template instances found for * this template class. Returns 0 if not a template or no instances. */ @@ -200,6 +192,11 @@ class ClassDef : public Definition */ bool isAbstract() const { return m_isAbstract; } + /*! returns the name of the class including outer classes, but not + * including namespaces. + */ + QCString className() const; + /* member lists by protection */ MemberList pubMembers; MemberList proMembers; @@ -262,7 +259,6 @@ class ClassDef : public Definition void setProtection(Protection p) { m_prot=p; } void setGroupDefForAllMembers(GroupDef *g,Grouping::GroupPri_t pri,const QCString &fileName,int startLine,bool hasDocs); void addInnerCompound(Definition *d); - void setIsTemplateBaseClass(int num) { m_isTemplBaseClass = num; } void addUsedClass(ClassDef *cd,const char *accessName); //void initTemplateMapping(); //void setTemplateArgumentMapping(const char *formal,const char *actual); @@ -384,13 +380,6 @@ class ClassDef : public Definition UsesClassDict *m_usesImplClassDict; UsesClassDict *m_usesIntfClassDict; - /*! Is this a class that exists because of template class that - * inherited one of it's template arguments. If so that this - * variable indicate the template argument number, otherwise - * this is -1 - */ - int m_isTemplBaseClass; - /*! Template instances that exists of this class, the key in the * dictionary is the template argument list. */ @@ -410,6 +399,8 @@ class ClassDef : public Definition /*! Is this an abstact class? */ bool m_isAbstract; + + QCString m_className; }; /*! \brief Class that contains information about a usage relation. diff --git a/src/config.l b/src/config.l index 3a887a6..cdaeb66 100644 --- a/src/config.l +++ b/src/config.l @@ -2038,6 +2038,13 @@ void Config::create() ); cb->addDependency("HAVE_DOT"); cb = addBool( + "TEMPLATE_RELATIONS", + "If set to YES, the inheritance and collaboration graphs will show the \n" + "relations between templates and their instances. \n", + TRUE + ); + cb->addDependency("HAVE_DOT"); + cb = addBool( "INCLUDE_GRAPH", "If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT \n" "tags are set to YES then doxygen will generate a graph for each documented \n" diff --git a/src/definition.cpp b/src/definition.cpp index fc764f7..06d4da7 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -34,7 +34,11 @@ Definition::Definition(const char *df,int dl, m_defFileName = df; m_defLine = dl; m_name=name; - m_localName=stripScope(name); + if (m_name!="<globalScope>") + m_localName=stripScope(name); + else + m_localName=name; + //printf("m_localName=%s\n",m_localName.data()); m_brief=b; m_doc=d; m_sectionDict=0, diff --git a/src/definition.h b/src/definition.h index c4ab29a..090dcd5 100644 --- a/src/definition.h +++ b/src/definition.h @@ -80,7 +80,7 @@ class Definition virtual bool isLinkable() const = 0; virtual QCString getReference() const { return m_ref; } - bool isReference() const { return !m_ref.isEmpty(); } + virtual bool isReference() const { return !m_ref.isEmpty(); } void setReference(const char *r) { m_ref=r; } /*! Add the list of anchors that mark the sections that are found in the @@ -1504,7 +1504,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) if (inBlock()) endBlock(); inParamBlock=TRUE; currentListIndent.push("D"); - outDoc->startParamList(); + outDoc->startParamList(BaseOutputDocInterface::Param); scanString(theTranslator->trParameters()+": "); outDoc->endDescTitle(); outDoc->writeDescItem(); @@ -1528,7 +1528,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) if (inBlock()) endBlock(); inRetValBlock=TRUE; currentListIndent.push("D"); - outDoc->startParamList(); + outDoc->startParamList(BaseOutputDocInterface::RetVal); scanString(theTranslator->trReturnValues()+": "); outDoc->endDescTitle(); outDoc->writeDescItem(); @@ -1552,7 +1552,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) if (inBlock()) endBlock(); inExceptionBlock=TRUE; currentListIndent.push("D"); - outDoc->startParamList(); + outDoc->startParamList(BaseOutputDocInterface::Exception); scanString(theTranslator->trExceptions()+": "); outDoc->endDescTitle(); outDoc->writeDescItem(); diff --git a/src/dot.cpp b/src/dot.cpp index 88e0571..bd13f75 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -40,7 +40,8 @@ static const char *edgeColorMap[] = "darkgreen", // Protected "firebrick4", // Private "darkorchid3", // "use" relation - "grey75" // Undocumented + "grey75", // Undocumented + "orange" // template relation }; static const char *edgeStyleMap[] = @@ -177,153 +178,6 @@ static bool isLeaf(ClassDef *cd) return TRUE; } -#if 0 -/*! Builds a mapping from formal arguments of class \a tcd to the - * actual arguments stored in templSpec. To properly initialize - * the mapping with the default template values - * ClassDef::initTemplateMapping() is called once for each class graph - * (the ClassDef::visited flag is used for this). - */ -static void setTemplateInstance(QCString templSpec,ClassDef *tcd) -{ - //printf("====== setTemplateInstance(templ=%s,class=%s)\n",templSpec.data(),tcd->name().data()); - if (!templSpec.isEmpty()) - { - //if (!tcd->visited) - //{ - // tcd->visited=TRUE; - //} - ArgumentList *tempArgList = new ArgumentList; - stringToArgumentList(templSpec,tempArgList); - ArgumentListIterator ali(*tempArgList); - Argument *arg; - uint count=0; - for (ali.toFirst();(arg=ali.current());++ali,++count) - { - ArgumentList *formalArgList = tcd->templateArguments(); - Argument *formalArg=0; - //printf("arg->type=%s count=%d formalArgList=%p\n", - // arg->type.data(),count,formalArgList); - if (formalArgList && formalArgList->count()>count && - (formalArg=formalArgList->at(count))) - { - if (formalArg->name!=arg->type) - { - tcd->setTemplateArgumentMapping(formalArg->name,arg->type); - //printf("%s->setTemplateInstantation(%s,%s)\n",tcd->name().data(), - // formalArg->name.data(),arg->type.data()); - } - } - } - delete tempArgList; - } -} - -/*! Substitutes the formal template argument list \a templSpec - * of class \a cd with the actual template arguments. - * The mapping from formal to actual template is assumed to be stored - * in \a cd using setTemplateInstance(). - */ -static QCString substituteTemplateSpec(ClassDef *cd,const QCString &templSpec) -{ - QCString result; - if (!templSpec.isEmpty()) - { - ArgumentList *tempArgList = new ArgumentList; - stringToArgumentList(templSpec,tempArgList); - ArgumentListIterator ali(*tempArgList); - Argument *arg; - bool first=TRUE; - for (ali.toFirst();(arg=ali.current());) - { - if (first) result="<",first=FALSE; - QCString actual = cd->getTemplateArgumentMapping(arg->type); - if (!actual.isEmpty()) - { - result+=actual; - } - else - { - result+=arg->type; - } - ++ali; - if (ali.current()) result+=","; else result+=">"; - } - delete tempArgList; - } - //printf("substituteTemplateSpec(%s,%s)=`%s'\n",cd->name().data(),templSpec.data(),result.data()); - return removeRedundantWhiteSpace(result); -} - -/*! Determines the actual template instance of template class \a tcd that - * relates to class \a cd. The result is stored in \a tcd. - * \param cd A class - * \param tcd A template base class - * \param templSpec Actual template parameter list to be used for tcd - * \param result resulting instance class - * \param actualArg actual template instance name of the resulting class - */ -static void computeTemplateInstance( - ClassDef *cd,ClassDef *tcd,const QCString templSpec, - ClassDef *&result,QCString &actualArg - - ) -{ - //printf("====== computeTemplateInstance(%s,base=%s,templ=%s)\n", - // cd->name().data(),tcd->name().data(),templSpec.data()); - // store the specific instance inside the class - setTemplateInstance(templSpec,tcd); - int tArgNum = tcd->isTemplateBaseClass(); - if (tArgNum!=-1) - { - //printf("tArgNum=%d\n",tArgNum); - ArgumentList *formalArgList = cd->templateArguments(); - if (formalArgList) - { - //printf("formalArgList=%p\n",formalArgList); - Argument *formalArg=formalArgList->at(tArgNum); - if (formalArg) - { - //printf("formalArg=%s\n",formalArg->name.data()); - actualArg = cd->getTemplateArgumentMapping(formalArg->name); - //printf("ActualArg=%s\n",actualArg.data()); - int pos=0; - QCString name; - QCString templSpec; - while (extractClassNameFromType(actualArg,pos,name,templSpec)) - { - Definition *scopeDef = cd->getOuterScope(); - QCString scopeName; - if (scopeDef) scopeName = scopeDef->qualifiedName(); - //printf("name=%s templSpec=%s\n",name.data(),templSpec.data()); - ClassDef *acd=0; - - // try with scope. - if (!scopeName.isEmpty()) - acd = getResolvedClass(scopeName+"::"+name); - // try without scope. - // TODO: try intermediate scopes as well! - if (acd==0) acd = getResolvedClass(name); - if (acd && !templSpec.isEmpty()) - { - // store specific template instance in the class - setTemplateInstance(templSpec,acd); - } - if (acd) - { - result = acd; - actualArg = acd->name()+templSpec; - return; - } - } - } - } - } - actualArg.resize(0); - result = 0; -} -#endif - //-------------------------------------------------------------------- class DotNodeList : public QList<DotNode> @@ -932,7 +786,7 @@ int DotClassGraph::m_curNodeNumber; void DotClassGraph::addClass(ClassDef *cd,DotNode *n,int prot, const char *label,int distance,const char *usedName,const char *templSpec,bool base) { - int edgeStyle = label ? EdgeInfo::Dashed : EdgeInfo::Solid; + int edgeStyle = (label || prot==EdgeInfo::Orange) ? EdgeInfo::Dashed : EdgeInfo::Solid; QCString className; if (usedName) // name is a typedef { @@ -997,34 +851,22 @@ void DotClassGraph::addClass(ClassDef *cd,DotNode *n,int prot, void DotClassGraph::buildGraph(ClassDef *cd,DotNode *n,int distance,bool base) { + // ---- Add inheritance relations + BaseClassListIterator bcli(base ? *cd->baseClasses() : *cd->subClasses()); BaseClassDef *bcd; for ( ; (bcd=bcli.current()) ; ++bcli ) { //printf("-------- inheritance relation %s->%s templ=`%s'\n", // cd->name().data(),bcd->classDef->name().data(),bcd->templSpecifiers.data()); - //QCString templSpec; - //if (base) templSpec = substituteTemplateSpec( - // cd,bcd->templSpecifiers); - //ClassDef *acd=0; - //QCString actualArg; - //computeTemplateInstance(cd,bcd->classDef,templSpec,acd,actualArg); - //printf("acd=%p actualArg=%s\n",acd,actualArg.data()); - //if (acd) - //{ - // addClass(acd,n,bcd->prot,0,distance,actualArg, - // templSpec,base); - //} - //else - //{ - // addClass(bcd->classDef,n,bcd->prot,0,distance,bcd->usedName, - // templSpec,base); - //} addClass(bcd->classDef,n,bcd->prot,0,distance,bcd->usedName, bcd->templSpecifiers,base); } if (m_graphType != Inheritance) { + + // ---- Add usage relations + UsesClassDict *dict = m_graphType==Implementation ? cd->usedImplementationClasses() : cd->usedInterfaceClasses(); @@ -1050,30 +892,48 @@ void DotClassGraph::buildGraph(ClassDef *cd,DotNode *n,int distance,bool base) label+=QCString("\\n")+s; } } - //QCString actualArg; - //ClassDef *acd=0; - //printf("-------- usage relation %s->%s templ=`%s'\n", - // cd->name().data(),ucd->classDef->name().data(), - // ucd->templSpecifiers.data()); - //QCString templSpec = substituteTemplateSpec( - // cd,ucd->templSpecifiers); - //computeTemplateInstance(cd,ucd->classDef, templSpec, acd,actualArg); - //if (acd) - //{ - // addClass(acd,n,EdgeInfo::Black,label,distance,actualArg, - // templSpec,base); - //} - //else - //{ - // //printf("Found label=`%s'\n",label.data()); - // addClass(ucd->classDef,n,EdgeInfo::Black,label,distance,0, - // templSpec,base); - //} - addClass(ucd->classDef,n,EdgeInfo::Black,label,distance,0, + addClass(ucd->classDef,n,EdgeInfo::Purple,label,distance,0, ucd->templSpecifiers,base); } } } + + // ---- Add template instantiation relations + + if (Config_getBool("TEMPLATE_RELATIONS")) + { + if (base) // template relations for base classes + { + ClassDef *templMaster=cd->templateMaster(); + if (templMaster) + { + QDictIterator<ClassDef> cli(*templMaster->getTemplateInstances()); + ClassDef *templInstance; + for (;(templInstance=cli.current());++cli) + { + if (templInstance==cd) + { + addClass(templMaster,n,EdgeInfo::Orange,cli.currentKey(),distance,0, + 0,TRUE); + } + } + } + } + else // template relations for super classes + { + QDict<ClassDef> *templInstances = cd->getTemplateInstances(); + if (templInstances) + { + QDictIterator<ClassDef> cli(*templInstances); + ClassDef *templInstance; + for (;(templInstance=cli.current());++cli) + { + addClass(templInstance,n,EdgeInfo::Orange,cli.currentKey(),distance,0, + 0,FALSE); + } + } + } + } } DotClassGraph::DotClassGraph(ClassDef *cd,GraphType t,int maxRecursionDepth) @@ -30,7 +30,7 @@ enum GraphOutputFormat { GIF , EPS }; struct EdgeInfo { - enum Colors { Blue=0, Green=1, Red=2, Black=3, Grey=4 }; + enum Colors { Blue=0, Green=1, Red=2, Purple=3, Grey=4, Orange=5 }; enum Styles { Solid=0, Dashed=1 }; EdgeInfo() : m_color(0), m_style(0), m_labColor(0) {} ~EdgeInfo() {} @@ -60,7 +60,7 @@ class DotNode DotNode(int n,const char *lab,const char *url,int distance = 0,bool rootNode=FALSE); ~DotNode(); void addChild(DotNode *n, - int edgeColor=EdgeInfo::Black, + int edgeColor=EdgeInfo::Purple, int edgeStyle=EdgeInfo::Solid, const char *edgeLab=0, const char *edgeURL=0, diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 70f7d98..6771f9c 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -2527,7 +2527,7 @@ static void findUsedClassesForClass(Entry *root, usedCd = new ClassDef( masterCd->getDefFileName(),masterCd->getDefLine(), usedName,ClassDef::Class); - usedCd->setIsTemplateBaseClass(count); + //usedCd->setIsTemplateBaseClass(count); Doxygen::hiddenClasses.inSort(usedName,usedCd); } if (isArtificial) usedCd->setClassIsArtificial(); @@ -2599,36 +2599,43 @@ static void findBaseClassesForClass( BaseInfo *bi=0; for (bii.toFirst();(bi=bii.current());++bii) { - bool delTempNames=FALSE; - if (templateNames==0) - { - templateNames = getTemplateArgumentsInName(formalArgs,bi->name); - delTempNames=TRUE; - } - BaseInfo tbi(bi->name,bi->prot,bi->virt); - if (actualArgs) // substitute the formal template arguments of the base class - { - tbi.name = substituteTemplateArgumentsInString(bi->name,formalArgs,actualArgs); - } + //printf("masterCd=%s bi->name=%s\n",masterCd->localName().data(),bi->name.data()); + //if ( masterCd->localName()!=bi->name.left(masterCd->localName().length()) + // || bi->name.at(masterCd->localName().length())!='<' + // ) // to avoid recursive lock-up in cases like + // // template<typename T> class A : public A<typename T::B> + //{ + bool delTempNames=FALSE; + if (templateNames==0) + { + templateNames = getTemplateArgumentsInName(formalArgs,bi->name); + delTempNames=TRUE; + } + BaseInfo tbi(bi->name,bi->prot,bi->virt); + if (actualArgs) // substitute the formal template arguments of the base class + { + tbi.name = substituteTemplateArgumentsInString(bi->name,formalArgs,actualArgs); + } - if (mode==DocumentedOnly) - { - // find a documented base class in the correct scope - if (!findClassRelation(root,instanceCd,&tbi,templateNames,DocumentedOnly,isArtificial)) + if (mode==DocumentedOnly) { - // no documented base class -> try to find an undocumented one - findClassRelation(root,instanceCd,&tbi,templateNames,Undocumented,isArtificial); + // find a documented base class in the correct scope + if (!findClassRelation(root,instanceCd,&tbi,templateNames,DocumentedOnly,isArtificial)) + { + // no documented base class -> try to find an undocumented one + findClassRelation(root,instanceCd,&tbi,templateNames,Undocumented,isArtificial); + } } - } - else if (mode==TemplateInstances) - { - findClassRelation(root,instanceCd,&tbi,templateNames,TemplateInstances,isArtificial); - } - if (delTempNames) - { - delete templateNames; - templateNames=0; - } + else if (mode==TemplateInstances) + { + findClassRelation(root,instanceCd,&tbi,templateNames,TemplateInstances,isArtificial); + } + if (delTempNames) + { + delete templateNames; + templateNames=0; + } + //} } } @@ -2736,9 +2743,11 @@ static bool findClassRelation( // baseClass?baseClass->name().data():"<none>", // templSpec.data() // ); - if (baseClassName!=root->name) // Check for base class with the same name. - // If found then look in the outer scope for a match - // and prevent recursion. + if (baseClassName.left(root->name.length())!=root->name || + baseClassName.at(root->name.length())!='<' + ) // Check for base class with the same name. + // If found then look in the outer scope for a match + // and prevent recursion. { Debug::print( Debug::Classes,0," class relation %s inherited by %s found (%s and %s)\n", @@ -2942,17 +2951,17 @@ static bool findClassRelation( baseClass->insertUsedFile(root->fileName); // is this an inherited template argument? //printf("%s->setIsTemplateBaseClass(%d)\n",baseClass->name().data(),isTemplBaseClass); - if (isATemplateArgument) - { - baseClass->setIsTemplateBaseClass(*templateNames->find(bi->name)); - } + //if (isATemplateArgument) + //{ + // baseClass->setIsTemplateBaseClass(*templateNames->find(bi->name)); + //} // add class to the list - if (!isATemplateArgument) - { - } - else - { - } + //if (!isATemplateArgument) + //{ + //} + //else + //{ + //} return TRUE; } else @@ -3117,10 +3126,6 @@ static void computeTemplateClassRelations() for (tdi.toFirst();(tcd=tdi.current());++tdi) // for each template instance { Debug::print(Debug::Classes,0," Template instance %s : \n",tcd->name().data()); - //QCString templName = tcd->name(); - //int index = templName.find('<'); - //ASSERT(index!=-1); - // templName.right(templName.length()-index); QCString templSpec = tdi.currentKey().data(); ArgumentList *templArgs = new ArgumentList; stringToArgumentList(templSpec,templArgs); @@ -3214,7 +3219,7 @@ static void computeMemberReferences() //---------------------------------------------------------------------- -static void addClassMemberTodoTestBufReferences(Definition *compound) +static void addClassMemberTodoTestBugReferences(Definition *compound) { MemberNameListIterator mnli(Doxygen::memberNameList); MemberName *mn=0; @@ -3229,7 +3234,7 @@ static void addClassMemberTodoTestBufReferences(Definition *compound) if (d) scopeName=d->name(); if (d==0) d=md->getGroupDef(); if (d==0) d=md->getFileDef(); - if (compound==d || (compound==0 && d!=0 && !md->visited)) + if (d!=0 && ((compound==0 && !md->visited) || compound==d)) { QCString memLabel; md->visited=TRUE; @@ -3247,7 +3252,7 @@ static void addClassMemberTodoTestBufReferences(Definition *compound) } } -static void addFileMemberTodoTestBufReferences(Definition *compound) +static void addFileMemberTodoTestBugReferences(Definition *compound) { MemberNameListIterator fnli(Doxygen::functionNameList); MemberName *mn=0; @@ -3262,7 +3267,7 @@ static void addFileMemberTodoTestBufReferences(Definition *compound) if (d) scopeName=d->name(); if (d==0) d=md->getGroupDef(); if (d==0) d=md->getFileDef(); - if (compound==d || (compound==0 && d!=0 && !md->visited)) + if (d!=0 && ((compound==0 && !md->visited) || compound==d)) { QCString memLabel; md->visited=TRUE; @@ -3312,7 +3317,7 @@ static void addTodoTestBugReferences() theTranslator->trClass(TRUE,TRUE), cd->getOutputFileBase(),cd->name() ); - addClassMemberTodoTestBufReferences(cd); + addClassMemberTodoTestBugReferences(cd); } FileName *fn=Doxygen::inputNameList.first(); while (fn) @@ -3323,7 +3328,7 @@ static void addTodoTestBugReferences() addRefItem(fd->todoId(),fd->testId(),fd->bugId(), theTranslator->trFile(TRUE,TRUE), fd->getOutputFileBase(),fd->name()); - addFileMemberTodoTestBufReferences(fd); + addFileMemberTodoTestBugReferences(fd); fd=fn->next(); } fn=Doxygen::inputNameList.next(); @@ -3334,7 +3339,7 @@ static void addTodoTestBugReferences() addRefItem(nd->todoId(),nd->testId(),nd->bugId(), theTranslator->trNamespace(TRUE,TRUE), nd->getOutputFileBase(),nd->name()); - addFileMemberTodoTestBufReferences(nd); + addFileMemberTodoTestBugReferences(nd); nd=Doxygen::namespaceList.next(); } GroupDef *gd=Doxygen::groupList.first(); @@ -3343,7 +3348,7 @@ static void addTodoTestBugReferences() addRefItem(gd->todoId(),gd->testId(),gd->bugId(), theTranslator->trGroup(TRUE,TRUE), gd->getOutputFileBase(),gd->groupTitle()); - addFileMemberTodoTestBufReferences(gd); + addFileMemberTodoTestBugReferences(gd); gd=Doxygen::groupList.next(); } PageSDictIterator pdi(*Doxygen::pageSDict); @@ -3354,8 +3359,8 @@ static void addTodoTestBugReferences() theTranslator->trPage(TRUE,TRUE), pi->name,pi->title); } - addClassMemberTodoTestBufReferences(0); - addFileMemberTodoTestBufReferences(0); + addClassMemberTodoTestBugReferences(0); + addFileMemberTodoTestBugReferences(0); } @@ -5143,8 +5148,8 @@ static void generateClassDocs() { ClassDef *cd=cli.current(); if ( cd->isLinkableInProject() && cd->templateMaster()==0 && - (cd->getOuterScope()==0 || - cd->getOuterScope()->definitionType()!=Definition::TypeClass + (cd->getOuterScope()==0 || // <-- should not happen + cd->getOuterScope()==Doxygen::globalScope ) ) // skip external references, anonymous compounds and // template instances and nested classes @@ -5465,10 +5470,10 @@ static void findMainPage(Entry *root) */ static void buildPackageList(Entry *root) { - if (root->section == Entry::PACKAGE_SEC) + if (root->section == Entry::PACKAGE_SEC || root->section == Entry::PACKAGEDOC_SEC && !root->name.isEmpty()) { PackageDef *pd=0; - if (!root->name.isEmpty() && (pd=Doxygen::packageDict.find(root->name))==0) + if ((pd=Doxygen::packageDict.find(root->name))==0) { QCString tagName; if (root->tagInfo) @@ -5477,16 +5482,26 @@ static void buildPackageList(Entry *root) } pd = new PackageDef(root->fileName,root->startLine,root->name,tagName); Doxygen::packageDict.inSort(root->name,pd); + pd->setDocumentation(root->doc); + pd->setBriefDescription(root->brief); } - if (pd) + else { - bool ambig; - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); - if (fd) + if (!pd->documentation() && !root->doc.isEmpty()) + { + pd->setDocumentation(root->doc); + } + if (!pd->briefDescription() && !root->brief.isEmpty()) { - fd->setPackageDef(pd); + pd->setBriefDescription(root->brief); } } + bool ambig; + FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + if (fd) + { + fd->setPackageDef(pd); + } } EntryListIterator eli(*root->sublist); Entry *e; @@ -5498,6 +5513,8 @@ static void buildPackageList(Entry *root) //---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- + /*! Add Java classes to their respective packages */ static void addClassesToPackages() { @@ -5730,6 +5747,22 @@ static void generateNamespaceDocs() msg("Generating docs for namespace %s\n",nd->name().data()); nd->writeDocumentation(*outputList); } + ClassSDict::Iterator cli(Doxygen::classSDict); + for ( ; cli.current() ; ++cli ) + { + ClassDef *cd=cli.current(); + if ( cd->getOuterScope()==nd && + cd->isLinkableInProject() && + cd->templateMaster()==0 + ) // skip external references, anonymous compounds and + // template instances and nested classes + { + msg("Generating docs for compound %s...\n",cd->name().data()); + + cd->writeDocumentation(*outputList); + cd->writeMemberList(*outputList); + } + } } } diff --git a/src/entry.h b/src/entry.h index 3a68808..146ce57 100644 --- a/src/entry.h +++ b/src/entry.h @@ -215,7 +215,8 @@ class Entry MAINPAGEDOC_SEC = 0x01200000, MEMBERGRP_SEC = 0x01300000, USINGDECL_SEC = 0x01400000, - PACKAGE_SEC = 0x01500000 + PACKAGE_SEC = 0x01500000, + PACKAGEDOC_SEC = 0x01600000, }; enum MemberSpecifier { diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index da43e85..a69d631 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -899,7 +899,7 @@ void HtmlGenerator::endMemberDocName() void HtmlGenerator::startParameterList() { DBG_HTML(t << "<!-- startParameterList -->" << endl;) - t << " <td class=\"md\">( </td>" << endl; + t << " <td class=\"md\">( </td>" << endl; } void HtmlGenerator::startParameterType(bool first) @@ -948,7 +948,7 @@ void HtmlGenerator::endParameterName(bool last,bool emptyList) t << " </tr>" << endl; t << " <tr>" << endl; t << " <td></td>" << endl; - t << " <td class=\"md\">) </td>" << endl; + t << " <td class=\"md\">) </td>" << endl; t << " <td class=\"md\" colspan=\"2\">"; } } diff --git a/src/htmlgen.h b/src/htmlgen.h index 9bc9ffb..6f60593 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -176,11 +176,12 @@ class HtmlGenerator : public OutputGenerator void writeRing(char c) { t << "&" << c << "ring;"; } void writeSharpS() { t << "ß"; } void writeCCedil(char c) { t << "&" << c << "cedil;"; } - void startDescList() { t << "<dl compact><dt>" << endl; } + void startDescList() { t << "<dl compact><dt><b>" << endl; } void endDescList() { t << "</dl>"; } - void startParamList() { startDescList(); } + void startParamList(ParamListTypes) + { startDescList(); } void endParamList() { endDescList(); } - void endDescTitle() {} + void endDescTitle() { t << "</b>"; } void writeDescItem() { t << "<dd>" << endl; } void startSection(const char *,const char *,bool); void endSection(const char *,bool); diff --git a/src/index.cpp b/src/index.cpp index 5e3e53f..d1ea611 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -1194,10 +1194,10 @@ void writeAlphabeticalClassList(OutputList &ol) { if (cd->isLinkableInProject() && cd->templateMaster()==0) { - int index = getPrefixIndex(cd->localName()); - if (toupper(cd->name().at(index))!=startLetter) // new begin letter => new header + int index = getPrefixIndex(cd->className()); + if (toupper(cd->className().at(index))!=startLetter) // new begin letter => new header { - startLetter=toupper(cd->name().at(index)); + startLetter=toupper(cd->className().at(index)); headerItems++; } } @@ -1227,11 +1227,11 @@ void writeAlphabeticalClassList(OutputList &ol) { if (cd->isLinkableInProject() && cd->templateMaster()==0) { - int index = getPrefixIndex(cd->localName()); - if (toupper(cd->name().at(index))!=startLetter) + int index = getPrefixIndex(cd->className()); + if (toupper(cd->className().at(index))!=startLetter) { // insert a new header using a dummy class pointer. - startLetter=toupper(cd->name().at(index)); + startLetter=toupper(cd->className().at(index)); colList[col].append((ClassDef *)8); // insert dummy for the header row++; if ( row >= rows + ((col<itemsInLastRow) ? 0 : -1)) @@ -1275,8 +1275,8 @@ void writeAlphabeticalClassList(OutputList &ol) if (cd) { //printf("head ClassDef=%p %s\n",cd,cd ? cd->name().data() : "<none>"); - int index = getPrefixIndex(cd->localName()); - startLetter=toupper(cd->name().at(index)); + int index = getPrefixIndex(cd->className()); + startLetter=toupper(cd->className().at(index)); char s[2]; s[0]=startLetter; s[1]=0; ol.writeIndexHeading(s); } @@ -1291,7 +1291,7 @@ void writeAlphabeticalClassList(OutputList &ol) } else { - extractNamespaceName(cd->name(),cname,namesp); + cname=cd->className(); } ol.writeObjectLink(cd->getReference(), diff --git a/src/latexgen.h b/src/latexgen.h index f2fca5a..51d2b61 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -185,7 +185,8 @@ class LatexGenerator : public OutputGenerator void endMemberDescription() { t << "\\item\\end{CompactList}"; } void startDescList() { t << "\\begin{Desc}\n\\item["; } void endDescList() { t << "\\end{Desc}" << endl; } - void startParamList() { startDescList(); } + void startParamList(ParamListTypes) + { startDescList(); } void endParamList() { endDescList(); } void endDescTitle() { t << "]"; } void writeDescItem() { t << "\\par" << endl; } diff --git a/src/mangen.h b/src/mangen.h index 92fcc3a..4a03abb 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -172,7 +172,7 @@ class ManGenerator : public OutputGenerator void endMemberDescription() { t << "\\fP\""; firstCol=FALSE; } void startDescList(); void endDescList() {} - void startParamList() { startDescList(); } + void startParamList(ParamListTypes) { startDescList(); } void endParamList() { endDescList(); } void endDescTitle(); void writeDescItem(); diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 9c04b94..f230ea6 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -359,10 +359,29 @@ MemberDef::~MemberDef() delete m_defTmpArgLists; } +void MemberDef::setReimplements(MemberDef *md) +{ + if (m_templateMaster) + { + m_templateMaster->setReimplements(md); + } + else + { + redefines=md; + } +} + void MemberDef::insertReimplementedBy(MemberDef *md) { - if (redefinedBy==0) redefinedBy = new MemberList; - redefinedBy->inSort(md); + if (m_templateMaster) + { + m_templateMaster->insertReimplementedBy(md); + } + else + { + if (redefinedBy==0) redefinedBy = new MemberList; + redefinedBy->inSort(md); + } } void MemberDef::insertEnumField(MemberDef *md) @@ -1472,18 +1491,31 @@ void MemberDef::warnIfUndocumented() bool MemberDef::isLinkableInProject() const { - return !name().isEmpty() && name().at(0)!='@' && - ((hasDocumentation() && !isReference()) - ) && - (prot!=Private || Config_getBool("EXTRACT_PRIVATE") || - mtype==Friend) && // not a hidden member due to protection - (classDef!=0 || Config_getBool("EXTRACT_STATIC") || - !isStatic()); // not a static file/namespace member + if (m_templateMaster) + { + return m_templateMaster->isLinkableInProject(); + } + else + { + return !name().isEmpty() && name().at(0)!='@' && + (hasDocumentation() && !isReference()) && + (prot!=Private || Config_getBool("EXTRACT_PRIVATE") || + mtype==Friend) && // not a hidden member due to protection + (classDef!=0 || Config_getBool("EXTRACT_STATIC") || + !isStatic()); // not a static file/namespace member + } } bool MemberDef::isLinkable() const { - return isLinkableInProject() || isReference(); + if (m_templateMaster) + { + return m_templateMaster->isLinkable(); + } + else + { + return isLinkableInProject() || isReference(); + } } void MemberDef::setEnumDecl(OutputList &ed) diff --git a/src/memberdef.h b/src/memberdef.h index 9f28afc..7e8c773 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -161,7 +161,7 @@ class MemberDef : public Definition void warnIfUndocumented(); // relation to other members - void setReimplements(MemberDef *md) { redefines=md; } + void setReimplements(MemberDef *md); void insertReimplementedBy(MemberDef *md); MemberDef *reimplements() const { return redefines; } MemberList *reimplementedBy() const { return redefinedBy; } diff --git a/src/outputgen.h b/src/outputgen.h index 7253c11..8d05ef5 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -40,6 +40,7 @@ class DotGfxHierarchyTable; class BaseOutputDocInterface { public: + enum ParamListTypes { Param, RetVal, Exception }; /*! Start of a bullet list: e.g. \c <ul> in html. writeListItem() is * Used for the bullet items. @@ -208,7 +209,7 @@ class BaseOutputDocInterface virtual void writeCCedil(char) = 0; virtual void startDescList() = 0; virtual void endDescList() = 0; - virtual void startParamList() = 0; + virtual void startParamList(ParamListTypes t) = 0; virtual void endParamList() = 0; virtual void endDescTitle() = 0; virtual void writeDescItem() = 0; diff --git a/src/outputlist.cpp b/src/outputlist.cpp index cba5c17..06d2ebc 100644 --- a/src/outputlist.cpp +++ b/src/outputlist.cpp @@ -261,6 +261,7 @@ FORALL1(int a1,a1) FORALL1(DotClassGraph &a1,a1) FORALL1(DotInclDepGraph &a1,a1) FORALL1(DotGfxHierarchyTable &a1,a1) +FORALL1(ParamListTypes a1,a1) #if defined(HAS_BOOL_TYPE) || defined(Q_HAS_BOOL_TYPE) FORALL1(bool a1,a1) FORALL2(bool a1,int a2,a1,a2) diff --git a/src/outputlist.h b/src/outputlist.h index 065144a..b96fc80 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -310,8 +310,8 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startDescList); } void endDescList() { forall(&OutputGenerator::endDescList); } - void startParamList() - { forall(&OutputGenerator::startParamList); } + void startParamList(ParamListTypes t) + { forall(&OutputGenerator::startParamList,t); } void endParamList() { forall(&OutputGenerator::endParamList); } void endDescTitle() @@ -455,6 +455,7 @@ class OutputList : public OutputDocInterface FORALLPROTO1(DotClassGraph &); FORALLPROTO1(DotInclDepGraph &); FORALLPROTO1(DotGfxHierarchyTable &); + FORALLPROTO1(ParamListTypes); #if defined(HAS_BOOL_TYPE) || defined(Q_HAS_BOOL_TYPE) FORALLPROTO1(bool); FORALLPROTO2(bool,int); diff --git a/src/rtfgen.h b/src/rtfgen.h index d2189a8..16d2b35 100644 --- a/src/rtfgen.h +++ b/src/rtfgen.h @@ -168,7 +168,7 @@ class RTFGenerator : public OutputGenerator void endMemberDescription(); void startDescList(); void endDescList(); - void startParamList() { startDescList(); } + void startParamList(ParamListTypes) { startDescList(); } void endParamList() { endDescList(); } void endDescTitle(); void writeDescItem(); diff --git a/src/scanner.l b/src/scanner.l index 9f60f21..52326e8 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -419,7 +419,7 @@ static int yyread(char *buf,int max_size) %} CMD ("\\"|"@") -SECTIONCMD {CMD}("image"|"author"|"internal"|"version"|"date"|"deprecated"|"param"|"exception"|"return"[s]?|"retval"|"bug"|"warning"|"par"|"sa"|"see"|"pre"|"post"|"invariant"|"note"|"remark"[s]?|"todo"|"test"|"ingroup"|"latexonly"|"htmlonly"|"{"|"verbatim") +SECTIONCMD {CMD}("image"|"author"|"internal"|"version"|"date"|"deprecated"|"param"|"exception"|"return"[s]?|"retval"|"bug"|"warning"|"par"|"sa"|"see"|"pre"|"post"|"invariant"|"note"|"remark"[s]?|"todo"|"test"|"ingroup"|"latexonly"|"htmlonly"|"{"|"verbatim") BN [ \t\n\r] BL [ \t\r]*"\n" B [ \t] @@ -468,6 +468,7 @@ TITLE [tT][iI][tT][lL][eE] %x Using %x UsingDirective %x NameSpaceDocArg1 +%x PackageDocArg1 %x SkipCurly %x SkipCurlyCpp %x SkipCurlyEndDoc @@ -1086,21 +1087,12 @@ TITLE [tT][iI][tT][lL][eE] *currentTemplateSpec+=*yytext; } <FindMembers,FindMemberName>{SCOPENAME} { - // correct for misinterpreting return type as scope name: example: A<T> func() - //printf("YY_START=%d current->tArgList=%p current->mtArgList=%p\n", - // YY_START,current->tArgList,current->mtArgList); - //if (YY_START==FindMembers /*&& current->tArgList*/ && current->mtArgList==0) - //{ - // current->mtArgList=current->tArgList; - // current->tArgList=0; - // current->scopeSpec.resize(0); - //} lineCount(); if (insideIDL && yyleng==9 && strcmp(yytext,"cpp_quote")==0) { BEGIN(CppQuote); } - else if (insideIDL && yyleng==6 && strcmp(yytext,"import")==0) + else if ((insideIDL || insideJava) && yyleng==6 && strcmp(yytext,"import")==0) { BEGIN(NextSemi); } @@ -2511,6 +2503,7 @@ TITLE [tT][iI][tT][lL][eE] <Specialization>{BN}+ { lineCount(); *specName +=' '; } <Specialization>"<<" { *specName += yytext; } <Specialization>">>" { *specName += yytext; } +<Specialization>"typename"{BN}+ { lineCount(); } <Specialization>. { *specName += *yytext; } @@ -2766,6 +2759,12 @@ TITLE [tT][iI][tT][lL][eE] current->startLine = yyLineNr; BEGIN( NameSpaceDocArg1 ); } +<Doc,JavaDoc>{B}*{CMD}"package"{B}+ { + current->section = Entry::PACKAGEDOC_SEC; + current->fileName = yyFileName; + current->startLine = yyLineNr; + BEGIN( PackageDocArg1 ); + } <Doc,JavaDoc>{B}*{CMD}"class"{B}+ { current->section = Entry::CLASSDOC_SEC; current->fileName = yyFileName; @@ -2986,6 +2985,18 @@ TITLE [tT][iI][tT][lL][eE] ); yyLineNr++; } +<PackageDocArg1>{SCOPENAME} { + current->name = yytext; + newDocState(); + } +<PackageDocArg1>"\\"{B}*"\n" { yyLineNr++; } +<PackageDocArg1>"\n" { + warn(yyFileName,yyLineNr, + "Warning: missing argument after " + "\\package." + ); + yyLineNr++; + } <ClassDocArg1>{SCOPENAME}/"<" { current->name = yytext; // prepend outer scope name diff --git a/src/util.cpp b/src/util.cpp index e766b3f..24cfa66 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -2819,7 +2819,7 @@ QCString convertNameToFile(const char *name,bool allowDots) } else { - num = (int)value; + num = *(int*)&value; } QCString result; result.sprintf("a%05d",num); @@ -3109,10 +3109,13 @@ bool extractClassNameFromType(const QCString &type,int &pos,QCString &name,QCStr /*! Substitutes any occurrence of a formal argument from argument list * \a formalArgs in \a name by the corresponding actual argument in * argument list \a actualArgs. The result after substitution - * is returned as a string. + * is returned as a string. The argument \a className is used to + * prevent recursive substitution. */ QCString substituteTemplateArgumentsInString( - const QCString &name,ArgumentList *formalArgs,ArgumentList *actualArgs) + const QCString &name, + ArgumentList *formalArgs, + ArgumentList *actualArgs) { //printf("substituteTemplateArgumentsInString(name=%s formal=%s actualArg=%s)\n", // name.data(),argListToString(formalArgs).data(),argListToString(actualArgs).data()); @@ -153,7 +153,9 @@ void addMembersToMemberGroup(MemberList *ml,MemberGroupDict *memberGroupDict, bool extractClassNameFromType(const QCString &type,int &pos, QCString &name,QCString &templSpec); QCString substituteTemplateArgumentsInString( - const QCString &name,ArgumentList *formalArgs,ArgumentList *actualArgs); + const QCString &name, + ArgumentList *formalArgs, + ArgumentList *actualArgs); ArgumentList *copyArgumentList(const ArgumentList *src); QList<ArgumentList> *copyArgumentLists(const QList<ArgumentList> *srcLists); diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 3b9d404..736ae0a 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -329,11 +329,16 @@ class XMLGenerator : public OutputDocInterface endNestedPar(); m_t << "</simplesect>"; } - void startParamList() + void startParamList(ParamListTypes t) { - m_t << "<parameterlist><title>"; // non DocBook - // TODO: what kind of list - // param, retval, exception + QCString kind; + switch(t) + { + case Param: kind="param"; break; + case RetVal: kind="retval"; break; + case Exception: kind="exception"; break; + } + m_t << "<parameterlist kind=\"" << kind << "\"><title>"; // non DocBook m_inParamList = TRUE; } void endParamList() |