Commit 31198c21 authored by Dimitri van Heesch's avatar Dimitri van Heesch

More template and context updates

parent 7cda115a
/****************************************************************************** /******************************************************************************
* *
* *
* *
* Copyright (C) 1997-2013 by Dimitri van Heesch. * Copyright (C) 1997-2013 by Dimitri van Heesch.
* *
* Permission to use, copy, modify, and distribute this software and its * Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby * documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software * granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty. * for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details. * See the GNU General Public License for more details.
* *
...@@ -57,29 +57,29 @@ class ClassDefImpl ...@@ -57,29 +57,29 @@ class ClassDefImpl
const QCString &ctStr, const char *fName); const QCString &ctStr, const char *fName);
/*! file name that forms the base for the output file containing the /*! file name that forms the base for the output file containing the
* class documentation. For compatibility with Qt (e.g. links via tag * class documentation. For compatibility with Qt (e.g. links via tag
* files) this name cannot be derived from the class name directly. * files) this name cannot be derived from the class name directly.
*/ */
QCString fileName; QCString fileName;
/*! Include information about the header file should be included /*! Include information about the header file should be included
* in the documentation. 0 by default, set by setIncludeFile(). * in the documentation. 0 by default, set by setIncludeFile().
*/ */
IncludeInfo *incInfo; IncludeInfo *incInfo;
/*! List of base class (or super-classes) from which this class derives /*! List of base class (or super-classes) from which this class derives
* directly. * directly.
*/ */
BaseClassList *inherits; BaseClassList *inherits;
/*! List of sub-classes that directly derive from this class /*! List of sub-classes that directly derive from this class
*/ */
BaseClassList *inheritedBy; BaseClassList *inheritedBy;
/*! Namespace this class is part of /*! Namespace this class is part of
* (this is the inner most namespace in case of nested namespaces) * (this is the inner most namespace in case of nested namespaces)
*/ */
NamespaceDef *nspace; NamespaceDef *nspace;
/*! File this class is defined in */ /*! File this class is defined in */
FileDef *fileDef; FileDef *fileDef;
...@@ -94,7 +94,7 @@ class ClassDefImpl ...@@ -94,7 +94,7 @@ class ClassDefImpl
ArgumentList *typeConstraints; ArgumentList *typeConstraints;
/*! Files that were used for generating the class documentation. */ /*! Files that were used for generating the class documentation. */
QStrList files; FileList files;
/*! Examples that use this class */ /*! Examples that use this class */
ExampleSDict *exampleSDict; ExampleSDict *exampleSDict;
...@@ -102,10 +102,10 @@ class ClassDefImpl ...@@ -102,10 +102,10 @@ class ClassDefImpl
/*! Holds the kind of "class" this is. */ /*! Holds the kind of "class" this is. */
ClassDef::CompoundType compType; ClassDef::CompoundType compType;
/*! The protection level in which this class was found. /*! The protection level in which this class was found.
* Typically Public, but for nested classes this can also be Protected * Typically Public, but for nested classes this can also be Protected
* or Private. * or Private.
*/ */
Protection prot; Protection prot;
/*! The inner classes contained in this class. Will be 0 if there are /*! The inner classes contained in this class. Will be 0 if there are
...@@ -120,13 +120,13 @@ class ClassDefImpl ...@@ -120,13 +120,13 @@ class ClassDefImpl
/*! Template instances that exists of this class, the key in the /*! Template instances that exists of this class, the key in the
* dictionary is the template argument list. * dictionary is the template argument list.
*/ */
QDict<ClassDef> *templateInstances; QDict<ClassDef> *templateInstances;
/*! Template instances that exists of this class, as defined by variables. /*! Template instances that exists of this class, as defined by variables.
* We do NOT want to document these individually. The key in the * We do NOT want to document these individually. The key in the
* dictionary is the template argument list. * dictionary is the template argument list.
*/ */
QDict<ClassDef> *variableInstances; QDict<ClassDef> *variableInstances;
QDict<int> *templBaseClassNames; QDict<int> *templBaseClassNames;
...@@ -162,10 +162,10 @@ class ClassDefImpl ...@@ -162,10 +162,10 @@ class ClassDefImpl
bool isTemplArg; bool isTemplArg;
/*! Does this class group its user-grouped members /*! Does this class group its user-grouped members
* as a sub-section of the normal (public/protected/..) * as a sub-section of the normal (public/protected/..)
* groups? * groups?
*/ */
bool subGrouping; bool subGrouping;
/** Reason of existence is a "use" relation */ /** Reason of existence is a "use" relation */
bool usedOnly; bool usedOnly;
...@@ -238,7 +238,7 @@ void ClassDefImpl::init(const char *defFileName, const char *name, ...@@ -238,7 +238,7 @@ void ClassDefImpl::init(const char *defFileName, const char *name,
// we cannot use getLanguage at this point, as setLanguage has not been called. // we cannot use getLanguage at this point, as setLanguage has not been called.
SrcLangExt lang = getLanguageFromFileName(defFileName); SrcLangExt lang = getLanguageFromFileName(defFileName);
if ((lang==SrcLangExt_Cpp || lang==SrcLangExt_ObjC) && if ((lang==SrcLangExt_Cpp || lang==SrcLangExt_ObjC) &&
guessSection(defFileName)==Entry::SOURCE_SEC) guessSection(defFileName)==Entry::SOURCE_SEC)
{ {
isLocal=TRUE; isLocal=TRUE;
...@@ -280,7 +280,7 @@ ClassDef::ClassDef( ...@@ -280,7 +280,7 @@ ClassDef::ClassDef(
const char *defFileName,int defLine,int defColumn, const char *defFileName,int defLine,int defColumn,
const char *nm,CompoundType ct, const char *nm,CompoundType ct,
const char *lref,const char *fName, const char *lref,const char *fName,
bool isSymbol,bool isJavaEnum) bool isSymbol,bool isJavaEnum)
: Definition(defFileName,defLine,defColumn,removeRedundantWhiteSpace(nm),0,0,isSymbol) : Definition(defFileName,defLine,defColumn,removeRedundantWhiteSpace(nm),0,0,isSymbol)
{ {
visited=FALSE; visited=FALSE;
...@@ -312,7 +312,7 @@ QCString ClassDef::displayName(bool includeScope) const ...@@ -312,7 +312,7 @@ QCString ClassDef::displayName(bool includeScope) const
{ {
n = VhdlDocGen::getClassName(this); n = VhdlDocGen::getClassName(this);
} }
else else
{ {
if (includeScope) if (includeScope)
{ {
...@@ -388,7 +388,7 @@ void ClassDef::addMembersToMemberGroup() ...@@ -388,7 +388,7 @@ void ClassDef::addMembersToMemberGroup()
MemberGroup *mg; MemberGroup *mg;
for (;(mg=mgli.current());++mgli) for (;(mg=mgli.current());++mgli)
{ {
if (mg->allMembersInSameSection() && m_impl->subGrouping) if (mg->allMembersInSameSection() && m_impl->subGrouping)
{ {
//printf("addToDeclarationSection(%s)\n",mg->header().data()); //printf("addToDeclarationSection(%s)\n",mg->header().data());
mg->addToDeclarationSection(); mg->addToDeclarationSection();
...@@ -456,14 +456,14 @@ void ClassDef::internalInsertMember(MemberDef *md, ...@@ -456,14 +456,14 @@ void ClassDef::internalInsertMember(MemberDef *md,
case MemberType_Slot: // Qt specific case MemberType_Slot: // Qt specific
switch (prot) switch (prot)
{ {
case Protected: case Protected:
case Package: // slots in packages are not possible! case Package: // slots in packages are not possible!
addMemberToList(MemberListType_proSlots,md,TRUE); addMemberToList(MemberListType_proSlots,md,TRUE);
break; break;
case Public: case Public:
addMemberToList(MemberListType_pubSlots,md,TRUE); addMemberToList(MemberListType_pubSlots,md,TRUE);
break; break;
case Private: case Private:
addMemberToList(MemberListType_priSlots,md,TRUE); addMemberToList(MemberListType_priSlots,md,TRUE);
break; break;
} }
...@@ -475,16 +475,16 @@ void ClassDef::internalInsertMember(MemberDef *md, ...@@ -475,16 +475,16 @@ void ClassDef::internalInsertMember(MemberDef *md,
{ {
switch (prot) switch (prot)
{ {
case Protected: case Protected:
addMemberToList(MemberListType_proStaticAttribs,md,TRUE); addMemberToList(MemberListType_proStaticAttribs,md,TRUE);
break; break;
case Package: case Package:
addMemberToList(MemberListType_pacStaticAttribs,md,TRUE); addMemberToList(MemberListType_pacStaticAttribs,md,TRUE);
break; break;
case Public: case Public:
addMemberToList(MemberListType_pubStaticAttribs,md,TRUE); addMemberToList(MemberListType_pubStaticAttribs,md,TRUE);
break; break;
case Private: case Private:
addMemberToList(MemberListType_priStaticAttribs,md,TRUE); addMemberToList(MemberListType_priStaticAttribs,md,TRUE);
break; break;
} }
...@@ -493,16 +493,16 @@ void ClassDef::internalInsertMember(MemberDef *md, ...@@ -493,16 +493,16 @@ void ClassDef::internalInsertMember(MemberDef *md,
{ {
switch (prot) switch (prot)
{ {
case Protected: case Protected:
addMemberToList(MemberListType_proStaticMethods,md,TRUE); addMemberToList(MemberListType_proStaticMethods,md,TRUE);
break; break;
case Package: case Package:
addMemberToList(MemberListType_pacStaticMethods,md,TRUE); addMemberToList(MemberListType_pacStaticMethods,md,TRUE);
break; break;
case Public: case Public:
addMemberToList(MemberListType_pubStaticMethods,md,TRUE); addMemberToList(MemberListType_pubStaticMethods,md,TRUE);
break; break;
case Private: case Private:
addMemberToList(MemberListType_priStaticMethods,md,TRUE); addMemberToList(MemberListType_priStaticMethods,md,TRUE);
break; break;
} }
...@@ -514,17 +514,17 @@ void ClassDef::internalInsertMember(MemberDef *md, ...@@ -514,17 +514,17 @@ void ClassDef::internalInsertMember(MemberDef *md,
{ {
switch (prot) switch (prot)
{ {
case Protected: case Protected:
addMemberToList(MemberListType_proAttribs,md,TRUE); addMemberToList(MemberListType_proAttribs,md,TRUE);
break; break;
case Package: case Package:
addMemberToList(MemberListType_pacAttribs,md,TRUE); addMemberToList(MemberListType_pacAttribs,md,TRUE);
break; break;
case Public: case Public:
addMemberToList(MemberListType_pubAttribs,md,TRUE); addMemberToList(MemberListType_pubAttribs,md,TRUE);
isSimple=!md->isFunctionPtr(); isSimple=!md->isFunctionPtr();
break; break;
case Private: case Private:
addMemberToList(MemberListType_priAttribs,md,TRUE); addMemberToList(MemberListType_priAttribs,md,TRUE);
break; break;
} }
...@@ -533,17 +533,17 @@ void ClassDef::internalInsertMember(MemberDef *md, ...@@ -533,17 +533,17 @@ void ClassDef::internalInsertMember(MemberDef *md,
{ {
switch (prot) switch (prot)
{ {
case Protected: case Protected:
addMemberToList(MemberListType_proTypes,md,TRUE); addMemberToList(MemberListType_proTypes,md,TRUE);
break; break;
case Package: case Package:
addMemberToList(MemberListType_pacTypes,md,TRUE); addMemberToList(MemberListType_pacTypes,md,TRUE);
break; break;
case Public: case Public:
addMemberToList(MemberListType_pubTypes,md,TRUE); addMemberToList(MemberListType_pubTypes,md,TRUE);
isSimple=QCString(md->typeString()).find(")(")==-1; isSimple=QCString(md->typeString()).find(")(")==-1;
break; break;
case Private: case Private:
addMemberToList(MemberListType_priTypes,md,TRUE); addMemberToList(MemberListType_priTypes,md,TRUE);
break; break;
} }
...@@ -552,22 +552,22 @@ void ClassDef::internalInsertMember(MemberDef *md, ...@@ -552,22 +552,22 @@ void ClassDef::internalInsertMember(MemberDef *md,
{ {
switch (prot) switch (prot)
{ {
case Protected: case Protected:
addMemberToList(MemberListType_proMethods,md,TRUE); addMemberToList(MemberListType_proMethods,md,TRUE);
break; break;
case Package: case Package:
addMemberToList(MemberListType_pacMethods,md,TRUE); addMemberToList(MemberListType_pacMethods,md,TRUE);
break; break;
case Public: case Public:
addMemberToList(MemberListType_pubMethods,md,TRUE); addMemberToList(MemberListType_pubMethods,md,TRUE);
break; break;
case Private: case Private:
addMemberToList(MemberListType_priMethods,md,TRUE); addMemberToList(MemberListType_priMethods,md,TRUE);
break; break;
} }
} }
} }
break; break;
} }
} }
if (!isSimple) // not a simple field -> not a simple struct if (!isSimple) // not a simple field -> not a simple struct
...@@ -641,17 +641,17 @@ void ClassDef::internalInsertMember(MemberDef *md, ...@@ -641,17 +641,17 @@ void ClassDef::internalInsertMember(MemberDef *md,
err("Unexpected member type %d found!\n",md->memberType()); err("Unexpected member type %d found!\n",md->memberType());
} }
} }
break; break;
} }
} }
/*************************************************/ /*************************************************/
/* insert member in the appropriate member group */ /* insert member in the appropriate member group */
/*************************************************/ /*************************************************/
// Note: this must be done AFTER inserting the member in the // Note: this must be done AFTER inserting the member in the
// regular groups // regular groups
//addMemberToGroup(md,groupId); //addMemberToGroup(md,groupId);
} }
if (md->virtualness()==Pure) if (md->virtualness()==Pure)
...@@ -665,10 +665,10 @@ void ClassDef::internalInsertMember(MemberDef *md, ...@@ -665,10 +665,10 @@ void ClassDef::internalInsertMember(MemberDef *md,
} }
//::addClassMemberNameToIndex(md); //::addClassMemberNameToIndex(md);
if (addToAllList && if (addToAllList &&
!(Config_getBool("HIDE_FRIEND_COMPOUNDS") && !(Config_getBool("HIDE_FRIEND_COMPOUNDS") &&
md->isFriend() && md->isFriend() &&
(QCString(md->typeString())=="friend class" || (QCString(md->typeString())=="friend class" ||
QCString(md->typeString())=="friend struct" || QCString(md->typeString())=="friend struct" ||
QCString(md->typeString())=="friend union"))) QCString(md->typeString())=="friend union")))
{ {
...@@ -764,16 +764,17 @@ void ClassDef::findSectionsInDocumentation() ...@@ -764,16 +764,17 @@ void ClassDef::findSectionsInDocumentation()
// add a file name to the used files set // add a file name to the used files set
void ClassDef::insertUsedFile(const char *f) void ClassDef::insertUsedFile(FileDef *fd)
{ {
if (m_impl->files.find(f)==-1) m_impl->files.append(f); if (fd==0) return;
if (m_impl->files.find(fd)==-1) m_impl->files.append(fd);
if (m_impl->templateInstances) if (m_impl->templateInstances)
{ {
QDictIterator<ClassDef> qdi(*m_impl->templateInstances); QDictIterator<ClassDef> qdi(*m_impl->templateInstances);
ClassDef *cd; ClassDef *cd;
for (qdi.toFirst();(cd=qdi.current());++qdi) for (qdi.toFirst();(cd=qdi.current());++qdi)
{ {
cd->insertUsedFile(f); cd->insertUsedFile(fd);
} }
} }
} }
...@@ -814,7 +815,7 @@ void ClassDef::setIncludeFile(FileDef *fd, ...@@ -814,7 +815,7 @@ void ClassDef::setIncludeFile(FileDef *fd,
m_impl->incInfo->includeName = includeName; m_impl->incInfo->includeName = includeName;
m_impl->incInfo->local = local; m_impl->incInfo->local = local;
} }
if (force && includeName) if (force && includeName)
{ {
m_impl->incInfo->includeName = includeName; m_impl->incInfo->includeName = includeName;
m_impl->incInfo->local = local; m_impl->incInfo->local = local;
...@@ -829,7 +830,7 @@ void ClassDef::setIncludeFile(FileDef *fd, ...@@ -829,7 +830,7 @@ void ClassDef::setIncludeFile(FileDef *fd,
// int pi=0; // int pi=0;
// if (m_impl->tempArgs) return m_impl->tempArgs; // if (m_impl->tempArgs) return m_impl->tempArgs;
// // find the outer most class scope // // find the outer most class scope
// while ((ti=name().find("::",pi))!=-1 && // while ((ti=name().find("::",pi))!=-1 &&
// (pcd=getClass(name().left(ti)))==0 // (pcd=getClass(name().left(ti)))==0
// ) pi=ti+2; // ) pi=ti+2;
// if (pcd) // if (pcd)
...@@ -858,7 +859,7 @@ static void searchTemplateSpecs(/*in*/ Definition *d, ...@@ -858,7 +859,7 @@ static void searchTemplateSpecs(/*in*/ Definition *d,
} }
name+=clName; name+=clName;
bool isSpecialization = d->localName().find('<')!=-1; bool isSpecialization = d->localName().find('<')!=-1;
if (cd->templateArguments()) if (cd->templateArguments())
{ {
result.append(cd->templateArguments()); result.append(cd->templateArguments());
if (!isSpecialization) if (!isSpecialization)
...@@ -881,7 +882,7 @@ static void writeTemplateSpec(OutputList &ol,Definition *d, ...@@ -881,7 +882,7 @@ static void writeTemplateSpec(OutputList &ol,Definition *d,
searchTemplateSpecs(d,specs,name); searchTemplateSpecs(d,specs,name);
if (specs.count()>0) // class has template scope specifiers if (specs.count()>0) // class has template scope specifiers
{ {
ol.startSubsubsection(); ol.startSubsubsection();
QListIterator<ArgumentList> spi(specs); QListIterator<ArgumentList> spi(specs);
ArgumentList *al; ArgumentList *al;
for (spi.toFirst();(al=spi.current());++spi) for (spi.toFirst();(al=spi.current());++spi)
...@@ -900,7 +901,7 @@ static void writeTemplateSpec(OutputList &ol,Definition *d, ...@@ -900,7 +901,7 @@ static void writeTemplateSpec(OutputList &ol,Definition *d,
{ {
ol.docify(" = "); ol.docify(" = ");
ol.docify(a->defval); ol.docify(a->defval);
} }
a=al->next(); a=al->next();
if (a) ol.docify(", "); if (a) ol.docify(", ");
} }
...@@ -916,12 +917,6 @@ static void writeTemplateSpec(OutputList &ol,Definition *d, ...@@ -916,12 +917,6 @@ static void writeTemplateSpec(OutputList &ol,Definition *d,
} }
} }
bool ClassDef::hasBriefDescription() const
{
static bool briefMemberDesc = Config_getBool("BRIEF_MEMBER_DESC");
return !briefDescription().isEmpty() && briefMemberDesc;
}
void ClassDef::writeBriefDescription(OutputList &ol,bool exampleFlag) void ClassDef::writeBriefDescription(OutputList &ol,bool exampleFlag)
{ {
if (hasBriefDescription()) if (hasBriefDescription())
...@@ -997,13 +992,13 @@ bool ClassDef::hasDetailedDescription() const ...@@ -997,13 +992,13 @@ bool ClassDef::hasDetailedDescription() const
{ {
static bool repeatBrief = Config_getBool("REPEAT_BRIEF"); static bool repeatBrief = Config_getBool("REPEAT_BRIEF");
static bool sourceBrowser = Config_getBool("SOURCE_BROWSER"); static bool sourceBrowser = Config_getBool("SOURCE_BROWSER");
return ((!briefDescription().isEmpty() && repeatBrief) || return ((!briefDescription().isEmpty() && repeatBrief) ||
!documentation().isEmpty() || !documentation().isEmpty() ||
(sourceBrowser && getStartBodyLine()!=-1 && getBodyDef())); (sourceBrowser && getStartBodyLine()!=-1 && getBodyDef()));
} }
// write the detailed description for this class // write the detailed description for this class
void ClassDef::writeDetailedDescription(OutputList &ol, const QCString &/*pageType*/, bool exampleFlag, void ClassDef::writeDetailedDescription(OutputList &ol, const QCString &/*pageType*/, bool exampleFlag,
const QCString &title,const QCString &anchor) const QCString &title,const QCString &anchor)
{ {
if (hasDetailedDescription() || exampleFlag) if (hasDetailedDescription() || exampleFlag)
...@@ -1038,111 +1033,113 @@ void ClassDef::writeDetailedDescription(OutputList &ol, const QCString &/*pageTy ...@@ -1038,111 +1033,113 @@ void ClassDef::writeDetailedDescription(OutputList &ol, const QCString &/*pageTy
//writeTemplateSpec(ol,this,pageType); //writeTemplateSpec(ol,this,pageType);
} }
} }
void ClassDef::showUsedFiles(OutputList &ol)
{
ol.pushGeneratorState();
ol.disable(OutputGenerator::Man);
QCString ClassDef::generatedFromFiles() const
{
QCString result;
SrcLangExt lang = getLanguage(); SrcLangExt lang = getLanguage();
ol.writeRuler();
if (lang==SrcLangExt_Fortran) if (lang==SrcLangExt_Fortran)
{ {
ol.parseText(theTranslator->trGeneratedFromFilesFortran( result = theTranslator->trGeneratedFromFilesFortran(
getLanguage()==SrcLangExt_ObjC && m_impl->compType==Interface ? Class : m_impl->compType, getLanguage()==SrcLangExt_ObjC && m_impl->compType==Interface ? Class : m_impl->compType,
m_impl->files.count()==1)); m_impl->files.count()==1);
} }
else if (isJavaEnum()) else if (isJavaEnum())
{ {
ol.parseText(theTranslator->trEnumGeneratedFromFiles(m_impl->files.count()==1)); result = theTranslator->trEnumGeneratedFromFiles(m_impl->files.count()==1);
} }
else if (m_impl->compType==Service) else if (m_impl->compType==Service)
{ {
ol.parseText(theTranslator->trServiceGeneratedFromFiles(m_impl->files.count()==1)); result = theTranslator->trServiceGeneratedFromFiles(m_impl->files.count()==1);
} }
else if (m_impl->compType==Singleton) else if (m_impl->compType==Singleton)
{ {
ol.parseText(theTranslator->trSingletonGeneratedFromFiles(m_impl->files.count()==1)); result = theTranslator->trSingletonGeneratedFromFiles(m_impl->files.count()==1);
} }
else else
{ {
ol.parseText(theTranslator->trGeneratedFromFiles( result = theTranslator->trGeneratedFromFiles(
getLanguage()==SrcLangExt_ObjC && m_impl->compType==Interface ? Class : m_impl->compType, getLanguage()==SrcLangExt_ObjC && m_impl->compType==Interface ? Class : m_impl->compType,
m_impl->files.count()==1)); m_impl->files.count()==1);
} }
return result;
}
void ClassDef::showUsedFiles(OutputList &ol)
{
ol.pushGeneratorState();
ol.disable(OutputGenerator::Man);
ol.writeRuler();
ol.parseText(generatedFromFiles());
bool first=TRUE; bool first=TRUE;
const char *file = m_impl->files.first(); FileDef *fd = m_impl->files.first();
while (file) while (fd)
{ {
bool ambig; if (first)
FileDef *fd=findFileDef(Doxygen::inputNameDict,file,ambig);
if (fd)
{ {
if (first) first=FALSE;
{ ol.startItemList();
first=FALSE; }
ol.startItemList();
}
ol.startItemListItem();
QCString path=fd->getPath();
if (Config_getBool("FULL_PATH_NAMES"))
{
ol.docify(stripFromPath(path));
}
QCString fname = fd->name(); ol.startItemListItem();
if (!fd->getVersion().isEmpty()) // append version if available QCString path=fd->getPath();
{ if (Config_getBool("FULL_PATH_NAMES"))
fname += " (" + fd->getVersion() + ")"; {
} ol.docify(stripFromPath(path));
}
// for HTML QCString fname = fd->name();
ol.pushGeneratorState(); if (!fd->getVersion().isEmpty()) // append version if available
ol.disableAllBut(OutputGenerator::Html); {
if (fd->generateSourceFile()) fname += " (" + fd->getVersion() + ")";
{ }
ol.writeObjectLink(0,fd->getSourceFileBase(),0,fname);
}
else if (fd->isLinkable())
{
ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,
fname);
}
else
{
ol.docify(fname);
}
ol.popGeneratorState();
// for other output formats // for HTML
ol.pushGeneratorState(); ol.pushGeneratorState();
ol.disable(OutputGenerator::Html); ol.disableAllBut(OutputGenerator::Html);
if (fd->isLinkable()) if (fd->generateSourceFile())
{ {
ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0, ol.writeObjectLink(0,fd->getSourceFileBase(),0,fname);
fname); }
} else if (fd->isLinkable())
else {
{ ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,
ol.docify(fname); fname);
} }
ol.popGeneratorState(); else
{
ol.docify(fname);
}
ol.popGeneratorState();
ol.endItemListItem(); // for other output formats
ol.pushGeneratorState();
ol.disable(OutputGenerator::Html);
if (fd->isLinkable())
{
ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,
fname);
} }
file=m_impl->files.next(); else
{
ol.docify(fname);
}
ol.popGeneratorState();
ol.endItemListItem();
fd=m_impl->files.next();
} }
if (!first) ol.endItemList(); if (!first) ol.endItemList();
ol.popGeneratorState(); ol.popGeneratorState();
} }
int ClassDef::countInheritanceNodes()
void ClassDef::writeInheritanceGraph(OutputList &ol)
{ {
// count direct inheritance relations
int count=0; int count=0;
BaseClassDef *ibcd; BaseClassDef *ibcd;
if (m_impl->inheritedBy) if (m_impl->inheritedBy)
...@@ -1165,10 +1162,16 @@ void ClassDef::writeInheritanceGraph(OutputList &ol) ...@@ -1165,10 +1162,16 @@ void ClassDef::writeInheritanceGraph(OutputList &ol)
ibcd=m_impl->inherits->next(); ibcd=m_impl->inherits->next();
} }
} }
return count;
}
void ClassDef::writeInheritanceGraph(OutputList &ol)
{
// count direct inheritance relations
int count=countInheritanceNodes();
bool renderDiagram = FALSE; bool renderDiagram = FALSE;
if (Config_getBool("HAVE_DOT") && if (Config_getBool("HAVE_DOT") &&
(Config_getBool("CLASS_DIAGRAMS") || Config_getBool("CLASS_GRAPH"))) (Config_getBool("CLASS_DIAGRAMS") || Config_getBool("CLASS_GRAPH")))
// write class diagram using dot // write class diagram using dot
{ {
...@@ -1184,7 +1187,7 @@ void ClassDef::writeInheritanceGraph(OutputList &ol) ...@@ -1184,7 +1187,7 @@ void ClassDef::writeInheritanceGraph(OutputList &ol)
renderDiagram = TRUE; renderDiagram = TRUE;
} }
} }
else if (Config_getBool("CLASS_DIAGRAMS") && count>0) else if (Config_getBool("CLASS_DIAGRAMS") && count>0)
// write class diagram using build-in generator // write class diagram using build-in generator
{ {
ClassDiagram diagram(this); // create a diagram of this class. ClassDiagram diagram(this); // create a diagram of this class.
...@@ -1194,7 +1197,7 @@ void ClassDef::writeInheritanceGraph(OutputList &ol) ...@@ -1194,7 +1197,7 @@ void ClassDef::writeInheritanceGraph(OutputList &ol)
ol.enable(OutputGenerator::Man); ol.enable(OutputGenerator::Man);
ol.endClassDiagram(diagram,getOutputFileBase(),displayName()); ol.endClassDiagram(diagram,getOutputFileBase(),displayName());
renderDiagram = TRUE; renderDiagram = TRUE;
} }
if (renderDiagram) // if we already show the inheritance relations graphically, if (renderDiagram) // if we already show the inheritance relations graphically,
// then hide the text version // then hide the text version
...@@ -1228,7 +1231,7 @@ void ClassDef::writeInheritanceGraph(OutputList &ol) ...@@ -1228,7 +1231,7 @@ void ClassDef::writeInheritanceGraph(OutputList &ol)
if (cd->isLinkable()) if (cd->isLinkable())
{ {
if (!Config_getString("GENERATE_TAGFILE").isEmpty()) if (!Config_getString("GENERATE_TAGFILE").isEmpty())
{ {
Doxygen::tagFile << " <base"; Doxygen::tagFile << " <base";
if (bcd->prot==Protected) if (bcd->prot==Protected)
...@@ -1243,7 +1246,7 @@ void ClassDef::writeInheritanceGraph(OutputList &ol) ...@@ -1243,7 +1246,7 @@ void ClassDef::writeInheritanceGraph(OutputList &ol)
{ {
Doxygen::tagFile << " virtualness=\"virtual\""; Doxygen::tagFile << " virtualness=\"virtual\"";
} }
Doxygen::tagFile << ">" << convertToXML(cd->name()) Doxygen::tagFile << ">" << convertToXML(cd->name())
<< "</base>" << endl; << "</base>" << endl;
} }
ol.writeObjectLink(cd->getReference(), ol.writeObjectLink(cd->getReference(),
...@@ -1261,7 +1264,7 @@ void ClassDef::writeInheritanceGraph(OutputList &ol) ...@@ -1261,7 +1264,7 @@ void ClassDef::writeInheritanceGraph(OutputList &ol)
err("invalid marker %d in inherits list!\n",entryIndex); err("invalid marker %d in inherits list!\n",entryIndex);
} }
index=newIndex+matchLen; index=newIndex+matchLen;
} }
ol.parseText(inheritLine.right(inheritLine.length()-index)); ol.parseText(inheritLine.right(inheritLine.length()-index));
ol.endParagraph(); ol.endParagraph();
} }
...@@ -1294,12 +1297,12 @@ void ClassDef::writeInheritanceGraph(OutputList &ol) ...@@ -1294,12 +1297,12 @@ void ClassDef::writeInheritanceGraph(OutputList &ol)
writeInheritanceSpecifier(ol,bcd); writeInheritanceSpecifier(ol,bcd);
} }
index=newIndex+matchLen; index=newIndex+matchLen;
} }
ol.parseText(inheritLine.right(inheritLine.length()-index)); ol.parseText(inheritLine.right(inheritLine.length()-index));
ol.endParagraph(); ol.endParagraph();
} }
if (renderDiagram) if (renderDiagram)
{ {
ol.enableAll(); ol.enableAll();
} }
...@@ -1322,33 +1325,40 @@ void ClassDef::writeCollaborationGraph(OutputList &ol) ...@@ -1322,33 +1325,40 @@ void ClassDef::writeCollaborationGraph(OutputList &ol)
} }
} }
QCString ClassDef::includeStatement() const
{
SrcLangExt lang = getLanguage();
bool isIDLorJava = lang==SrcLangExt_IDL || lang==SrcLangExt_Java;
if (isIDLorJava)
{
return "import";
}
else if (isObjectiveC())
{
return "#import ";
}
else
{
return "#include ";
}
}
void ClassDef::writeIncludeFiles(OutputList &ol) void ClassDef::writeIncludeFiles(OutputList &ol)
{ {
if (m_impl->incInfo /*&& Config_getBool("SHOW_INCLUDE_FILES")*/) if (m_impl->incInfo /*&& Config_getBool("SHOW_INCLUDE_FILES")*/)
{ {
QCString nm=m_impl->incInfo->includeName.isEmpty() ? QCString nm=m_impl->incInfo->includeName.isEmpty() ?
(m_impl->incInfo->fileDef ? (m_impl->incInfo->fileDef ?
m_impl->incInfo->fileDef->docName().data() : "" m_impl->incInfo->fileDef->docName().data() : ""
) : ) :
m_impl->incInfo->includeName.data(); m_impl->incInfo->includeName.data();
if (!nm.isEmpty()) if (!nm.isEmpty())
{ {
ol.startParagraph(); ol.startParagraph();
ol.startTypewriter(); ol.startTypewriter();
ol.docify(includeStatement());
SrcLangExt lang = getLanguage(); SrcLangExt lang = getLanguage();
bool isIDLorJava = lang==SrcLangExt_IDL || lang==SrcLangExt_Java; bool isIDLorJava = lang==SrcLangExt_IDL || lang==SrcLangExt_Java;
if (isIDLorJava)
{
ol.docify("import ");
}
else if (isObjectiveC())
{
ol.docify("#import ");
}
else
{
ol.docify("#include ");
}
if (m_impl->incInfo->local || isIDLorJava) if (m_impl->incInfo->local || isIDLorJava)
ol.docify("\""); ol.docify("\"");
else else
...@@ -1371,7 +1381,7 @@ void ClassDef::writeIncludeFiles(OutputList &ol) ...@@ -1371,7 +1381,7 @@ void ClassDef::writeIncludeFiles(OutputList &ol)
ol.docify("\""); ol.docify("\"");
else else
ol.docify(">"); ol.docify(">");
if (isIDLorJava) if (isIDLorJava)
ol.docify(";"); ol.docify(";");
ol.endTypewriter(); ol.endTypewriter();
ol.endParagraph(); ol.endParagraph();
...@@ -1426,7 +1436,7 @@ void ClassDef::writeMemberGroups(OutputList &ol,bool showInline) ...@@ -1426,7 +1436,7 @@ void ClassDef::writeMemberGroups(OutputList &ol,bool showInline)
void ClassDef::writeNestedClasses(OutputList &ol,const QCString &title) void ClassDef::writeNestedClasses(OutputList &ol,const QCString &title)
{ {
// nested classes // nested classes
if (m_impl->innerClasses) if (m_impl->innerClasses)
{ {
m_impl->innerClasses->writeDeclaration(ol,0,title,TRUE); m_impl->innerClasses->writeDeclaration(ol,0,title,TRUE);
} }
...@@ -1434,7 +1444,7 @@ void ClassDef::writeNestedClasses(OutputList &ol,const QCString &title) ...@@ -1434,7 +1444,7 @@ void ClassDef::writeNestedClasses(OutputList &ol,const QCString &title)
void ClassDef::writeInlineClasses(OutputList &ol) void ClassDef::writeInlineClasses(OutputList &ol)
{ {
if (m_impl->innerClasses) if (m_impl->innerClasses)
{ {
m_impl->innerClasses->writeDocumentation(ol,this); m_impl->innerClasses->writeDocumentation(ol,this);
} }
...@@ -1502,12 +1512,12 @@ void ClassDef::writeSummaryLinks(OutputList &ol) ...@@ -1502,12 +1512,12 @@ void ClassDef::writeSummaryLinks(OutputList &ol)
LayoutDocEntry *lde; LayoutDocEntry *lde;
bool first=TRUE; bool first=TRUE;
SrcLangExt lang = getLanguage(); SrcLangExt lang = getLanguage();
if (lang!=SrcLangExt_VHDL) if (lang!=SrcLangExt_VHDL)
{ {
for (eli.toFirst();(lde=eli.current());++eli) for (eli.toFirst();(lde=eli.current());++eli)
{ {
if (lde->kind()==LayoutDocEntry::ClassNestedClasses && if (lde->kind()==LayoutDocEntry::ClassNestedClasses &&
m_impl->innerClasses && m_impl->innerClasses &&
m_impl->innerClasses->declVisible() m_impl->innerClasses->declVisible()
) )
...@@ -1555,7 +1565,7 @@ void ClassDef::writeSummaryLinks(OutputList &ol) ...@@ -1555,7 +1565,7 @@ void ClassDef::writeSummaryLinks(OutputList &ol)
void ClassDef::writeTagFileMarker() void ClassDef::writeTagFileMarker()
{ {
// write section to the tag file // write section to the tag file
if (!Config_getString("GENERATE_TAGFILE").isEmpty()) if (!Config_getString("GENERATE_TAGFILE").isEmpty())
{ {
Doxygen::tagFile << " <compound kind=\"" << compoundTypeString(); Doxygen::tagFile << " <compound kind=\"" << compoundTypeString();
Doxygen::tagFile << "\""; Doxygen::tagFile << "\"";
...@@ -1596,7 +1606,7 @@ void ClassDef::writeInlineDocumentation(OutputList &ol) ...@@ -1596,7 +1606,7 @@ void ClassDef::writeInlineDocumentation(OutputList &ol)
LayoutDocEntry *lde; LayoutDocEntry *lde;
// part 1: anchor and title // part 1: anchor and title
QCString s = compoundTypeString()+" "+name(); QCString s = compoundTypeString()+" "+name();
// part 1a // part 1a
ol.pushGeneratorState(); ol.pushGeneratorState();
...@@ -1640,7 +1650,7 @@ void ClassDef::writeInlineDocumentation(OutputList &ol) ...@@ -1640,7 +1650,7 @@ void ClassDef::writeInlineDocumentation(OutputList &ol)
{ {
switch (lde->kind()) switch (lde->kind())
{ {
case LayoutDocEntry::BriefDesc: case LayoutDocEntry::BriefDesc:
{ {
// since we already shown the brief description in the // since we already shown the brief description in the
// declaration part of the container, so we use this to // declaration part of the container, so we use this to
...@@ -1648,15 +1658,15 @@ void ClassDef::writeInlineDocumentation(OutputList &ol) ...@@ -1648,15 +1658,15 @@ void ClassDef::writeInlineDocumentation(OutputList &ol)
writeDetailedDocumentationBody(ol); writeDetailedDocumentationBody(ol);
} }
break; break;
case LayoutDocEntry::ClassInheritanceGraph: case LayoutDocEntry::ClassInheritanceGraph:
writeInheritanceGraph(ol); writeInheritanceGraph(ol);
break; break;
case LayoutDocEntry::ClassCollaborationGraph: case LayoutDocEntry::ClassCollaborationGraph:
writeCollaborationGraph(ol); writeCollaborationGraph(ol);
break; break;
case LayoutDocEntry::MemberDeclStart: case LayoutDocEntry::MemberDeclStart:
if (!isSimple) startMemberDeclarations(ol); if (!isSimple) startMemberDeclarations(ol);
break; break;
case LayoutDocEntry::MemberDecl: case LayoutDocEntry::MemberDecl:
{ {
LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
...@@ -1666,13 +1676,13 @@ void ClassDef::writeInlineDocumentation(OutputList &ol) ...@@ -1666,13 +1676,13 @@ void ClassDef::writeInlineDocumentation(OutputList &ol)
case LayoutDocEntry::MemberGroups: case LayoutDocEntry::MemberGroups:
if (!isSimple) writeMemberGroups(ol,TRUE); if (!isSimple) writeMemberGroups(ol,TRUE);
break; break;
case LayoutDocEntry::MemberDeclEnd: case LayoutDocEntry::MemberDeclEnd:
if (!isSimple) endMemberDeclarations(ol); if (!isSimple) endMemberDeclarations(ol);
break; break;
case LayoutDocEntry::MemberDefStart: case LayoutDocEntry::MemberDefStart:
if (!isSimple) startMemberDocumentation(ol); if (!isSimple) startMemberDocumentation(ol);
break; break;
case LayoutDocEntry::MemberDef: case LayoutDocEntry::MemberDef:
{ {
LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde; LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde;
if (isSimple) if (isSimple)
...@@ -1684,8 +1694,8 @@ void ClassDef::writeInlineDocumentation(OutputList &ol) ...@@ -1684,8 +1694,8 @@ void ClassDef::writeInlineDocumentation(OutputList &ol)
writeMemberDocumentation(ol,lmd->type,lmd->title(lang),TRUE); writeMemberDocumentation(ol,lmd->type,lmd->title(lang),TRUE);
} }
} }
break; break;
case LayoutDocEntry::MemberDefEnd: case LayoutDocEntry::MemberDefEnd:
if (!isSimple) endMemberDocumentation(ol); if (!isSimple) endMemberDocumentation(ol);
break; break;
default: default:
...@@ -1757,8 +1767,8 @@ void ClassDef::writeDeclarationLink(OutputList &ol,bool &found,const char *heade ...@@ -1757,8 +1767,8 @@ void ClassDef::writeDeclarationLink(OutputList &ol,bool &found,const char *heade
static bool extractLocalClasses = Config_getBool("EXTRACT_LOCAL_CLASSES"); static bool extractLocalClasses = Config_getBool("EXTRACT_LOCAL_CLASSES");
bool isLink = isLinkable(); bool isLink = isLinkable();
SrcLangExt lang = getLanguage(); SrcLangExt lang = getLanguage();
if (isLink || if (isLink ||
(!hideUndocClasses && (!hideUndocClasses &&
(!isLocal() || extractLocalClasses) (!isLocal() || extractLocalClasses)
) )
) )
...@@ -1776,7 +1786,7 @@ void ClassDef::writeDeclarationLink(OutputList &ol,bool &found,const char *heade ...@@ -1776,7 +1786,7 @@ void ClassDef::writeDeclarationLink(OutputList &ol,bool &found,const char *heade
} }
else else
{ {
ol.parseText(lang==SrcLangExt_Fortran ? ol.parseText(lang==SrcLangExt_Fortran ?
theTranslator->trDataTypes() : theTranslator->trDataTypes() :
theTranslator->trCompounds()); theTranslator->trCompounds());
} }
...@@ -1787,7 +1797,7 @@ void ClassDef::writeDeclarationLink(OutputList &ol,bool &found,const char *heade ...@@ -1787,7 +1797,7 @@ void ClassDef::writeDeclarationLink(OutputList &ol,bool &found,const char *heade
if (!Config_getString("GENERATE_TAGFILE").isEmpty() && if (!Config_getString("GENERATE_TAGFILE").isEmpty() &&
!isReference()) // skip classes found in tag files !isReference()) // skip classes found in tag files
{ {
Doxygen::tagFile << " <class kind=\"" << compoundTypeString() Doxygen::tagFile << " <class kind=\"" << compoundTypeString()
<< "\">" << convertToXML(name()) << "</class>" << endl; << "\">" << convertToXML(name()) << "</class>" << endl;
} }
ol.startMemberDeclaration(); ol.startMemberDeclaration();
...@@ -1801,7 +1811,7 @@ void ClassDef::writeDeclarationLink(OutputList &ol,bool &found,const char *heade ...@@ -1801,7 +1811,7 @@ void ClassDef::writeDeclarationLink(OutputList &ol,bool &found,const char *heade
ol.writeString(" "); ol.writeString(" ");
ol.insertMemberAlign(); ol.insertMemberAlign();
} }
if (isLink) if (isLink)
{ {
ol.writeObjectLink(getReference(), ol.writeObjectLink(getReference(),
getOutputFileBase(), getOutputFileBase(),
...@@ -1809,7 +1819,7 @@ void ClassDef::writeDeclarationLink(OutputList &ol,bool &found,const char *heade ...@@ -1809,7 +1819,7 @@ void ClassDef::writeDeclarationLink(OutputList &ol,bool &found,const char *heade
cname cname
); );
} }
else else
{ {
ol.startBold(); ol.startBold();
ol.docify(cname); ol.docify(cname);
...@@ -1899,67 +1909,67 @@ void ClassDef::writeDocumentationContents(OutputList &ol,const QCString & /*page ...@@ -1899,67 +1909,67 @@ void ClassDef::writeDocumentationContents(OutputList &ol,const QCString & /*page
{ {
switch (lde->kind()) switch (lde->kind())
{ {
case LayoutDocEntry::BriefDesc: case LayoutDocEntry::BriefDesc:
writeBriefDescription(ol,exampleFlag); writeBriefDescription(ol,exampleFlag);
break; break;
case LayoutDocEntry::ClassIncludes: case LayoutDocEntry::ClassIncludes:
writeIncludeFiles(ol); writeIncludeFiles(ol);
break; break;
case LayoutDocEntry::ClassInheritanceGraph: case LayoutDocEntry::ClassInheritanceGraph:
writeInheritanceGraph(ol); writeInheritanceGraph(ol);
break; break;
case LayoutDocEntry::ClassCollaborationGraph: case LayoutDocEntry::ClassCollaborationGraph:
writeCollaborationGraph(ol); writeCollaborationGraph(ol);
break; break;
case LayoutDocEntry::ClassAllMembersLink: case LayoutDocEntry::ClassAllMembersLink:
//writeAllMembersLink(ol); // this is now part of the summary links //writeAllMembersLink(ol); // this is now part of the summary links
break; break;
case LayoutDocEntry::MemberDeclStart: case LayoutDocEntry::MemberDeclStart:
startMemberDeclarations(ol); startMemberDeclarations(ol);
break; break;
case LayoutDocEntry::MemberGroups: case LayoutDocEntry::MemberGroups:
writeMemberGroups(ol); writeMemberGroups(ol);
break; break;
case LayoutDocEntry::MemberDecl: case LayoutDocEntry::MemberDecl:
{ {
LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
writeMemberDeclarations(ol,lmd->type,lmd->title(lang),lmd->subtitle(lang)); writeMemberDeclarations(ol,lmd->type,lmd->title(lang),lmd->subtitle(lang));
} }
break; break;
case LayoutDocEntry::ClassNestedClasses: case LayoutDocEntry::ClassNestedClasses:
{ {
LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
writeNestedClasses(ol,ls->title(lang)); writeNestedClasses(ol,ls->title(lang));
} }
break; break;
case LayoutDocEntry::MemberDeclEnd: case LayoutDocEntry::MemberDeclEnd:
endMemberDeclarations(ol); endMemberDeclarations(ol);
break; break;
case LayoutDocEntry::DetailedDesc: case LayoutDocEntry::DetailedDesc:
{ {
LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
writeDetailedDescription(ol,pageType,exampleFlag,ls->title(lang)); writeDetailedDescription(ol,pageType,exampleFlag,ls->title(lang));
} }
break; break;
case LayoutDocEntry::MemberDefStart: case LayoutDocEntry::MemberDefStart:
startMemberDocumentation(ol); startMemberDocumentation(ol);
break; break;
case LayoutDocEntry::ClassInlineClasses: case LayoutDocEntry::ClassInlineClasses:
writeInlineClasses(ol); writeInlineClasses(ol);
break; break;
case LayoutDocEntry::MemberDef: case LayoutDocEntry::MemberDef:
{ {
LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde; LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde;
writeMemberDocumentation(ol,lmd->type,lmd->title(lang)); writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
} }
break; break;
case LayoutDocEntry::MemberDefEnd: case LayoutDocEntry::MemberDefEnd:
endMemberDocumentation(ol); endMemberDocumentation(ol);
break; break;
case LayoutDocEntry::ClassUsedFiles: case LayoutDocEntry::ClassUsedFiles:
showUsedFiles(ol); showUsedFiles(ol);
break; break;
case LayoutDocEntry::AuthorSection: case LayoutDocEntry::AuthorSection:
writeAuthorSection(ol); writeAuthorSection(ol);
break; break;
case LayoutDocEntry::NamespaceNestedNamespaces: case LayoutDocEntry::NamespaceNestedNamespaces:
...@@ -1971,16 +1981,16 @@ void ClassDef::writeDocumentationContents(OutputList &ol,const QCString & /*page ...@@ -1971,16 +1981,16 @@ void ClassDef::writeDocumentationContents(OutputList &ol,const QCString & /*page
case LayoutDocEntry::FileConstantGroups: case LayoutDocEntry::FileConstantGroups:
case LayoutDocEntry::FileIncludes: case LayoutDocEntry::FileIncludes:
case LayoutDocEntry::FileIncludeGraph: case LayoutDocEntry::FileIncludeGraph:
case LayoutDocEntry::FileIncludedByGraph: case LayoutDocEntry::FileIncludedByGraph:
case LayoutDocEntry::FileSourceLink: case LayoutDocEntry::FileSourceLink:
case LayoutDocEntry::FileInlineClasses: case LayoutDocEntry::FileInlineClasses:
case LayoutDocEntry::GroupClasses: case LayoutDocEntry::GroupClasses:
case LayoutDocEntry::GroupInlineClasses: case LayoutDocEntry::GroupInlineClasses:
case LayoutDocEntry::GroupNamespaces: case LayoutDocEntry::GroupNamespaces:
case LayoutDocEntry::GroupDirs: case LayoutDocEntry::GroupDirs:
case LayoutDocEntry::GroupNestedGroups: case LayoutDocEntry::GroupNestedGroups:
case LayoutDocEntry::GroupFiles: case LayoutDocEntry::GroupFiles:
case LayoutDocEntry::GroupGraph: case LayoutDocEntry::GroupGraph:
case LayoutDocEntry::GroupPageDocs: case LayoutDocEntry::GroupPageDocs:
case LayoutDocEntry::DirSubDirs: case LayoutDocEntry::DirSubDirs:
case LayoutDocEntry::DirFiles: case LayoutDocEntry::DirFiles:
...@@ -1991,7 +2001,7 @@ void ClassDef::writeDocumentationContents(OutputList &ol,const QCString & /*page ...@@ -1991,7 +2001,7 @@ void ClassDef::writeDocumentationContents(OutputList &ol,const QCString & /*page
} }
} }
if (!Config_getString("GENERATE_TAGFILE").isEmpty()) if (!Config_getString("GENERATE_TAGFILE").isEmpty())
{ {
writeDocAnchorsToTagFile(); writeDocAnchorsToTagFile();
Doxygen::tagFile << " </compound>" << endl; Doxygen::tagFile << " </compound>" << endl;
...@@ -2003,12 +2013,12 @@ QCString ClassDef::title() const ...@@ -2003,12 +2013,12 @@ QCString ClassDef::title() const
{ {
QCString pageTitle; QCString pageTitle;
SrcLangExt lang = getLanguage(); SrcLangExt lang = getLanguage();
if (lang==SrcLangExt_Fortran) if (lang==SrcLangExt_Fortran)
{ {
pageTitle = theTranslator->trCompoundReferenceFortran(displayName(), pageTitle = theTranslator->trCompoundReferenceFortran(displayName(),
m_impl->compType, m_impl->compType,
m_impl->tempArgs != 0); m_impl->tempArgs != 0);
} }
else if (lang==SrcLangExt_VHDL) else if (lang==SrcLangExt_VHDL)
{ {
...@@ -2042,8 +2052,8 @@ void ClassDef::writeDocumentation(OutputList &ol) ...@@ -2042,8 +2052,8 @@ void ClassDef::writeDocumentation(OutputList &ol)
//static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); //static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
//static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); //static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL");
QCString pageTitle = title(); QCString pageTitle = title();
startFile(ol,getOutputFileBase(),name(),pageTitle,HLI_ClassVisible,!generateTreeView); startFile(ol,getOutputFileBase(),name(),pageTitle,HLI_ClassVisible,!generateTreeView);
if (!generateTreeView) if (!generateTreeView)
{ {
if (getOuterScope()!=Doxygen::globalScope) if (getOuterScope()!=Doxygen::globalScope)
...@@ -2059,7 +2069,7 @@ void ClassDef::writeDocumentation(OutputList &ol) ...@@ -2059,7 +2069,7 @@ void ClassDef::writeDocumentation(OutputList &ol)
addGroupListToTitle(ol,this); addGroupListToTitle(ol,this);
endTitle(ol,getOutputFileBase(),displayName()); endTitle(ol,getOutputFileBase(),displayName());
writeDocumentationContents(ol,pageTitle); writeDocumentationContents(ol,pageTitle);
endFileWithNavPath(this,ol); endFileWithNavPath(this,ol);
if (Config_getBool("SEPARATE_MEMBER_PAGES")) if (Config_getBool("SEPARATE_MEMBER_PAGES"))
...@@ -2076,7 +2086,7 @@ void ClassDef::writeMemberPages(OutputList &ol) ...@@ -2076,7 +2086,7 @@ void ClassDef::writeMemberPages(OutputList &ol)
ol.pushGeneratorState(); ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html); ol.disableAllBut(OutputGenerator::Html);
QListIterator<MemberList> mli(m_impl->memberLists); QListIterator<MemberList> mli(m_impl->memberLists);
MemberList *ml; MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli) for (mli.toFirst();(ml=mli.current());++mli)
...@@ -2177,7 +2187,7 @@ void ClassDef::writeMemberList(OutputList &ol) ...@@ -2177,7 +2187,7 @@ void ClassDef::writeMemberList(OutputList &ol)
QCString memListFile = getMemberListFileName(); QCString memListFile = getMemberListFileName();
startFile(ol,memListFile,memListFile,theTranslator->trMemberList(), startFile(ol,memListFile,memListFile,theTranslator->trMemberList(),
HLI_ClassVisible,!generateTreeView,getOutputFileBase()); HLI_ClassVisible,!generateTreeView,getOutputFileBase());
if (!generateTreeView) if (!generateTreeView)
{ {
if (getOuterScope()!=Doxygen::globalScope) if (getOuterScope()!=Doxygen::globalScope)
...@@ -2195,13 +2205,13 @@ void ClassDef::writeMemberList(OutputList &ol) ...@@ -2195,13 +2205,13 @@ void ClassDef::writeMemberList(OutputList &ol)
ol.writeObjectLink(getReference(),getOutputFileBase(),anchor(),displayName()); ol.writeObjectLink(getReference(),getOutputFileBase(),anchor(),displayName());
ol.parseText(theTranslator->trIncludingInheritedMembers()); ol.parseText(theTranslator->trIncludingInheritedMembers());
ol.endParagraph(); ol.endParagraph();
//ol.startItemList(); //ol.startItemList();
ol.writeString("<table class=\"directory\">\n"); ol.writeString("<table class=\"directory\">\n");
int idx=0; int idx=0;
//MemberNameInfo *mni=m_impl->allMemberNameInfoList->first(); //MemberNameInfo *mni=m_impl->allMemberNameInfoList->first();
MemberNameInfoSDict::Iterator mnii(*m_impl->allMemberNameInfoSDict); MemberNameInfoSDict::Iterator mnii(*m_impl->allMemberNameInfoSDict);
MemberNameInfo *mni; MemberNameInfo *mni;
for (mnii.toFirst();(mni=mnii.current());++mnii) for (mnii.toFirst();(mni=mnii.current());++mnii)
{ {
...@@ -2212,14 +2222,14 @@ void ClassDef::writeMemberList(OutputList &ol) ...@@ -2212,14 +2222,14 @@ void ClassDef::writeMemberList(OutputList &ol)
ClassDef *cd=md->getClassDef(); ClassDef *cd=md->getClassDef();
Protection prot = mi->prot; Protection prot = mi->prot;
Specifier virt=md->virtualness(); Specifier virt=md->virtualness();
//printf("%s: Member %s of class %s md->protection()=%d mi->prot=%d prot=%d inherited=%d\n", //printf("%s: Member %s of class %s md->protection()=%d mi->prot=%d prot=%d inherited=%d\n",
// name().data(),md->name().data(),cd->name().data(),md->protection(),mi->prot,prot,mi->inherited); // name().data(),md->name().data(),cd->name().data(),md->protection(),mi->prot,prot,mi->inherited);
if (cd && !md->name().isEmpty() && md->name()[0]!='@') if (cd && !md->name().isEmpty() && md->name()[0]!='@')
{ {
bool memberWritten=FALSE; bool memberWritten=FALSE;
if (cd->isLinkable() && md->isLinkable()) if (cd->isLinkable() && md->isLinkable())
// create a link to the documentation // create a link to the documentation
{ {
QCString name=mi->ambiguityResolutionScope+md->name(); QCString name=mi->ambiguityResolutionScope+md->name();
...@@ -2255,7 +2265,7 @@ void ClassDef::writeMemberList(OutputList &ol) ...@@ -2255,7 +2265,7 @@ void ClassDef::writeMemberList(OutputList &ol)
md->anchor(),name); md->anchor(),name);
if ( md->isFunction() || md->isSignal() || md->isSlot() || if ( md->isFunction() || md->isSignal() || md->isSlot() ||
(md->isFriend() && md->argsString())) (md->isFriend() && md->argsString()))
ol.docify(md->argsString()); ol.docify(md->argsString());
else if (md->isEnumerate()) else if (md->isEnumerate())
ol.parseText(" "+theTranslator->trEnumName()); ol.parseText(" "+theTranslator->trEnumName());
...@@ -2271,9 +2281,9 @@ void ClassDef::writeMemberList(OutputList &ol) ...@@ -2271,9 +2281,9 @@ void ClassDef::writeMemberList(OutputList &ol)
memberWritten=TRUE; memberWritten=TRUE;
} }
else if (!cd->isArtificial() && else if (!cd->isArtificial() &&
!Config_getBool("HIDE_UNDOC_MEMBERS") && !Config_getBool("HIDE_UNDOC_MEMBERS") &&
(protectionLevelVisible(md->protection()) || md->isFriend()) (protectionLevelVisible(md->protection()) || md->isFriend())
) // no documentation, ) // no documentation,
// generate link to the class instead. // generate link to the class instead.
{ {
//ol.writeListItem(); //ol.writeListItem();
...@@ -2298,7 +2308,7 @@ void ClassDef::writeMemberList(OutputList &ol) ...@@ -2298,7 +2308,7 @@ void ClassDef::writeMemberList(OutputList &ol)
ol.endBold(); ol.endBold();
if (!md->isObjCMethod()) if (!md->isObjCMethod())
{ {
if ( md->isFunction() || md->isSignal() || md->isSlot() ) if ( md->isFunction() || md->isSignal() || md->isSlot() )
ol.docify(md->argsString()); ol.docify(md->argsString());
else if (md->isEnumerate()) else if (md->isEnumerate())
ol.parseText(" "+theTranslator->trEnumName()); ol.parseText(" "+theTranslator->trEnumName());
...@@ -2333,15 +2343,15 @@ void ClassDef::writeMemberList(OutputList &ol) ...@@ -2333,15 +2343,15 @@ void ClassDef::writeMemberList(OutputList &ol)
ol.writeObjectLink(cd->getReference(), ol.writeObjectLink(cd->getReference(),
cd->getOutputFileBase(), cd->getOutputFileBase(),
cd->anchor(), cd->anchor(),
md->category() ? md->category() ?
md->category()->displayName() : md->category()->displayName() :
cd->displayName()); cd->displayName());
ol.writeString("</td>"); ol.writeString("</td>");
ol.writeString("<td class=\"entry\">"); ol.writeString("<td class=\"entry\">");
} }
SrcLangExt lang = md->getLanguage(); SrcLangExt lang = md->getLanguage();
if ( if (
(prot!=Public || (virt!=Normal && getLanguage()!=SrcLangExt_ObjC) || (prot!=Public || (virt!=Normal && getLanguage()!=SrcLangExt_ObjC) ||
md->isFriend() || md->isRelated() || md->isExplicit() || md->isFriend() || md->isRelated() || md->isExplicit() ||
md->isMutable() || (md->isInline() && Config_getBool("INLINE_INFO")) || md->isMutable() || (md->isInline() && Config_getBool("INLINE_INFO")) ||
md->isSignal() || md->isSlot() || md->isSignal() || md->isSlot() ||
...@@ -2353,7 +2363,7 @@ void ClassDef::writeMemberList(OutputList &ol) ...@@ -2353,7 +2363,7 @@ void ClassDef::writeMemberList(OutputList &ol)
{ {
ol.writeString("<span class=\"mlabel\">"); ol.writeString("<span class=\"mlabel\">");
QStrList sl; QStrList sl;
if (lang==SrcLangExt_VHDL) if (lang==SrcLangExt_VHDL)
{ {
sl.append(VhdlDocGen::trVhdlType(md->getMemberSpecifiers())); //append vhdl type sl.append(VhdlDocGen::trVhdlType(md->getMemberSpecifiers())); //append vhdl type
} }
...@@ -2361,14 +2371,14 @@ void ClassDef::writeMemberList(OutputList &ol) ...@@ -2361,14 +2371,14 @@ void ClassDef::writeMemberList(OutputList &ol)
else if (md->isRelated()) sl.append("related"); else if (md->isRelated()) sl.append("related");
else else
{ {
if (Config_getBool("INLINE_INFO") && md->isInline()) if (Config_getBool("INLINE_INFO") && md->isInline())
sl.append("inline"); sl.append("inline");
if (md->isExplicit()) sl.append("explicit"); if (md->isExplicit()) sl.append("explicit");
if (md->isMutable()) sl.append("mutable"); if (md->isMutable()) sl.append("mutable");
if (prot==Protected) sl.append("protected"); if (prot==Protected) sl.append("protected");
else if (prot==Private) sl.append("private"); else if (prot==Private) sl.append("private");
else if (prot==Package) sl.append("package"); else if (prot==Package) sl.append("package");
if (virt==Virtual && getLanguage()!=SrcLangExt_ObjC) if (virt==Virtual && getLanguage()!=SrcLangExt_ObjC)
sl.append("virtual"); sl.append("virtual");
else if (virt==Pure) sl.append("pure virtual"); else if (virt==Pure) sl.append("pure virtual");
if (md->isStatic()) sl.append("static"); if (md->isStatic()) sl.append("static");
...@@ -2408,7 +2418,7 @@ void ClassDef::writeMemberList(OutputList &ol) ...@@ -2408,7 +2418,7 @@ void ClassDef::writeMemberList(OutputList &ol)
//ol.endItemList(); //ol.endItemList();
ol.writeString("</table>"); ol.writeString("</table>");
endFile(ol); endFile(ol);
ol.popGeneratorState(); ol.popGeneratorState();
} }
...@@ -2438,7 +2448,7 @@ bool ClassDef::addExample(const char *anchor,const char *nameStr, ...@@ -2438,7 +2448,7 @@ bool ClassDef::addExample(const char *anchor,const char *nameStr,
// returns TRUE if this class is used in an example // returns TRUE if this class is used in an example
bool ClassDef::hasExamples() bool ClassDef::hasExamples()
{ {
if (m_impl->exampleSDict==0) if (m_impl->exampleSDict==0)
return FALSE; return FALSE;
else else
return m_impl->exampleSDict->count()>0; return m_impl->exampleSDict->count()>0;
...@@ -2449,7 +2459,7 @@ void ClassDef::setTemplateArguments(ArgumentList *al) ...@@ -2449,7 +2459,7 @@ void ClassDef::setTemplateArguments(ArgumentList *al)
{ {
if (al==0) return; if (al==0) return;
if (!m_impl->tempArgs) delete m_impl->tempArgs; // delete old list if needed if (!m_impl->tempArgs) delete m_impl->tempArgs; // delete old list if needed
m_impl->tempArgs=new ArgumentList; m_impl->tempArgs=new ArgumentList;
ArgumentListIterator ali(*al); ArgumentListIterator ali(*al);
Argument *a; Argument *a;
for (;(a=ali.current());++ali) for (;(a=ali.current());++ali)
...@@ -2472,12 +2482,12 @@ void ClassDef::setTypeConstraints(ArgumentList *al) ...@@ -2472,12 +2482,12 @@ void ClassDef::setTypeConstraints(ArgumentList *al)
} }
/*! Returns \c TRUE iff this class or a class inheriting from this class /*! Returns \c TRUE iff this class or a class inheriting from this class
* is \e not defined in an external tag file. * is \e not defined in an external tag file.
*/ */
bool ClassDef::hasNonReferenceSuperClass() bool ClassDef::hasNonReferenceSuperClass()
{ {
bool found=!isReference() && isLinkableInProject() && !isHidden(); bool found=!isReference() && isLinkableInProject() && !isHidden();
if (found) if (found)
{ {
return TRUE; // we're done if this class is not a reference return TRUE; // we're done if this class is not a reference
} }
...@@ -2488,7 +2498,7 @@ bool ClassDef::hasNonReferenceSuperClass() ...@@ -2488,7 +2498,7 @@ bool ClassDef::hasNonReferenceSuperClass()
{ {
ClassDef *bcd=bcli.current()->classDef; ClassDef *bcd=bcli.current()->classDef;
// recurse into the super class branch // recurse into the super class branch
found = found || bcd->hasNonReferenceSuperClass(); found = found || bcd->hasNonReferenceSuperClass();
if (!found) if (!found)
{ {
// look for template instances that might have non-reference super classes // look for template instances that might have non-reference super classes
...@@ -2508,7 +2518,7 @@ bool ClassDef::hasNonReferenceSuperClass() ...@@ -2508,7 +2518,7 @@ bool ClassDef::hasNonReferenceSuperClass()
return found; return found;
} }
/*! called from MemberDef::writeDeclaration() to (recusively) write the /*! called from MemberDef::writeDeclaration() to (recusively) write the
* definition of an anonymous struct, union or class. * definition of an anonymous struct, union or class.
*/ */
void ClassDef::writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup, void ClassDef::writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup,
...@@ -2524,7 +2534,7 @@ void ClassDef::writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup, ...@@ -2524,7 +2534,7 @@ void ClassDef::writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup,
if (ri==-1) ri=name().length(); if (ri==-1) ri=name().length();
QCString cn=name().right(name().length()-ri-2); QCString cn=name().right(name().length()-ri-2);
if (!cn.isEmpty() && cn.at(0)!='@' && md) if (!cn.isEmpty() && cn.at(0)!='@' && md)
{ {
if (cn.right(2)=="-p" /*|| cn.right(2)=="-g"*/) if (cn.right(2)=="-p" /*|| cn.right(2)=="-g"*/)
{ {
cn = cn.left(cn.length()-2); cn = cn.left(cn.length()-2);
...@@ -2542,7 +2552,7 @@ void ClassDef::writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup, ...@@ -2542,7 +2552,7 @@ void ClassDef::writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup,
} }
} }
ol.docify(" {"); ol.docify(" {");
ol.endMemberItem(); ol.endMemberItem();
// write user defined member groups // write user defined member groups
if (m_impl->memberGroupSDict) if (m_impl->memberGroupSDict)
...@@ -2571,7 +2581,7 @@ void ClassDef::writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup, ...@@ -2571,7 +2581,7 @@ void ClassDef::writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup,
/*! a link to this class is possible within this project */ /*! a link to this class is possible within this project */
bool ClassDef::isLinkableInProject() const bool ClassDef::isLinkableInProject() const
{ {
static bool extractLocal = Config_getBool("EXTRACT_LOCAL_CLASSES"); static bool extractLocal = Config_getBool("EXTRACT_LOCAL_CLASSES");
static bool extractStatic = Config_getBool("EXTRACT_STATIC"); static bool extractStatic = Config_getBool("EXTRACT_STATIC");
static bool hideUndoc = Config_getBool("HIDE_UNDOC_CLASSES"); static bool hideUndoc = Config_getBool("HIDE_UNDOC_CLASSES");
...@@ -2586,7 +2596,7 @@ bool ClassDef::isLinkableInProject() const ...@@ -2586,7 +2596,7 @@ bool ClassDef::isLinkableInProject() const
name().find('@')==-1 && /* not anonymous */ name().find('@')==-1 && /* not anonymous */
protectionLevelVisible(m_impl->prot) && /* private/internal */ protectionLevelVisible(m_impl->prot) && /* private/internal */
(!m_impl->isLocal || extractLocal) && /* local */ (!m_impl->isLocal || extractLocal) && /* local */
(hasDocumentation() || !hideUndoc) && /* documented */ (hasDocumentation() || !hideUndoc) && /* documented */
(!m_impl->isStatic || extractStatic) && /* static */ (!m_impl->isStatic || extractStatic) && /* static */
!isReference(); /* not an external reference */ !isReference(); /* not an external reference */
} }
...@@ -2606,8 +2616,8 @@ bool ClassDef::isLinkable() const ...@@ -2606,8 +2616,8 @@ bool ClassDef::isLinkable() const
/*! the class is visible in a class diagram, or class hierarchy */ /*! the class is visible in a class diagram, or class hierarchy */
bool ClassDef::isVisibleInHierarchy() bool ClassDef::isVisibleInHierarchy()
{ {
static bool allExternals = Config_getBool("ALLEXTERNALS"); static bool allExternals = Config_getBool("ALLEXTERNALS");
static bool hideUndocClasses = Config_getBool("HIDE_UNDOC_CLASSES"); static bool hideUndocClasses = Config_getBool("HIDE_UNDOC_CLASSES");
static bool extractStatic = Config_getBool("EXTRACT_STATIC"); static bool extractStatic = Config_getBool("EXTRACT_STATIC");
...@@ -2620,10 +2630,10 @@ bool ClassDef::isVisibleInHierarchy() ...@@ -2620,10 +2630,10 @@ bool ClassDef::isVisibleInHierarchy()
/*!isArtificial() &&*/ // 1.8.2: allowed these to appear /*!isArtificial() &&*/ // 1.8.2: allowed these to appear
// and not privately inherited // and not privately inherited
protectionLevelVisible(m_impl->prot) && protectionLevelVisible(m_impl->prot) &&
// documented or shown anyway or documentation is external // documented or shown anyway or documentation is external
(hasDocumentation() || (hasDocumentation() ||
!hideUndocClasses || !hideUndocClasses ||
(m_impl->templateMaster && m_impl->templateMaster->hasDocumentation()) || (m_impl->templateMaster && m_impl->templateMaster->hasDocumentation()) ||
isReference() isReference()
) && ) &&
// is not part of an unnamed namespace or shown anyway // is not part of an unnamed namespace or shown anyway
...@@ -2637,7 +2647,7 @@ bool ClassDef::hasDocumentation() const ...@@ -2637,7 +2647,7 @@ bool ClassDef::hasDocumentation() const
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// recursive function: // recursive function:
// returns TRUE iff class definition `bcd' represents an (in)direct base // returns TRUE iff class definition `bcd' represents an (in)direct base
// class of class definition `cd'. // class of class definition `cd'.
bool ClassDef::isBaseClass(ClassDef *bcd, bool followInstances,int level) bool ClassDef::isBaseClass(ClassDef *bcd, bool followInstances,int level)
...@@ -2659,9 +2669,9 @@ bool ClassDef::isBaseClass(ClassDef *bcd, bool followInstances,int level) ...@@ -2659,9 +2669,9 @@ bool ClassDef::isBaseClass(ClassDef *bcd, bool followInstances,int level)
ClassDef *ccd=bcli.current()->classDef; ClassDef *ccd=bcli.current()->classDef;
if (!followInstances && ccd->templateMaster()) ccd=ccd->templateMaster(); if (!followInstances && ccd->templateMaster()) ccd=ccd->templateMaster();
//printf("isBaseClass() baseclass %s\n",ccd->name().data()); //printf("isBaseClass() baseclass %s\n",ccd->name().data());
if (ccd==bcd) if (ccd==bcd)
found=TRUE; found=TRUE;
else else
found=ccd->isBaseClass(bcd,followInstances,level+1); found=ccd->isBaseClass(bcd,followInstances,level+1);
} }
} }
...@@ -2684,9 +2694,9 @@ bool ClassDef::isSubClass(ClassDef *cd,int level) ...@@ -2684,9 +2694,9 @@ bool ClassDef::isSubClass(ClassDef *cd,int level)
for ( ; bcli.current() && !found ; ++bcli) for ( ; bcli.current() && !found ; ++bcli)
{ {
ClassDef *ccd=bcli.current()->classDef; ClassDef *ccd=bcli.current()->classDef;
if (ccd==cd) if (ccd==cd)
found=TRUE; found=TRUE;
else else
found=ccd->isSubClass(cd,level+1); found=ccd->isSubClass(cd,level+1);
} }
} }
...@@ -2702,8 +2712,8 @@ static bool isStandardFunc(MemberDef *md) ...@@ -2702,8 +2712,8 @@ static bool isStandardFunc(MemberDef *md)
md->isDestructor(); // destructor md->isDestructor(); // destructor
} }
/*! /*!
* recusively merges the `all members' lists of a class base * recusively merges the `all members' lists of a class base
* with that of this class. Must only be called for classes without * with that of this class. Must only be called for classes without
* subclasses! * subclasses!
*/ */
...@@ -2727,7 +2737,7 @@ void ClassDef::mergeMembers() ...@@ -2727,7 +2737,7 @@ void ClassDef::mergeMembers()
BaseClassDef *bcd; BaseClassDef *bcd;
for ( ; (bcd=bcli.current()) ; ++bcli ) for ( ; (bcd=bcli.current()) ; ++bcli )
{ {
ClassDef *bClass=bcd->classDef; ClassDef *bClass=bcd->classDef;
// merge the members in the base class of this inheritance branch first // merge the members in the base class of this inheritance branch first
bClass->mergeMembers(); bClass->mergeMembers();
...@@ -2746,10 +2756,10 @@ void ClassDef::mergeMembers() ...@@ -2746,10 +2756,10 @@ void ClassDef::mergeMembers()
if (dstMnd!=0 && (dstMni=dstMnd->find(srcMni->memberName()))) if (dstMnd!=0 && (dstMni=dstMnd->find(srcMni->memberName())))
// a member with that name is already in the class. // a member with that name is already in the class.
// the member may hide or reimplement the one in the sub class // the member may hide or reimplement the one in the sub class
// or there may be another path to the base class that is already // or there may be another path to the base class that is already
// visited via another branch in the class hierarchy. // visited via another branch in the class hierarchy.
{ {
MemberNameInfoIterator srcMnii(*srcMni); MemberNameInfoIterator srcMnii(*srcMni);
MemberInfo *srcMi; MemberInfo *srcMi;
for ( ; (srcMi=srcMnii.current()) ; ++srcMnii ) for ( ; (srcMi=srcMnii.current()) ; ++srcMnii )
{ {
...@@ -2757,7 +2767,7 @@ void ClassDef::mergeMembers() ...@@ -2757,7 +2767,7 @@ void ClassDef::mergeMembers()
bool found=FALSE; bool found=FALSE;
bool ambigue=FALSE; bool ambigue=FALSE;
bool hidden=FALSE; bool hidden=FALSE;
MemberNameInfoIterator dstMnii(*dstMni); MemberNameInfoIterator dstMnii(*dstMni);
MemberInfo *dstMi; MemberInfo *dstMi;
ClassDef *srcCd = srcMd->getClassDef(); ClassDef *srcCd = srcMd->getClassDef();
for ( ; (dstMi=dstMnii.current()) && !found; ++dstMnii ) for ( ; (dstMi=dstMnii.current()) && !found; ++dstMnii )
...@@ -2767,7 +2777,7 @@ void ClassDef::mergeMembers() ...@@ -2767,7 +2777,7 @@ void ClassDef::mergeMembers()
{ {
ClassDef *dstCd = dstMd->getClassDef(); ClassDef *dstCd = dstMd->getClassDef();
//printf(" Is %s a base class of %s?\n",srcCd->name().data(),dstCd->name().data()); //printf(" Is %s a base class of %s?\n",srcCd->name().data(),dstCd->name().data());
if (srcCd==dstCd || dstCd->isBaseClass(srcCd,TRUE)) if (srcCd==dstCd || dstCd->isBaseClass(srcCd,TRUE))
// member is in the same or a base class // member is in the same or a base class
{ {
ArgumentList *srcAl = srcMd->argumentList(); ArgumentList *srcAl = srcMd->argumentList();
...@@ -2799,18 +2809,18 @@ void ClassDef::mergeMembers() ...@@ -2799,18 +2809,18 @@ void ClassDef::mergeMembers()
} }
else // same members else // same members
{ {
// do not add if base class is virtual or // do not add if base class is virtual or
// if scope paths are equal or // if scope paths are equal or
// if base class is an interface (and thus implicitly virtual). // if base class is an interface (and thus implicitly virtual).
//printf("same member found srcMi->virt=%d dstMi->virt=%d\n",srcMi->virt,dstMi->virt); //printf("same member found srcMi->virt=%d dstMi->virt=%d\n",srcMi->virt,dstMi->virt);
if ((srcMi->virt!=Normal && dstMi->virt!=Normal) || if ((srcMi->virt!=Normal && dstMi->virt!=Normal) ||
bClass->name()+sep+srcMi->scopePath == dstMi->scopePath || bClass->name()+sep+srcMi->scopePath == dstMi->scopePath ||
dstMd->getClassDef()->compoundType()==Interface dstMd->getClassDef()->compoundType()==Interface
) )
{ {
found=TRUE; found=TRUE;
} }
else // member can be reached via multiple paths in the else // member can be reached via multiple paths in the
// inheritance tree // inheritance tree
{ {
//printf("$$ Existing member %s %s add scope %s\n", //printf("$$ Existing member %s %s add scope %s\n",
...@@ -2832,10 +2842,10 @@ void ClassDef::mergeMembers() ...@@ -2832,10 +2842,10 @@ void ClassDef::mergeMembers()
// TODO: fix the case where a member is hidden by inheritance // TODO: fix the case where a member is hidden by inheritance
// of a member with the same name but with another prototype, // of a member with the same name but with another prototype,
// while there is more than one path to the member in the // while there is more than one path to the member in the
// base class due to multiple inheritance. In this case // base class due to multiple inheritance. In this case
// it seems that the member is not reachable by prefixing a // it seems that the member is not reachable by prefixing a
// scope name either (according to my compiler). Currently, // scope name either (according to my compiler). Currently,
// this case is shown anyway. // this case is shown anyway.
if (!found && srcMd->protection()!=Private && !srcMd->isFriend()) if (!found && srcMd->protection()!=Private && !srcMd->isFriend())
{ {
...@@ -2890,10 +2900,10 @@ void ClassDef::mergeMembers() ...@@ -2890,10 +2900,10 @@ void ClassDef::mergeMembers()
} }
else // base class has a member that is not in the sub class => copy else // base class has a member that is not in the sub class => copy
{ {
// create a deep copy of the list (only the MemberInfo's will be // create a deep copy of the list (only the MemberInfo's will be
// copied, not the actual MemberDef's) // copied, not the actual MemberDef's)
MemberNameInfo *newMni = 0; MemberNameInfo *newMni = 0;
newMni = new MemberNameInfo(srcMni->memberName()); newMni = new MemberNameInfo(srcMni->memberName());
// copy the member(s) from the base to the sub class // copy the member(s) from the base to the sub class
MemberNameInfoIterator mnii(*srcMni); MemberNameInfoIterator mnii(*srcMni);
...@@ -3000,7 +3010,7 @@ void ClassDef::mergeCategory(ClassDef *category) ...@@ -3000,7 +3010,7 @@ void ClassDef::mergeCategory(ClassDef *category)
} }
// make methods private for categories defined in the .m file // make methods private for categories defined in the .m file
//printf("%s::mergeCategory makePrivate=%d\n",name().data(),makePrivate); //printf("%s::mergeCategory makePrivate=%d\n",name().data(),makePrivate);
MemberNameInfoSDict *srcMnd = category->memberNameInfoSDict(); MemberNameInfoSDict *srcMnd = category->memberNameInfoSDict();
MemberNameInfoSDict *dstMnd = m_impl->allMemberNameInfoSDict; MemberNameInfoSDict *dstMnd = m_impl->allMemberNameInfoSDict;
...@@ -3019,7 +3029,7 @@ void ClassDef::mergeCategory(ClassDef *category) ...@@ -3019,7 +3029,7 @@ void ClassDef::mergeCategory(ClassDef *category)
//if (dstMi) //if (dstMi)
//{ //{
// Protection prot = dstMi->prot; // Protection prot = dstMi->prot;
// if (makePrivate || isExtension) // if (makePrivate || isExtension)
// { // {
// prot = Private; // prot = Private;
// removeMemberFromLists(dstMi->memberDef); // removeMemberFromLists(dstMi->memberDef);
...@@ -3039,7 +3049,7 @@ void ClassDef::mergeCategory(ClassDef *category) ...@@ -3039,7 +3049,7 @@ void ClassDef::mergeCategory(ClassDef *category)
//printf("New member %s\n",srcMni->memberName()); //printf("New member %s\n",srcMni->memberName());
// create a deep copy of the list // create a deep copy of the list
MemberNameInfo *newMni = 0; MemberNameInfo *newMni = 0;
newMni = new MemberNameInfo(srcMni->memberName()); newMni = new MemberNameInfo(srcMni->memberName());
// copy the member(s) from the category to this class // copy the member(s) from the category to this class
MemberNameInfoIterator mnii(*srcMni); MemberNameInfoIterator mnii(*srcMni);
...@@ -3079,7 +3089,7 @@ void ClassDef::mergeCategory(ClassDef *category) ...@@ -3079,7 +3089,7 @@ void ClassDef::mergeCategory(ClassDef *category)
newMd->setCategory(category); newMd->setCategory(category);
newMd->setCategoryRelation(mi->memberDef); newMd->setCategoryRelation(mi->memberDef);
mi->memberDef->setCategoryRelation(newMd); mi->memberDef->setCategoryRelation(newMd);
if (makePrivate || isExtension) if (makePrivate || isExtension)
{ {
newMd->makeImplementationDetail(); newMd->makeImplementationDetail();
} }
...@@ -3102,9 +3112,9 @@ void ClassDef::addUsedClass(ClassDef *cd,const char *accessName, ...@@ -3102,9 +3112,9 @@ void ClassDef::addUsedClass(ClassDef *cd,const char *accessName,
static bool umlLook = Config_getBool("UML_LOOK"); static bool umlLook = Config_getBool("UML_LOOK");
if (prot==Private && !extractPrivate) return; if (prot==Private && !extractPrivate) return;
//printf("%s::addUsedClass(%s,%s)\n",name().data(),cd->name().data(),accessName); //printf("%s::addUsedClass(%s,%s)\n",name().data(),cd->name().data(),accessName);
if (m_impl->usesImplClassDict==0) if (m_impl->usesImplClassDict==0)
{ {
m_impl->usesImplClassDict = new UsesClassDict(17); m_impl->usesImplClassDict = new UsesClassDict(17);
m_impl->usesImplClassDict->setAutoDelete(TRUE); m_impl->usesImplClassDict->setAutoDelete(TRUE);
} }
UsesClassDef *ucd=m_impl->usesImplClassDict->find(cd->name()); UsesClassDef *ucd=m_impl->usesImplClassDict->find(cd->name());
...@@ -3136,9 +3146,9 @@ void ClassDef::addUsedByClass(ClassDef *cd,const char *accessName, ...@@ -3136,9 +3146,9 @@ void ClassDef::addUsedByClass(ClassDef *cd,const char *accessName,
static bool umlLook = Config_getBool("UML_LOOK"); static bool umlLook = Config_getBool("UML_LOOK");
if (prot==Private && !extractPrivate) return; if (prot==Private && !extractPrivate) return;
//printf("%s::addUsedByClass(%s,%s)\n",name().data(),cd->name().data(),accessName); //printf("%s::addUsedByClass(%s,%s)\n",name().data(),cd->name().data(),accessName);
if (m_impl->usedByImplClassDict==0) if (m_impl->usedByImplClassDict==0)
{ {
m_impl->usedByImplClassDict = new UsesClassDict(17); m_impl->usedByImplClassDict = new UsesClassDict(17);
m_impl->usedByImplClassDict->setAutoDelete(TRUE); m_impl->usedByImplClassDict->setAutoDelete(TRUE);
} }
UsesClassDef *ucd=m_impl->usedByImplClassDict->find(cd->name()); UsesClassDef *ucd=m_impl->usedByImplClassDict->find(cd->name());
...@@ -3165,8 +3175,8 @@ void ClassDef::addUsedByClass(ClassDef *cd,const char *accessName, ...@@ -3165,8 +3175,8 @@ void ClassDef::addUsedByClass(ClassDef *cd,const char *accessName,
#if 0 #if 0
/*! Builds up a dictionary of all classes that are used by the state of this /*! Builds up a dictionary of all classes that are used by the state of this
* class (the "implementation"). * class (the "implementation").
* Must be called before mergeMembers() is called! * Must be called before mergeMembers() is called!
*/ */
...@@ -3205,7 +3215,7 @@ void ClassDef::determineImplUsageRelation() ...@@ -3205,7 +3215,7 @@ void ClassDef::determineImplUsageRelation()
if (arg->name==usedClassName) // type is a template argument if (arg->name==usedClassName) // type is a template argument
{ {
found=TRUE; found=TRUE;
if (m_impl->usesImplClassDict==0) m_impl->usesImplClassDict = new UsesClassDict(257); if (m_impl->usesImplClassDict==0) m_impl->usesImplClassDict = new UsesClassDict(257);
cd = new ClassDef(cd->getDefFileName(),cd->getDefLine(), cd = new ClassDef(cd->getDefFileName(),cd->getDefLine(),
usedClassName,ClassDef::Class); usedClassName,ClassDef::Class);
cd->setIsTemplateBaseClass(count); cd->setIsTemplateBaseClass(count);
...@@ -3232,12 +3242,12 @@ void ClassDef::determineImplUsageRelation() ...@@ -3232,12 +3242,12 @@ void ClassDef::determineImplUsageRelation()
if (cd==0) cd=getResolvedClass(name()+"::"+usedClassName,0,&templSpec); if (cd==0) cd=getResolvedClass(name()+"::"+usedClassName,0,&templSpec);
if (cd==0) cd=getResolvedClass(usedClassName,0,&templSpec); // TODO: also try in-between scopes! if (cd==0) cd=getResolvedClass(usedClassName,0,&templSpec); // TODO: also try in-between scopes!
//printf("Search for class %s result=%p\n",usedClassName.data(),cd); //printf("Search for class %s result=%p\n",usedClassName.data(),cd);
if (cd) // class exists if (cd) // class exists
{ {
found=TRUE; found=TRUE;
if (m_impl->usesImplClassDict==0) if (m_impl->usesImplClassDict==0)
{ {
m_impl->usesImplClassDict = new UsesClassDict(257); m_impl->usesImplClassDict = new UsesClassDict(257);
m_impl->usesImplClassDict->setAutoDelete(TRUE); m_impl->usesImplClassDict->setAutoDelete(TRUE);
} }
UsesClassDef *ucd=m_impl->usesImplClassDict->find(cd->name()); UsesClassDef *ucd=m_impl->usesImplClassDict->find(cd->name());
...@@ -3267,7 +3277,7 @@ void ClassDef::determineImplUsageRelation() ...@@ -3267,7 +3277,7 @@ void ClassDef::determineImplUsageRelation()
for (;(ucd=ucdi.current());++ucdi) for (;(ucd=ucdi.current());++ucdi)
{ {
msg(" %s via ",ucd->classDef->name().data()); msg(" %s via ",ucd->classDef->name().data());
QDictIterator<void> dvi(*ucd->accessors); QDictIterator<void> dvi(*ucd->accessors);
const char *s; const char *s;
for (;(s=dvi.currentKey());++dvi) for (;(s=dvi.currentKey());++dvi)
{ {
...@@ -3295,9 +3305,9 @@ void ClassDef::addUsedInterfaceClasses(MemberDef *md,const char *typeStr) ...@@ -3295,9 +3305,9 @@ void ClassDef::addUsedInterfaceClasses(MemberDef *md,const char *typeStr)
if (cd==0) cd=getClass(type.mid(i,l)); // TODO: also try in-between scopes! if (cd==0) cd=getClass(type.mid(i,l)); // TODO: also try in-between scopes!
if (cd && cd!=this && !isBaseClass(cd)) if (cd && cd!=this && !isBaseClass(cd))
{ {
if (m_impl->usesIntfClassDict==0) if (m_impl->usesIntfClassDict==0)
{ {
m_impl->usesIntfClassDict = new UsesClassDict(257); m_impl->usesIntfClassDict = new UsesClassDict(257);
} }
UsesClassDef *ucd=m_impl->usesIntfClassDict->find(cd->name()); UsesClassDef *ucd=m_impl->usesIntfClassDict->find(cd->name());
if (ucd==0) if (ucd==0)
...@@ -3326,7 +3336,7 @@ void ClassDef::determineIntfUsageRelation() ...@@ -3326,7 +3336,7 @@ void ClassDef::determineIntfUsageRelation()
for (mnii.toFirst();(mi=mnii.current());++mnii) for (mnii.toFirst();(mi=mnii.current());++mnii)
{ {
MemberDef *md=mi->memberDef; MemberDef *md=mi->memberDef;
// compute the protection level for this member // compute the protection level for this member
Protection protect=md->protection(); Protection protect=md->protection();
if (mi->prot==Protected) // inherited protection if (mi->prot==Protected) // inherited protection
...@@ -3334,8 +3344,8 @@ void ClassDef::determineIntfUsageRelation() ...@@ -3334,8 +3344,8 @@ void ClassDef::determineIntfUsageRelation()
if (protect==Public) protect=Protected; if (protect==Public) protect=Protected;
else if (protect==Protected) protect=Private; else if (protect==Protected) protect=Private;
} }
if (!md->name().isEmpty() && md->name()[0]!='@' && if (!md->name().isEmpty() && md->name()[0]!='@' &&
(mi->prot!=Private && protect!=Private) (mi->prot!=Private && protect!=Private)
) )
{ {
...@@ -3375,7 +3385,7 @@ QCString ClassDef::compoundTypeString() const ...@@ -3375,7 +3385,7 @@ QCString ClassDef::compoundTypeString() const
case Category: return "category"; case Category: return "category";
case Exception: return "exception"; case Exception: return "exception";
default: return "unknown"; default: return "unknown";
} }
} }
else else
{ {
...@@ -3395,8 +3405,8 @@ QCString ClassDef::compoundTypeString() const ...@@ -3395,8 +3405,8 @@ QCString ClassDef::compoundTypeString() const
} }
} }
QCString ClassDef::getOutputFileBase() const QCString ClassDef::getOutputFileBase() const
{ {
if (!Doxygen::generatingXmlOutput) if (!Doxygen::generatingXmlOutput)
{ {
static bool inlineGroupedClasses = Config_getBool("INLINE_GROUPED_CLASSES"); static bool inlineGroupedClasses = Config_getBool("INLINE_GROUPED_CLASSES");
...@@ -3437,36 +3447,36 @@ QCString ClassDef::getOutputFileBase() const ...@@ -3437,36 +3447,36 @@ QCString ClassDef::getOutputFileBase() const
else else
{ {
// normal locally defined class // normal locally defined class
return convertNameToFile(m_impl->fileName); return convertNameToFile(m_impl->fileName);
} }
} }
QCString ClassDef::getInstanceOutputFileBase() const QCString ClassDef::getInstanceOutputFileBase() const
{ {
if (isReference()) if (isReference())
{ {
return m_impl->fileName; return m_impl->fileName;
} }
else else
{ {
return convertNameToFile(m_impl->fileName); return convertNameToFile(m_impl->fileName);
} }
} }
QCString ClassDef::getFileBase() const QCString ClassDef::getFileBase() const
{ {
if (m_impl->templateMaster) if (m_impl->templateMaster)
{ {
return m_impl->templateMaster->getFileBase(); return m_impl->templateMaster->getFileBase();
} }
else else
{ {
return m_impl->fileName; return m_impl->fileName;
} }
} }
QCString ClassDef::getSourceFileBase() const QCString ClassDef::getSourceFileBase() const
{ {
if (m_impl->templateMaster) if (m_impl->templateMaster)
{ {
return m_impl->templateMaster->getSourceFileBase(); return m_impl->templateMaster->getSourceFileBase();
...@@ -3568,7 +3578,7 @@ ClassDef *ClassDef::insertTemplateInstance(const QCString &fileName, ...@@ -3568,7 +3578,7 @@ ClassDef *ClassDef::insertTemplateInstance(const QCString &fileName,
int startLine, int startColumn, const QCString &templSpec,bool &freshInstance) int startLine, int startColumn, const QCString &templSpec,bool &freshInstance)
{ {
freshInstance = FALSE; freshInstance = FALSE;
if (m_impl->templateInstances==0) if (m_impl->templateInstances==0)
{ {
m_impl->templateInstances = new QDict<ClassDef>(17); m_impl->templateInstances = new QDict<ClassDef>(17);
} }
...@@ -3590,7 +3600,7 @@ ClassDef *ClassDef::insertTemplateInstance(const QCString &fileName, ...@@ -3590,7 +3600,7 @@ ClassDef *ClassDef::insertTemplateInstance(const QCString &fileName,
ClassDef *ClassDef::getVariableInstance(const char *templSpec) ClassDef *ClassDef::getVariableInstance(const char *templSpec)
{ {
if (m_impl->variableInstances==0) if (m_impl->variableInstances==0)
{ {
m_impl->variableInstances = new QDict<ClassDef>(17); m_impl->variableInstances = new QDict<ClassDef>(17);
m_impl->variableInstances->setAutoDelete(TRUE); m_impl->variableInstances->setAutoDelete(TRUE);
...@@ -3746,7 +3756,7 @@ QCString ClassDef::qualifiedNameWithTemplateParameters( ...@@ -3746,7 +3756,7 @@ QCString ClassDef::qualifiedNameWithTemplateParameters(
QCString clName = className(); QCString clName = className();
//bool isGeneric = getLanguage()==SrcLangExt_CSharp; //bool isGeneric = getLanguage()==SrcLangExt_CSharp;
//if (isGeneric && clName.right(2)=="-g") //if (isGeneric && clName.right(2)=="-g")
//{ //{
// clName = clName.left(clName.length()-2); // clName = clName.left(clName.length()-2);
//} //}
...@@ -3928,7 +3938,7 @@ void ClassDef::sortMemberLists() ...@@ -3928,7 +3938,7 @@ void ClassDef::sortMemberLists()
* For protected inheritance, both protected and public members of the * For protected inheritance, both protected and public members of the
* base class should be joined in the protected member section. * base class should be joined in the protected member section.
* *
* For private inheritance, both protected and public members of the * For private inheritance, both protected and public members of the
* base class should be joined in the private member section. * base class should be joined in the private member section.
*/ */
static void convertProtectionLevel( static void convertProtectionLevel(
...@@ -3948,9 +3958,9 @@ static void convertProtectionLevel( ...@@ -3948,9 +3958,9 @@ static void convertProtectionLevel(
// the private section of the base class should not // the private section of the base class should not
// be visible // be visible
{ {
case MemberListType_priMethods: case MemberListType_priMethods:
case MemberListType_priStaticMethods: case MemberListType_priStaticMethods:
case MemberListType_priSlots: case MemberListType_priSlots:
case MemberListType_priAttribs: case MemberListType_priAttribs:
case MemberListType_priStaticAttribs: case MemberListType_priStaticAttribs:
case MemberListType_priTypes: case MemberListType_priTypes:
...@@ -3967,15 +3977,15 @@ static void convertProtectionLevel( ...@@ -3967,15 +3977,15 @@ static void convertProtectionLevel(
// both the public and protected members are shown // both the public and protected members are shown
// as protected // as protected
{ {
case MemberListType_pubMethods: case MemberListType_pubMethods:
case MemberListType_pubStaticMethods: case MemberListType_pubStaticMethods:
case MemberListType_pubSlots: case MemberListType_pubSlots:
case MemberListType_pubAttribs: case MemberListType_pubAttribs:
case MemberListType_pubStaticAttribs: case MemberListType_pubStaticAttribs:
case MemberListType_pubTypes: case MemberListType_pubTypes:
case MemberListType_priMethods: case MemberListType_priMethods:
case MemberListType_priStaticMethods: case MemberListType_priStaticMethods:
case MemberListType_priSlots: case MemberListType_priSlots:
case MemberListType_priAttribs: case MemberListType_priAttribs:
case MemberListType_priStaticAttribs: case MemberListType_priStaticAttribs:
case MemberListType_priTypes: case MemberListType_priTypes:
...@@ -3983,25 +3993,25 @@ static void convertProtectionLevel( ...@@ -3983,25 +3993,25 @@ static void convertProtectionLevel(
*outListType2=-1; *outListType2=-1;
break; break;
case MemberListType_proMethods: case MemberListType_proMethods:
*outListType2=MemberListType_pubMethods; *outListType2=MemberListType_pubMethods;
break; break;
case MemberListType_proStaticMethods: case MemberListType_proStaticMethods:
*outListType2=MemberListType_pubStaticMethods; *outListType2=MemberListType_pubStaticMethods;
break; break;
case MemberListType_proSlots: case MemberListType_proSlots:
*outListType2=MemberListType_pubSlots; *outListType2=MemberListType_pubSlots;
break; break;
case MemberListType_proAttribs: case MemberListType_proAttribs:
*outListType2=MemberListType_pubAttribs; *outListType2=MemberListType_pubAttribs;
break; break;
case MemberListType_proStaticAttribs: case MemberListType_proStaticAttribs:
*outListType2=MemberListType_pubStaticAttribs; *outListType2=MemberListType_pubStaticAttribs;
break; break;
case MemberListType_proTypes: case MemberListType_proTypes:
*outListType2=MemberListType_pubTypes; *outListType2=MemberListType_pubTypes;
break; break;
default: default:
break; break;
} }
} }
...@@ -4011,15 +4021,15 @@ static void convertProtectionLevel( ...@@ -4011,15 +4021,15 @@ static void convertProtectionLevel(
// both the public and protected members are shown // both the public and protected members are shown
// as private // as private
{ {
case MemberListType_pubMethods: case MemberListType_pubMethods:
case MemberListType_pubStaticMethods: case MemberListType_pubStaticMethods:
case MemberListType_pubSlots: case MemberListType_pubSlots:
case MemberListType_pubAttribs: case MemberListType_pubAttribs:
case MemberListType_pubStaticAttribs: case MemberListType_pubStaticAttribs:
case MemberListType_pubTypes: case MemberListType_pubTypes:
case MemberListType_proMethods: case MemberListType_proMethods:
case MemberListType_proStaticMethods: case MemberListType_proStaticMethods:
case MemberListType_proSlots: case MemberListType_proSlots:
case MemberListType_proAttribs: case MemberListType_proAttribs:
case MemberListType_proStaticAttribs: case MemberListType_proStaticAttribs:
case MemberListType_proTypes: case MemberListType_proTypes:
...@@ -4027,7 +4037,7 @@ static void convertProtectionLevel( ...@@ -4027,7 +4037,7 @@ static void convertProtectionLevel(
*outListType2=-1; *outListType2=-1;
break; break;
case MemberListType_priMethods: case MemberListType_priMethods:
if (extractPrivate) if (extractPrivate)
{ {
*outListType1=MemberListType_pubMethods; *outListType1=MemberListType_pubMethods;
...@@ -4039,7 +4049,7 @@ static void convertProtectionLevel( ...@@ -4039,7 +4049,7 @@ static void convertProtectionLevel(
*outListType2=-1; *outListType2=-1;
} }
break; break;
case MemberListType_priStaticMethods: case MemberListType_priStaticMethods:
if (extractPrivate) if (extractPrivate)
{ {
*outListType1=MemberListType_pubStaticMethods; *outListType1=MemberListType_pubStaticMethods;
...@@ -4051,7 +4061,7 @@ static void convertProtectionLevel( ...@@ -4051,7 +4061,7 @@ static void convertProtectionLevel(
*outListType2=-1; *outListType2=-1;
} }
break; break;
case MemberListType_priSlots: case MemberListType_priSlots:
if (extractPrivate) if (extractPrivate)
{ {
*outListType1=MemberListType_pubSlots; *outListType1=MemberListType_pubSlots;
...@@ -4099,7 +4109,7 @@ static void convertProtectionLevel( ...@@ -4099,7 +4109,7 @@ static void convertProtectionLevel(
*outListType2=-1; *outListType2=-1;
} }
break; break;
default: default:
break; break;
} }
} }
...@@ -4116,7 +4126,7 @@ int ClassDef::countMemberDeclarations(MemberListType lt,ClassDef *inheritedFrom, ...@@ -4116,7 +4126,7 @@ int ClassDef::countMemberDeclarations(MemberListType lt,ClassDef *inheritedFrom,
MemberList * ml2 = getMemberList((MemberListType)lt2); MemberList * ml2 = getMemberList((MemberListType)lt2);
if (getLanguage()!=SrcLangExt_VHDL) // use specific declarations function if (getLanguage()!=SrcLangExt_VHDL) // use specific declarations function
{ {
if (ml) if (ml)
{ {
ml->countDecMembers(); ml->countDecMembers();
count+=ml->numDecMembers(); count+=ml->numDecMembers();
...@@ -4164,7 +4174,7 @@ int ClassDef::countInheritedDecMembers(MemberListType lt, ...@@ -4164,7 +4174,7 @@ int ClassDef::countInheritedDecMembers(MemberListType lt,
convertProtectionLevel(lt,ibcd->prot,&lt1,&lt2); convertProtectionLevel(lt,ibcd->prot,&lt1,&lt2);
//printf("%s: convert %d->(%d,%d) prot=%d\n", //printf("%s: convert %d->(%d,%d) prot=%d\n",
// icd->name().data(),lt,lt1,lt2,ibcd->prot); // icd->name().data(),lt,lt1,lt2,ibcd->prot);
if (visitedClasses->find(icd)==0) if (visitedClasses->find(icd)==0)
{ {
visitedClasses->insert(icd,icd); // guard for multiple virtual inheritance visitedClasses->insert(icd,icd); // guard for multiple virtual inheritance
if (lt1!=-1) if (lt1!=-1)
...@@ -4191,7 +4201,7 @@ void ClassDef::getTitleForMemberListType(MemberListType type, ...@@ -4191,7 +4201,7 @@ void ClassDef::getTitleForMemberListType(MemberListType type,
if (lde->kind()==LayoutDocEntry::MemberDecl) if (lde->kind()==LayoutDocEntry::MemberDecl)
{ {
LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
if (lmd->type==type) if (lmd->type==type)
{ {
title = lmd->title(lang); title = lmd->title(lang);
subtitle = lmd->subtitle(lang); subtitle = lmd->subtitle(lang);
...@@ -4254,8 +4264,8 @@ int ClassDef::countMembersIncludingGrouped(MemberListType lt, ...@@ -4254,8 +4264,8 @@ int ClassDef::countMembersIncludingGrouped(MemberListType lt,
{ {
int count=0; int count=0;
MemberList *ml = getMemberList(lt); MemberList *ml = getMemberList(lt);
if (ml) if (ml)
{ {
count=ml->countInheritableMembers(inheritedFrom); count=ml->countInheritableMembers(inheritedFrom);
} }
//printf("%s:countMembersIncludingGrouped: count=%d\n",name().data(),count); //printf("%s:countMembersIncludingGrouped: count=%d\n",name().data(),count);
...@@ -4265,7 +4275,7 @@ int ClassDef::countMembersIncludingGrouped(MemberListType lt, ...@@ -4265,7 +4275,7 @@ int ClassDef::countMembersIncludingGrouped(MemberListType lt,
MemberGroup *mg; MemberGroup *mg;
for (;(mg=mgli.current());++mgli) for (;(mg=mgli.current());++mgli)
{ {
bool hasOwnSection = !mg->allMembersInSameSection() || bool hasOwnSection = !mg->allMembersInSameSection() ||
!m_impl->subGrouping; // group is in its own section !m_impl->subGrouping; // group is in its own section
if ((additional && hasOwnSection) || (!additional && !hasOwnSection)) if ((additional && hasOwnSection) || (!additional && !hasOwnSection))
{ {
...@@ -4307,7 +4317,7 @@ void ClassDef::writeInheritedMemberDeclarations(OutputList &ol, ...@@ -4307,7 +4317,7 @@ void ClassDef::writeInheritedMemberDeclarations(OutputList &ol,
lt2=lt3; lt2=lt3;
} }
//printf("%s:convert %d->(%d,%d) prot=%d\n",icd->name().data(),lt,lt1,lt2,ibcd->prot); //printf("%s:convert %d->(%d,%d) prot=%d\n",icd->name().data(),lt,lt1,lt2,ibcd->prot);
if (visitedClasses->find(icd)==0) if (visitedClasses->find(icd)==0)
{ {
visitedClasses->insert(icd,icd); // guard for multiple virtual inheritance visitedClasses->insert(icd,icd); // guard for multiple virtual inheritance
if (lt1!=-1) if (lt1!=-1)
...@@ -4345,17 +4355,17 @@ void ClassDef::writeMemberDeclarations(OutputList &ol,MemberListType lt,const QC ...@@ -4345,17 +4355,17 @@ void ClassDef::writeMemberDeclarations(OutputList &ol,MemberListType lt,const QC
{ {
//printf("%s::writeMemberDeclarations(%s) ml=%p ml2=%p\n",name().data(),title.data(),ml,ml2); //printf("%s::writeMemberDeclarations(%s) ml=%p ml2=%p\n",name().data(),title.data(),ml,ml2);
QCString tt = title, st = subTitle; QCString tt = title, st = subTitle;
if (ml) if (ml)
{ {
//printf(" writeDeclaration type=%d count=%d\n",lt,ml->numDecMembers()); //printf(" writeDeclaration type=%d count=%d\n",lt,ml->numDecMembers());
ml->writeDeclarations(ol,this,0,0,0,tt,st,definitionType(),FALSE,showInline,inheritedFrom,lt); ml->writeDeclarations(ol,this,0,0,0,tt,st,definitionType(),FALSE,showInline,inheritedFrom,lt);
tt.resize(0); tt.resize(0);
st.resize(0); st.resize(0);
} }
if (ml2) if (ml2)
{ {
//printf(" writeDeclaration type=%d count=%d\n",lt2,ml2->numDecMembers()); //printf(" writeDeclaration type=%d count=%d\n",lt2,ml2->numDecMembers());
ml2->writeDeclarations(ol,this,0,0,0,tt,st,definitionType(),FALSE,showInline,inheritedFrom,lt); ml2->writeDeclarations(ol,this,0,0,0,tt,st,definitionType(),FALSE,showInline,inheritedFrom,lt);
} }
static bool inlineInheritedMembers = Config_getBool("INLINE_INHERITED_MEMB"); static bool inlineInheritedMembers = Config_getBool("INLINE_INHERITED_MEMB");
if (!inlineInheritedMembers) // show inherited members as separate lists if (!inlineInheritedMembers) // show inherited members as separate lists
...@@ -4407,91 +4417,91 @@ void ClassDef::writePlainMemberDeclaration(OutputList &ol, ...@@ -4407,91 +4417,91 @@ void ClassDef::writePlainMemberDeclaration(OutputList &ol,
{ {
//printf("%s: ClassDef::writePlainMemberDeclaration()\n",name().data()); //printf("%s: ClassDef::writePlainMemberDeclaration()\n",name().data());
MemberList * ml = getMemberList(lt); MemberList * ml = getMemberList(lt);
if (ml) if (ml)
{ {
ml->setInGroup(inGroup); ml->setInGroup(inGroup);
ml->writePlainDeclarations(ol,this,0,0,0,definitionType(),inheritedFrom,inheritId); ml->writePlainDeclarations(ol,this,0,0,0,definitionType(),inheritedFrom,inheritId);
} }
} }
bool ClassDef::isLocal() const bool ClassDef::isLocal() const
{ {
return m_impl->isLocal; return m_impl->isLocal;
} }
ClassSDict *ClassDef::getClassSDict() ClassSDict *ClassDef::getClassSDict()
{ {
return m_impl->innerClasses; return m_impl->innerClasses;
} }
ClassDef::CompoundType ClassDef::compoundType() const ClassDef::CompoundType ClassDef::compoundType() const
{ {
return m_impl->compType; return m_impl->compType;
} }
BaseClassList *ClassDef::baseClasses() const BaseClassList *ClassDef::baseClasses() const
{ {
return m_impl->inherits; return m_impl->inherits;
} }
BaseClassList *ClassDef::subClasses() const BaseClassList *ClassDef::subClasses() const
{ {
return m_impl->inheritedBy; return m_impl->inheritedBy;
} }
MemberNameInfoSDict *ClassDef::memberNameInfoSDict() const MemberNameInfoSDict *ClassDef::memberNameInfoSDict() const
{ {
return m_impl->allMemberNameInfoSDict; return m_impl->allMemberNameInfoSDict;
} }
Protection ClassDef::protection() const Protection ClassDef::protection() const
{ {
return m_impl->prot; return m_impl->prot;
} }
ArgumentList *ClassDef::templateArguments() const ArgumentList *ClassDef::templateArguments() const
{ {
return m_impl->tempArgs; return m_impl->tempArgs;
} }
NamespaceDef *ClassDef::getNamespaceDef() const NamespaceDef *ClassDef::getNamespaceDef() const
{ {
return m_impl->nspace; return m_impl->nspace;
} }
FileDef *ClassDef::getFileDef() const FileDef *ClassDef::getFileDef() const
{ {
return m_impl->fileDef; return m_impl->fileDef;
} }
QDict<ClassDef> *ClassDef::getTemplateInstances() const QDict<ClassDef> *ClassDef::getTemplateInstances() const
{ {
return m_impl->templateInstances; return m_impl->templateInstances;
} }
ClassDef *ClassDef::templateMaster() const ClassDef *ClassDef::templateMaster() const
{ {
return m_impl->templateMaster; return m_impl->templateMaster;
} }
bool ClassDef::isTemplate() const bool ClassDef::isTemplate() const
{ {
return m_impl->tempArgs!=0; return m_impl->tempArgs!=0;
} }
IncludeInfo *ClassDef::includeInfo() const IncludeInfo *ClassDef::includeInfo() const
{ {
return m_impl->incInfo; return m_impl->incInfo;
} }
UsesClassDict *ClassDef::usedImplementationClasses() const UsesClassDict *ClassDef::usedImplementationClasses() const
{ {
return m_impl->usesImplClassDict; return m_impl->usesImplClassDict;
} }
UsesClassDict *ClassDef::usedByImplementationClasses() const UsesClassDict *ClassDef::usedByImplementationClasses() const
{ {
return m_impl->usedByImplClassDict; return m_impl->usedByImplClassDict;
} }
UsesClassDict *ClassDef::usedInterfaceClasses() const UsesClassDict *ClassDef::usedInterfaceClasses() const
...@@ -4504,9 +4514,9 @@ bool ClassDef::isTemplateArgument() const ...@@ -4504,9 +4514,9 @@ bool ClassDef::isTemplateArgument() const
return m_impl->isTemplArg; return m_impl->isTemplArg;
} }
bool ClassDef::isAbstract() const bool ClassDef::isAbstract() const
{ {
return m_impl->isAbstract || (m_impl->spec&Entry::Abstract); return m_impl->isAbstract || (m_impl->spec&Entry::Abstract);
} }
bool ClassDef::isFinal() const bool ClassDef::isFinal() const
...@@ -4524,69 +4534,69 @@ bool ClassDef::isPublished() const ...@@ -4524,69 +4534,69 @@ bool ClassDef::isPublished() const
return m_impl->spec&Entry::Published; return m_impl->spec&Entry::Published;
} }
bool ClassDef::isObjectiveC() const bool ClassDef::isObjectiveC() const
{ {
return getLanguage()==SrcLangExt_ObjC; return getLanguage()==SrcLangExt_ObjC;
} }
bool ClassDef::isCSharp() const bool ClassDef::isCSharp() const
{ {
return getLanguage()==SrcLangExt_CSharp; return getLanguage()==SrcLangExt_CSharp;
} }
ClassDef *ClassDef::categoryOf() const ClassDef *ClassDef::categoryOf() const
{ {
return m_impl->categoryOf; return m_impl->categoryOf;
} }
const QList<MemberList> &ClassDef::getMemberLists() const const QList<MemberList> &ClassDef::getMemberLists() const
{ {
return m_impl->memberLists; return m_impl->memberLists;
} }
MemberGroupSDict *ClassDef::getMemberGroupSDict() const MemberGroupSDict *ClassDef::getMemberGroupSDict() const
{ {
return m_impl->memberGroupSDict; return m_impl->memberGroupSDict;
} }
void ClassDef::setNamespace(NamespaceDef *nd) void ClassDef::setNamespace(NamespaceDef *nd)
{ {
m_impl->nspace = nd; m_impl->nspace = nd;
} }
void ClassDef::setFileDef(FileDef *fd) void ClassDef::setFileDef(FileDef *fd)
{ {
m_impl->fileDef=fd; m_impl->fileDef=fd;
} }
void ClassDef::setSubGrouping(bool enabled) void ClassDef::setSubGrouping(bool enabled)
{ {
m_impl->subGrouping = enabled; m_impl->subGrouping = enabled;
} }
void ClassDef::setProtection(Protection p) void ClassDef::setProtection(Protection p)
{ {
m_impl->prot=p; m_impl->prot=p;
} }
void ClassDef::setIsStatic(bool b) void ClassDef::setIsStatic(bool b)
{ {
m_impl->isStatic=b; m_impl->isStatic=b;
} }
void ClassDef::setCompoundType(CompoundType t) void ClassDef::setCompoundType(CompoundType t)
{ {
m_impl->compType = t; m_impl->compType = t;
} }
void ClassDef::setTemplateMaster(ClassDef *tm) void ClassDef::setTemplateMaster(ClassDef *tm)
{ {
m_impl->templateMaster=tm; m_impl->templateMaster=tm;
} }
void ClassDef::makeTemplateArgument(bool b) void ClassDef::makeTemplateArgument(bool b)
{ {
m_impl->isTemplArg = b; m_impl->isTemplArg = b;
} }
void ClassDef::setCategoryOf(ClassDef *cd) void ClassDef::setCategoryOf(ClassDef *cd)
...@@ -4644,7 +4654,7 @@ QCString ClassDef::anchor() const ...@@ -4644,7 +4654,7 @@ QCString ClassDef::anchor() const
else else
{ {
// normal locally defined class // normal locally defined class
anc = convertNameToFile(m_impl->fileName); anc = convertNameToFile(m_impl->fileName);
} }
} }
return anc; return anc;
...@@ -4657,12 +4667,12 @@ bool ClassDef::isEmbeddedInOuterScope() const ...@@ -4657,12 +4667,12 @@ bool ClassDef::isEmbeddedInOuterScope() const
Definition *container = getOuterScope(); Definition *container = getOuterScope();
bool containerLinkable = bool containerLinkable =
container && container &&
( (
(container==Doxygen::globalScope && getFileDef() && getFileDef()->isLinkableInProject()) || // global class in documented file (container==Doxygen::globalScope && getFileDef() && getFileDef()->isLinkableInProject()) || // global class in documented file
container->isLinkableInProject() // class in documented scope container->isLinkableInProject() // class in documented scope
); );
// inline because of INLINE_GROUPED_CLASSES=YES ? // inline because of INLINE_GROUPED_CLASSES=YES ?
bool b1 = (inlineGroupedClasses && partOfGroups()!=0); // a grouped class bool b1 = (inlineGroupedClasses && partOfGroups()!=0); // a grouped class
...@@ -4734,7 +4744,7 @@ bool ClassDef::isExtension() const ...@@ -4734,7 +4744,7 @@ bool ClassDef::isExtension() const
QCString n = name(); QCString n = name();
int si = n.find('('); int si = n.find('(');
int ei = n.find(')'); int ei = n.find(')');
bool b = ei>si && n.mid(si+1,ei-si-1).stripWhiteSpace().isEmpty(); bool b = ei>si && n.mid(si+1,ei-si-1).stripWhiteSpace().isEmpty();
return b; return b;
} }
...@@ -4743,3 +4753,8 @@ const ClassSDict *ClassDef::innerClasses() const ...@@ -4743,3 +4753,8 @@ const ClassSDict *ClassDef::innerClasses() const
return m_impl->innerClasses; return m_impl->innerClasses;
} }
const FileList &ClassDef::usedFiles() const
{
return m_impl->files;
}
...@@ -31,6 +31,7 @@ class ClassList; ...@@ -31,6 +31,7 @@ class ClassList;
class ClassSDict; class ClassSDict;
class OutputList; class OutputList;
class FileDef; class FileDef;
class FileList;
class BaseClassList; class BaseClassList;
class NamespaceDef; class NamespaceDef;
class MemberDef; class MemberDef;
...@@ -125,9 +126,6 @@ class ClassDef : public Definition ...@@ -125,9 +126,6 @@ class ClassDef : public Definition
/** returns TRUE if this class has documentation */ /** returns TRUE if this class has documentation */
bool hasDocumentation() const; bool hasDocumentation() const;
/** returns TRUE if this class has a brief description */
bool hasBriefDescription() const;
/** returns TRUE if this class has a non-empty detailed description */ /** returns TRUE if this class has a non-empty detailed description */
bool hasDetailedDescription() const; bool hasDetailedDescription() const;
...@@ -310,6 +308,11 @@ class ClassDef : public Definition ...@@ -310,6 +308,11 @@ class ClassDef : public Definition
const ClassSDict *innerClasses() const; const ClassSDict *innerClasses() const;
QCString title() const; QCString title() const;
QCString generatedFromFiles() const;
const FileList &usedFiles() const;
QCString includeStatement() const;
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
// --- setters ---- // --- setters ----
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
...@@ -318,7 +321,7 @@ class ClassDef : public Definition ...@@ -318,7 +321,7 @@ class ClassDef : public Definition
void insertSubClass(ClassDef *,Protection p,Specifier s,const char *t=0); void insertSubClass(ClassDef *,Protection p,Specifier s,const char *t=0);
void setIncludeFile(FileDef *fd,const char *incName,bool local,bool force); void setIncludeFile(FileDef *fd,const char *incName,bool local,bool force);
void insertMember(MemberDef *); void insertMember(MemberDef *);
void insertUsedFile(const char *); void insertUsedFile(FileDef *);
bool addExample(const char *anchor,const char *name, const char *file); bool addExample(const char *anchor,const char *name, const char *file);
void mergeCategory(ClassDef *category); void mergeCategory(ClassDef *category);
void setNamespace(NamespaceDef *nd); void setNamespace(NamespaceDef *nd);
...@@ -375,6 +378,7 @@ class ClassDef : public Definition ...@@ -375,6 +378,7 @@ class ClassDef : public Definition
void addGroupedInheritedMembers(OutputList &ol,MemberListType lt, void addGroupedInheritedMembers(OutputList &ol,MemberListType lt,
ClassDef *inheritedFrom,const QCString &inheritId); ClassDef *inheritedFrom,const QCString &inheritId);
int countMembersIncludingGrouped(MemberListType lt,ClassDef *inheritedFrom,bool additional); int countMembersIncludingGrouped(MemberListType lt,ClassDef *inheritedFrom,bool additional);
int countInheritanceNodes();
bool visited; bool visited;
......
/****************************************************************************** /******************************************************************************
* *
* *
* *
* Copyright (C) 1997-2013 by Dimitri van Heesch. * Copyright (C) 1997-2013 by Dimitri van Heesch.
* *
* Permission to use, copy, modify, and distribute this software and its * Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby * documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software * granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty. * for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details. * See the GNU General Public License for more details.
* *
...@@ -39,8 +39,8 @@ static int compItems(void *item1,void *item2) ...@@ -39,8 +39,8 @@ static int compItems(void *item1,void *item2)
ClassDef *c2=(ClassDef *)item2; ClassDef *c2=(ClassDef *)item2;
static bool b = Config_getBool("SORT_BY_SCOPE_NAME"); static bool b = Config_getBool("SORT_BY_SCOPE_NAME");
//printf("compItems: %d %s<->%s\n",b,c1->name().data(),c2->name().data()); //printf("compItems: %d %s<->%s\n",b,c1->name().data(),c2->name().data());
if (b) if (b)
{ {
return qstricmp(c1->name(), return qstricmp(c1->name(),
c2->name()); c2->name());
} }
...@@ -76,13 +76,13 @@ bool ClassSDict::declVisible(const ClassDef::CompoundType *filter) const ...@@ -76,13 +76,13 @@ bool ClassSDict::declVisible(const ClassDef::CompoundType *filter) const
ClassDef *cd=0; ClassDef *cd=0;
for (sdi.toFirst();(cd=sdi.current());++sdi) for (sdi.toFirst();(cd=sdi.current());++sdi)
{ {
if (cd->name().find('@')==-1 && if (cd->name().find('@')==-1 &&
(filter==0 || *filter==cd->compoundType()) (filter==0 || *filter==cd->compoundType())
) )
{ {
bool isLink = cd->isLinkable(); bool isLink = cd->isLinkable();
if (isLink || if (isLink ||
(!hideUndocClasses && (!hideUndocClasses &&
(!cd->isLocal() || extractLocalClasses) (!cd->isLocal() || extractLocalClasses)
) )
) )
...@@ -107,8 +107,8 @@ void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *f ...@@ -107,8 +107,8 @@ void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *f
for (sdi.toFirst();(cd=sdi.current());++sdi) for (sdi.toFirst();(cd=sdi.current());++sdi)
{ {
//printf(" ClassSDict::writeDeclaration for %s\n",cd->name().data()); //printf(" ClassSDict::writeDeclaration for %s\n",cd->name().data());
if (cd->name().find('@')==-1 && if (cd->name().find('@')==-1 &&
!cd->isExtension() && !cd->isExtension() &&
(cd->protection()!=Private || extractPrivate) && (cd->protection()!=Private || extractPrivate) &&
(filter==0 || *filter==cd->compoundType()) (filter==0 || *filter==cd->compoundType())
) )
...@@ -119,7 +119,7 @@ void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *f ...@@ -119,7 +119,7 @@ void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *f
if (found) ol.endMemberList(); if (found) ol.endMemberList();
} }
} }
void ClassSDict::writeDocumentation(OutputList &ol,Definition * container) void ClassSDict::writeDocumentation(OutputList &ol,Definition * container)
{ {
static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
...@@ -140,7 +140,7 @@ void ClassSDict::writeDocumentation(OutputList &ol,Definition * container) ...@@ -140,7 +140,7 @@ void ClassSDict::writeDocumentation(OutputList &ol,Definition * container)
// cd->name().data(),cd->getOuterScope(),cd->isEmbeddedInOuterScope(), // cd->name().data(),cd->getOuterScope(),cd->isEmbeddedInOuterScope(),
// container); // container);
if (cd->name().find('@')==-1 && if (cd->name().find('@')==-1 &&
cd->isLinkableInProject() && cd->isLinkableInProject() &&
cd->isEmbeddedInOuterScope() && cd->isEmbeddedInOuterScope() &&
(container==0 || cd->partOfGroups()==0) // if container==0 -> show as part of the group docs, otherwise only show if not part of a group (container==0 || cd->partOfGroups()==0) // if container==0 -> show as part of the group docs, otherwise only show if not part of a group
......
...@@ -17,16 +17,56 @@ ...@@ -17,16 +17,56 @@
#include "docparser.h" #include "docparser.h"
#include "htmlgen.h" #include "htmlgen.h"
#include "htmldocvisitor.h" #include "htmldocvisitor.h"
#include "dot.h"
#include "diagram.h"
struct ContextGlobals
{
enum OutputFormat
{
Html,
LateX,
Rtf,
ManPage,
DocBook,
Xml,
TagFile
};
int dynSectionId;
QCString outputDir;
OutputFormat outputFormat;
} g_globals;
/** @brief Scoped smart pointer */
template<class T> class ScopedPtr
{
private:
T *m_ptr;
ScopedPtr(const ScopedPtr &);
ScopedPtr &operator=(const ScopedPtr &);
void operator==(const ScopedPtr &) const;
void operator!=(const ScopedPtr &) const;
public:
typedef T Type;
explicit ScopedPtr(T *p=0) : m_ptr(p) {}
~ScopedPtr() { delete m_ptr; };
T &operator*() const { return *m_ptr; }
T *operator->() const { return m_ptr; }
T *get() const { return m_ptr; }
operator bool() const { return m_ptr!=0; }
void reset(T *p=0) { if (p!=m_ptr) { delete m_ptr; m_ptr = p; } }
};
// iterator support // iterator support
template<class T> template<class T>
class GenericConstIterator : public TemplateListIntf::ConstIterator class GenericConstIterator : public TemplateListIntf::ConstIterator
{ {
public: public:
GenericConstIterator(const QList<T> &list) GenericConstIterator(const QList<T> &list)
: m_it(list) { } : m_it(list) { }
virtual ~GenericConstIterator() {} virtual ~GenericConstIterator() {}
void toFirst() void toFirst()
{ {
m_it.toFirst(); m_it.toFirst();
} }
...@@ -105,11 +145,16 @@ class GenericNodeListContext : public TemplateListIntf ...@@ -105,11 +145,16 @@ class GenericNodeListContext : public TemplateListIntf
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** @brief Helper class to map a property name to a handler member function */ /** @brief Helper class to map a property name to a handler member function */
template<typename T>
class PropertyMapper class PropertyMapper
{ {
public: private:
struct PropertyFunc struct PropertyFuncIntf
{
virtual ~PropertyFuncIntf() {}
virtual TemplateVariant operator()() const = 0;
};
template<typename T>
struct PropertyFunc : public PropertyFuncIntf
{ {
typedef TemplateVariant (T::*Handler)() const; typedef TemplateVariant (T::*Handler)() const;
PropertyFunc(const T *o,Handler h) : obj(o), handler(h) {} PropertyFunc(const T *o,Handler h) : obj(o), handler(h) {}
...@@ -120,24 +165,41 @@ class PropertyMapper ...@@ -120,24 +165,41 @@ class PropertyMapper
const T *obj; const T *obj;
Handler handler; Handler handler;
}; };
public:
PropertyMapper() { m_map.setAutoDelete(TRUE); } PropertyMapper() { m_map.setAutoDelete(TRUE); }
TemplateVariant get(const char *n)
/** Add a property to the map
* @param[in] name The name of the property to add.
* @param[in] obj The object handling access to the property.
* @param[in] handle The method to call when the property is accessed.
*/
template<typename T>
void addProperty(const char *name,const T* obj,
typename PropertyFunc<T>::Handler handle)
{
m_map.insert(name,new PropertyFunc<T>(obj,handle));
}
/** Gets the value of a property.
* @param[in] name The name of the property.
* @returns A variant representing the properties value or an
* invalid variant if it was not found.
*/
TemplateVariant get(const char *name) const
{ {
//printf("PropertyMapper::get(%s)\n",n); //printf("PropertyMapper::get(%s)\n",name);
TemplateVariant result; TemplateVariant result;
PropertyFunc *func = m_map.find(n); PropertyFuncIntf *func = m_map.find(name);
if (func) if (func)
{ {
result = (*func)(); result = (*func)();
} }
return result; return result;
} }
void insert(const char *name,const PropertyFunc *func)
{
m_map.insert(name,func);
}
private: private:
QDict<PropertyFunc> m_map; QDict<PropertyFuncIntf> m_map;
}; };
...@@ -213,7 +275,7 @@ TemplateVariant ConfigContext::get(const char *name) const ...@@ -213,7 +275,7 @@ TemplateVariant ConfigContext::get(const char *name) const
//%% struct Doxygen: global information //%% struct Doxygen: global information
//%% { //%% {
class DoxygenContext::Private : public PropertyMapper<DoxygenContext::Private> class DoxygenContext::Private : public PropertyMapper
{ {
public: public:
TemplateVariant version() const TemplateVariant version() const
...@@ -227,9 +289,9 @@ class DoxygenContext::Private : public PropertyMapper<DoxygenContext::Private> ...@@ -227,9 +289,9 @@ class DoxygenContext::Private : public PropertyMapper<DoxygenContext::Private>
Private() Private()
{ {
//%% string version //%% string version
insert("version",new PropertyFunc(this,&Private::version)); addProperty("version",this,&Private::version); //makeProperty(this,&Private::version));
//%% string date //%% string date
insert("date", new PropertyFunc(this,&Private::date)); addProperty("date", this,&Private::date);
} }
}; };
//%% } //%% }
...@@ -253,14 +315,31 @@ TemplateVariant DoxygenContext::get(const char *n) const ...@@ -253,14 +315,31 @@ TemplateVariant DoxygenContext::get(const char *n) const
//%% struct Translator: translation methods //%% struct Translator: translation methods
//%% { //%% {
class TranslateContext::Private : public PropertyMapper<TranslateContext::Private> class TranslateContext::Private : public PropertyMapper
{ {
public: public:
static QCString generatedAtFunc(const void *obj,const QValueList<TemplateVariant> &args)
static TemplateVariant generatedAtFunc(const void *obj,const QValueList<TemplateVariant> &args)
{ {
return ((TranslateContext::Private*)obj)->generatedAt(args); return ((TranslateContext::Private*)obj)->generatedAt(args);
} }
QCString generatedAt(const QValueList<TemplateVariant> &args) const static TemplateVariant inheritanceDiagramForFunc(const void *obj,const QValueList<TemplateVariant> &args)
{
return ((TranslateContext::Private*)obj)->inheritanceDiagramFor(args);
}
static TemplateVariant inheritsListFunc(const void *obj,const QValueList<TemplateVariant> &args)
{
return ((TranslateContext::Private*)obj)->inheritsList(args);
}
static TemplateVariant inheritedByListFunc(const void *obj,const QValueList<TemplateVariant> &args)
{
return ((TranslateContext::Private*)obj)->inheritedByList(args);
}
static TemplateVariant collaborationDiagramForFunc(const void *obj,const QValueList<TemplateVariant> &args)
{
return ((TranslateContext::Private*)obj)->collaborationDiagramFor(args);
}
TemplateVariant generatedAt(const QValueList<TemplateVariant> &args) const
{ {
if (args.count()==2) if (args.count()==2)
{ {
...@@ -268,11 +347,61 @@ class TranslateContext::Private : public PropertyMapper<TranslateContext::Privat ...@@ -268,11 +347,61 @@ class TranslateContext::Private : public PropertyMapper<TranslateContext::Privat
} }
else else
{ {
err("tr.generateAt should take two parameters!\n"); err("tr.generateAt should take two parameters, got %d!\n",args.count());
}
return TemplateVariant();
}
TemplateVariant inheritanceDiagramFor(const QValueList<TemplateVariant> &args) const
{
if (args.count()==1)
{
return theTranslator->trClassDiagram(args[0].toString());
}
else
{
err("tr.inheritanceDiagramFor should take one parameter, got %d!\n",args.count());
}
return TemplateVariant();
}
TemplateVariant collaborationDiagramFor(const QValueList<TemplateVariant> &args) const
{
if (args.count()==1)
{
return theTranslator->trCollaborationDiagram(args[0].toString());
}
else
{
err("tr.collaborationDiagramFor should take one parameter, got %d!\n",args.count());
}
return TemplateVariant();
}
TemplateVariant inheritsList(const QValueList<TemplateVariant> &args) const
{
if (args.count()==1)
{
return theTranslator->trInheritsList(args[0].toInt());
}
else
{
err("tr.inheritsList should take one integer parameter, got %d!\n",args.count());
}
return TemplateVariant();
}
QCString inheritedByList(const QValueList<TemplateVariant> &args) const
{
if (args.count()==1)
{
return theTranslator->trInheritedByList(args[0].toInt());
}
else
{
err("tr.inheritedByList should take one integer parameter, got %d!\n",args.count());
} }
return QCString(); return QCString();
} }
TemplateVariant generatedBy() const TemplateVariant generatedBy() const
{ {
return theTranslator->trGeneratedBy(); return theTranslator->trGeneratedBy();
...@@ -281,6 +410,14 @@ class TranslateContext::Private : public PropertyMapper<TranslateContext::Privat ...@@ -281,6 +410,14 @@ class TranslateContext::Private : public PropertyMapper<TranslateContext::Privat
{ {
return TemplateVariant(this,&Private::generatedAtFunc); return TemplateVariant(this,&Private::generatedAtFunc);
} }
TemplateVariant inheritanceDiagramFor() const
{
return TemplateVariant(this,&Private::inheritanceDiagramForFunc);
}
TemplateVariant collaborationDiagramFor() const
{
return TemplateVariant(this,&Private::collaborationDiagramForFunc);
}
TemplateVariant search() const TemplateVariant search() const
{ {
return theTranslator->trSearch(); return theTranslator->trSearch();
...@@ -366,7 +503,7 @@ class TranslateContext::Private : public PropertyMapper<TranslateContext::Privat ...@@ -366,7 +503,7 @@ class TranslateContext::Private : public PropertyMapper<TranslateContext::Privat
return theTranslator->trModulesMembers(); return theTranslator->trModulesMembers();
} }
else else
{ {
return theTranslator->trNamespaceMembers(); return theTranslator->trNamespaceMembers();
} }
} }
...@@ -390,54 +527,70 @@ class TranslateContext::Private : public PropertyMapper<TranslateContext::Privat ...@@ -390,54 +527,70 @@ class TranslateContext::Private : public PropertyMapper<TranslateContext::Privat
{ {
return theTranslator->trDetailedDescription(); return theTranslator->trDetailedDescription();
} }
TemplateVariant inheritsList() const
{
return TemplateVariant(this,&Private::inheritsListFunc);
}
TemplateVariant inheritedByList() const
{
return TemplateVariant(this,&Private::inheritedByListFunc);
}
Private() Private()
{ {
//%% string generatedBy //%% string generatedBy
insert("generatedby", new PropertyFunc(this,&Private::generatedBy)); addProperty("generatedby", this,&Private::generatedBy);
//%% string generatedAt //%% string generatedAt
insert("generatedAt", new PropertyFunc(this,&Private::generatedAt)); addProperty("generatedAt", this,&Private::generatedAt);
//%% string search //%% string search
insert("search", new PropertyFunc(this,&Private::search)); addProperty("search", this,&Private::search);
//%% string mainPage //%% string mainPage
insert("mainPage", new PropertyFunc(this,&Private::mainPage)); addProperty("mainPage", this,&Private::mainPage);
//%% string classes //%% string classes
insert("classes", new PropertyFunc(this,&Private::classes)); addProperty("classes", this,&Private::classes);
//%% string classList //%% string classList
insert("classList", new PropertyFunc(this,&Private::classList)); addProperty("classList", this,&Private::classList);
//%% string classIndex //%% string classIndex
insert("classIndex", new PropertyFunc(this,&Private::classIndex)); addProperty("classIndex", this,&Private::classIndex);
//%% string classHierarchy //%% string classHierarchy
insert("classHierarchy", new PropertyFunc(this,&Private::classHierarchy)); addProperty("classHierarchy", this,&Private::classHierarchy);
//%% string classMembers //%% string classMembers
insert("classMembers", new PropertyFunc(this,&Private::classMembers)); addProperty("classMembers", this,&Private::classMembers);
//%% string modules //%% string modules
insert("modules", new PropertyFunc(this,&Private::modules)); addProperty("modules", this,&Private::modules);
//%% string namespaces //%% string namespaces
insert("namespaces", new PropertyFunc(this,&Private::namespaces)); addProperty("namespaces", this,&Private::namespaces);
//%% string files //%% string files
insert("files", new PropertyFunc(this,&Private::files)); addProperty("files", this,&Private::files);
//%% string pages //%% string pages
insert("pages", new PropertyFunc(this,&Private::pages)); addProperty("pages", this,&Private::pages);
//%% string examples //%% string examples
insert("examples", new PropertyFunc(this,&Private::examples)); addProperty("examples", this,&Private::examples);
//%% string namespaceList //%% string namespaceList
insert("namespaceList", new PropertyFunc(this,&Private::namespaceList)); addProperty("namespaceList", this,&Private::namespaceList);
//%% string namespaceMembers //%% string namespaceMembers
insert("namespaceMembers",new PropertyFunc(this,&Private::namespaceMembers)); addProperty("namespaceMembers", this,&Private::namespaceMembers);
//%% srting fileList //%% srting fileList
insert("fileList", new PropertyFunc(this,&Private::fileList)); addProperty("fileList", this,&Private::fileList);
//%% string fileMembers //%% string fileMembers
insert("fileMembers", new PropertyFunc(this,&Private::fileMembers)); addProperty("fileMembers", this,&Private::fileMembers);
//%% string relatedPagesDescripiton //%% string relatedPagesDescripiton
insert("relatedPagesDesc",new PropertyFunc(this,&Private::relatedPagesDesc)); addProperty("relatedPagesDesc", this,&Private::relatedPagesDesc);
//%% string more //%% string more
insert("more", new PropertyFunc(this,&Private::more)); addProperty("more", this,&Private::more);
//%% string detailedDescription //%% string detailedDescription
insert("detailedDesc", new PropertyFunc(this,&Private::detailedDesc)); addProperty("detailedDesc", this,&Private::detailedDesc);
//%% string inheritanceDiagramFor
addProperty("inheritanceDiagramFor", this,&Private::inheritanceDiagramFor);
//%% string collaborationDiagramFor
addProperty("collaborationDiagramFor", this,&Private::collaborationDiagramFor);
//%% string inheritsList
addProperty("inheritsList", this,&Private::inheritsList);
//%% string inheritedByList
addProperty("inheritedByList", this,&Private::inheritedByList);
m_javaOpt = Config_getBool("OPTIMIZE_OUTPUT_JAVA"); m_javaOpt = Config_getBool("OPTIMIZE_OUTPUT_JAVA");
m_fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); m_fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
m_vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); m_vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL");
} }
private: private:
bool m_javaOpt; bool m_javaOpt;
...@@ -475,11 +628,10 @@ static TemplateVariant parseDoc(Definition *def,const QCString &file,int line, ...@@ -475,11 +628,10 @@ static TemplateVariant parseDoc(Definition *def,const QCString &file,int line,
root->accept(&visitor); root->accept(&visitor);
} }
bool isEmpty = root->isEmpty(); bool isEmpty = root->isEmpty();
if (isEmpty) if (isEmpty)
result = ""; result = "";
else else
result = TemplateVariant(docs); result = TemplateVariant(docs,TRUE);
result.setRaw(TRUE);
delete root; delete root;
return result; return result;
} }
...@@ -488,64 +640,199 @@ static TemplateVariant parseDoc(Definition *def,const QCString &file,int line, ...@@ -488,64 +640,199 @@ static TemplateVariant parseDoc(Definition *def,const QCString &file,int line,
//%% struct Symbol: shared info for all symbols //%% struct Symbol: shared info for all symbols
//%% { //%% {
template<typename T> template<typename T>
class DefinitionContext : public PropertyMapper<T> class DefinitionContext : public PropertyMapper
{ {
public: public:
DefinitionContext(const T *super,Definition *d) : m_def(d), m_detailsCached(FALSE) DefinitionContext(Definition *d) : m_def(d)
{ {
//%% string name: the name of the symbol //%% string name: the name of the symbol
PropertyMapper<T>::insert("name", new typename PropertyMapper<T>::PropertyFunc(super,&DefinitionContext::name)); addProperty("name",this,&DefinitionContext::name);
//%% string bareName: the bare name of the symbol with scope info
addProperty("bareName",this,&DefinitionContext::bareName);
//%% string relPath: the relative path to the root of the output (CREATE_SUBDIRS) //%% string relPath: the relative path to the root of the output (CREATE_SUBDIRS)
PropertyMapper<T>::insert("relPath", new typename PropertyMapper<T>::PropertyFunc(super,&DefinitionContext::relPath)); addProperty("relPath",this,&DefinitionContext::relPath);
//%% string fileName: the file name of the output file associated with the symbol (without extension) //%% string fileName: the file name of the output file associated with the symbol (without extension)
PropertyMapper<T>::insert("fileName", new typename PropertyMapper<T>::PropertyFunc(super,&DefinitionContext::fileName)); addProperty("fileName",this,&DefinitionContext::fileName);
//%% string anchor: anchor within the page
addProperty("anchor",this,&DefinitionContext::anchor);
//%% string details: the detailed documentation for this symbol //%% string details: the detailed documentation for this symbol
PropertyMapper<T>::insert("details", new typename PropertyMapper<T>::PropertyFunc(super,&DefinitionContext::details)); addProperty("details",this,&DefinitionContext::details);
//%% string brief: the brief description for this symbol //%% string brief: the brief description for this symbol
PropertyMapper<T>::insert("brief", new typename PropertyMapper<T>::PropertyFunc(super,&DefinitionContext::brief)); addProperty("brief",this,&DefinitionContext::brief);
//%% string sourceFileName: the file name of the source file (without extension)
addProperty("sourceFileName",this,&DefinitionContext::sourceFileName);
//%% bool isLinkable: can the symbol be linked to?
addProperty("isLinkable",this,&DefinitionContext::isLinkable);
//%% bool isLinkableInProject: can the symbol be linked within this project?
addProperty("isLinkableInProject",this,&DefinitionContext::isLinkableInProject);
//%% int dynSectionId: identifier that can be used for collapsable sections
addProperty("dynSectionId",this,&DefinitionContext::dynSectionId);
//%% string language: the programming language in which the symbol is written
addProperty("language",this,&DefinitionContext::language);
} }
TemplateVariant fileName() const TemplateVariant fileName() const
{ {
return TemplateVariant(m_def->getOutputFileBase()); return m_def->getOutputFileBase();
}
TemplateVariant anchor() const
{
return m_def->anchor();
}
TemplateVariant sourceFileName() const
{
return m_def->getSourceFileBase();
}
TemplateVariant isLinkable() const
{
return m_def->isLinkable();
}
TemplateVariant isLinkableInProject() const
{
return m_def->isLinkableInProject();
} }
TemplateVariant name() const TemplateVariant name() const
{ {
return m_def->displayName(); return m_def->displayName(TRUE);
} }
TemplateVariant relPath() const TemplateVariant bareName() const
{
return m_def->displayName(FALSE);
}
QCString relPathAsString() const
{ {
static bool createSubdirs = Config_getBool("CREATE_SUBDIRS"); static bool createSubdirs = Config_getBool("CREATE_SUBDIRS");
return createSubdirs ? TemplateVariant("../../") : TemplateVariant(""); return createSubdirs ? QCString("../../") : QCString("");
}
TemplateVariant relPath() const
{
return relPathAsString();
} }
TemplateVariant details() const TemplateVariant details() const
{ {
if (!m_detailsCached) if (!m_details)
{ {
m_details = parseDoc(m_def,m_def->docFile(),m_def->docLine(), m_details.reset(new TemplateVariant(parseDoc(m_def,m_def->docFile(),m_def->docLine(),
relPath().toString(),m_def->documentation(),FALSE); relPathAsString(),m_def->documentation(),FALSE)));
m_detailsCached = TRUE;
} }
return m_details; return *m_details;
} }
TemplateVariant brief() const TemplateVariant brief() const
{ {
if (!m_briefCached) if (!m_brief)
{
if (m_def->hasBriefDescription())
{
m_brief.reset(new TemplateVariant(parseDoc(m_def,m_def->briefFile(),m_def->briefLine(),
relPathAsString(),m_def->briefDescription(),TRUE)));
}
else
{
m_brief.reset(new TemplateVariant(""));
}
}
return *m_brief;
}
TemplateVariant dynSectionId() const
{
return g_globals.dynSectionId;
}
TemplateVariant language() const
{
SrcLangExt lang = m_def->getLanguage();
QCString result = "unknown";
switch (lang)
{ {
m_brief = parseDoc(m_def,m_def->briefFile(),m_def->briefLine(), case SrcLangExt_Unknown: break;
relPath().toString(),m_def->briefDescription(),TRUE); case SrcLangExt_IDL: result="idl"; break;
m_briefCached = TRUE; case SrcLangExt_Java: result="java"; break;
case SrcLangExt_CSharp: result="csharp"; break;
case SrcLangExt_D: result="d"; break;
case SrcLangExt_PHP: result="php"; break;
case SrcLangExt_ObjC: result="objc"; break;
case SrcLangExt_Cpp: result="cpp"; break;
case SrcLangExt_JS: result="js"; break;
case SrcLangExt_Python: result="python"; break;
case SrcLangExt_Fortran: result="fortran"; break;
case SrcLangExt_VHDL: result="vhdl"; break;
case SrcLangExt_XML: result="xml"; break;
case SrcLangExt_Tcl: result="tcl"; break;
case SrcLangExt_Markdown: result="markdown"; break;
} }
return m_brief; return result;
} }
private: private:
Definition *m_def; Definition *m_def;
mutable bool m_detailsCached; mutable ScopedPtr<TemplateVariant> m_details;
mutable TemplateVariant m_details; mutable ScopedPtr<TemplateVariant> m_brief;
mutable bool m_briefCached; };
mutable TemplateVariant m_brief; //%% }
//------------------------------------------------------------------------
//%% struct IncludeInfo: include file information
//%% {
class IncludeInfoContext::Private : public PropertyMapper
{
public:
Private(IncludeInfo *info,SrcLangExt lang) :
m_info(info),
m_fileContext(info && info->fileDef ? info->fileDef : 0),
m_lang(lang)
{
if (m_info)
{
addProperty("file",this,&Private::file);
addProperty("name",this,&Private::name);
addProperty("isImport",this,&Private::isImport);
addProperty("isLocal",this,&Private::isLocal);
}
}
TemplateVariant isLocal() const
{
bool isIDLorJava = m_lang==SrcLangExt_IDL || m_lang==SrcLangExt_Java;
return m_info->local || isIDLorJava;
}
TemplateVariant isImport() const
{
return m_info->imported;
}
TemplateVariant file() const
{
if (m_info->fileDef)
{
return &m_fileContext;
}
else
{
return FALSE;
}
}
TemplateVariant name() const
{
return m_info->includeName;
}
private:
IncludeInfo *m_info;
FileContext m_fileContext;
SrcLangExt m_lang;
}; };
IncludeInfoContext::IncludeInfoContext(IncludeInfo *info,SrcLangExt lang)
{
p = new Private(info,lang);
}
IncludeInfoContext::~IncludeInfoContext()
{
delete p;
}
TemplateVariant IncludeInfoContext::get(const char *n) const
{
return p->get(n);
}
//%% } //%% }
//------------------------------------------------------------------------ //------------------------------------------------------------------------
...@@ -555,13 +842,57 @@ class DefinitionContext : public PropertyMapper<T> ...@@ -555,13 +842,57 @@ class DefinitionContext : public PropertyMapper<T>
class ClassContext::Private : public DefinitionContext<ClassContext::Private> class ClassContext::Private : public DefinitionContext<ClassContext::Private>
{ {
public: public:
Private(ClassDef *cd) : DefinitionContext(this,cd) , m_classDef(cd) Private(ClassDef *cd) : DefinitionContext(cd) ,
{ m_classDef(cd), m_usedFiles(cd),
insert("title", new PropertyFunc(this,&Private::title)); m_includeInfo(cd ? cd->includeInfo() : 0, cd ? cd->getLanguage() : SrcLangExt_Unknown)
insert("highlight", new PropertyFunc(this,&Private::highlight)); {
insert("subhighlight", new PropertyFunc(this,&Private::subHighlight)); addProperty("title", this,&Private::title);
insert("hasBrief", new PropertyFunc(this,&Private::hasBrief)); addProperty("highlight", this,&Private::highlight);
insert("hasDetails", new PropertyFunc(this,&Private::hasDetails)); addProperty("subhighlight", this,&Private::subHighlight);
addProperty("hasDetails", this,&Private::hasDetails);
addProperty("generatedFromFiles", this,&Private::generatedFromFiles);
addProperty("usedFiles", this,&Private::usedFiles);
addProperty("hasInheritanceDiagram", this,&Private::hasInheritanceDiagram);
addProperty("inheritanceDiagram", this,&Private::inheritanceDiagram);
addProperty("hasCollaborationDiagram", this,&Private::hasCollaborationDiagram);
addProperty("collaborationDiagram", this,&Private::collaborationDiagram);
addProperty("includeInfo", this,&Private::includeInfo);
addProperty("includeStatement", this,&Private::includeStatement);
addProperty("inherits", this,&Private::inherits);
addProperty("inheritedBy", this,&Private::inheritedBy);
addProperty("unoIDLServices", this,&Private::unoIDLServices);
addProperty("unoIDLInterfaces", this,&Private::unoIDLInterfaces);
addProperty("signals", this,&Private::signals);
addProperty("publicTypes", this,&Private::publicTypes);
addProperty("publicMethods", this,&Private::publicMethods);
addProperty("publicStaticMethods", this,&Private::publicStaticMethods);
addProperty("publicAttributes", this,&Private::publicAttributes);
addProperty("publicStaticAttributes", this,&Private::publicStaticAttributes);
addProperty("publicSlots", this,&Private::publicSlots);
addProperty("protectedTypes", this,&Private::protectedTypes);
addProperty("protectedMethods", this,&Private::protectedMethods);
addProperty("protectedStaticMethods", this,&Private::protectedStaticMethods);
addProperty("protectedAttributes", this,&Private::protectedAttributes);
addProperty("protectedStaticAttributes", this,&Private::protectedStaticAttributes);
addProperty("protectedSlots", this,&Private::protectedSlots);
addProperty("privateTypes", this,&Private::privateTypes);
addProperty("privateMethods", this,&Private::privateMethods);
addProperty("privateStaticMethods", this,&Private::privateStaticMethods);
addProperty("privateAttributes", this,&Private::privateAttributes);
addProperty("privateStaticAttributes", this,&Private::privateStaticAttributes);
addProperty("privateSlots", this,&Private::privateSlots);
addProperty("packageTypes", this,&Private::packageTypes);
addProperty("packageMethods", this,&Private::packageMethods);
addProperty("packageStaticMethods", this,&Private::packageStaticMethods);
addProperty("packageAttributes", this,&Private::packageAttributes);
addProperty("packageStaticAttributes", this,&Private::packageStaticAttributes);
addProperty("properties", this,&Private::properties);
addProperty("events", this,&Private::events);
addProperty("friends", this,&Private::friends);
addProperty("related", this,&Private::related);
addProperty("nestedClasses", this,&Private::nestedClasses);
addProperty("compoundType", this,&Private::compoundType);
addProperty("templateDecls", this,&Private::templateDecls);
} }
TemplateVariant title() const TemplateVariant title() const
{ {
...@@ -575,21 +906,422 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private> ...@@ -575,21 +906,422 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
{ {
return TemplateVariant(""); return TemplateVariant("");
} }
TemplateVariant hasBrief() const
{
return m_classDef->hasBriefDescription();
}
TemplateVariant hasDetails() const TemplateVariant hasDetails() const
{ {
return m_classDef->hasDetailedDescription(); return m_classDef->hasDetailedDescription();
} }
TemplateVariant generatedFromFiles() const
{
return m_classDef->generatedFromFiles();
}
TemplateVariant usedFiles() const
{
return TemplateVariant(&m_usedFiles);
}
DotClassGraph *getClassGraph() const
{
if (!m_cache.classGraph)
{
m_cache.classGraph.reset(new DotClassGraph(m_classDef,DotNode::Inheritance));
}
return m_cache.classGraph.get();
}
int numInheritanceNodes() const
{
if (m_cache.inheritanceNodes==-1)
{
m_cache.inheritanceNodes=m_classDef->countInheritanceNodes();
}
return m_cache.inheritanceNodes>0;
}
TemplateVariant hasInheritanceDiagram() const
{
bool result=FALSE;
static bool haveDot = Config_getBool("HAVE_DOT");
static bool classDiagrams = Config_getBool("CLASS_DIAGRAMS");
static bool classGraph = Config_getBool("CLASS_GRAPH");
if (haveDot && (classDiagrams || classGraph))
{
DotClassGraph *cg = getClassGraph();
result = !cg->isTrivial() && !cg->isTooBig();
}
else if (classDiagrams)
{
result = numInheritanceNodes()>0;
}
return result;
}
TemplateVariant inheritanceDiagram() const
{
QGString result;
static bool haveDot = Config_getBool("HAVE_DOT");
static bool classDiagrams = Config_getBool("CLASS_DIAGRAMS");
static bool classGraph = Config_getBool("CLASS_GRAPH");
if (haveDot && (classDiagrams || classGraph))
{
DotClassGraph *cg = getClassGraph();
FTextStream t(&result);
cg->writeGraph(t,BITMAP,
g_globals.outputDir,
m_classDef->getOutputFileBase()+Doxygen::htmlFileExtension,
relPathAsString(),TRUE,TRUE,g_globals.dynSectionId
);
}
else if (classDiagrams)
{
ClassDiagram d(m_classDef);
FTextStream t(&result);
QCString name = convertToHtml(m_classDef->displayName());
t << "<div class=\"center\">" << endl;
t << "<img src=\"";
t << relPathAsString() << m_classDef->getOutputFileBase();
t << ".png\" usemap=\"#" << name << "_map\" alt=\"\"/>" << endl;
t << "<map id=\"" << name << "_map\" name=\"" << name << "_map\">" << endl;
d.writeImage(t,g_globals.outputDir,
relPathAsString(),
m_classDef->getOutputFileBase());
t << "</div>";
}
g_globals.dynSectionId++;
return TemplateVariant(result.data(),TRUE);
}
DotClassGraph *getCollaborationGraph() const
{
if (!m_cache.collaborationGraph)
{
m_cache.collaborationGraph.reset(new DotClassGraph(m_classDef,DotNode::Collaboration));
}
return m_cache.collaborationGraph.get();
}
TemplateVariant hasCollaborationDiagram() const
{
static bool haveDot = Config_getBool("HAVE_DOT");
return haveDot && !getCollaborationGraph()->isTrivial();
}
TemplateVariant collaborationDiagram() const
{
static bool haveDot = Config_getBool("HAVE_DOT");
QGString result;
if (haveDot)
{
DotClassGraph *cg = getCollaborationGraph();
FTextStream t(&result);
cg->writeGraph(t,BITMAP,
g_globals.outputDir,
m_classDef->getOutputFileBase()+Doxygen::htmlFileExtension,
relPathAsString(),TRUE,TRUE,g_globals.dynSectionId
);
}
g_globals.dynSectionId++;
return TemplateVariant(result.data(),TRUE);
}
TemplateVariant includeInfo() const
{
if (m_classDef->includeInfo())
{
return TemplateVariant(&m_includeInfo);
}
else
{
return TemplateVariant(FALSE);
}
}
TemplateVariant includeStatement() const
{
return m_classDef->includeStatement();
}
TemplateVariant inherits() const
{
if (!m_cache.inheritsList)
{
m_cache.inheritsList.reset(new InheritanceListContext(m_classDef->baseClasses(),TRUE));
}
return m_cache.inheritsList.get();
}
TemplateVariant inheritedBy() const
{
if (!m_cache.inheritedByList)
{
m_cache.inheritedByList.reset(new InheritanceListContext(m_classDef->subClasses(),FALSE));
}
return m_cache.inheritedByList.get();
}
TemplateVariant getMemberList(ScopedPtr<MemberListInfoContext> &list,
MemberListType type,const char *title) const
{
if (!list)
{
MemberList *ml = m_classDef->getMemberList(type);
if (ml)
{
list.reset(new MemberListInfoContext(ml,title));
}
}
if (list)
{
return list.get();
}
else
{
return TemplateVariant(FALSE);
}
}
TemplateVariant unoIDLServices() const
{
return getMemberList(m_cache.unoIDLServices,MemberListType_services,theTranslator->trServices());
}
TemplateVariant unoIDLInterfaces() const
{
return getMemberList(m_cache.unoIDLInterfaces,MemberListType_interfaces,theTranslator->trInterfaces());
}
TemplateVariant signals() const
{
return getMemberList(m_cache.signals,MemberListType_signals,theTranslator->trSignals());
}
TemplateVariant publicTypes() const
{
return getMemberList(m_cache.publicTypes,MemberListType_pubTypes,theTranslator->trPublicTypes());
}
TemplateVariant publicMethods() const
{
return getMemberList(m_cache.publicMethods,MemberListType_pubMethods,
m_classDef->getLanguage()==SrcLangExt_ObjC ? theTranslator->trInstanceMethods()
: theTranslator->trPublicMembers());
}
TemplateVariant publicStaticMethods() const
{
return getMemberList(m_cache.publicStaticMethods,MemberListType_pubStaticMethods,
m_classDef->getLanguage()==SrcLangExt_ObjC ? theTranslator->trClassMethods()
: theTranslator->trStaticPublicMembers());
}
TemplateVariant publicAttributes() const
{
return getMemberList(m_cache.publicAttributes,MemberListType_pubAttribs,theTranslator->trPublicAttribs());
}
TemplateVariant publicStaticAttributes() const
{
return getMemberList(m_cache.publicStaticAttributes,MemberListType_pubStaticAttribs,theTranslator->trStaticPublicAttribs());
}
TemplateVariant publicSlots() const
{
return getMemberList(m_cache.publicSlots,MemberListType_pubSlots,theTranslator->trPublicSlots());
}
TemplateVariant protectedTypes() const
{
return getMemberList(m_cache.protectedTypes,MemberListType_proTypes,theTranslator->trProtectedTypes());
}
TemplateVariant protectedMethods() const
{
return getMemberList(m_cache.protectedMethods,MemberListType_proMethods,theTranslator->trProtectedMembers());
}
TemplateVariant protectedStaticMethods() const
{
return getMemberList(m_cache.protectedStaticMethods,MemberListType_proStaticMethods,theTranslator->trStaticProtectedMembers());
}
TemplateVariant protectedAttributes() const
{
return getMemberList(m_cache.protectedAttributes,MemberListType_proAttribs,theTranslator->trProtectedAttribs());
}
TemplateVariant protectedStaticAttributes() const
{
return getMemberList(m_cache.protectedStaticAttributes,MemberListType_proStaticAttribs,theTranslator->trStaticProtectedAttribs());
}
TemplateVariant protectedSlots() const
{
return getMemberList(m_cache.protectedSlots,MemberListType_proSlots,theTranslator->trProtectedSlots());
}
TemplateVariant privateTypes() const
{
return getMemberList(m_cache.privateTypes,MemberListType_priTypes,theTranslator->trPrivateTypes());
}
TemplateVariant privateSlots() const
{
return getMemberList(m_cache.privateSlots,MemberListType_priSlots,theTranslator->trPrivateSlots());
}
TemplateVariant privateMethods() const
{
return getMemberList(m_cache.privateMethods,MemberListType_priMethods,theTranslator->trPrivateMembers());
}
TemplateVariant privateStaticMethods() const
{
return getMemberList(m_cache.privateStaticMethods,MemberListType_priStaticMethods,theTranslator->trStaticPrivateMembers());
}
TemplateVariant privateAttributes() const
{
return getMemberList(m_cache.privateAttributes,MemberListType_priAttribs,theTranslator->trPrivateAttribs());
}
TemplateVariant privateStaticAttributes() const
{
return getMemberList(m_cache.privateStaticAttributes,MemberListType_priStaticAttribs,theTranslator->trStaticPrivateAttribs());
}
TemplateVariant packageTypes() const
{
return getMemberList(m_cache.packageTypes,MemberListType_pacTypes,theTranslator->trPackageTypes());
}
TemplateVariant packageMethods() const
{
return getMemberList(m_cache.packageMethods,MemberListType_pacMethods,theTranslator->trPackageMembers());
}
TemplateVariant packageStaticMethods() const
{
return getMemberList(m_cache.packageStaticMethods,MemberListType_pacStaticMethods,theTranslator->trStaticPackageMembers());
}
TemplateVariant packageAttributes() const
{
return getMemberList(m_cache.packageAttributes,MemberListType_pacAttribs,theTranslator->trPackageAttribs());
}
TemplateVariant packageStaticAttributes() const
{
return getMemberList(m_cache.packageStaticAttributes,MemberListType_pacStaticAttribs,theTranslator->trStaticPackageAttribs());
}
TemplateVariant properties() const
{
return getMemberList(m_cache.properties,MemberListType_properties,theTranslator->trProperties());
}
TemplateVariant events() const
{
return getMemberList(m_cache.events,MemberListType_events,theTranslator->trEvents());
}
TemplateVariant friends() const
{
return getMemberList(m_cache.events,MemberListType_friends,theTranslator->trFriends());
}
TemplateVariant related() const
{
return getMemberList(m_cache.events,MemberListType_related,theTranslator->trRelatedFunctions());
}
TemplateVariant nestedClasses() const
{
static bool extractPrivate = Config_getBool("EXTRACT_PRIVATE");
static bool hideUndocClasses = Config_getBool("HIDE_UNDOC_CLASSES");
static bool extractLocalClasses = Config_getBool("EXTRACT_LOCAL_CLASSES");
if (!m_cache.nestedClasses)
{
if (m_classDef->getClassSDict())
{
NestedClassListContext *classList = new NestedClassListContext;
ClassSDict::Iterator sdi(*m_classDef->getClassSDict());
ClassDef *cd;
for (sdi.toFirst();(cd=sdi.current());++sdi)
{
bool linkable = cd->isLinkable();
if (cd->name().find('@')==-1 && !cd->isExtension() &&
(cd->protection()!=::Private || extractPrivate) &&
(linkable ||
(!hideUndocClasses && (!cd->isLocal() || extractLocalClasses)))
)
{
classList->append(cd);
}
}
m_cache.nestedClasses.reset(classList);
}
}
if (m_cache.nestedClasses)
{
return m_cache.nestedClasses.get();
}
else
{
return TemplateVariant(FALSE);
}
}
TemplateVariant compoundType() const
{
return m_classDef->compoundTypeString();
}
void addTemplateDecls(Definition *d,TemplateList *tl) const
{
if (d->definitionType()==Definition::TypeClass)
{
Definition *parent = d->getOuterScope();
if (parent)
{
addTemplateDecls(parent,tl);
}
ClassDef *cd=(ClassDef *)d;
if (cd->templateArguments())
{
ArgumentListContext *al = new ArgumentListContext(cd->templateArguments());
// since a TemplateVariant does take ownership of the object, we add it
// a separate list just to be able to delete it and avoid a memory leak
m_cache.templateArgList.append(al);
tl->append(al);
}
}
}
TemplateVariant templateDecls() const
{
if (!m_cache.templateDecls)
{
TemplateList *tl = new TemplateList;
addTemplateDecls(m_classDef,tl);
m_cache.templateDecls.reset(tl);
}
if (m_cache.templateDecls)
{
return m_cache.templateDecls.get();
}
else
{
return TemplateVariant(FALSE);
}
}
private: private:
ClassDef *m_classDef; ClassDef *m_classDef;
UsedFilesContext m_usedFiles;
IncludeInfoContext m_includeInfo;
struct Cachable
{
Cachable() : inheritanceNodes(-1) { templateArgList.setAutoDelete(TRUE); }
ScopedPtr<InheritanceListContext> inheritsList;
ScopedPtr<InheritanceListContext> inheritedByList;
ScopedPtr<DotClassGraph> classGraph;
ScopedPtr<DotClassGraph> collaborationGraph;
ScopedPtr<NestedClassListContext> nestedClasses;
ScopedPtr<MemberListInfoContext> publicTypes;
ScopedPtr<MemberListInfoContext> publicMethods;
ScopedPtr<MemberListInfoContext> publicStaticMethods;
ScopedPtr<MemberListInfoContext> publicAttributes;
ScopedPtr<MemberListInfoContext> publicStaticAttributes;
ScopedPtr<MemberListInfoContext> publicSlots;
ScopedPtr<MemberListInfoContext> protectedTypes;
ScopedPtr<MemberListInfoContext> protectedMethods;
ScopedPtr<MemberListInfoContext> protectedStaticMethods;
ScopedPtr<MemberListInfoContext> protectedAttributes;
ScopedPtr<MemberListInfoContext> protectedStaticAttributes;
ScopedPtr<MemberListInfoContext> protectedSlots;
ScopedPtr<MemberListInfoContext> privateTypes;
ScopedPtr<MemberListInfoContext> privateMethods;
ScopedPtr<MemberListInfoContext> privateStaticMethods;
ScopedPtr<MemberListInfoContext> privateAttributes;
ScopedPtr<MemberListInfoContext> privateStaticAttributes;
ScopedPtr<MemberListInfoContext> privateSlots;
ScopedPtr<MemberListInfoContext> packageTypes;
ScopedPtr<MemberListInfoContext> packageMethods;
ScopedPtr<MemberListInfoContext> packageStaticMethods;
ScopedPtr<MemberListInfoContext> packageAttributes;
ScopedPtr<MemberListInfoContext> packageStaticAttributes;
ScopedPtr<MemberListInfoContext> unoIDLServices;
ScopedPtr<MemberListInfoContext> unoIDLInterfaces;
ScopedPtr<MemberListInfoContext> signals;
ScopedPtr<MemberListInfoContext> properties;
ScopedPtr<MemberListInfoContext> events;
ScopedPtr<MemberListInfoContext> friends;
ScopedPtr<MemberListInfoContext> related;
ScopedPtr<TemplateList> templateDecls;
int inheritanceNodes;
QList<ArgumentListContext> templateArgList;
};
mutable Cachable m_cache;
}; };
//%% } //%% }
ClassContext::ClassContext(ClassDef *cd) ClassContext::ClassContext(ClassDef *cd)
{ {
//printf("ClassContext::ClassContext(%s)\n",cd?cd->name().data():"<none>");
p = new Private(cd); p = new Private(cd);
} }
...@@ -610,11 +1342,11 @@ TemplateVariant ClassContext::get(const char *n) const ...@@ -610,11 +1342,11 @@ TemplateVariant ClassContext::get(const char *n) const
class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Private> class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Private>
{ {
public: public:
Private(NamespaceDef *nd) : DefinitionContext(this,nd) , m_namespaceDef(nd) Private(NamespaceDef *nd) : DefinitionContext(nd) , m_namespaceDef(nd)
{ {
insert("title", new PropertyFunc(this,&Private::title)); addProperty("title",this,&Private::title);
insert("highlight", new PropertyFunc(this,&Private::highlight)); addProperty("highlight",this,&Private::highlight);
insert("subhighlight", new PropertyFunc(this,&Private::subHighlight)); addProperty("subhighlight",this,&Private::subHighlight);
} }
TemplateVariant title() const TemplateVariant title() const
{ {
...@@ -655,15 +1387,16 @@ TemplateVariant NamespaceContext::get(const char *n) const ...@@ -655,15 +1387,16 @@ TemplateVariant NamespaceContext::get(const char *n) const
class FileContext::Private : public DefinitionContext<FileContext::Private> class FileContext::Private : public DefinitionContext<FileContext::Private>
{ {
public: public:
Private(FileDef *fd) : DefinitionContext(this,fd) , m_fileDef(fd) Private(FileDef *fd) : DefinitionContext(fd) , m_fileDef(fd)
{ {
insert("title", new PropertyFunc(this,&Private::title)); addProperty("title",this,&Private::title);
insert("highlight", new PropertyFunc(this,&Private::highlight)); addProperty("highlight",this,&Private::highlight);
insert("subhighlight", new PropertyFunc(this,&Private::subHighlight)); addProperty("subhighlight",this,&Private::subHighlight);
addProperty("versionInfo",this,&Private::versionInfo);
} }
TemplateVariant title() const TemplateVariant title() const
{ {
return TemplateVariant(m_fileDef->title()); return m_fileDef->title();
} }
TemplateVariant highlight() const TemplateVariant highlight() const
{ {
...@@ -673,6 +1406,10 @@ class FileContext::Private : public DefinitionContext<FileContext::Private> ...@@ -673,6 +1406,10 @@ class FileContext::Private : public DefinitionContext<FileContext::Private>
{ {
return TemplateVariant(""); return TemplateVariant("");
} }
TemplateVariant versionInfo() const
{
return m_fileDef->getVersion();
}
private: private:
FileDef *m_fileDef; FileDef *m_fileDef;
}; };
...@@ -700,12 +1437,12 @@ TemplateVariant FileContext::get(const char *n) const ...@@ -700,12 +1437,12 @@ TemplateVariant FileContext::get(const char *n) const
class DirContext::Private : public DefinitionContext<DirContext::Private> class DirContext::Private : public DefinitionContext<DirContext::Private>
{ {
public: public:
Private(DirDef *dd) : DefinitionContext(this,dd) , m_dirDef(dd) Private(DirDef *dd) : DefinitionContext(dd) , m_dirDef(dd)
{ {
insert("title", new PropertyFunc(this,&Private::title)); addProperty("title",this,&Private::title);
insert("highlight", new PropertyFunc(this,&Private::highlight)); addProperty("highlight",this,&Private::highlight);
insert("subhighlight", new PropertyFunc(this,&Private::subHighlight)); addProperty("subhighlight",this,&Private::subHighlight);
insert("dirName", new PropertyFunc(this,&Private::dirName)); addProperty("dirName",this,&Private::dirName);
} }
TemplateVariant title() const TemplateVariant title() const
{ {
...@@ -751,11 +1488,11 @@ TemplateVariant DirContext::get(const char *n) const ...@@ -751,11 +1488,11 @@ TemplateVariant DirContext::get(const char *n) const
class PageContext::Private : public DefinitionContext<PageContext::Private> class PageContext::Private : public DefinitionContext<PageContext::Private>
{ {
public: public:
Private(PageDef *pd) : DefinitionContext(this,pd) , m_pageDef(pd) Private(PageDef *pd) : DefinitionContext(pd) , m_pageDef(pd)
{ {
insert("title", new PropertyFunc(this,&Private::title)); addProperty("title",this,&Private::title);
insert("highlight", new PropertyFunc(this,&Private::highlight)); addProperty("highlight",this,&Private::highlight);
insert("subhighlight", new PropertyFunc(this,&Private::subHighlight)); addProperty("subhighlight",this,&Private::subHighlight);
} }
TemplateVariant title() const TemplateVariant title() const
{ {
...@@ -789,6 +1526,256 @@ TemplateVariant PageContext::get(const char *n) const ...@@ -789,6 +1526,256 @@ TemplateVariant PageContext::get(const char *n) const
return p->get(n); return p->get(n);
} }
//------------------------------------------------------------------------
class TextGeneratorHtml : public TextGeneratorIntf
{
public:
TextGeneratorHtml(FTextStream &ts,const QCString &relPath)
: m_ts(ts), m_relPath(relPath) {}
void writeString(const char *s,bool keepSpaces) const
{
if (s==0) return;
//printf("TextGeneratorOlImpl::writeString('%s',%d)\n",s,keepSpaces);
if (keepSpaces)
{
const char *p=s;
char c;
while ((c=*p++))
{
switch(c)
{
case '<': m_ts << "&lt;"; break;
case '>': m_ts << "&gt;"; break;
case '\'': m_ts << "&#39;"; break;
case '"': m_ts << "&quot;"; break;
case '&': m_ts << "&amp;"; break;
case ' ': m_ts << "&#160;"; break;
}
}
}
else
{
m_ts << convertToHtml(s);
}
}
void writeBreak(int indent) const
{
m_ts << "<br/>";
for (int i=0;i<indent;i++)
{
m_ts << "&#160;";
}
}
void writeLink(const char *ref,const char *f,
const char *anchor,const char *name
) const
{
if (ref)
{
m_ts << "<a class=\"elRef\" ";
m_ts << externalLinkTarget() << externalRef(m_relPath,ref,FALSE);
}
else
{
m_ts << "<a class=\"el\" ";
}
m_ts << "href=\"";
m_ts << externalRef(m_relPath,ref,TRUE);
if (f) m_ts << f << Doxygen::htmlFileExtension;
if (anchor) m_ts << "#" << anchor;
m_ts << "\">";
m_ts << convertToHtml(name);
m_ts << "</a>";
}
private:
FTextStream &m_ts;
QCString m_relPath;
};
class TextGeneratorFactory
{
public:
static TextGeneratorFactory *instance()
{
static TextGeneratorFactory *instance = 0;
if (instance==0) instance = new TextGeneratorFactory;
return instance;
}
TextGeneratorIntf *create(FTextStream &ts,const QCString &relPath)
{
switch (g_globals.outputFormat)
{
case ContextGlobals::Html:
return new TextGeneratorHtml(ts,relPath);
break;
default:
break;
}
return 0;
}
private:
TextGeneratorFactory() {}
virtual ~TextGeneratorFactory() {}
};
TemplateVariant createLinkedText(Definition *def,const QCString &relPath,const QCString &text)
{
QGString s;
FTextStream ts(&s);
TextGeneratorIntf *tg = TextGeneratorFactory::instance()->create(ts,relPath);
if (tg)
{
linkifyText(*tg,def->getOuterScope(),def->getBodyDef(),def,text);
return TemplateVariant(s.data(),TRUE);
}
else
{
return text;
}
}
//%% struct Member(Symbol): member information
//%% {
class MemberContext::Private : public DefinitionContext<MemberContext::Private>
{
public:
Private(MemberDef *md) : DefinitionContext(md) , m_memberDef(md)
{
addProperty("declType", this,&Private::declType);
addProperty("declArgs", this,&Private::declArgs);
addProperty("isStatic", this,&Private::isStatic);
addProperty("isObjCMethod", this,&Private::isObjCMethod);
addProperty("isObjCProperty", this,&Private::isObjCProperty);
addProperty("isImplementation", this,&Private::isImplementation);
addProperty("isEvent", this,&Private::isEvent);
addProperty("isProperty", this,&Private::isProperty);
addProperty("hasDetails", this,&Private::hasDetails);
addProperty("exception", this,&Private::exception);
addProperty("bitfields", this,&Private::bitfields);
addProperty("initializer", this,&Private::initializer);
addProperty("oneLineInitializer",this,&Private::oneLineInitializer);
addProperty("templateArgs", this,&Private::templateArgs);
addProperty("templateAlias", this,&Private::templateAlias);
addProperty("propertyAttrs", this,&Private::propertyAttrs);
addProperty("eventAttrs", this,&Private::eventAttrs);
if (md && md->isProperty())
{
if (md->isGettable()) m_propertyAttrs.append("get");
if (md->isSettable()) m_propertyAttrs.append("set");
}
if (md && md->isEvent())
{
if (md->isAddable()) m_eventAttrs.append("add");
if (md->isRemovable()) m_eventAttrs.append("remove");
if (md->isRaisable()) m_eventAttrs.append("raise");
}
}
TemplateVariant declType() const
{
return createLinkedText(m_memberDef,relPathAsString(),m_memberDef->getDeclType());
}
TemplateVariant declArgs() const
{
return createLinkedText(m_memberDef,relPathAsString(),m_memberDef->argsString());
}
TemplateVariant exception() const
{
return createLinkedText(m_memberDef,relPathAsString(),m_memberDef->excpString());
}
TemplateVariant bitfields() const
{
return createLinkedText(m_memberDef,relPathAsString(),m_memberDef->bitfieldString());
}
TemplateVariant isStatic() const
{
return m_memberDef->isStatic();
}
TemplateVariant isObjCMethod() const
{
return m_memberDef->isObjCMethod();
}
TemplateVariant isObjCProperty() const
{
return m_memberDef->isObjCProperty();
}
TemplateVariant isImplementation() const
{
return m_memberDef->isImplementation();
}
TemplateVariant isEvent() const
{
return m_memberDef->isEvent();
}
TemplateVariant isProperty() const
{
return m_memberDef->isProperty();
}
TemplateVariant hasDetails() const
{
return m_memberDef->isDetailedSectionLinkable();
}
TemplateVariant initializer() const
{
return m_memberDef->initializer();
}
TemplateVariant oneLineInitializer() const
{
return m_memberDef->hasOneLineInitializer();
}
TemplateVariant templateArgs() const
{
if (!m_templateArgs)
{
m_templateArgs.reset(new ArgumentListContext(m_memberDef->templateArguments()));
}
return m_templateArgs.get();
}
TemplateVariant templateAlias() const
{
if (m_memberDef->isAlias())
{
return createLinkedText(m_memberDef,relPathAsString(),
QCString(" = ")+m_memberDef->typeString());
}
return "";
}
TemplateVariant propertyAttrs() const
{
return &m_propertyAttrs;
}
TemplateVariant eventAttrs() const
{
return &m_eventAttrs;
}
private:
MemberDef *m_memberDef;
mutable ScopedPtr<ArgumentListContext> m_templateArgs;
TemplateList m_propertyAttrs;
TemplateList m_eventAttrs;
};
//%% }
MemberContext::MemberContext(MemberDef *md)
{
p = new Private(md);
}
MemberContext::~MemberContext()
{
delete p;
}
TemplateVariant MemberContext::get(const char *n) const
{
return p->get(n);
}
//------------------------------------------------------------------------ //------------------------------------------------------------------------
//%% struct Module(Symbol): group information //%% struct Module(Symbol): group information
...@@ -796,11 +1783,11 @@ TemplateVariant PageContext::get(const char *n) const ...@@ -796,11 +1783,11 @@ TemplateVariant PageContext::get(const char *n) const
class ModuleContext::Private : public DefinitionContext<ModuleContext::Private> class ModuleContext::Private : public DefinitionContext<ModuleContext::Private>
{ {
public: public:
Private(GroupDef *gd) : DefinitionContext(this,gd) , m_groupDef(gd) Private(GroupDef *gd) : DefinitionContext(gd) , m_groupDef(gd)
{ {
insert("title", new PropertyFunc(this,&Private::title)); addProperty("title",this,&Private::title);
insert("highlight", new PropertyFunc(this,&Private::highlight)); addProperty("highlight",this,&Private::highlight);
insert("subhighlight", new PropertyFunc(this,&Private::subHighlight)); addProperty("subhighlight",this,&Private::subHighlight);
} }
TemplateVariant title() const TemplateVariant title() const
{ {
...@@ -836,6 +1823,47 @@ TemplateVariant ModuleContext::get(const char *n) const ...@@ -836,6 +1823,47 @@ TemplateVariant ModuleContext::get(const char *n) const
//------------------------------------------------------------------------ //------------------------------------------------------------------------
//%% list NestedClassList[Class] : list of nested classes
class NestedClassListContext::Private : public GenericNodeListContext<ClassContext>
{
};
NestedClassListContext::NestedClassListContext()
{
p = new Private;
}
NestedClassListContext::~NestedClassListContext()
{
delete p;
}
// TemplateListIntf
int NestedClassListContext::count() const
{
return p->count();
}
TemplateVariant NestedClassListContext::at(int index) const
{
return p->at(index);
}
TemplateListIntf::ConstIterator *NestedClassListContext::createIterator() const
{
return p->createIterator();
}
void NestedClassListContext::append(ClassDef *cd)
{
if (cd)
{
p->append(new ClassContext(cd));
}
}
//------------------------------------------------------------------------
//%% list ClassList[Class] : list of classes //%% list ClassList[Class] : list of classes
class ClassListContext::Private : public GenericNodeListContext<ClassContext> class ClassListContext::Private : public GenericNodeListContext<ClassContext>
{ {
...@@ -846,8 +1874,8 @@ class ClassListContext::Private : public GenericNodeListContext<ClassContext> ...@@ -846,8 +1874,8 @@ class ClassListContext::Private : public GenericNodeListContext<ClassContext>
ClassDef *cd; ClassDef *cd;
for (cli.toFirst() ; (cd=cli.current()) ; ++cli ) for (cli.toFirst() ; (cd=cli.current()) ; ++cli )
{ {
if (cd->getLanguage()==SrcLangExt_VHDL && if (cd->getLanguage()==SrcLangExt_VHDL &&
((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::PACKAGECLASS || ((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::PACKAGECLASS ||
(VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::PACKBODYCLASS) (VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::PACKBODYCLASS)
) // no architecture ) // no architecture
{ {
...@@ -891,19 +1919,19 @@ TemplateListIntf::ConstIterator *ClassListContext::createIterator() const ...@@ -891,19 +1919,19 @@ TemplateListIntf::ConstIterator *ClassListContext::createIterator() const
//------------------------------------------------------------------------ //------------------------------------------------------------------------
//%% struct ClassInheritanceNode: node in inheritance tree //%% struct ClassInheritanceNode: node in inheritance tree
//%% { //%% {
class ClassInheritanceNodeContext::Private : public PropertyMapper<ClassInheritanceNodeContext::Private> class ClassInheritanceNodeContext::Private : public PropertyMapper
{ {
public: public:
Private(ClassDef *cd) : m_classContext(cd) Private(ClassDef *cd) : m_classContext(cd)
{ {
//%% bool is_leaf_node: true if this node does not have any children //%% bool is_leaf_node: true if this node does not have any children
insert("is_leaf_node", new PropertyFunc(this,&Private::isLeafNode)); addProperty("is_leaf_node",this,&Private::isLeafNode);
//%% ClassInheritance children: list of nested classes/namespaces //%% ClassInheritance children: list of nested classes/namespaces
insert("children", new PropertyFunc(this,&Private::children)); addProperty("children",this,&Private::children);
//%% Class class: class info //%% Class class: class info
insert("class", new PropertyFunc(this,&Private::getClass)); addProperty("class",this,&Private::getClass);
} }
void addChildren(const BaseClassList *bcl,bool hideSuper) void addChildren(const BaseClassList *bcl,bool hideSuper)
{ {
...@@ -911,7 +1939,7 @@ class ClassInheritanceNodeContext::Private : public PropertyMapper<ClassInherita ...@@ -911,7 +1939,7 @@ class ClassInheritanceNodeContext::Private : public PropertyMapper<ClassInherita
BaseClassListIterator bcli(*bcl); BaseClassListIterator bcli(*bcl);
BaseClassDef *bcd; BaseClassDef *bcd;
for (bcli.toFirst() ; (bcd=bcli.current()) ; ++bcli) for (bcli.toFirst() ; (bcd=bcli.current()) ; ++bcli)
{ {
ClassDef *cd=bcd->classDef; ClassDef *cd=bcd->classDef;
if (cd->getLanguage()==SrcLangExt_VHDL && (VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS) if (cd->getLanguage()==SrcLangExt_VHDL && (VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS)
{ {
...@@ -938,11 +1966,11 @@ class ClassInheritanceNodeContext::Private : public PropertyMapper<ClassInherita ...@@ -938,11 +1966,11 @@ class ClassInheritanceNodeContext::Private : public PropertyMapper<ClassInherita
//printf("Class %s at %p visited=%d\n",cd->name().data(),cd,cd->visited); //printf("Class %s at %p visited=%d\n",cd->name().data(),cd,cd->visited);
bool wasVisited=cd->visited; bool wasVisited=cd->visited;
cd->visited=TRUE; cd->visited=TRUE;
if (cd->getLanguage()==SrcLangExt_VHDL) if (cd->getLanguage()==SrcLangExt_VHDL)
{ {
tnc->addChildren(cd->baseClasses(),wasVisited); tnc->addChildren(cd->baseClasses(),wasVisited);
} }
else else
{ {
tnc->addChildren(cd->subClasses(),wasVisited); tnc->addChildren(cd->subClasses(),wasVisited);
} }
...@@ -968,7 +1996,7 @@ class ClassInheritanceNodeContext::Private : public PropertyMapper<ClassInherita ...@@ -968,7 +1996,7 @@ class ClassInheritanceNodeContext::Private : public PropertyMapper<ClassInherita
}; };
//%% } //%% }
ClassInheritanceNodeContext::ClassInheritanceNodeContext(ClassDef *cd) ClassInheritanceNodeContext::ClassInheritanceNodeContext(ClassDef *cd)
{ {
p = new Private(cd); p = new Private(cd);
} }
...@@ -1004,7 +2032,7 @@ class ClassInheritanceContext::Private : public ...@@ -1004,7 +2032,7 @@ class ClassInheritanceContext::Private : public
bool b; bool b;
if (cd->getLanguage()==SrcLangExt_VHDL) if (cd->getLanguage()==SrcLangExt_VHDL)
{ {
if (!(VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::ENTITYCLASS) if (!(VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::ENTITYCLASS)
{ {
continue; continue;
} }
...@@ -1021,8 +2049,8 @@ class ClassInheritanceContext::Private : public ...@@ -1021,8 +2049,8 @@ class ClassInheritanceContext::Private : public
// new root level class // new root level class
ClassInheritanceNodeContext *tnc = new ClassInheritanceNodeContext(cd); ClassInheritanceNodeContext *tnc = new ClassInheritanceNodeContext(cd);
append(tnc); append(tnc);
bool hasChildren = !cd->visited && classHasVisibleChildren(cd); bool hasChildren = !cd->visited && classHasVisibleChildren(cd);
if (cd->getLanguage()==SrcLangExt_VHDL && hasChildren) if (cd->getLanguage()==SrcLangExt_VHDL && hasChildren)
{ {
tnc->addChildren(cd->baseClasses(),cd->visited); tnc->addChildren(cd->baseClasses(),cd->visited);
cd->visited=TRUE; cd->visited=TRUE;
...@@ -1075,9 +2103,9 @@ TemplateListIntf::ConstIterator *ClassInheritanceContext::createIterator() const ...@@ -1075,9 +2103,9 @@ TemplateListIntf::ConstIterator *ClassInheritanceContext::createIterator() const
//------------------------------------------------------------------------ //------------------------------------------------------------------------
//%% struct ClassHierarchy: inheritance tree //%% struct ClassHierarchy: inheritance tree
//%% { //%% {
class ClassHierarchyContext::Private : public PropertyMapper<ClassHierarchyContext::Private> class ClassHierarchyContext::Private : public PropertyMapper
{ {
public: public:
TemplateVariant tree() const TemplateVariant tree() const
...@@ -1102,7 +2130,7 @@ class ClassHierarchyContext::Private : public PropertyMapper<ClassHierarchyConte ...@@ -1102,7 +2130,7 @@ class ClassHierarchyContext::Private : public PropertyMapper<ClassHierarchyConte
} }
TemplateVariant title() const TemplateVariant title() const
{ {
static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL");
if (vhdlOpt) if (vhdlOpt)
{ {
return VhdlDocGen::trDesignUnitHierarchy(); return VhdlDocGen::trDesignUnitHierarchy();
...@@ -1115,12 +2143,12 @@ class ClassHierarchyContext::Private : public PropertyMapper<ClassHierarchyConte ...@@ -1115,12 +2143,12 @@ class ClassHierarchyContext::Private : public PropertyMapper<ClassHierarchyConte
Private() Private()
{ {
//%% ClassInheritance tree //%% ClassInheritance tree
insert("tree",new PropertyFunc(this,&Private::tree)); addProperty("tree",this,&Private::tree);
insert("fileName",new PropertyFunc(this,&Private::fileName)); addProperty("fileName",this,&Private::fileName);
insert("relPath",new PropertyFunc(this,&Private::relPath)); addProperty("relPath",this,&Private::relPath);
insert("highlight",new PropertyFunc(this,&Private::highlight)); addProperty("highlight",this,&Private::highlight);
insert("subhighlight",new PropertyFunc(this,&Private::subhighlight)); addProperty("subhighlight",this,&Private::subhighlight);
insert("title",new PropertyFunc(this,&Private::title)); addProperty("title",this,&Private::title);
} }
private: private:
ClassInheritanceContext m_classTree; ClassInheritanceContext m_classTree;
...@@ -1146,21 +2174,21 @@ TemplateVariant ClassHierarchyContext::get(const char *name) const ...@@ -1146,21 +2174,21 @@ TemplateVariant ClassHierarchyContext::get(const char *name) const
//%% struct NestingNode: node is a nesting relation tree //%% struct NestingNode: node is a nesting relation tree
//%% { //%% {
class NestingNodeContext::Private : public PropertyMapper<NestingNodeContext::Private> class NestingNodeContext::Private : public PropertyMapper
{ {
public: public:
Private(Definition *d,bool addCls) : m_def(d), Private(Definition *d,bool addCls) : m_def(d),
m_classContext(m_def->definitionType()==Definition::TypeClass?(ClassDef*)d:0), m_classContext(m_def->definitionType()==Definition::TypeClass?(ClassDef*)d:0),
m_namespaceContext(m_def->definitionType()==Definition::TypeNamespace?(NamespaceDef*)d:0) m_namespaceContext(m_def->definitionType()==Definition::TypeNamespace?(NamespaceDef*)d:0)
{ {
//%% bool is_leaf_node: true if this node does not have any children //%% bool is_leaf_node: true if this node does not have any children
insert("is_leaf_node", new PropertyFunc(this,&Private::isLeafNode)); addProperty("is_leaf_node",this,&Private::isLeafNode);
//%% Nesting children: list of nested classes/namespaces //%% Nesting children: list of nested classes/namespaces
insert("children", new PropertyFunc(this,&Private::children)); addProperty("children",this,&Private::children);
//%% [optional] Class class: class info (if this node represents a class) //%% [optional] Class class: class info (if this node represents a class)
insert("class", new PropertyFunc(this,&Private::getClass)); addProperty("class",this,&Private::getClass);
//%% [optional] Namespace namespace: namespace info (if this node represents a namespace) //%% [optional] Namespace namespace: namespace info (if this node represents a namespace)
insert("namespace", new PropertyFunc(this,&Private::getNamespace)); addProperty("namespace",this,&Private::getNamespace);
addNamespaces(addCls); addNamespaces(addCls);
addClasses(); addClasses();
} }
...@@ -1222,7 +2250,7 @@ class NestingNodeContext::Private : public PropertyMapper<NestingNodeContext::Pr ...@@ -1222,7 +2250,7 @@ class NestingNodeContext::Private : public PropertyMapper<NestingNodeContext::Pr
}; };
//%% } //%% }
NestingNodeContext::NestingNodeContext(Definition *d,bool addClass) NestingNodeContext::NestingNodeContext(Definition *d,bool addClass)
{ {
p = new Private(d,addClass); p = new Private(d,addClass);
} }
...@@ -1268,21 +2296,21 @@ class NestingContext::Private : public GenericNodeListContext<NestingNodeContext ...@@ -1268,21 +2296,21 @@ class NestingContext::Private : public GenericNodeListContext<NestingNodeContext
ClassDef *cd; ClassDef *cd;
for (;(cd=cli.current());++cli) for (;(cd=cli.current());++cli)
{ {
if (cd->getLanguage()==SrcLangExt_VHDL) if (cd->getLanguage()==SrcLangExt_VHDL)
{ {
if ((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::PACKAGECLASS || if ((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::PACKAGECLASS ||
(VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::PACKBODYCLASS (VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::PACKBODYCLASS
)// no architecture )// no architecture
{ {
continue; continue;
} }
} }
if (!rootOnly || if (!rootOnly ||
cd->getOuterScope()==0 || cd->getOuterScope()==0 ||
cd->getOuterScope()==Doxygen::globalScope cd->getOuterScope()==Doxygen::globalScope
) )
{ {
if (classVisibleInIndex(cd) && cd->templateMaster()==0) if (classVisibleInIndex(cd) && cd->templateMaster()==0)
{ {
NestingNodeContext *nnc = new NestingNodeContext(cd,TRUE); NestingNodeContext *nnc = new NestingNodeContext(cd,TRUE);
append(nnc); append(nnc);
...@@ -1332,7 +2360,7 @@ void NestingContext::addNamespaces(const NamespaceSDict &nsDict,bool rootOnly,bo ...@@ -1332,7 +2360,7 @@ void NestingContext::addNamespaces(const NamespaceSDict &nsDict,bool rootOnly,bo
//%% struct ClassTree: Class nesting relations //%% struct ClassTree: Class nesting relations
//%% { //%% {
class ClassTreeContext::Private : public PropertyMapper<ClassTreeContext::Private> class ClassTreeContext::Private : public PropertyMapper
{ {
public: public:
TemplateVariant tree() const TemplateVariant tree() const
...@@ -1358,8 +2386,8 @@ class ClassTreeContext::Private : public PropertyMapper<ClassTreeContext::Privat ...@@ -1358,8 +2386,8 @@ class ClassTreeContext::Private : public PropertyMapper<ClassTreeContext::Privat
TemplateVariant title() const TemplateVariant title() const
{ {
static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL");
if (fortranOpt) if (fortranOpt)
{ {
return theTranslator->trCompoundListFortran(); return theTranslator->trCompoundListFortran();
} }
...@@ -1383,12 +2411,12 @@ class ClassTreeContext::Private : public PropertyMapper<ClassTreeContext::Privat ...@@ -1383,12 +2411,12 @@ class ClassTreeContext::Private : public PropertyMapper<ClassTreeContext::Privat
m_classTree.addClasses(*Doxygen::classSDict,TRUE); m_classTree.addClasses(*Doxygen::classSDict,TRUE);
} }
//%% Nesting tree //%% Nesting tree
insert("tree", new PropertyFunc(this,&Private::tree)); addProperty("tree",this,&Private::tree);
insert("fileName", new PropertyFunc(this,&Private::fileName)); addProperty("fileName",this,&Private::fileName);
insert("relPath", new PropertyFunc(this,&Private::relPath)); addProperty("relPath",this,&Private::relPath);
insert("highlight", new PropertyFunc(this,&Private::highlight)); addProperty("highlight",this,&Private::highlight);
insert("subhighlight",new PropertyFunc(this,&Private::subhighlight)); addProperty("subhighlight",this,&Private::subhighlight);
insert("title", new PropertyFunc(this,&Private::title)); addProperty("title",this,&Private::title);
} }
private: private:
NestingContext m_classTree; NestingContext m_classTree;
...@@ -1461,7 +2489,7 @@ TemplateListIntf::ConstIterator *NamespaceListContext::createIterator() const ...@@ -1461,7 +2489,7 @@ TemplateListIntf::ConstIterator *NamespaceListContext::createIterator() const
//%% struct NamespaceTree: tree of nested namespace //%% struct NamespaceTree: tree of nested namespace
//%% { //%% {
class NamespaceTreeContext::Private : public PropertyMapper<NamespaceTreeContext::Private> class NamespaceTreeContext::Private : public PropertyMapper
{ {
public: public:
TemplateVariant tree() const TemplateVariant tree() const
...@@ -1488,8 +2516,8 @@ class NamespaceTreeContext::Private : public PropertyMapper<NamespaceTreeContext ...@@ -1488,8 +2516,8 @@ class NamespaceTreeContext::Private : public PropertyMapper<NamespaceTreeContext
{ {
static bool javaOpt = Config_getBool("OPTIMIZE_OUTPUT_JAVA"); static bool javaOpt = Config_getBool("OPTIMIZE_OUTPUT_JAVA");
static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL");
if (javaOpt || vhdlOpt) if (javaOpt || vhdlOpt)
{ {
return theTranslator->trPackages(); return theTranslator->trPackages();
} }
...@@ -1509,12 +2537,12 @@ class NamespaceTreeContext::Private : public PropertyMapper<NamespaceTreeContext ...@@ -1509,12 +2537,12 @@ class NamespaceTreeContext::Private : public PropertyMapper<NamespaceTreeContext
m_namespaceTree.addNamespaces(*Doxygen::namespaceSDict,TRUE,FALSE); m_namespaceTree.addNamespaces(*Doxygen::namespaceSDict,TRUE,FALSE);
} }
//%% Nesting tree //%% Nesting tree
insert("tree", new PropertyFunc(this,&Private::tree)); addProperty("tree",this,&Private::tree);
insert("fileName", new PropertyFunc(this,&Private::fileName)); addProperty("fileName",this,&Private::fileName);
insert("relPath", new PropertyFunc(this,&Private::relPath)); addProperty("relPath",this,&Private::relPath);
insert("highlight", new PropertyFunc(this,&Private::highlight)); addProperty("highlight",this,&Private::highlight);
insert("subhighlight",new PropertyFunc(this,&Private::subhighlight)); addProperty("subhighlight",this,&Private::subhighlight);
insert("title", new PropertyFunc(this,&Private::title)); addProperty("title",this,&Private::title);
} }
private: private:
NestingContext m_namespaceTree; NestingContext m_namespaceTree;
...@@ -1594,23 +2622,76 @@ TemplateListIntf::ConstIterator *FileListContext::createIterator() const ...@@ -1594,23 +2622,76 @@ TemplateListIntf::ConstIterator *FileListContext::createIterator() const
//------------------------------------------------------------------------ //------------------------------------------------------------------------
//%% list UsedFiles[File] : list of files
class UsedFilesContext::Private : public GenericNodeListContext<FileContext>
{
public:
void addFile(FileDef *fd)
{
append(new FileContext(fd));
}
};
UsedFilesContext::UsedFilesContext(ClassDef *cd)
{
p = new Private;
if (cd)
{
QListIterator<FileDef> li(cd->usedFiles());
FileDef *fd;
for (li.toFirst();(fd=li.current());++li)
{
p->addFile(fd);
}
}
}
UsedFilesContext::~UsedFilesContext()
{
delete p;
}
// TemplateListIntf
int UsedFilesContext::count() const
{
return p->count();
}
TemplateVariant UsedFilesContext::at(int index) const
{
return p->at(index);
}
TemplateListIntf::ConstIterator *UsedFilesContext::createIterator() const
{
return p->createIterator();
}
void UsedFilesContext::addFile(FileDef *fd)
{
p->addFile(fd);
}
//------------------------------------------------------------------------
//%% struct DirFileNode: node is a directory hierarchy //%% struct DirFileNode: node is a directory hierarchy
//%% { //%% {
class DirFileNodeContext::Private : public PropertyMapper<DirFileNodeContext::Private> class DirFileNodeContext::Private : public PropertyMapper
{ {
public: public:
Private(Definition *d) : m_def(d), Private(Definition *d) : m_def(d),
m_dirContext (m_def->definitionType()==Definition::TypeDir ? (DirDef*)d : 0), m_dirContext (m_def->definitionType()==Definition::TypeDir ? (DirDef*)d : 0),
m_fileContext(m_def->definitionType()==Definition::TypeFile ? (FileDef*)d : 0) m_fileContext(m_def->definitionType()==Definition::TypeFile ? (FileDef*)d : 0)
{ {
//%% bool is_leaf_node: true if this node does not have any children //%% bool is_leaf_node: true if this node does not have any children
insert("is_leaf_node", new PropertyFunc(this,&Private::isLeafNode)); addProperty("is_leaf_node",this,&Private::isLeafNode);
//%% DirFile children: list of nested classes/namespaces //%% DirFile children: list of nested classes/namespaces
insert("children", new PropertyFunc(this,&Private::children)); addProperty("children",this,&Private::children);
//%% [optional] Dir dir: directory info (if this node represents a directory) //%% [optional] Dir dir: directory info (if this node represents a directory)
insert("dir", new PropertyFunc(this,&Private::getDir)); addProperty("dir",this,&Private::getDir);
//%% [optional] File file: file info (if this node represents a file) //%% [optional] File file: file info (if this node represents a file)
insert("file", new PropertyFunc(this,&Private::getFile)); addProperty("file",this,&Private::getFile);
addDirFiles(); addDirFiles();
} }
TemplateVariant isLeafNode() const TemplateVariant isLeafNode() const
...@@ -1663,7 +2744,7 @@ class DirFileNodeContext::Private : public PropertyMapper<DirFileNodeContext::Pr ...@@ -1663,7 +2744,7 @@ class DirFileNodeContext::Private : public PropertyMapper<DirFileNodeContext::Pr
}; };
//%% } //%% }
DirFileNodeContext::DirFileNodeContext(Definition *d) DirFileNodeContext::DirFileNodeContext(Definition *d)
{ {
p = new Private(d); p = new Private(d);
} }
...@@ -1691,7 +2772,7 @@ class DirFileContext::Private : public GenericNodeListContext<DirFileNodeContext ...@@ -1691,7 +2772,7 @@ class DirFileContext::Private : public GenericNodeListContext<DirFileNodeContext
DirDef *dd; DirDef *dd;
for (dli.toFirst();(dd=dli.current());++dli) for (dli.toFirst();(dd=dli.current());++dli)
{ {
if (dd->getOuterScope()==Doxygen::globalScope) if (dd->getOuterScope()==Doxygen::globalScope)
{ {
append(new DirFileNodeContext(dd)); append(new DirFileNodeContext(dd));
} }
...@@ -1708,7 +2789,7 @@ class DirFileContext::Private : public GenericNodeListContext<DirFileNodeContext ...@@ -1708,7 +2789,7 @@ class DirFileContext::Private : public GenericNodeListContext<DirFileNodeContext
} }
void addFiles(const FileNameList &fnList) void addFiles(const FileNameList &fnList)
{ {
FileNameListIterator fnli(fnList); FileNameListIterator fnli(fnList);
FileName *fn; FileName *fn;
for (fnli.toFirst();(fn=fnli.current());++fnli) for (fnli.toFirst();(fn=fnli.current());++fnli)
{ {
...@@ -1785,7 +2866,7 @@ void DirFileContext::addFiles(const FileList &files) ...@@ -1785,7 +2866,7 @@ void DirFileContext::addFiles(const FileList &files)
//%% struct FileTree: tree of directories and files //%% struct FileTree: tree of directories and files
//%% { //%% {
class FileTreeContext::Private : public PropertyMapper<FileTreeContext::Private> class FileTreeContext::Private : public PropertyMapper
{ {
public: public:
TemplateVariant tree() const TemplateVariant tree() const
...@@ -1824,12 +2905,12 @@ class FileTreeContext::Private : public PropertyMapper<FileTreeContext::Private> ...@@ -1824,12 +2905,12 @@ class FileTreeContext::Private : public PropertyMapper<FileTreeContext::Private>
m_dirFileTree.addFiles(*Doxygen::inputNameList); m_dirFileTree.addFiles(*Doxygen::inputNameList);
} }
//%% DirFile tree: //%% DirFile tree:
insert("tree", new PropertyFunc(this,&Private::tree)); addProperty("tree",this,&Private::tree);
insert("fileName", new PropertyFunc(this,&Private::fileName)); addProperty("fileName",this,&Private::fileName);
insert("relPath", new PropertyFunc(this,&Private::relPath)); addProperty("relPath",this,&Private::relPath);
insert("highlight", new PropertyFunc(this,&Private::highlight)); addProperty("highlight",this,&Private::highlight);
insert("subhighlight",new PropertyFunc(this,&Private::subhighlight)); addProperty("subhighlight",this,&Private::subhighlight);
insert("title", new PropertyFunc(this,&Private::title)); addProperty("title",this,&Private::title);
} }
private: private:
DirFileContext m_dirFileTree; DirFileContext m_dirFileTree;
...@@ -1855,17 +2936,17 @@ TemplateVariant FileTreeContext::get(const char *name) const ...@@ -1855,17 +2936,17 @@ TemplateVariant FileTreeContext::get(const char *name) const
//%% struct PageNode: node is a directory hierarchy //%% struct PageNode: node is a directory hierarchy
//%% { //%% {
class PageNodeContext::Private : public PropertyMapper<PageNodeContext::Private> class PageNodeContext::Private : public PropertyMapper
{ {
public: public:
Private(PageDef *pd) : m_pageDef(pd), m_pageContext(pd) Private(PageDef *pd) : m_pageDef(pd), m_pageContext(pd)
{ {
//%% bool is_leaf_node: true if this node does not have any children //%% bool is_leaf_node: true if this node does not have any children
insert("is_leaf_node", new PropertyFunc(this,&Private::isLeafNode)); addProperty("is_leaf_node",this,&Private::isLeafNode);
//%% PageList children: list of nested classes/namespaces //%% PageList children: list of nested classes/namespaces
insert("children", new PropertyFunc(this,&Private::children)); addProperty("children",this,&Private::children);
//%% Page page: page info //%% Page page: page info
insert("page", new PropertyFunc(this,&Private::getPage)); addProperty("page",this,&Private::getPage);
addPages(); addPages();
} }
TemplateVariant isLeafNode() const TemplateVariant isLeafNode() const
...@@ -1894,7 +2975,7 @@ class PageNodeContext::Private : public PropertyMapper<PageNodeContext::Private> ...@@ -1894,7 +2975,7 @@ class PageNodeContext::Private : public PropertyMapper<PageNodeContext::Private>
}; };
//%% } //%% }
PageNodeContext::PageNodeContext(PageDef *pd) PageNodeContext::PageNodeContext(PageDef *pd)
{ {
p = new Private(pd); p = new Private(pd);
} }
...@@ -1922,7 +3003,7 @@ class PageNodeListContext::Private : public GenericNodeListContext<PageNodeConte ...@@ -1922,7 +3003,7 @@ class PageNodeListContext::Private : public GenericNodeListContext<PageNodeConte
for (pli.toFirst();(pd=pli.current());++pli) for (pli.toFirst();(pd=pli.current());++pli)
{ {
if (!rootOnly || if (!rootOnly ||
pd->getOuterScope()==0 || pd->getOuterScope()==0 ||
pd->getOuterScope()->definitionType()!=Definition::TypePage) pd->getOuterScope()->definitionType()!=Definition::TypePage)
{ {
append(new PageNodeContext(pd)); append(new PageNodeContext(pd));
...@@ -1966,7 +3047,7 @@ void PageNodeListContext::addPages(const PageSDict &pages,bool rootOnly) ...@@ -1966,7 +3047,7 @@ void PageNodeListContext::addPages(const PageSDict &pages,bool rootOnly)
//%% struct PageTree: tree of related pages //%% struct PageTree: tree of related pages
//%% { //%% {
class PageTreeContext::Private : public PropertyMapper<PageTreeContext::Private> class PageTreeContext::Private : public PropertyMapper
{ {
public: public:
TemplateVariant tree() const TemplateVariant tree() const
...@@ -1995,19 +3076,19 @@ class PageTreeContext::Private : public PropertyMapper<PageTreeContext::Private> ...@@ -1995,19 +3076,19 @@ class PageTreeContext::Private : public PropertyMapper<PageTreeContext::Private>
} }
Private() Private()
{ {
// Add pages // Add pages
if (Doxygen::pageSDict) if (Doxygen::pageSDict)
{ {
m_pageList.addPages(*Doxygen::pageSDict,TRUE); m_pageList.addPages(*Doxygen::pageSDict,TRUE);
} }
//%% PageNodeList tree: //%% PageNodeList tree:
insert("tree", new PropertyFunc(this,&Private::tree)); addProperty("tree",this,&Private::tree);
insert("fileName", new PropertyFunc(this,&Private::fileName)); addProperty("fileName",this,&Private::fileName);
insert("relPath", new PropertyFunc(this,&Private::relPath)); addProperty("relPath",this,&Private::relPath);
insert("highlight", new PropertyFunc(this,&Private::highlight)); addProperty("highlight",this,&Private::highlight);
insert("subhighlight",new PropertyFunc(this,&Private::subhighlight)); addProperty("subhighlight",this,&Private::subhighlight);
insert("title", new PropertyFunc(this,&Private::title)); addProperty("title",this,&Private::title);
} }
private: private:
PageNodeListContext m_pageList; PageNodeListContext m_pageList;
...@@ -2033,7 +3114,7 @@ TemplateVariant PageTreeContext::get(const char *name) const ...@@ -2033,7 +3114,7 @@ TemplateVariant PageTreeContext::get(const char *name) const
//%% struct PageList: list of related pages //%% struct PageList: list of related pages
//%% { //%% {
class PageListContext::Private : public PropertyMapper<PageListContext::Private> class PageListContext::Private : public PropertyMapper
{ {
public: public:
TemplateVariant items() const TemplateVariant items() const
...@@ -2062,7 +3143,7 @@ class PageListContext::Private : public PropertyMapper<PageListContext::Private> ...@@ -2062,7 +3143,7 @@ class PageListContext::Private : public PropertyMapper<PageListContext::Private>
} }
Private() Private()
{ {
// Add pages // Add pages
PageSDict::Iterator pdi(*Doxygen::pageSDict); PageSDict::Iterator pdi(*Doxygen::pageSDict);
PageDef *pd=0; PageDef *pd=0;
for (pdi.toFirst();(pd=pdi.current());++pdi) for (pdi.toFirst();(pd=pdi.current());++pdi)
...@@ -2074,12 +3155,12 @@ class PageListContext::Private : public PropertyMapper<PageListContext::Private> ...@@ -2074,12 +3155,12 @@ class PageListContext::Private : public PropertyMapper<PageListContext::Private>
} }
//%% list[Page] items: //%% list[Page] items:
insert("items", new PropertyFunc(this,&Private::items)); addProperty("items",this,&Private::items);
insert("fileName", new PropertyFunc(this,&Private::fileName)); addProperty("fileName",this,&Private::fileName);
insert("relPath", new PropertyFunc(this,&Private::relPath)); addProperty("relPath",this,&Private::relPath);
insert("highlight", new PropertyFunc(this,&Private::highlight)); addProperty("highlight",this,&Private::highlight);
insert("subhighlight",new PropertyFunc(this,&Private::subhighlight)); addProperty("subhighlight",this,&Private::subhighlight);
insert("title", new PropertyFunc(this,&Private::title)); addProperty("title",this,&Private::title);
} }
private: private:
GenericNodeListContext<PageContext> m_pageList; GenericNodeListContext<PageContext> m_pageList;
...@@ -2106,17 +3187,17 @@ TemplateVariant PageListContext::get(const char *name) const ...@@ -2106,17 +3187,17 @@ TemplateVariant PageListContext::get(const char *name) const
//%% struct ModuleNode: node is a directory hierarchy //%% struct ModuleNode: node is a directory hierarchy
//%% { //%% {
class ModuleNodeContext::Private : public PropertyMapper<ModuleNodeContext::Private> class ModuleNodeContext::Private : public PropertyMapper
{ {
public: public:
Private(GroupDef *gd) : m_groupDef(gd), m_moduleContext(gd) Private(GroupDef *gd) : m_groupDef(gd), m_moduleContext(gd)
{ {
//%% bool is_leaf_node: true if this node does not have any children //%% bool is_leaf_node: true if this node does not have any children
insert("is_leaf_node", new PropertyFunc(this,&Private::isLeafNode)); addProperty("is_leaf_node",this,&Private::isLeafNode);
//%% ModuleList children: list of submodules //%% ModuleList children: list of submodules
insert("children", new PropertyFunc(this,&Private::children)); addProperty("children",this,&Private::children);
//%% Module module: module info //%% Module module: module info
insert("module", new PropertyFunc(this,&Private::getModule)); addProperty("module",this,&Private::getModule);
addModules(); addModules();
} }
TemplateVariant isLeafNode() const TemplateVariant isLeafNode() const
...@@ -2145,7 +3226,7 @@ class ModuleNodeContext::Private : public PropertyMapper<ModuleNodeContext::Priv ...@@ -2145,7 +3226,7 @@ class ModuleNodeContext::Private : public PropertyMapper<ModuleNodeContext::Priv
}; };
//%% } //%% }
ModuleNodeContext::ModuleNodeContext(GroupDef *gd) ModuleNodeContext::ModuleNodeContext(GroupDef *gd)
{ {
p = new Private(gd); p = new Private(gd);
} }
...@@ -2231,7 +3312,7 @@ void ModuleListContext::addModules(const GroupList &modules) ...@@ -2231,7 +3312,7 @@ void ModuleListContext::addModules(const GroupList &modules)
//%% struct ModuleTree: tree of modules //%% struct ModuleTree: tree of modules
//%% { //%% {
class ModuleTreeContext::Private : public PropertyMapper<ModuleTreeContext::Private> class ModuleTreeContext::Private : public PropertyMapper
{ {
public: public:
TemplateVariant tree() const TemplateVariant tree() const
...@@ -2260,19 +3341,19 @@ class ModuleTreeContext::Private : public PropertyMapper<ModuleTreeContext::Priv ...@@ -2260,19 +3341,19 @@ class ModuleTreeContext::Private : public PropertyMapper<ModuleTreeContext::Priv
} }
Private() Private()
{ {
// Add modules // Add modules
if (Doxygen::groupSDict) if (Doxygen::groupSDict)
{ {
m_moduleList.addModules(*Doxygen::groupSDict); m_moduleList.addModules(*Doxygen::groupSDict);
} }
//%% ModuleList tree: //%% ModuleList tree:
insert("tree", new PropertyFunc(this,&Private::tree)); addProperty("tree",this,&Private::tree);
insert("fileName", new PropertyFunc(this,&Private::fileName)); addProperty("fileName",this,&Private::fileName);
insert("relPath", new PropertyFunc(this,&Private::relPath)); addProperty("relPath",this,&Private::relPath);
insert("highlight", new PropertyFunc(this,&Private::highlight)); addProperty("highlight",this,&Private::highlight);
insert("subhighlight",new PropertyFunc(this,&Private::subhighlight)); addProperty("subhighlight",this,&Private::subhighlight);
insert("title", new PropertyFunc(this,&Private::title)); addProperty("title",this,&Private::title);
} }
private: private:
ModuleListContext m_moduleList; ModuleListContext m_moduleList;
...@@ -2298,7 +3379,7 @@ TemplateVariant ModuleTreeContext::get(const char *name) const ...@@ -2298,7 +3379,7 @@ TemplateVariant ModuleTreeContext::get(const char *name) const
//%% struct ExampleList: list of examples page //%% struct ExampleList: list of examples page
//%% { //%% {
class ExampleListContext::Private : public PropertyMapper<ExampleListContext::Private> class ExampleListContext::Private : public PropertyMapper
{ {
public: public:
TemplateVariant items() const TemplateVariant items() const
...@@ -2327,19 +3408,19 @@ class ExampleListContext::Private : public PropertyMapper<ExampleListContext::Pr ...@@ -2327,19 +3408,19 @@ class ExampleListContext::Private : public PropertyMapper<ExampleListContext::Pr
} }
Private() Private()
{ {
// Add pages // Add pages
if (Doxygen::exampleSDict) if (Doxygen::exampleSDict)
{ {
m_pageList.addPages(*Doxygen::exampleSDict,FALSE); m_pageList.addPages(*Doxygen::exampleSDict,FALSE);
} }
//%% PageNodeList items: //%% PageNodeList items:
insert("items", new PropertyFunc(this,&Private::items)); addProperty("items",this,&Private::items);
insert("fileName", new PropertyFunc(this,&Private::fileName)); addProperty("fileName",this,&Private::fileName);
insert("relPath", new PropertyFunc(this,&Private::relPath)); addProperty("relPath",this,&Private::relPath);
insert("highlight", new PropertyFunc(this,&Private::highlight)); addProperty("highlight",this,&Private::highlight);
insert("subhighlight",new PropertyFunc(this,&Private::subhighlight)); addProperty("subhighlight",this,&Private::subhighlight);
insert("title", new PropertyFunc(this,&Private::title)); addProperty("title",this,&Private::title);
} }
private: private:
PageNodeListContext m_pageList; PageNodeListContext m_pageList;
...@@ -2361,6 +3442,307 @@ TemplateVariant ExampleListContext::get(const char *name) const ...@@ -2361,6 +3442,307 @@ TemplateVariant ExampleListContext::get(const char *name) const
return p->get(name); return p->get(name);
} }
//------------------------------------------------------------------------
//%% struct InheritanceNode: a class in the inheritance list
//%% {
class InheritanceNodeContext::Private : public PropertyMapper
{
public:
Private(ClassDef *cd,const QCString &name) : m_classContext(cd), m_name(name)
{
addProperty("class",this,&Private::getClass);
addProperty("name",this,&Private::name);
}
TemplateVariant getClass() const
{
return &m_classContext;
}
TemplateVariant name() const
{
return m_name;
}
private:
ClassContext m_classContext;
QCString m_name;
};
//%% }
InheritanceNodeContext::InheritanceNodeContext(ClassDef *cd,const QCString &name)
{
p = new Private(cd,name);
}
InheritanceNodeContext::~InheritanceNodeContext()
{
delete p;
}
TemplateVariant InheritanceNodeContext::get(const char *name) const
{
return p->get(name);
}
//------------------------------------------------------------------------
//%% list InheritanceList[InheritanceNode] : list of inherited classes
class InheritanceListContext::Private : public GenericNodeListContext<InheritanceNodeContext>
{
public:
void addClass(ClassDef *cd,const QCString &name)
{
append(new InheritanceNodeContext(cd,name));
}
};
InheritanceListContext::InheritanceListContext(const BaseClassList *list, bool baseClasses)
{
p = new Private;
if (list)
{
BaseClassListIterator li(*list);
BaseClassDef *bcd;
for (li.toFirst();(bcd=li.current());++li)
{
ClassDef *cd=bcd->classDef;
QCString name;
if (baseClasses)
{
name = insertTemplateSpecifierInScope(
cd->displayName(),bcd->templSpecifiers);
}
else
{
name = cd->displayName();
}
//printf("InheritanceListContext: adding %s baseClass=%d\n",name.data(),baseClasses);
p->addClass(cd,name);
}
}
}
InheritanceListContext::~InheritanceListContext()
{
delete p;
}
// TemplateListIntf
int InheritanceListContext::count() const
{
return p->count();
}
TemplateVariant InheritanceListContext::at(int index) const
{
return p->at(index);
}
TemplateListIntf::ConstIterator *InheritanceListContext::createIterator() const
{
return p->createIterator();
}
//------------------------------------------------------------------------
//%% list MemberList[Member] : list of inherited classes
class MemberListContext::Private : public GenericNodeListContext<MemberContext>
{
public:
void addMember(MemberDef *md)
{
append(new MemberContext(md));
}
};
MemberListContext::MemberListContext(const MemberList *list)
{
p = new Private;
if (list)
{
MemberListIterator mli(*list);
MemberDef *md;
for (mli.toFirst();(md=mli.current());++mli)
{
if (md->isBriefSectionVisible())
{
p->addMember(md);
}
}
}
}
MemberListContext::~MemberListContext()
{
delete p;
}
// TemplateListIntf
int MemberListContext::count() const
{
return p->count();
}
TemplateVariant MemberListContext::at(int index) const
{
return p->at(index);
}
TemplateListIntf::ConstIterator *MemberListContext::createIterator() const
{
return p->createIterator();
}
//------------------------------------------------------------------------
//%% struct MemberListInfo: member list information
//%% {
class MemberListInfoContext::Private : public PropertyMapper
{
public:
Private(const MemberList *ml,const QCString &title,const QCString &subtitle) :
m_memberListContext(ml), m_memberList(ml), m_title(title), m_subtitle(subtitle)
{
addProperty("members", this,&Private::members);
addProperty("title", this,&Private::title);
addProperty("subtitle",this,&Private::subtitle);
addProperty("anchor", this,&Private::anchor);
// TODO: member groups
}
TemplateVariant members() const
{
return &m_memberListContext;
}
TemplateVariant title() const
{
return m_title;
}
TemplateVariant subtitle() const
{
return m_subtitle;
}
TemplateVariant anchor() const
{
return m_memberList->listTypeAsString(m_memberList->listType());
}
private:
MemberListContext m_memberListContext;
const MemberList *m_memberList;
QCString m_title;
QCString m_subtitle;
};
//%% }
MemberListInfoContext::MemberListInfoContext(const MemberList *ml,
const QCString &title,const QCString &subtitle)
{
p = new Private(ml,title,subtitle);
}
MemberListInfoContext::~MemberListInfoContext()
{
delete p;
}
TemplateVariant MemberListInfoContext::get(const char *name) const
{
return p->get(name);
}
//------------------------------------------------------------------------
//%% struct Argument: member list information
//%% {
class ArgumentContext::Private : public PropertyMapper
{
public:
Private(const Argument *arg) :
m_argument(arg)
{
addProperty("type", this,&Private::type);
addProperty("name", this,&Private::name);
addProperty("defVal",this,&Private::defVal);
}
TemplateVariant type() const
{
return m_argument->type;
}
TemplateVariant name() const
{
return m_argument->name;
}
TemplateVariant defVal() const
{
return m_argument->defval;
}
private:
const Argument *m_argument;
};
//%% }
ArgumentContext::ArgumentContext(const Argument *al)
{
p = new Private(al);
}
ArgumentContext::~ArgumentContext()
{
delete p;
}
TemplateVariant ArgumentContext::get(const char *name) const
{
return p->get(name);
}
//------------------------------------------------------------------------
//%% list ArgumentList[Argument] : list of inherited classes
class ArgumentListContext::Private : public GenericNodeListContext<ArgumentContext>
{
public:
void addArgument(const Argument *arg)
{
append(new ArgumentContext(arg));
}
};
ArgumentListContext::ArgumentListContext(const ArgumentList *list)
{
p = new Private;
if (list)
{
ArgumentListIterator ali(*list);
const Argument *arg;
for (ali.toFirst();(arg=ali.current());++ali)
{
p->addArgument(arg);
}
}
}
ArgumentListContext::~ArgumentListContext()
{
delete p;
}
// TemplateListIntf
int ArgumentListContext::count() const
{
return p->count();
}
TemplateVariant ArgumentListContext::at(int index) const
{
return p->at(index);
}
TemplateListIntf::ConstIterator *ArgumentListContext::createIterator() const
{
return p->createIterator();
}
//------------------------------------------------------------------------ //------------------------------------------------------------------------
class HtmlEscaper : public TemplateEscapeIntf class HtmlEscaper : public TemplateEscapeIntf
...@@ -2374,12 +3756,78 @@ class HtmlEscaper : public TemplateEscapeIntf ...@@ -2374,12 +3756,78 @@ class HtmlEscaper : public TemplateEscapeIntf
//------------------------------------------------------------------------ //------------------------------------------------------------------------
class HtmlSpaceless : public TemplateSpacelessIntf
{
public:
HtmlSpaceless() : m_insideTag(FALSE), m_insideString('\0'), m_removeSpaces(TRUE) {}
QCString remove(const QCString &s)
{
QGString result;
const char *p = s.data();
char c;
while ((c=*p++))
{
switch(c)
{
case '<': // start of a tag
if (!m_insideString) m_insideTag=TRUE,m_removeSpaces=FALSE;
result+=c;
break;
case '>': // end of a tag
if (!m_insideString) m_insideTag=FALSE,m_removeSpaces=TRUE;
result+=c;
break;
case '\\': // escaped character in a string
result+=c;
if (m_insideString && *p) result+=*p++;
break;
case '"': case '\'':
if (m_insideTag)
{
if (m_insideString==c) // end of string
{
m_insideString='\0';
}
else // start of string
{
m_insideString=c;
}
}
result+=c;
break;
case ' ': case '\t': case '\n': // whitespace
if (!m_removeSpaces)
{
result+=' ';
}
if (!m_insideTag) // outside tags strip consecutive whitespace
{
m_removeSpaces=TRUE;
}
break;
default:
result+=c;
m_removeSpaces=FALSE;
break;
}
}
result+='\0';
//printf("HtmlSpaceless::remove('%s')='%s' m_insideTag=%d m_insideString=%d removeSpaces=%d\n",s.data(),result.data(),
// m_insideTag,m_insideString,m_removeSpaces);
return result.data();
}
private:
bool m_insideTag;
char m_insideString;
bool m_removeSpaces;
};
//------------------------------------------------------------------------
void generateOutputViaTemplate() void generateOutputViaTemplate()
{ {
TemplateEngine e; TemplateEngine e;
TemplateContext *ctx = e.createContext(); TemplateContext *ctx = e.createContext();
HtmlEscaper esc;
ctx->setEscapeIntf(&esc);
if (ctx) if (ctx)
{ {
DoxygenContext doxygen; DoxygenContext doxygen;
...@@ -2431,7 +3879,14 @@ void generateOutputViaTemplate() ...@@ -2431,7 +3879,14 @@ void generateOutputViaTemplate()
Template *tpl = e.loadByName("htmllayout.tpl"); Template *tpl = e.loadByName("htmllayout.tpl");
if (tpl) if (tpl)
{ {
ctx->setOutputDirectory(Config_getString("HTML_OUTPUT")); g_globals.outputFormat = ContextGlobals::Html;
g_globals.dynSectionId = 0;
g_globals.outputDir = Config_getString("HTML_OUTPUT");
HtmlEscaper esc;
ctx->setEscapeIntf(&esc);
HtmlSpaceless spl;
ctx->setSpacelessIntf(&spl);
ctx->setOutputDirectory(g_globals.outputDir);
FTextStream ts; FTextStream ts;
tpl->render(ts,ctx); tpl->render(ts,ctx);
} }
......
#ifndef CONTEXT_H #ifndef CONTEXT_H
#define CONTEXT_H #define CONTEXT_H
#include "types.h"
#include "template.h" #include "template.h"
class Definition; class Definition;
class ClassDef; class ClassDef;
class ClassSDict; class ClassSDict;
class BaseClassList;
class PageDef; class PageDef;
class GroupDef; class GroupDef;
class NamespaceDef; class NamespaceDef;
...@@ -21,6 +23,11 @@ class PageSDict; ...@@ -21,6 +23,11 @@ class PageSDict;
class GroupSDict; class GroupSDict;
class GroupDef; class GroupDef;
class GroupList; class GroupList;
struct IncludeInfo;
class MemberList;
class MemberDef;
struct Argument;
class ArgumentList;
//---------------------------------------------------- //----------------------------------------------------
...@@ -72,6 +79,42 @@ class TranslateContext : public TemplateStructIntf ...@@ -72,6 +79,42 @@ class TranslateContext : public TemplateStructIntf
//---------------------------------------------------- //----------------------------------------------------
class UsedFilesContext : public TemplateListIntf
{
public:
UsedFilesContext(ClassDef *cd);
~UsedFilesContext();
// TemplateListIntf
virtual int count() const;
virtual TemplateVariant at(int index) const;
virtual TemplateListIntf::ConstIterator *createIterator() const;
void addFile(FileDef *fd);
private:
class Private;
Private *p;
};
//----------------------------------------------------
class IncludeInfoContext : public TemplateStructIntf
{
public:
IncludeInfoContext(IncludeInfo *,SrcLangExt lang);
~IncludeInfoContext();
// TemplateStructIntf methods
virtual TemplateVariant get(const char *name) const;
private:
class Private;
Private *p;
};
//----------------------------------------------------
class ClassContext : public TemplateStructIntf class ClassContext : public TemplateStructIntf
{ {
public: public:
...@@ -150,6 +193,23 @@ class PageContext : public TemplateStructIntf ...@@ -150,6 +193,23 @@ class PageContext : public TemplateStructIntf
Private *p; Private *p;
}; };
//----------------------------------------------------
class MemberContext : public TemplateStructIntf
{
public:
MemberContext(MemberDef *);
~MemberContext();
// TemplateStructIntf methods
virtual TemplateVariant get(const char *name) const;
private:
class Private;
Private *p;
};
//---------------------------------------------------- //----------------------------------------------------
class ModuleContext : public TemplateStructIntf class ModuleContext : public TemplateStructIntf
...@@ -168,6 +228,26 @@ class ModuleContext : public TemplateStructIntf ...@@ -168,6 +228,26 @@ class ModuleContext : public TemplateStructIntf
//---------------------------------------------------- //----------------------------------------------------
class NestedClassListContext : public TemplateListIntf
{
public:
NestedClassListContext();
~NestedClassListContext();
// TemplateListIntf
virtual int count() const;
virtual TemplateVariant at(int index) const;
virtual TemplateListIntf::ConstIterator *createIterator() const;
void append(ClassDef *cd);
private:
class Private;
Private *p;
};
//----------------------------------------------------
class ClassListContext : public TemplateListIntf class ClassListContext : public TemplateListIntf
{ {
public: public:
...@@ -530,6 +610,109 @@ class ExampleListContext : public TemplateStructIntf ...@@ -530,6 +610,109 @@ class ExampleListContext : public TemplateStructIntf
//---------------------------------------------------- //----------------------------------------------------
class InheritanceNodeContext : public TemplateStructIntf
{
public:
InheritanceNodeContext(ClassDef *cd,const QCString &name);
~InheritanceNodeContext();
// TemplateStructIntf methods
virtual TemplateVariant get(const char *name) const;
private:
class Private;
Private *p;
};
//----------------------------------------------------
class InheritanceListContext : public TemplateListIntf
{
public:
InheritanceListContext(const BaseClassList *list,bool baseClasses);
~InheritanceListContext();
// TemplateListIntf
virtual int count() const;
virtual TemplateVariant at(int index) const;
virtual TemplateListIntf::ConstIterator *createIterator() const;
private:
class Private;
Private *p;
};
//----------------------------------------------------
class MemberListContext : public TemplateListIntf
{
public:
MemberListContext(const MemberList *ml);
~MemberListContext();
// TemplateListIntf
virtual int count() const;
virtual TemplateVariant at(int index) const;
virtual TemplateListIntf::ConstIterator *createIterator() const;
private:
class Private;
Private *p;
};
//----------------------------------------------------
class MemberListInfoContext : public TemplateStructIntf
{
public:
MemberListInfoContext(const MemberList *ml,const QCString &title,
const QCString &subtitle=QCString());
~MemberListInfoContext();
// TemplateStructIntf methods
virtual TemplateVariant get(const char *name) const;
private:
class Private;
Private *p;
};
//----------------------------------------------------
class ArgumentContext : public TemplateStructIntf
{
public:
ArgumentContext(const Argument *arg);
~ArgumentContext();
// TemplateStructIntf methods
virtual TemplateVariant get(const char *name) const;
private:
class Private;
Private *p;
};
//----------------------------------------------------
class ArgumentListContext : public TemplateListIntf
{
public:
ArgumentListContext(const ArgumentList *al);
~ArgumentListContext();
// TemplateListIntf
virtual int count() const;
virtual TemplateVariant at(int index) const;
virtual TemplateListIntf::ConstIterator *createIterator() const;
private:
class Private;
Private *p;
};
//----------------------------------------------------
void generateOutputViaTemplate(); void generateOutputViaTemplate();
#endif #endif
...@@ -1876,4 +1876,10 @@ void Definition::_setSymbolName(const QCString &name) ...@@ -1876,4 +1876,10 @@ void Definition::_setSymbolName(const QCString &name)
m_symbolName=name; m_symbolName=name;
} }
bool Definition::hasBriefDescription() const
{
static bool briefMemberDesc = Config_getBool("BRIEF_MEMBER_DESC");
return !briefDescription().isEmpty() && briefMemberDesc;
}
...@@ -260,6 +260,9 @@ class Definition : public DefinitionIntf ...@@ -260,6 +260,9 @@ class Definition : public DefinitionIntf
bool hasSections() const; bool hasSections() const;
/** returns TRUE if this class has a brief description */
bool hasBriefDescription() const;
QCString id() const; QCString id() const;
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
......
...@@ -1336,8 +1336,7 @@ static void addClassToContext(EntryNav *rootNav) ...@@ -1336,8 +1336,7 @@ static void addClassToContext(EntryNav *rootNav)
// see if the class is found inside a namespace // see if the class is found inside a namespace
//bool found=addNamespace(root,cd); //bool found=addNamespace(root,cd);
// the empty string test is needed for extract all case cd->insertUsedFile(fd);
cd->insertUsedFile(root->fileName);
// add class to the list // add class to the list
//printf("ClassDict.insert(%s)\n",resolveDefines(fullName).data()); //printf("ClassDict.insert(%s)\n",resolveDefines(fullName).data());
...@@ -1537,7 +1536,6 @@ static ClassDef *createTagLessInstance(ClassDef *rootCd,ClassDef *templ,const QC ...@@ -1537,7 +1536,6 @@ static ClassDef *createTagLessInstance(ClassDef *rootCd,ClassDef *templ,const QC
gd->addClass(cd); gd->addClass(cd);
} }
} }
//cd->insertUsedFile(root->fileName);
//printf("** adding class %s based on %s\n",fullName.data(),templ->name().data()); //printf("** adding class %s based on %s\n",fullName.data(),templ->name().data());
Doxygen::classSDict->append(fullName,cd); Doxygen::classSDict->append(fullName,cd);
...@@ -1776,7 +1774,7 @@ static void buildNamespaceList(EntryNav *rootNav) ...@@ -1776,7 +1774,7 @@ static void buildNamespaceList(EntryNav *rootNav)
// the empty string test is needed for extract all case // the empty string test is needed for extract all case
nd->setBriefDescription(root->brief,root->briefFile,root->briefLine); nd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
nd->insertUsedFile(root->fileName); nd->insertUsedFile(fd);
nd->setBodySegment(root->bodyLine,root->endBodyLine); nd->setBodySegment(root->bodyLine,root->endBodyLine);
nd->setBodyDef(fd); nd->setBodyDef(fd);
// add class to the list // add class to the list
...@@ -1954,7 +1952,7 @@ static void findUsingDirectives(EntryNav *rootNav) ...@@ -1954,7 +1952,7 @@ static void findUsingDirectives(EntryNav *rootNav)
// the empty string test is needed for extract all case // the empty string test is needed for extract all case
nd->setBriefDescription(root->brief,root->briefFile,root->briefLine); nd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
nd->insertUsedFile(root->fileName); nd->insertUsedFile(fd);
// add class to the list // add class to the list
Doxygen::namespaceSDict->inSort(name,nd); Doxygen::namespaceSDict->inSort(name,nd);
nd->setRefItems(root->sli); nd->setRefItems(root->sli);
...@@ -2373,7 +2371,7 @@ static MemberDef *addVariableToClass( ...@@ -2373,7 +2371,7 @@ static MemberDef *addVariableToClass(
md->setRefItems(root->sli); md->setRefItems(root->sli);
//TODO: insert FileDef instead of filename strings. //TODO: insert FileDef instead of filename strings.
cd->insertUsedFile(root->fileName); cd->insertUsedFile(rootNav->fileDef());
rootNav->changeSection(Entry::EMPTY_SEC); rootNav->changeSection(Entry::EMPTY_SEC);
return md; return md;
} }
...@@ -3114,7 +3112,7 @@ static void addInterfaceOrServiceToServiceOrSingleton( ...@@ -3114,7 +3112,7 @@ static void addInterfaceOrServiceToServiceOrSingleton(
findClassRelation(rootNav,cd,cd,&base,0,DocumentedOnly,true) findClassRelation(rootNav,cd,cd,&base,0,DocumentedOnly,true)
|| findClassRelation(rootNav,cd,cd,&base,0,Undocumented,true); || findClassRelation(rootNav,cd,cd,&base,0,Undocumented,true);
// add file to list of used files // add file to list of used files
cd->insertUsedFile(root->fileName); cd->insertUsedFile(fd);
addMemberToGroups(root,md); addMemberToGroups(root,md);
rootNav->changeSection(Entry::EMPTY_SEC); rootNav->changeSection(Entry::EMPTY_SEC);
...@@ -3357,7 +3355,7 @@ static void addMethodToClass(EntryNav *rootNav,ClassDef *cd, ...@@ -3357,7 +3355,7 @@ static void addMethodToClass(EntryNav *rootNav,ClassDef *cd,
// add member to the class cd // add member to the class cd
cd->insertMember(md); cd->insertMember(md);
// add file to list of used files // add file to list of used files
cd->insertUsedFile(root->fileName); cd->insertUsedFile(fd);
addMemberToGroups(root,md); addMemberToGroups(root,md);
rootNav->changeSection(Entry::EMPTY_SEC); rootNav->changeSection(Entry::EMPTY_SEC);
...@@ -4831,7 +4829,7 @@ static bool findClassRelation( ...@@ -4831,7 +4829,7 @@ static bool findClassRelation(
// add this class as super class to the base class // add this class as super class to the base class
baseClass->insertSubClass(cd,bi->prot,bi->virt,templSpec); baseClass->insertSubClass(cd,bi->prot,bi->virt,templSpec);
// the undocumented base was found in this file // the undocumented base was found in this file
baseClass->insertUsedFile(root->fileName); baseClass->insertUsedFile(rootNav->fileDef());
baseClass->setOuterScope(Doxygen::globalScope); baseClass->setOuterScope(Doxygen::globalScope);
if (baseClassName.right(2)=="-p") if (baseClassName.right(2)=="-p")
{ {
...@@ -5344,7 +5342,7 @@ static void addMemberDocs(EntryNav *rootNav, ...@@ -5344,7 +5342,7 @@ static void addMemberDocs(EntryNav *rootNav,
md->mergeMemberSpecifiers(root->spec); md->mergeMemberSpecifiers(root->spec);
md->addSectionsToDefinition(root->anchors); md->addSectionsToDefinition(root->anchors);
addMemberToGroups(root,md); addMemberToGroups(root,md);
if (cd) cd->insertUsedFile(root->fileName); if (cd) cd->insertUsedFile(rfd);
//printf("root->mGrpId=%d\n",root->mGrpId); //printf("root->mGrpId=%d\n",root->mGrpId);
if (root->mGrpId!=-1) if (root->mGrpId!=-1)
{ {
...@@ -6424,7 +6422,7 @@ static void findMember(EntryNav *rootNav, ...@@ -6424,7 +6422,7 @@ static void findMember(EntryNav *rootNav,
md->setMemberGroupId(root->mGrpId); md->setMemberGroupId(root->mGrpId);
mn->append(md); mn->append(md);
cd->insertMember(md); cd->insertMember(md);
cd->insertUsedFile(root->fileName); cd->insertUsedFile(fd);
md->setRefItems(root->sli); md->setRefItems(root->sli);
} }
} }
...@@ -6621,7 +6619,7 @@ static void findMember(EntryNav *rootNav, ...@@ -6621,7 +6619,7 @@ static void findMember(EntryNav *rootNav,
//md->setMemberDefTemplateArguments(root->mtArgList); //md->setMemberDefTemplateArguments(root->mtArgList);
mn->append(md); mn->append(md);
cd->insertMember(md); cd->insertMember(md);
cd->insertUsedFile(root->fileName); cd->insertUsedFile(fd);
md->setRefItems(root->sli); md->setRefItems(root->sli);
if (root->relatesType == Duplicate) md->setRelatedAlso(cd); if (root->relatesType == Duplicate) md->setRelatedAlso(cd);
if (!isDefine) if (!isDefine)
...@@ -6693,7 +6691,7 @@ localObjCMethod: ...@@ -6693,7 +6691,7 @@ localObjCMethod:
md->setMemberSpecifiers(root->spec); md->setMemberSpecifiers(root->spec);
md->setMemberGroupId(root->mGrpId); md->setMemberGroupId(root->mGrpId);
cd->insertMember(md); cd->insertMember(md);
cd->insertUsedFile(root->fileName); cd->insertUsedFile(fd);
md->setRefItems(root->sli); md->setRefItems(root->sli);
if ((mn=Doxygen::memberNameSDict->find(root->name))) if ((mn=Doxygen::memberNameSDict->find(root->name)))
{ {
...@@ -7077,7 +7075,7 @@ static void findEnums(EntryNav *rootNav) ...@@ -7077,7 +7075,7 @@ static void findEnums(EntryNav *rootNav)
md->setDefinition(cd->name()+"::"+name+baseType); md->setDefinition(cd->name()+"::"+name+baseType);
} }
cd->insertMember(md); cd->insertMember(md);
cd->insertUsedFile(root->fileName); cd->insertUsedFile(fd);
} }
md->setDocumentation(root->doc,root->docFile,root->docLine); md->setDocumentation(root->doc,root->docFile,root->docLine);
md->setDocsForDefinition(!root->proto); md->setDocsForDefinition(!root->proto);
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* Copyright (C) 1997-2013 by Dimitri van Heesch. * Copyright (C) 1997-2013 by Dimitri van Heesch.
* *
* Permission to use, copy, modify, and distribute this software and its * Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby * documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software * granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty. * for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details. * See the GNU General Public License for more details.
* *
...@@ -71,9 +71,9 @@ static QCString addTemplateNames(const QCString &s,const QCString &n,const QCStr ...@@ -71,9 +71,9 @@ static QCString addTemplateNames(const QCString &s,const QCString &n,const QCStr
if (s.length()==j || (s.at(j)!='<' && !isId(s.at(j)))) if (s.length()==j || (s.at(j)!='<' && !isId(s.at(j))))
{ // add template names { // add template names
//printf("Adding %s+%s\n",clRealName.data(),t.data()); //printf("Adding %s+%s\n",clRealName.data(),t.data());
result+=clRealName+t; result+=clRealName+t;
} }
else else
{ // template names already present { // template names already present
//printf("Adding %s\n",clRealName.data()); //printf("Adding %s\n",clRealName.data());
result+=clRealName; result+=clRealName;
...@@ -116,15 +116,15 @@ static QCString addTemplateNames(const QCString &s,const QCString &n,const QCStr ...@@ -116,15 +116,15 @@ static QCString addTemplateNames(const QCString &s,const QCString &n,const QCStr
// --- leave writeDefArgumentList with return value FALSE // --- leave writeDefArgumentList with return value FALSE
// ol.endMemberDocName // ol.endMemberDocName
// ol.endMemberDoc(hasArgs=FALSE); // ol.endMemberDoc(hasArgs=FALSE);
// //
static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, static bool writeDefArgumentList(OutputList &ol,ClassDef *cd,
const QCString & /*scopeName*/,MemberDef *md) const QCString & /*scopeName*/,MemberDef *md)
{ {
ArgumentList *defArgList=(md->isDocsForDefinition()) ? ArgumentList *defArgList=(md->isDocsForDefinition()) ?
md->argumentList() : md->declArgumentList(); md->argumentList() : md->declArgumentList();
//printf("writeDefArgumentList `%s' isDocsForDefinition()=%d\n",md->name().data(),md->isDocsForDefinition()); //printf("writeDefArgumentList `%s' isDocsForDefinition()=%d\n",md->name().data(),md->isDocsForDefinition());
if (defArgList==0 || md->isProperty()) if (defArgList==0 || md->isProperty())
{ {
return FALSE; // member has no function like argument list return FALSE; // member has no function like argument list
} }
...@@ -140,7 +140,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, ...@@ -140,7 +140,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd,
ol.startParameterType(TRUE,0); ol.startParameterType(TRUE,0);
ol.endParameterType(); ol.endParameterType();
ol.startParameterName(FALSE); ol.startParameterName(FALSE);
while (a) while (a)
{ {
if (a->defval.isEmpty()) if (a->defval.isEmpty())
{ {
...@@ -167,7 +167,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, ...@@ -167,7 +167,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd,
if (latexOn) ol.enable(OutputGenerator::Latex); if (latexOn) ol.enable(OutputGenerator::Latex);
ol.endMemberDocName(); ol.endMemberDocName();
ol.startParameterList(!md->isObjCMethod()); ol.startParameterList(!md->isObjCMethod());
} }
ol.enableAll(); ol.enableAll();
ol.disable(OutputGenerator::Html); ol.disable(OutputGenerator::Html);
...@@ -194,7 +194,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, ...@@ -194,7 +194,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd,
} }
else if (cd->templateArguments()) else if (cd->templateArguments())
{ {
cName=tempArgListToString(cd->templateArguments()); cName=tempArgListToString(cd->templateArguments());
//printf("2. cName=%s\n",cName.data()); //printf("2. cName=%s\n",cName.data());
} }
else // no template specifier else // no template specifier
...@@ -209,7 +209,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, ...@@ -209,7 +209,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd,
bool isDefine = md->isDefine(); bool isDefine = md->isDefine();
while (a) while (a)
{ {
if (isDefine || first) if (isDefine || first)
{ {
ol.startParameterType(first,0); ol.startParameterType(first,0);
paramTypeStarted=TRUE; paramTypeStarted=TRUE;
...@@ -224,7 +224,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, ...@@ -224,7 +224,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd,
int wp=a->type.find(res); int wp=a->type.find(res);
// use the following to put the function pointer type before the name // use the following to put the function pointer type before the name
bool hasFuncPtrType=FALSE; bool hasFuncPtrType=FALSE;
if (!a->attrib.isEmpty() && !md->isObjCMethod()) // argument has an IDL attribute if (!a->attrib.isEmpty() && !md->isObjCMethod()) // argument has an IDL attribute
{ {
...@@ -251,7 +251,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, ...@@ -251,7 +251,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd,
} }
if (!isDefine) if (!isDefine)
{ {
if (paramTypeStarted) if (paramTypeStarted)
{ {
ol.endParameterType(); ol.endParameterType();
paramTypeStarted=FALSE; paramTypeStarted=FALSE;
...@@ -260,10 +260,10 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, ...@@ -260,10 +260,10 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd,
} }
if (hasFuncPtrType) if (hasFuncPtrType)
{ {
ol.docify(a->type.mid(wp,vp-wp)); ol.docify(a->type.mid(wp,vp-wp));
} }
if (!a->name.isEmpty() || (a->name.isEmpty() && a->type=="...")) // argument has a name if (!a->name.isEmpty() || (a->name.isEmpty() && a->type=="...")) // argument has a name
{ {
//if (!hasFuncPtrType) //if (!hasFuncPtrType)
//{ //{
// ol.docify(" "); // ol.docify(" ");
...@@ -284,7 +284,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, ...@@ -284,7 +284,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd,
{ {
ol.docify(a->array); ol.docify(a->array);
} }
if (hasFuncPtrType) // write the part of the argument type if (hasFuncPtrType) // write the part of the argument type
// that comes after the name // that comes after the name
{ {
linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(), linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(),
...@@ -297,15 +297,15 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, ...@@ -297,15 +297,15 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd,
ol.docify(" = "); ol.docify(" = ");
ol.startTypewriter(); ol.startTypewriter();
linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(),md,n,FALSE,TRUE,TRUE); linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(),md,n,FALSE,TRUE,TRUE);
ol.endTypewriter(); ol.endTypewriter();
} }
a=defArgList->next(); a=defArgList->next();
if (a) if (a)
{ {
if (!md->isObjCMethod()) ol.docify(", "); // there are more arguments if (!md->isObjCMethod()) ol.docify(", "); // there are more arguments
if (!isDefine) if (!isDefine)
{ {
QCString key; QCString key;
if (md->isObjCMethod() && a->attrib.length()>=2) if (md->isObjCMethod() && a->attrib.length()>=2)
...@@ -316,7 +316,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, ...@@ -316,7 +316,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd,
if (key!=",") key+=":"; // for normal keywords add colon if (key!=",") key+=":"; // for normal keywords add colon
} }
ol.endParameterName(FALSE,FALSE,!md->isObjCMethod()); ol.endParameterName(FALSE,FALSE,!md->isObjCMethod());
if (paramTypeStarted) if (paramTypeStarted)
{ {
ol.endParameterType(); ol.endParameterType();
} }
...@@ -360,7 +360,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, ...@@ -360,7 +360,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd,
md, // self md, // self
defArgList->trailingReturnType, // text defArgList->trailingReturnType, // text
FALSE // autoBreak FALSE // autoBreak
); );
} }
return TRUE; return TRUE;
...@@ -441,7 +441,7 @@ static void writeTemplatePrefix(OutputList &ol,ArgumentList *al) ...@@ -441,7 +441,7 @@ static void writeTemplatePrefix(OutputList &ol,ArgumentList *al)
{ {
ol.docify(" = "); ol.docify(" = ");
ol.docify(a->defval); ol.docify(a->defval);
} }
a=al->next(); a=al->next();
if (a) ol.docify(", "); if (a) ol.docify(", ");
} }
...@@ -484,16 +484,16 @@ class MemberDefImpl ...@@ -484,16 +484,16 @@ class MemberDefImpl
const ArgumentList *al const ArgumentList *al
); );
ClassDef *classDef; // member of or related to ClassDef *classDef; // member of or related to
FileDef *fileDef; // member of file definition FileDef *fileDef; // member of file definition
NamespaceDef *nspace; // the namespace this member is in. NamespaceDef *nspace; // the namespace this member is in.
MemberDef *enumScope; // the enclosing scope, if this is an enum field MemberDef *enumScope; // the enclosing scope, if this is an enum field
bool livesInsideEnum; bool livesInsideEnum;
MemberDef *annEnumType; // the anonymous enum that is the type of this member MemberDef *annEnumType; // the anonymous enum that is the type of this member
MemberList *enumFields; // enumeration fields MemberList *enumFields; // enumeration fields
MemberDef *redefines; // the members that this member redefines MemberDef *redefines; // the members that this member redefines
MemberList *redefinedBy; // the list of members that redefine this one MemberList *redefinedBy; // the list of members that redefine this one
MemberDef *memDef; // member definition for this declaration MemberDef *memDef; // member definition for this declaration
...@@ -523,7 +523,7 @@ class MemberDefImpl ...@@ -523,7 +523,7 @@ class MemberDefImpl
uint64 memSpec; // The specifiers present for this member uint64 memSpec; // The specifiers present for this member
MemberType mtype; // returns the kind of member MemberType mtype; // returns the kind of member
int maxInitLines; // when the initializer will be displayed int maxInitLines; // when the initializer will be displayed
int userInitLines; // result of explicit \hideinitializer or \showinitializer int userInitLines; // result of explicit \hideinitializer or \showinitializer
MemberDef *annMemb; MemberDef *annMemb;
...@@ -533,13 +533,13 @@ class MemberDefImpl ...@@ -533,13 +533,13 @@ class MemberDefImpl
ArgumentList *tArgList; // template argument list of function template ArgumentList *tArgList; // template argument list of function template
ArgumentList *typeConstraints; // type constraints for template parameters ArgumentList *typeConstraints; // type constraints for template parameters
MemberDef *templateMaster; MemberDef *templateMaster;
QList<ArgumentList> *defTmpArgLists; // lists of template argument lists QList<ArgumentList> *defTmpArgLists; // lists of template argument lists
// (for template functions in nested template classes) // (for template functions in nested template classes)
ClassDef *cachedAnonymousType; // if the member has an anonymous compound ClassDef *cachedAnonymousType; // if the member has an anonymous compound
// as its type then this is computed by // as its type then this is computed by
// getClassDefOfAnonymousType() and // getClassDefOfAnonymousType() and
// cached here. // cached here.
SDict<MemberList> *classSectionSDict; // not accessible SDict<MemberList> *classSectionSDict; // not accessible
MemberDef *groupAlias; // Member containing the definition MemberDef *groupAlias; // Member containing the definition
...@@ -555,7 +555,7 @@ class MemberDefImpl ...@@ -555,7 +555,7 @@ class MemberDefImpl
ClassDef *cachedTypedefValue; ClassDef *cachedTypedefValue;
QCString cachedTypedefTemplSpec; QCString cachedTypedefTemplSpec;
QCString cachedResolvedType; QCString cachedResolvedType;
// inbody documentation // inbody documentation
//int inbodyLine; //int inbodyLine;
//QCString inbodyFile; //QCString inbodyFile;
...@@ -568,7 +568,7 @@ class MemberDefImpl ...@@ -568,7 +568,7 @@ class MemberDefImpl
QCString explicitOutputFileBase; QCString explicitOutputFileBase;
// objective-c // objective-c
bool implOnly; // function found in implementation but not bool implOnly; // function found in implementation but not
// in the interface // in the interface
bool hasDocumentedParams; bool hasDocumentedParams;
bool hasDocumentedReturnType; bool hasDocumentedReturnType;
...@@ -578,7 +578,7 @@ class MemberDefImpl ...@@ -578,7 +578,7 @@ class MemberDefImpl
bool proto; // is it a prototype; bool proto; // is it a prototype;
bool docEnumValues; // is an enum with documented enum values. bool docEnumValues; // is an enum with documented enum values.
bool annScope; // member is part of an annoymous scope bool annScope; // member is part of an annoymous scope
bool annUsed; bool annUsed;
bool hasCallGraph; bool hasCallGraph;
bool hasCallerGraph; bool hasCallerGraph;
bool explExt; // member was explicitly declared external bool explExt; // member was explicitly declared external
...@@ -743,10 +743,10 @@ void MemberDefImpl::init(Definition *def, ...@@ -743,10 +743,10 @@ void MemberDefImpl::init(Definition *def,
* \c Normal, \c Virtual, \c Pure. * \c Normal, \c Virtual, \c Pure.
* \param s A boolean that is true iff the member is static. * \param s A boolean that is true iff the member is static.
* \param r The relationship between the class and the member. * \param r The relationship between the class and the member.
* \param mt The kind of member. See #MemberType for a list of * \param mt The kind of member. See #MemberType for a list of
* all types. * all types.
* \param tal The template arguments of this member. * \param tal The template arguments of this member.
* \param al The arguments of this member. This is a structured form of * \param al The arguments of this member. This is a structured form of
* the string past as argument \a a. * the string past as argument \a a.
*/ */
...@@ -788,7 +788,7 @@ MemberDef *MemberDef::deepCopy() const ...@@ -788,7 +788,7 @@ MemberDef *MemberDef::deepCopy() const
result->m_impl->defTmpArgLists=0; result->m_impl->defTmpArgLists=0;
result->m_impl->classSectionSDict=0; result->m_impl->classSectionSDict=0;
result->m_impl->declArgList=0; result->m_impl->declArgList=0;
// replace pointers owned by the object by deep copies // replace pointers owned by the object by deep copies
if (m_impl->redefinedBy) if (m_impl->redefinedBy)
{ {
MemberListIterator mli(*m_impl->redefinedBy); MemberListIterator mli(*m_impl->redefinedBy);
...@@ -861,8 +861,8 @@ void MemberDef::moveTo(Definition *scope) ...@@ -861,8 +861,8 @@ void MemberDef::moveTo(Definition *scope)
{ {
m_impl->nspace = (NamespaceDef*)scope; m_impl->nspace = (NamespaceDef*)scope;
} }
m_isLinkableCached = 0; m_isLinkableCached = 0;
m_isConstructorCached = 0; m_isConstructorCached = 0;
} }
...@@ -874,8 +874,8 @@ MemberDef::~MemberDef() ...@@ -874,8 +874,8 @@ MemberDef::~MemberDef()
m_impl=0; m_impl=0;
} }
void MemberDef::setReimplements(MemberDef *md) void MemberDef::setReimplements(MemberDef *md)
{ {
m_impl->redefines = md; m_impl->redefines = md;
} }
...@@ -886,20 +886,20 @@ void MemberDef::insertReimplementedBy(MemberDef *md) ...@@ -886,20 +886,20 @@ void MemberDef::insertReimplementedBy(MemberDef *md)
m_impl->templateMaster->insertReimplementedBy(md); m_impl->templateMaster->insertReimplementedBy(md);
} }
if (m_impl->redefinedBy==0) m_impl->redefinedBy = new MemberList(MemberListType_redefinedBy); if (m_impl->redefinedBy==0) m_impl->redefinedBy = new MemberList(MemberListType_redefinedBy);
if (m_impl->redefinedBy->findRef(md)==-1) if (m_impl->redefinedBy->findRef(md)==-1)
{ {
m_impl->redefinedBy->inSort(md); m_impl->redefinedBy->inSort(md);
} }
} }
MemberDef *MemberDef::reimplements() const MemberDef *MemberDef::reimplements() const
{ {
return m_impl->redefines; return m_impl->redefines;
} }
MemberList *MemberDef::reimplementedBy() const MemberList *MemberDef::reimplementedBy() const
{ {
return m_impl->redefinedBy; return m_impl->redefinedBy;
} }
bool MemberDef::isReimplementedBy(ClassDef *cd) const bool MemberDef::isReimplementedBy(ClassDef *cd) const
...@@ -934,7 +934,7 @@ bool MemberDef::addExample(const char *anchor,const char *nameStr, ...@@ -934,7 +934,7 @@ bool MemberDef::addExample(const char *anchor,const char *nameStr,
{ {
//printf("%s::addExample(%s,%s,%s)\n",name().data(),anchor,nameStr,file); //printf("%s::addExample(%s,%s,%s)\n",name().data(),anchor,nameStr,file);
if (m_impl->exampleSDict==0) m_impl->exampleSDict = new ExampleSDict; if (m_impl->exampleSDict==0) m_impl->exampleSDict = new ExampleSDict;
if (m_impl->exampleSDict->find(nameStr)==0) if (m_impl->exampleSDict->find(nameStr)==0)
{ {
//printf("Add reference to example %s to member %s\n",nameStr,name.data()); //printf("Add reference to example %s to member %s\n",nameStr,name.data());
Example *e=new Example; Example *e=new Example;
...@@ -944,12 +944,12 @@ bool MemberDef::addExample(const char *anchor,const char *nameStr, ...@@ -944,12 +944,12 @@ bool MemberDef::addExample(const char *anchor,const char *nameStr,
m_impl->exampleSDict->inSort(nameStr,e); m_impl->exampleSDict->inSort(nameStr,e);
return TRUE; return TRUE;
} }
return FALSE; return FALSE;
} }
bool MemberDef::hasExamples() bool MemberDef::hasExamples()
{ {
if (m_impl->exampleSDict==0) if (m_impl->exampleSDict==0)
return FALSE; return FALSE;
else else
return m_impl->exampleSDict->count()>0; return m_impl->exampleSDict->count()>0;
...@@ -986,7 +986,7 @@ QCString MemberDef::getOutputFileBase() const ...@@ -986,7 +986,7 @@ QCString MemberDef::getOutputFileBase() const
{ {
baseName=m_impl->fileDef->getOutputFileBase(); baseName=m_impl->fileDef->getOutputFileBase();
} }
if (baseName.isEmpty()) if (baseName.isEmpty())
{ {
warn(getDefFileName(),getDefLine(), warn(getDefFileName(),getDefLine(),
...@@ -1048,7 +1048,7 @@ QCString MemberDef::anchor() const ...@@ -1048,7 +1048,7 @@ QCString MemberDef::anchor() const
{ {
result.prepend(m_impl->enumScope->anchor()); result.prepend(m_impl->enumScope->anchor());
} }
if (m_impl->group) if (m_impl->group)
{ {
if (m_impl->groupMember) if (m_impl->groupMember)
{ {
...@@ -1067,7 +1067,7 @@ void MemberDef::_computeLinkableInProject() ...@@ -1067,7 +1067,7 @@ void MemberDef::_computeLinkableInProject()
static bool extractStatic = Config_getBool("EXTRACT_STATIC"); static bool extractStatic = Config_getBool("EXTRACT_STATIC");
m_isLinkableCached = 2; // linkable m_isLinkableCached = 2; // linkable
//printf("MemberDef::isLinkableInProject(name=%s)\n",name().data()); //printf("MemberDef::isLinkableInProject(name=%s)\n",name().data());
if (isHidden()) if (isHidden())
{ {
//printf("is hidden\n"); //printf("is hidden\n");
m_isLinkableCached = 1; m_isLinkableCached = 1;
...@@ -1079,51 +1079,51 @@ void MemberDef::_computeLinkableInProject() ...@@ -1079,51 +1079,51 @@ void MemberDef::_computeLinkableInProject()
m_isLinkableCached = m_impl->templateMaster->isLinkableInProject() ? 2 : 1; m_isLinkableCached = m_impl->templateMaster->isLinkableInProject() ? 2 : 1;
return; return;
} }
if (name().isEmpty() || name().at(0)=='@') if (name().isEmpty() || name().at(0)=='@')
{ {
//printf("name invalid\n"); //printf("name invalid\n");
m_isLinkableCached = 1; // not a valid or a dummy name m_isLinkableCached = 1; // not a valid or a dummy name
return; return;
} }
if (!hasDocumentation() && !isReference()) if (!hasDocumentation() && !isReference())
{ {
//printf("no docs or reference\n"); //printf("no docs or reference\n");
m_isLinkableCached = 1; // no documentation m_isLinkableCached = 1; // no documentation
return; return;
} }
if (m_impl->group && !m_impl->group->isLinkableInProject()) if (m_impl->group && !m_impl->group->isLinkableInProject())
{ {
//printf("group but group not linkable!\n"); //printf("group but group not linkable!\n");
m_isLinkableCached = 1; // group but group not linkable m_isLinkableCached = 1; // group but group not linkable
return; return;
} }
if (!m_impl->group && m_impl->classDef && !m_impl->classDef->isLinkableInProject()) if (!m_impl->group && m_impl->classDef && !m_impl->classDef->isLinkableInProject())
{ {
//printf("in a class but class not linkable!\n"); //printf("in a class but class not linkable!\n");
m_isLinkableCached = 1; // in class but class not linkable m_isLinkableCached = 1; // in class but class not linkable
return; return;
} }
if (!m_impl->group && m_impl->nspace && !m_impl->related && !m_impl->nspace->isLinkableInProject()) if (!m_impl->group && m_impl->nspace && !m_impl->related && !m_impl->nspace->isLinkableInProject())
{ {
//printf("in a namespace but namespace not linkable!\n"); //printf("in a namespace but namespace not linkable!\n");
m_isLinkableCached = 1; // in namespace but namespace not linkable m_isLinkableCached = 1; // in namespace but namespace not linkable
return; return;
} }
if (!m_impl->group && !m_impl->nspace && if (!m_impl->group && !m_impl->nspace &&
!m_impl->related && !m_impl->classDef && !m_impl->related && !m_impl->classDef &&
m_impl->fileDef && !m_impl->fileDef->isLinkableInProject()) m_impl->fileDef && !m_impl->fileDef->isLinkableInProject())
{ {
//printf("in a file but file not linkable!\n"); //printf("in a file but file not linkable!\n");
m_isLinkableCached = 1; // in file (and not in namespace) but file not linkable m_isLinkableCached = 1; // in file (and not in namespace) but file not linkable
return; return;
} }
if (!protectionLevelVisible(m_impl->prot) && m_impl->mtype!=MemberType_Friend) if (!protectionLevelVisible(m_impl->prot) && m_impl->mtype!=MemberType_Friend)
{ {
//printf("private and invisible!\n"); //printf("private and invisible!\n");
m_isLinkableCached = 1; // hidden due to protection m_isLinkableCached = 1; // hidden due to protection
return; return;
} }
if (m_impl->stat && m_impl->classDef==0 && !extractStatic) if (m_impl->stat && m_impl->classDef==0 && !extractStatic)
{ {
//printf("static and invisible!\n"); //printf("static and invisible!\n");
m_isLinkableCached = 1; // hidden due to staticness m_isLinkableCached = 1; // hidden due to staticness
...@@ -1203,11 +1203,11 @@ void MemberDef::writeLink(OutputList &ol,ClassDef *,NamespaceDef *, ...@@ -1203,11 +1203,11 @@ void MemberDef::writeLink(OutputList &ol,ClassDef *,NamespaceDef *,
{ {
n.prepend(m_impl->enumScope->displayName()+sep); n.prepend(m_impl->enumScope->displayName()+sep);
} }
if (m_impl->classDef && gd && !isRelated()) if (m_impl->classDef && gd && !isRelated())
{ {
n.prepend(m_impl->classDef->displayName()+sep); n.prepend(m_impl->classDef->displayName()+sep);
} }
else if (m_impl->nspace && (gd || fd)) else if (m_impl->nspace && (gd || fd))
{ {
n.prepend(m_impl->nspace->displayName()+sep); n.prepend(m_impl->nspace->displayName()+sep);
} }
...@@ -1243,12 +1243,12 @@ void MemberDef::writeLink(OutputList &ol,ClassDef *,NamespaceDef *, ...@@ -1243,12 +1243,12 @@ void MemberDef::writeLink(OutputList &ol,ClassDef *,NamespaceDef *,
/*! If this member has an anonymous class/struct/union as its type, then /*! If this member has an anonymous class/struct/union as its type, then
* this method will return the ClassDef that describes this return type. * this method will return the ClassDef that describes this return type.
*/ */
ClassDef *MemberDef::getClassDefOfAnonymousType() ClassDef *MemberDef::getClassDefOfAnonymousType()
{ {
if (m_impl->cachedAnonymousType) return m_impl->cachedAnonymousType; if (m_impl->cachedAnonymousType) return m_impl->cachedAnonymousType;
QCString cname; QCString cname;
if (getClassDef()!=0) if (getClassDef()!=0)
{ {
cname=getClassDef()->name().copy(); cname=getClassDef()->name().copy();
} }
...@@ -1277,7 +1277,7 @@ ClassDef *MemberDef::getClassDefOfAnonymousType() ...@@ -1277,7 +1277,7 @@ ClassDef *MemberDef::getClassDefOfAnonymousType()
QCString annName = ltype.mid(il,ir-il); QCString annName = ltype.mid(il,ir-il);
// if inside a class or namespace try to prepend the scope name // if inside a class or namespace try to prepend the scope name
if (!cname.isEmpty() && annName.left(cname.length()+2)!=cname+"::") if (!cname.isEmpty() && annName.left(cname.length()+2)!=cname+"::")
{ {
QCString ts=stripAnonymousNamespaceScope(cname+"::"+annName); QCString ts=stripAnonymousNamespaceScope(cname+"::"+annName);
annoClassDef=getClass(ts); annoClassDef=getClass(ts);
...@@ -1292,7 +1292,7 @@ ClassDef *MemberDef::getClassDefOfAnonymousType() ...@@ -1292,7 +1292,7 @@ ClassDef *MemberDef::getClassDefOfAnonymousType()
m_impl->cachedAnonymousType = annoClassDef; m_impl->cachedAnonymousType = annoClassDef;
return annoClassDef; return annoClassDef;
} }
/*! This methods returns TRUE iff the brief section (also known as /*! This methods returns TRUE iff the brief section (also known as
* declaration section) is visible in the documentation. * declaration section) is visible in the documentation.
*/ */
...@@ -1313,51 +1313,51 @@ bool MemberDef::isBriefSectionVisible() const ...@@ -1313,51 +1313,51 @@ bool MemberDef::isBriefSectionVisible() const
MemberGroupInfo *info = Doxygen::memGrpInfoDict[m_impl->grpId]; MemberGroupInfo *info = Doxygen::memGrpInfoDict[m_impl->grpId];
//printf("name=%s m_impl->grpId=%d info=%p\n",name().data(),m_impl->grpId,info); //printf("name=%s m_impl->grpId=%d info=%p\n",name().data(),m_impl->grpId,info);
//QCString *pMemGrp = Doxygen::memberDocDict[grpId]; //QCString *pMemGrp = Doxygen::memberDocDict[grpId];
bool hasDocs = hasDocumentation() || bool hasDocs = hasDocumentation() ||
// part of a documented member group // part of a documented member group
(m_impl->grpId!=-1 && info && !(info->doc.isEmpty() && info->header.isEmpty())); (m_impl->grpId!=-1 && info && !(info->doc.isEmpty() && info->header.isEmpty()));
// only include static members with file/namespace scope if // only include static members with file/namespace scope if
// explicitly enabled in the config file // explicitly enabled in the config file
bool visibleIfStatic = !(getClassDef()==0 && bool visibleIfStatic = !(getClassDef()==0 &&
isStatic() && isStatic() &&
!extractStatic !extractStatic
); );
// only include members is the are documented or // only include members is the are documented or
// HIDE_UNDOC_MEMBERS is NO in the config file // HIDE_UNDOC_MEMBERS is NO in the config file
bool visibleIfDocumented = (!hideUndocMembers || bool visibleIfDocumented = (!hideUndocMembers ||
hasDocs || hasDocs ||
isDocumentedFriendClass() isDocumentedFriendClass()
); );
// hide members with no detailed description and brief descriptions // hide members with no detailed description and brief descriptions
// explicitly disabled. // explicitly disabled.
bool visibleIfEnabled = !(hideUndocMembers && bool visibleIfEnabled = !(hideUndocMembers &&
documentation().isEmpty() && documentation().isEmpty() &&
!briefMemberDesc && !briefMemberDesc &&
!repeatBrief !repeatBrief
); );
// Hide friend (class|struct|union) declarations if HIDE_FRIEND_COMPOUNDS is true // Hide friend (class|struct|union) declarations if HIDE_FRIEND_COMPOUNDS is true
bool visibleIfFriendCompound = !(hideFriendCompounds && bool visibleIfFriendCompound = !(hideFriendCompounds &&
isFriend() && isFriend() &&
(m_impl->type=="friend class" || (m_impl->type=="friend class" ||
m_impl->type=="friend struct" || m_impl->type=="friend struct" ||
m_impl->type=="friend union" m_impl->type=="friend union"
) )
); );
// only include members that are non-private unless EXTRACT_PRIVATE is // only include members that are non-private unless EXTRACT_PRIVATE is
// set to YES or the member is part of a group // set to YES or the member is part of a group
bool visibleIfPrivate = (protectionLevelVisible(protection()) || bool visibleIfPrivate = (protectionLevelVisible(protection()) ||
m_impl->mtype==MemberType_Friend m_impl->mtype==MemberType_Friend
); );
// hide member if it overrides a member in a superclass and has no // hide member if it overrides a member in a superclass and has no
// documentation of its own // documentation of its own
//bool visibleIfDocVirtual = !reimplements() || //bool visibleIfDocVirtual = !reimplements() ||
// !Config_getBool("INHERIT_DOCS") || // !Config_getBool("INHERIT_DOCS") ||
// hasDocs; // hasDocs;
// true if this member is a constructor or destructor // true if this member is a constructor or destructor
...@@ -1380,20 +1380,47 @@ bool MemberDef::isBriefSectionVisible() const ...@@ -1380,20 +1380,47 @@ bool MemberDef::isBriefSectionVisible() const
// visibleIfStatic,visibleIfDocumented, // visibleIfStatic,visibleIfDocumented,
// visibleIfEnabled,visibleIfPrivate,visibleIfNotDefaultCDTor, // visibleIfEnabled,visibleIfPrivate,visibleIfNotDefaultCDTor,
// visibleIfFriendCompound,!m_impl->annScope); // visibleIfFriendCompound,!m_impl->annScope);
bool visible = visibleIfStatic && visibleIfDocumented && bool visible = visibleIfStatic && visibleIfDocumented &&
visibleIfEnabled && visibleIfPrivate && visibleIfEnabled && visibleIfPrivate &&
/*visibleIfDocVirtual &&*/ visibleIfNotDefaultCDTor && /*visibleIfDocVirtual &&*/ visibleIfNotDefaultCDTor &&
visibleIfFriendCompound && visibleIfFriendCompound &&
!m_impl->annScope && !isHidden(); !m_impl->annScope && !isHidden();
//printf("MemberDef::isBriefSectionVisible() %d\n",visible); //printf("MemberDef::isBriefSectionVisible() %d\n",visible);
return visible; return visible;
} }
QCString MemberDef::getDeclType() const
{
QCString ltype(m_impl->type);
if (m_impl->mtype==MemberType_Typedef)
{
ltype.prepend("typedef ");
}
if (isAlias())
{
ltype="using";
}
// strip `friend' keyword from ltype
ltype.stripPrefix("friend ");
if (ltype=="@") // rename type from enum values
{
ltype="";
}
else
{
if (isObjCMethod())
{
ltype.prepend("(");
ltype.append(")");
}
}
return ltype;
}
void MemberDef::writeDeclaration(OutputList &ol, void MemberDef::writeDeclaration(OutputList &ol,
ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd,
bool inGroup, const DefType compoundType, bool inGroup, const DefType compoundType,
ClassDef *inheritedFrom,const char *inheritId) ClassDef *inheritedFrom,const char *inheritId)
{ {
//printf("%s MemberDef::writeDeclaration() inGroup=%d\n",qualifiedName().data(),inGroup); //printf("%s MemberDef::writeDeclaration() inGroup=%d\n",qualifiedName().data(),inGroup);
...@@ -1431,7 +1458,7 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -1431,7 +1458,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
// start a new member declaration // start a new member declaration
bool isAnonymous = annoClassDef || m_impl->annMemb || m_impl->annEnumType; bool isAnonymous = annoClassDef || m_impl->annMemb || m_impl->annEnumType;
///printf("startMemberItem for %s\n",name().data()); ///printf("startMemberItem for %s\n",name().data());
ol.startMemberItem(anchor(), ol.startMemberItem(anchor(),
isAnonymous ? 1 : m_impl->tArgList ? 3 : 0, isAnonymous ? 1 : m_impl->tArgList ? 3 : 0,
inheritId inheritId
); );
...@@ -1441,7 +1468,7 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -1441,7 +1468,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
if (!detailsVisible && !m_impl->annMemb) if (!detailsVisible && !m_impl->annMemb)
{ {
QCString doxyName=name().copy(); QCString doxyName=name().copy();
if (!cname.isEmpty()) if (!cname.isEmpty())
{ {
doxyName.prepend(cdname+getLanguageSpecificSeparator(getLanguage())); doxyName.prepend(cdname+getLanguageSpecificSeparator(getLanguage()));
} }
...@@ -1458,7 +1485,7 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -1458,7 +1485,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
if (annoClassDef || m_impl->annMemb) if (annoClassDef || m_impl->annMemb)
{ {
int j; int j;
for (j=0;j<s_indentLevel;j++) for (j=0;j<s_indentLevel;j++)
{ {
ol.writeNonBreakableSpace(3); ol.writeNonBreakableSpace(3);
} }
...@@ -1499,16 +1526,16 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -1499,16 +1526,16 @@ void MemberDef::writeDeclaration(OutputList &ol,
//printf(">>>>>>>>>>>>>> startMemberItem(2)\n"); //printf(">>>>>>>>>>>>>> startMemberItem(2)\n");
ol.startMemberItem(anchor(),2,inheritId); ol.startMemberItem(anchor(),2,inheritId);
int j; int j;
for (j=0;j< s_indentLevel-1;j++) for (j=0;j< s_indentLevel-1;j++)
{ {
ol.writeNonBreakableSpace(3); ol.writeNonBreakableSpace(3);
} }
QCString varName=ltype.right(ltype.length()-ir).stripWhiteSpace(); QCString varName=ltype.right(ltype.length()-ir).stripWhiteSpace();
//printf(">>>>>> indDepth=%d ltype=`%s' varName=`%s'\n",indDepth,ltype.data(),varName.data()); //printf(">>>>>> indDepth=%d ltype=`%s' varName=`%s'\n",indDepth,ltype.data(),varName.data());
ol.docify("}"); ol.docify("}");
if (varName.isEmpty() && (name().isEmpty() || name().at(0)=='@')) if (varName.isEmpty() && (name().isEmpty() || name().at(0)=='@'))
{ {
ol.docify(";"); ol.docify(";");
} }
endAnonScopeNeeded=TRUE; endAnonScopeNeeded=TRUE;
} }
...@@ -1522,10 +1549,10 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -1522,10 +1549,10 @@ void MemberDef::writeDeclaration(OutputList &ol,
this, // self this, // self
ltype.left(i), // text ltype.left(i), // text
TRUE // autoBreak TRUE // autoBreak
); );
getAnonymousEnumType()->writeEnumDeclaration(ol,cd,nd,fd,gd,compoundType); getAnonymousEnumType()->writeEnumDeclaration(ol,cd,nd,fd,gd,compoundType);
//ol+=*getAnonymousEnumType()->enumDecl(); //ol+=*getAnonymousEnumType()->enumDecl();
linkifyText(TextGeneratorOLImpl(ol),d,m_impl->fileDef,this,ltype.right(ltype.length()-i-l),TRUE); linkifyText(TextGeneratorOLImpl(ol),d,m_impl->fileDef,this,ltype.right(ltype.length()-i-l),TRUE);
} }
else else
{ {
...@@ -1536,7 +1563,7 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -1536,7 +1563,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
this, // self this, // self
ltype, // text ltype, // text
TRUE // autoBreak TRUE // autoBreak
); );
} }
} }
} }
...@@ -1565,12 +1592,12 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -1565,12 +1592,12 @@ void MemberDef::writeDeclaration(OutputList &ol,
ol.disable(OutputGenerator::Html); ol.disable(OutputGenerator::Html);
} }
if (!ltype.isEmpty()) ol.docify(" "); if (!ltype.isEmpty()) ol.docify(" ");
if (htmlOn) if (htmlOn)
{ {
ol.enable(OutputGenerator::Html); ol.enable(OutputGenerator::Html);
} }
if (m_impl->annMemb) if (m_impl->annMemb)
{ {
ol.pushGeneratorState(); ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html); ol.disableAllBut(OutputGenerator::Html);
...@@ -1583,7 +1610,7 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -1583,7 +1610,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
} }
// *** write name // *** write name
if (!name().isEmpty() && name().at(0)!='@') // hide anonymous stuff if (!name().isEmpty() && name().at(0)!='@') // hide anonymous stuff
{ {
//printf("Member name=`%s gd=%p md->groupDef=%p inGroup=%d isLinkable()=%d\n",name().data(),gd,getGroupDef(),inGroup,isLinkable()); //printf("Member name=`%s gd=%p md->groupDef=%p inGroup=%d isLinkable()=%d\n",name().data(),gd,getGroupDef(),inGroup,isLinkable());
if (!(name().isEmpty() || name().at(0)=='@') && // name valid if (!(name().isEmpty() || name().at(0)=='@') && // name valid
...@@ -1608,27 +1635,27 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -1608,27 +1635,27 @@ void MemberDef::writeDeclaration(OutputList &ol,
{ {
//printf("writeLink %s->%d\n",name.data(),hasDocumentation()); //printf("writeLink %s->%d\n",name.data(),hasDocumentation());
ClassDef *rcd = cd; ClassDef *rcd = cd;
if (isReference() && m_impl->classDef) rcd = m_impl->classDef; if (isReference() && m_impl->classDef) rcd = m_impl->classDef;
writeLink(ol,rcd,nd,fd,gd); writeLink(ol,rcd,nd,fd,gd);
} }
} }
else if (isDocumentedFriendClass()) else if (isDocumentedFriendClass())
// if the member is an undocumented friend declaration for some class, // if the member is an undocumented friend declaration for some class,
// then maybe we can link to the class // then maybe we can link to the class
{ {
writeLink(ol,getClass(name()),0,0,0); writeLink(ol,getClass(name()),0,0,0);
} }
else else
// there is a brief member description and brief member // there is a brief member description and brief member
// descriptions are enabled or there is no detailed description. // descriptions are enabled or there is no detailed description.
{ {
if (m_impl->annMemb) if (m_impl->annMemb)
{ {
m_impl->annMemb->setAnonymousUsed(); m_impl->annMemb->setAnonymousUsed();
setAnonymousUsed(); setAnonymousUsed();
} }
ClassDef *rcd = cd; ClassDef *rcd = cd;
if (isReference() && m_impl->classDef) rcd = m_impl->classDef; if (isReference() && m_impl->classDef) rcd = m_impl->classDef;
writeLink(ol,rcd,nd,fd,gd,TRUE); writeLink(ol,rcd,nd,fd,gd,TRUE);
} }
} }
...@@ -1654,7 +1681,7 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -1654,7 +1681,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
} }
// *** write arguments // *** write arguments
if (argsString() && !isObjCMethod()) if (argsString() && !isObjCMethod())
{ {
if (!isDefine()) ol.writeString(" "); if (!isDefine()) ol.writeString(" ");
linkifyText(TextGeneratorOLImpl(ol), // out linkifyText(TextGeneratorOLImpl(ol), // out
...@@ -1678,20 +1705,20 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -1678,20 +1705,20 @@ void MemberDef::writeDeclaration(OutputList &ol,
// *** write bitfields // *** write bitfields
if (!m_impl->bitfields.isEmpty()) // add bitfields if (!m_impl->bitfields.isEmpty()) // add bitfields
{ {
linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),this,m_impl->bitfields.simplifyWhiteSpace()); linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),this,m_impl->bitfields);
} }
else if (hasOneLineInitializer() else if (hasOneLineInitializer()
//!init.isEmpty() && initLines==0 && // one line initializer //!init.isEmpty() && initLines==0 && // one line initializer
//((maxInitLines>0 && userInitLines==-1) || userInitLines>0) // enabled by default or explicitly //((maxInitLines>0 && userInitLines==-1) || userInitLines>0) // enabled by default or explicitly
) // add initializer ) // add initializer
{ {
if (!isDefine()) if (!isDefine())
{ {
//ol.writeString(" = "); //ol.writeString(" = ");
ol.writeString(" "); ol.writeString(" ");
linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),this,m_impl->initializer.simplifyWhiteSpace()); linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),this,m_impl->initializer.simplifyWhiteSpace());
} }
else else
{ {
ol.writeNonBreakableSpace(3); ol.writeNonBreakableSpace(3);
linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),this,m_impl->initializer); linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),this,m_impl->initializer);
...@@ -1699,7 +1726,7 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -1699,7 +1726,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
} }
else if (isAlias()) // using template alias else if (isAlias()) // using template alias
{ {
ol.writeString(" = "); ol.writeString(" = ");
linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),this,m_impl->type); linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),this,m_impl->type);
} }
...@@ -1758,14 +1785,14 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -1758,14 +1785,14 @@ void MemberDef::writeDeclaration(OutputList &ol,
//printf("endMember %s annoClassDef=%p annEnumType=%p\n", //printf("endMember %s annoClassDef=%p annEnumType=%p\n",
// name().data(),annoClassDef,annEnumType); // name().data(),annoClassDef,annEnumType);
ol.endMemberItem(); ol.endMemberItem();
if (endAnonScopeNeeded) if (endAnonScopeNeeded)
{ {
ol.endAnonTypeScope(--s_indentLevel); ol.endAnonTypeScope(--s_indentLevel);
} }
// write brief description // write brief description
if (!briefDescription().isEmpty() && if (!briefDescription().isEmpty() &&
Config_getBool("BRIEF_MEMBER_DESC") Config_getBool("BRIEF_MEMBER_DESC")
/* && !annMemb */ /* && !annMemb */
) )
{ {
...@@ -1777,7 +1804,7 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -1777,7 +1804,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
{ {
ol.startMemberDescription(anchor(),inheritId); ol.startMemberDescription(anchor(),inheritId);
ol.writeDoc(rootNode,getOuterScope()?getOuterScope():d,this); ol.writeDoc(rootNode,getOuterScope()?getOuterScope():d,this);
if (detailsVisible) if (detailsVisible)
{ {
ol.pushGeneratorState(); ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html); ol.disableAllBut(OutputGenerator::Html);
...@@ -1812,8 +1839,8 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -1812,8 +1839,8 @@ void MemberDef::writeDeclaration(OutputList &ol,
warnIfUndocumented(); warnIfUndocumented();
} }
bool MemberDef::isDetailedSectionLinkable() const bool MemberDef::isDetailedSectionLinkable() const
{ {
static bool extractAll = Config_getBool("EXTRACT_ALL"); static bool extractAll = Config_getBool("EXTRACT_ALL");
static bool alwaysDetailedSec = Config_getBool("ALWAYS_DETAILED_SEC"); static bool alwaysDetailedSec = Config_getBool("ALWAYS_DETAILED_SEC");
static bool repeatBrief = Config_getBool("REPEAT_BRIEF"); static bool repeatBrief = Config_getBool("REPEAT_BRIEF");
...@@ -1822,27 +1849,27 @@ bool MemberDef::isDetailedSectionLinkable() const ...@@ -1822,27 +1849,27 @@ bool MemberDef::isDetailedSectionLinkable() const
static bool extractStatic = Config_getBool("EXTRACT_STATIC"); static bool extractStatic = Config_getBool("EXTRACT_STATIC");
// the member has details documentation for any of the following reasons // the member has details documentation for any of the following reasons
bool docFilter = bool docFilter =
// treat everything as documented // treat everything as documented
extractAll || extractAll ||
// has detailed docs // has detailed docs
!documentation().isEmpty() || !documentation().isEmpty() ||
// has inbody docs // has inbody docs
!inbodyDocumentation().isEmpty() || !inbodyDocumentation().isEmpty() ||
// is an enum with values that are documented // is an enum with values that are documented
(m_impl->mtype==MemberType_Enumeration && m_impl->docEnumValues) || (m_impl->mtype==MemberType_Enumeration && m_impl->docEnumValues) ||
// is documented enum value // is documented enum value
(m_impl->mtype==MemberType_EnumValue && !briefDescription().isEmpty()) || (m_impl->mtype==MemberType_EnumValue && !briefDescription().isEmpty()) ||
// has brief description that is part of the detailed description // has brief description that is part of the detailed description
(!briefDescription().isEmpty() && // has brief docs (!briefDescription().isEmpty() && // has brief docs
(alwaysDetailedSec && // they are visible in (alwaysDetailedSec && // they are visible in
(repeatBrief || // detailed section or (repeatBrief || // detailed section or
!briefMemberDesc // they are explicitly not !briefMemberDesc // they are explicitly not
) // shown in brief section ) // shown in brief section
) )
) || ) ||
// has a multi-line initialization block // has a multi-line initialization block
//(initLines>0 && initLines<maxInitLines) || //(initLines>0 && initLines<maxInitLines) ||
(hasMultiLineInitializer() && !hideUndocMembers) || (hasMultiLineInitializer() && !hideUndocMembers) ||
// has one or more documented arguments // has one or more documented arguments
(m_impl->defArgList!=0 && m_impl->defArgList->hasDocumentation()) || (m_impl->defArgList!=0 && m_impl->defArgList->hasDocumentation()) ||
...@@ -1850,11 +1877,11 @@ bool MemberDef::isDetailedSectionLinkable() const ...@@ -1850,11 +1877,11 @@ bool MemberDef::isDetailedSectionLinkable() const
(m_impl->memSpec & (Entry::Attribute|Entry::Property)) || (m_impl->memSpec & (Entry::Attribute|Entry::Property)) ||
// has user comments // has user comments
Doxygen::userComments Doxygen::userComments
; ;
// this is not a global static or global statics should be extracted // this is not a global static or global statics should be extracted
bool staticFilter = getClassDef()!=0 || !isStatic() || extractStatic; bool staticFilter = getClassDef()!=0 || !isStatic() || extractStatic;
// only include members that are non-private unless EXTRACT_PRIVATE is // only include members that are non-private unless EXTRACT_PRIVATE is
// set to YES or the member is part of a group // set to YES or the member is part of a group
bool privateFilter = protectionLevelVisible(protection()) || m_impl->mtype==MemberType_Friend; bool privateFilter = protectionLevelVisible(protection()) || m_impl->mtype==MemberType_Friend;
...@@ -1868,29 +1895,29 @@ bool MemberDef::isDetailedSectionLinkable() const ...@@ -1868,29 +1895,29 @@ bool MemberDef::isDetailedSectionLinkable() const
// is true // is true
bool friendCompoundFilter = !(Config_getBool("HIDE_FRIEND_COMPOUNDS") && bool friendCompoundFilter = !(Config_getBool("HIDE_FRIEND_COMPOUNDS") &&
isFriend() && isFriend() &&
(m_impl->type=="friend class" || (m_impl->type=="friend class" ||
m_impl->type=="friend struct" || m_impl->type=="friend struct" ||
m_impl->type=="friend union" m_impl->type=="friend union"
) )
); );
bool result = ((docFilter && staticFilter && privateFilter && friendCompoundFilter && !isHidden())); bool result = ((docFilter && staticFilter && privateFilter && friendCompoundFilter && !isHidden()));
//printf("%s::isDetailedSectionLinkable: %d\n",name().data(),result); //printf("%s::isDetailedSectionLinkable: %d\n",name().data(),result);
return result; return result;
} }
bool MemberDef::isDetailedSectionVisible(bool inGroup,bool inFile) const bool MemberDef::isDetailedSectionVisible(bool inGroup,bool inFile) const
{ {
static bool separateMemPages = Config_getBool("SEPARATE_MEMBER_PAGES"); static bool separateMemPages = Config_getBool("SEPARATE_MEMBER_PAGES");
static bool inlineSimpleStructs = Config_getBool("INLINE_SIMPLE_STRUCTS"); static bool inlineSimpleStructs = Config_getBool("INLINE_SIMPLE_STRUCTS");
static bool hideUndocMembers = Config_getBool("HIDE_UNDOC_MEMBERS"); static bool hideUndocMembers = Config_getBool("HIDE_UNDOC_MEMBERS");
bool groupFilter = getGroupDef()==0 || inGroup || separateMemPages; bool groupFilter = getGroupDef()==0 || inGroup || separateMemPages;
bool fileFilter = getNamespaceDef()==0 || !inFile; bool fileFilter = getNamespaceDef()==0 || !inFile;
bool simpleFilter = !hideUndocMembers && inlineSimpleStructs && bool simpleFilter = !hideUndocMembers && inlineSimpleStructs &&
getClassDef()!=0 && getClassDef()->isSimple(); getClassDef()!=0 && getClassDef()->isSimple();
bool visible = isDetailedSectionLinkable() && groupFilter && fileFilter && bool visible = isDetailedSectionLinkable() && groupFilter && fileFilter &&
!isReference(); !isReference();
bool result = visible || simpleFilter; bool result = visible || simpleFilter;
//printf("%s::isDetailedSectionVisble: %d groupFilter=%d fileFilter=%d\n", //printf("%s::isDetailedSectionVisble: %d groupFilter=%d fileFilter=%d\n",
...@@ -1905,12 +1932,12 @@ void MemberDef::_getLabels(QStrList &sl,Definition *container) const ...@@ -1905,12 +1932,12 @@ void MemberDef::_getLabels(QStrList &sl,Definition *container) const
Specifier lvirt=virtualness(); Specifier lvirt=virtualness();
if ((!isObjCMethod() || isOptional() || isRequired()) && if ((!isObjCMethod() || isOptional() || isRequired()) &&
(protection()!=Public || lvirt!=Normal || (protection()!=Public || lvirt!=Normal ||
isFriend() || isRelated() || isFriend() || isRelated() ||
(isInline() && inlineInfo) || (isInline() && inlineInfo) ||
isSignal() || isSlot() || isSignal() || isSlot() ||
isStatic() || isStatic() ||
(m_impl->classDef && m_impl->classDef!=container && container->definitionType()==TypeClass) || (m_impl->classDef && m_impl->classDef!=container && container->definitionType()==TypeClass) ||
(m_impl->memSpec & ~Entry::Inline)!=0 (m_impl->memSpec & ~Entry::Inline)!=0
) )
) )
{ {
...@@ -1991,11 +2018,11 @@ void MemberDef::_getLabels(QStrList &sl,Definition *container) const ...@@ -1991,11 +2018,11 @@ void MemberDef::_getLabels(QStrList &sl,Definition *container) const
sl.append("implementation"); sl.append("implementation");
} }
} }
if (m_impl->classDef && if (m_impl->classDef &&
container->definitionType()==TypeClass && container->definitionType()==TypeClass &&
m_impl->classDef!=container && m_impl->classDef!=container &&
!isRelated() !isRelated()
) )
{ {
sl.append("inherited"); sl.append("inherited");
} }
...@@ -2010,7 +2037,7 @@ void MemberDef::_getLabels(QStrList &sl,Definition *container) const ...@@ -2010,7 +2037,7 @@ void MemberDef::_getLabels(QStrList &sl,Definition *container) const
void MemberDef::_writeCallGraph(OutputList &ol) void MemberDef::_writeCallGraph(OutputList &ol)
{ {
// write call graph // write call graph
if ((m_impl->hasCallGraph || Config_getBool("CALL_GRAPH")) if ((m_impl->hasCallGraph || Config_getBool("CALL_GRAPH"))
&& (isFunction() || isSlot() || isSignal()) && Config_getBool("HAVE_DOT") && (isFunction() || isSlot() || isSignal()) && Config_getBool("HAVE_DOT")
) )
{ {
...@@ -2027,7 +2054,7 @@ void MemberDef::_writeCallGraph(OutputList &ol) ...@@ -2027,7 +2054,7 @@ void MemberDef::_writeCallGraph(OutputList &ol)
ol.startCallGraph(); ol.startCallGraph();
ol.parseText(theTranslator->trCallGraph()); ol.parseText(theTranslator->trCallGraph());
ol.endCallGraph(callGraph); ol.endCallGraph(callGraph);
ol.endParagraph(); ol.endParagraph();
ol.enableAll(); ol.enableAll();
} }
} }
...@@ -2035,7 +2062,7 @@ void MemberDef::_writeCallGraph(OutputList &ol) ...@@ -2035,7 +2062,7 @@ void MemberDef::_writeCallGraph(OutputList &ol)
void MemberDef::_writeCallerGraph(OutputList &ol) void MemberDef::_writeCallerGraph(OutputList &ol)
{ {
if ((m_impl->hasCallerGraph || Config_getBool("CALLER_GRAPH")) if ((m_impl->hasCallerGraph || Config_getBool("CALLER_GRAPH"))
&& (isFunction() || isSlot() || isSignal()) && Config_getBool("HAVE_DOT") && (isFunction() || isSlot() || isSignal()) && Config_getBool("HAVE_DOT")
) )
{ {
...@@ -2068,7 +2095,7 @@ void MemberDef::_writeReimplements(OutputList &ol) ...@@ -2068,7 +2095,7 @@ void MemberDef::_writeReimplements(OutputList &ol)
if (bcd->isLinkable()) if (bcd->isLinkable())
{ {
ol.startParagraph(); ol.startParagraph();
QCString reimplFromLine; QCString reimplFromLine;
if (bmd->virtualness()!=Pure && bcd->compoundType()!=ClassDef::Interface) if (bmd->virtualness()!=Pure && bcd->compoundType()!=ClassDef::Interface)
{ {
reimplFromLine = theTranslator->trReimplementedFromList(1); reimplFromLine = theTranslator->trReimplementedFromList(1);
...@@ -2090,7 +2117,7 @@ void MemberDef::_writeReimplements(OutputList &ol) ...@@ -2090,7 +2117,7 @@ void MemberDef::_writeReimplements(OutputList &ol)
//ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), //ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(),
// bmd->anchor(),bcd->name()); // bmd->anchor(),bcd->name());
if ( bmd->isLinkableInProject() ) if ( bmd->isLinkableInProject() )
{ {
writePageRef(ol,bmd->getOutputFileBase(),bmd->anchor()); writePageRef(ol,bmd->getOutputFileBase(),bmd->anchor());
} }
...@@ -2130,7 +2157,7 @@ void MemberDef::_writeReimplementedBy(OutputList &ol) ...@@ -2130,7 +2157,7 @@ void MemberDef::_writeReimplementedBy(OutputList &ol)
{ {
// count the members that directly inherit from md and for // count the members that directly inherit from md and for
// which the member and class are visible in the docs. // which the member and class are visible in the docs.
if ( bmd->isLinkable() && bcd->isLinkable() ) if ( bmd->isLinkable() && bcd->isLinkable() )
{ {
count++; count++;
} }
...@@ -2164,7 +2191,7 @@ void MemberDef::_writeReimplementedBy(OutputList &ol) ...@@ -2164,7 +2191,7 @@ void MemberDef::_writeReimplementedBy(OutputList &ol)
// find the entryIndex-th documented entry in the inheritance list. // find the entryIndex-th documented entry in the inheritance list.
for (mli.toLast();(bmd=mli.current()) && (bcd=bmd->getClassDef());--mli) for (mli.toLast();(bmd=mli.current()) && (bcd=bmd->getClassDef());--mli)
{ {
if ( bmd->isLinkable() && bcd->isLinkable()) if ( bmd->isLinkable() && bcd->isLinkable())
{ {
if (count==entryIndex) break; if (count==entryIndex) break;
count++; count++;
...@@ -2178,14 +2205,14 @@ void MemberDef::_writeReimplementedBy(OutputList &ol) ...@@ -2178,14 +2205,14 @@ void MemberDef::_writeReimplementedBy(OutputList &ol)
ol.writeObjectLink(bmd->getReference(),bmd->getOutputFileBase(), ol.writeObjectLink(bmd->getReference(),bmd->getOutputFileBase(),
bmd->anchor(),bcd->displayName()); bmd->anchor(),bcd->displayName());
if (bmd->isLinkableInProject() ) if (bmd->isLinkableInProject() )
{ {
writePageRef(ol,bmd->getOutputFileBase(),bmd->anchor()); writePageRef(ol,bmd->getOutputFileBase(),bmd->anchor());
} }
} }
++mli; ++mli;
index=newIndex+matchLen; index=newIndex+matchLen;
} }
ol.parseText(reimplInLine.right(reimplInLine.length()-index)); ol.parseText(reimplInLine.right(reimplInLine.length()-index));
ol.endParagraph(); ol.endParagraph();
} }
...@@ -2213,7 +2240,7 @@ void MemberDef::_writeCategoryRelation(OutputList &ol) ...@@ -2213,7 +2240,7 @@ void MemberDef::_writeCategoryRelation(OutputList &ol)
{ {
if (m_impl->category) if (m_impl->category)
{ {
// this member is in a normal class and implements method categoryRelation from category // this member is in a normal class and implements method categoryRelation from category
// so link to method 'categoryRelation' with 'provided by category 'category' text. // so link to method 'categoryRelation' with 'provided by category 'category' text.
text = theTranslator->trProvidedByCategory(); text = theTranslator->trProvidedByCategory();
name = m_impl->category->displayName(); name = m_impl->category->displayName();
...@@ -2322,19 +2349,19 @@ void MemberDef::_writeEnumValues(OutputList &ol,Definition *container, ...@@ -2322,19 +2349,19 @@ void MemberDef::_writeEnumValues(OutputList &ol,Definition *container,
bool hasDetails = !fmd->documentation().isEmpty(); bool hasDetails = !fmd->documentation().isEmpty();
if (hasBrief) if (hasBrief)
{ {
ol.generateDoc(fmd->briefFile(),fmd->briefLine(), ol.generateDoc(fmd->briefFile(),fmd->briefLine(),
getOuterScope()?getOuterScope():container, getOuterScope()?getOuterScope():container,
fmd,fmd->briefDescription(),TRUE,FALSE); fmd,fmd->briefDescription(),TRUE,FALSE);
} }
// FIXME:PARA // FIXME:PARA
//if (!fmd->briefDescription().isEmpty() && //if (!fmd->briefDescription().isEmpty() &&
// !fmd->documentation().isEmpty()) // !fmd->documentation().isEmpty())
//{ //{
// ol.newParagraph(); // ol.newParagraph();
//} //}
if (hasDetails) if (hasDetails)
{ {
ol.generateDoc(fmd->docFile(),fmd->docLine(), ol.generateDoc(fmd->docFile(),fmd->docLine(),
getOuterScope()?getOuterScope():container, getOuterScope()?getOuterScope():container,
fmd,fmd->documentation()+"\n",TRUE,FALSE); fmd,fmd->documentation()+"\n",TRUE,FALSE);
...@@ -2344,13 +2371,13 @@ void MemberDef::_writeEnumValues(OutputList &ol,Definition *container, ...@@ -2344,13 +2371,13 @@ void MemberDef::_writeEnumValues(OutputList &ol,Definition *container,
fmd=fmdl->next(); fmd=fmdl->next();
} }
} }
if (!first) if (!first)
{ {
//ol.endItemList(); //ol.endItemList();
ol.endDescTable(); ol.endDescTable();
//ol.endDescForItem(); //ol.endDescForItem();
//ol.endSimpleSect(); //ol.endSimpleSect();
//ol.writeChar('\n'); //ol.writeChar('\n');
} }
} }
} }
...@@ -2415,7 +2442,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -2415,7 +2442,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
QCString ldef = definition(); QCString ldef = definition();
QCString title = name(); QCString title = name();
//printf("member `%s' def=`%s'\n",name().data(),ldef.data()); //printf("member `%s' def=`%s'\n",name().data(),ldef.data());
if (isEnumerate()) if (isEnumerate())
{ {
if (title.at(0)=='@') if (title.at(0)=='@')
{ {
...@@ -2463,7 +2490,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -2463,7 +2490,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,ldef.left(i)); linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,ldef.left(i));
vmd->writeEnumDeclaration(ol,getClassDef(),getNamespaceDef(),getFileDef(),getGroupDef(),definitionType()); vmd->writeEnumDeclaration(ol,getClassDef(),getNamespaceDef(),getFileDef(),getGroupDef(),definitionType());
linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,ldef.right(ldef.length()-i-l)); linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,ldef.right(ldef.length()-i-l));
found=TRUE; found=TRUE;
} }
} }
...@@ -2475,7 +2502,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -2475,7 +2502,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
// search for the last anonymous compound name in the definition // search for the last anonymous compound name in the definition
int si=ldef.find(' '),pi,ei=i+l; int si=ldef.find(' '),pi,ei=i+l;
if (si==-1) si=0; if (si==-1) si=0;
while ((pi=r.match(ldef,i+l,&l))!=-1) while ((pi=r.match(ldef,i+l,&l))!=-1)
{ {
i=pi; i=pi;
ei=i+l; ei=i+l;
...@@ -2500,7 +2527,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -2500,7 +2527,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
{ {
bool first=TRUE; bool first=TRUE;
SrcLangExt lang = getLanguage(); SrcLangExt lang = getLanguage();
if (m_impl->defTmpArgLists && lang==SrcLangExt_Cpp) if (m_impl->defTmpArgLists && lang==SrcLangExt_Cpp)
// definition has explicit template parameter declarations // definition has explicit template parameter declarations
{ {
QListIterator<ArgumentList> ali(*m_impl->defTmpArgLists); QListIterator<ArgumentList> ali(*m_impl->defTmpArgLists);
...@@ -2563,7 +2590,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -2563,7 +2590,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
{ {
// strip scope name // strip scope name
int ep = ldef.find("::"); int ep = ldef.find("::");
if (ep!=-1) if (ep!=-1)
{ {
int sp=ldef.findRev(' ',ep); int sp=ldef.findRev(' ',ep);
if (sp!=-1) if (sp!=-1)
...@@ -2609,14 +2636,14 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -2609,14 +2636,14 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
if (hasOneLineInitializer()) // add initializer if (hasOneLineInitializer()) // add initializer
{ {
if (!isDefine()) if (!isDefine())
{ {
//ol.docify(" = "); //ol.docify(" = ");
ol.docify(" "); ol.docify(" ");
QCString init = m_impl->initializer.simplifyWhiteSpace(); QCString init = m_impl->initializer.simplifyWhiteSpace();
linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,init); linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,init);
} }
else else
{ {
ol.writeNonBreakableSpace(3); ol.writeNonBreakableSpace(3);
linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,m_impl->initializer); linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,m_impl->initializer);
...@@ -2645,7 +2672,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -2645,7 +2672,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
} }
ol.popGeneratorState(); ol.popGeneratorState();
if (hasParameterList) if (hasParameterList)
{ {
ol.endParameterList(); ol.endParameterList();
ol.endMemberDoc(TRUE); ol.endMemberDoc(TRUE);
...@@ -2717,12 +2744,12 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -2717,12 +2744,12 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
} }
/* write brief description */ /* write brief description */
if (!brief.isEmpty() && if (!brief.isEmpty() &&
(Config_getBool("REPEAT_BRIEF") || (Config_getBool("REPEAT_BRIEF") ||
!Config_getBool("BRIEF_MEMBER_DESC") !Config_getBool("BRIEF_MEMBER_DESC")
) )
) )
{ {
ol.startParagraph(); ol.startParagraph();
ol.generateDoc(briefFile(),briefLine(), ol.generateDoc(briefFile(),briefLine(),
getOuterScope()?getOuterScope():container,this, getOuterScope()?getOuterScope():container,this,
...@@ -2731,11 +2758,11 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -2731,11 +2758,11 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
} }
/* write detailed description */ /* write detailed description */
if (!detailed.isEmpty() || if (!detailed.isEmpty() ||
!inbodyDocumentation().isEmpty()) !inbodyDocumentation().isEmpty())
{ {
// write vhdl inline code with or without option INLINE_SOURCE // write vhdl inline code with or without option INLINE_SOURCE
if (optVhdl && VhdlDocGen::isMisc(this)) if (optVhdl && VhdlDocGen::isMisc(this))
{ {
VhdlDocGen::writeSource(this,ol,cname); VhdlDocGen::writeSource(this,ol,cname);
return; return;
...@@ -2744,7 +2771,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -2744,7 +2771,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
{ {
ol.generateDoc(docFile(),docLine(),getOuterScope()?getOuterScope():container,this,detailed+"\n",TRUE,FALSE); ol.generateDoc(docFile(),docLine(),getOuterScope()?getOuterScope():container,this,detailed+"\n",TRUE,FALSE);
} }
if (!inbodyDocumentation().isEmpty()) if (!inbodyDocumentation().isEmpty())
{ {
ol.generateDoc(inbodyFile(),inbodyLine(), ol.generateDoc(inbodyFile(),inbodyLine(),
...@@ -2763,7 +2790,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -2763,7 +2790,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
//printf("***** defArgList=%p name=%s docs=%s hasDocs=%d\n", //printf("***** defArgList=%p name=%s docs=%s hasDocs=%d\n",
// defArgList, // defArgList,
// defArgList?defArgList->hasDocumentation():-1); // defArgList?defArgList->hasDocumentation():-1);
if (docArgList!=0 && docArgList->hasDocumentation()) if (docArgList!=0 && docArgList->hasDocumentation())
{ {
...@@ -2818,7 +2845,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -2818,7 +2845,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
ol.endIndent(); ol.endIndent();
// enable LaTeX again // enable LaTeX again
//if (Config_getBool("EXTRACT_ALL") && !hasDocs) ol.enable(OutputGenerator::Latex); //if (Config_getBool("EXTRACT_ALL") && !hasDocs) ol.enable(OutputGenerator::Latex);
ol.popGeneratorState(); ol.popGeneratorState();
//------------------------------------------------ //------------------------------------------------
...@@ -2864,7 +2891,7 @@ static QCString simplifyTypeForTable(const QCString &s) ...@@ -2864,7 +2891,7 @@ static QCString simplifyTypeForTable(const QCString &s)
} }
#if 0 #if 0
/** Returns the type definition corresponding to a member's return type. /** Returns the type definition corresponding to a member's return type.
* @param[in] scope The scope in which to search for the class definition. * @param[in] scope The scope in which to search for the class definition.
* @param[in] type The string representing the member's return type. * @param[in] type The string representing the member's return type.
* @param[in] lang The programming language in which the class is defined. * @param[in] lang The programming language in which the class is defined.
...@@ -2887,7 +2914,7 @@ static Definition *getClassFromType(Definition *scope,const QCString &type,SrcLa ...@@ -2887,7 +2914,7 @@ static Definition *getClassFromType(Definition *scope,const QCString &type,SrcLa
cd = getResolvedClass(scope,0,name+templSpec,&md); cd = getResolvedClass(scope,0,name+templSpec,&md);
} }
cd = getResolvedClass(scope,0,name); cd = getResolvedClass(scope,0,name);
if (cd) if (cd)
{ {
start=i; start=i;
length=l; length=l;
...@@ -2965,20 +2992,20 @@ void MemberDef::writeMemberDocSimple(OutputList &ol, Definition *container) ...@@ -2965,20 +2992,20 @@ void MemberDef::writeMemberDocSimple(OutputList &ol, Definition *container)
this, // self this, // self
ts, // text ts, // text
TRUE // autoBreak TRUE // autoBreak
); );
} }
ol.endDoxyAnchor(cfname,memAnchor); ol.endDoxyAnchor(cfname,memAnchor);
ol.endInlineMemberType(); ol.endInlineMemberType();
ol.startInlineMemberName(); ol.startInlineMemberName();
ol.docify(doxyName); ol.docify(doxyName);
if (isVariable() && argsString() && !isObjCMethod()) if (isVariable() && argsString() && !isObjCMethod())
{ {
linkifyText(TextGeneratorOLImpl(ol),getOuterScope(),getBodyDef(),this,argsString()); linkifyText(TextGeneratorOLImpl(ol),getOuterScope(),getBodyDef(),this,argsString());
} }
if (!m_impl->bitfields.isEmpty()) // add bitfields if (!m_impl->bitfields.isEmpty()) // add bitfields
{ {
linkifyText(TextGeneratorOLImpl(ol),getOuterScope(),getBodyDef(),this,m_impl->bitfields.simplifyWhiteSpace()); linkifyText(TextGeneratorOLImpl(ol),getOuterScope(),getBodyDef(),this,m_impl->bitfields);
} }
ol.endInlineMemberName(); ol.endInlineMemberName();
...@@ -2988,8 +3015,8 @@ void MemberDef::writeMemberDocSimple(OutputList &ol, Definition *container) ...@@ -2988,8 +3015,8 @@ void MemberDef::writeMemberDocSimple(OutputList &ol, Definition *container)
QCString detailed = documentation(); QCString detailed = documentation();
/* write brief description */ /* write brief description */
if (!brief.isEmpty()) if (!brief.isEmpty())
{ {
ol.generateDoc(briefFile(),briefLine(), ol.generateDoc(briefFile(),briefLine(),
getOuterScope()?getOuterScope():container,this, getOuterScope()?getOuterScope():container,this,
brief,FALSE,FALSE,0,TRUE,FALSE); brief,FALSE,FALSE,0,TRUE,FALSE);
...@@ -2997,11 +3024,11 @@ void MemberDef::writeMemberDocSimple(OutputList &ol, Definition *container) ...@@ -2997,11 +3024,11 @@ void MemberDef::writeMemberDocSimple(OutputList &ol, Definition *container)
/* write detailed description */ /* write detailed description */
if (!detailed.isEmpty()) if (!detailed.isEmpty())
{ {
ol.generateDoc(docFile(),docLine(), ol.generateDoc(docFile(),docLine(),
getOuterScope()?getOuterScope():container,this, getOuterScope()?getOuterScope():container,this,
detailed+"\n",FALSE,FALSE,0,FALSE,FALSE); detailed+"\n",FALSE,FALSE,0,FALSE,FALSE);
} }
ol.endInlineMemberDoc(); ol.endInlineMemberDoc();
...@@ -3015,7 +3042,7 @@ QCString MemberDef::memberTypeName() const ...@@ -3015,7 +3042,7 @@ QCString MemberDef::memberTypeName() const
case MemberType_Function: return "function"; case MemberType_Function: return "function";
case MemberType_Variable: return "variable"; case MemberType_Variable: return "variable";
case MemberType_Typedef: return "typedef"; case MemberType_Typedef: return "typedef";
case MemberType_Enumeration: return "enumeration"; case MemberType_Enumeration: return "enumeration";
case MemberType_EnumValue: return "enumvalue"; case MemberType_EnumValue: return "enumvalue";
case MemberType_Signal: return "signal"; case MemberType_Signal: return "signal";
case MemberType_Slot: return "slot"; case MemberType_Slot: return "slot";
...@@ -3038,10 +3065,10 @@ void MemberDef::warnIfUndocumented() ...@@ -3038,10 +3065,10 @@ void MemberDef::warnIfUndocumented()
GroupDef *gd = getGroupDef(); GroupDef *gd = getGroupDef();
Definition *d=0; Definition *d=0;
const char *t=0; const char *t=0;
if (cd) if (cd)
t="class", d=cd; t="class", d=cd;
else if (nd) else if (nd)
t="namespace", d=nd; t="namespace", d=nd;
else if (gd) else if (gd)
t="group", d=gd; t="group", d=gd;
else else
...@@ -3053,7 +3080,7 @@ void MemberDef::warnIfUndocumented() ...@@ -3053,7 +3080,7 @@ void MemberDef::warnIfUndocumented()
// d->isLinkable(),isLinkable(),isDocumentedFriendClass(), // d->isLinkable(),isLinkable(),isDocumentedFriendClass(),
// name().data(),prot); // name().data(),prot);
if ((!hasUserDocumentation() && !extractAll) && if ((!hasUserDocumentation() && !extractAll) &&
!isFriendClass() && !isFriendClass() &&
name().find('@')==-1 && d && d->name().find('@')==-1 && name().find('@')==-1 && d && d->name().find('@')==-1 &&
protectionLevelVisible(m_impl->prot) && protectionLevelVisible(m_impl->prot) &&
!isReference() !isReference()
...@@ -3068,8 +3095,8 @@ void MemberDef::warnIfUndocumented() ...@@ -3068,8 +3095,8 @@ void MemberDef::warnIfUndocumented()
bool MemberDef::isFriendClass() const bool MemberDef::isFriendClass() const
{ {
return (isFriend() && return (isFriend() &&
(m_impl->type=="friend class" || m_impl->type=="friend struct" || (m_impl->type=="friend class" || m_impl->type=="friend struct" ||
m_impl->type=="friend union")); m_impl->type=="friend union"));
} }
...@@ -3080,12 +3107,12 @@ bool MemberDef::isDocumentedFriendClass() const ...@@ -3080,12 +3107,12 @@ bool MemberDef::isDocumentedFriendClass() const
int i=baseName.find('<'); int i=baseName.find('<');
if (i!=-1) baseName=baseName.left(i); if (i!=-1) baseName=baseName.left(i);
return (isFriendClass() && return (isFriendClass() &&
(fcd=getClass(baseName)) && fcd->isLinkable()); (fcd=getClass(baseName)) && fcd->isLinkable());
} }
bool MemberDef::hasDocumentation() const bool MemberDef::hasDocumentation() const
{ {
return Definition::hasDocumentation() || return Definition::hasDocumentation() ||
(m_impl->mtype==MemberType_Enumeration && m_impl->docEnumValues) || // has enum values (m_impl->mtype==MemberType_Enumeration && m_impl->docEnumValues) || // has enum values
(m_impl->defArgList!=0 && m_impl->defArgList->hasDocumentation()); // has doc arguments (m_impl->defArgList!=0 && m_impl->defArgList->hasDocumentation()); // has doc arguments
} }
...@@ -3104,10 +3131,10 @@ void MemberDef::setMemberGroup(MemberGroup *grp) ...@@ -3104,10 +3131,10 @@ void MemberDef::setMemberGroup(MemberGroup *grp)
m_impl->memberGroup = grp; m_impl->memberGroup = grp;
} }
bool MemberDef::visibleMemberGroup(bool hideNoHeader) bool MemberDef::visibleMemberGroup(bool hideNoHeader)
{ {
return m_impl->memberGroup!=0 && return m_impl->memberGroup!=0 &&
(!hideNoHeader || m_impl->memberGroup->header()!="[NOHEADER]"); (!hideNoHeader || m_impl->memberGroup->header()!="[NOHEADER]");
} }
QCString MemberDef::getScopeString() const QCString MemberDef::getScopeString() const
...@@ -3152,17 +3179,17 @@ void MemberDef::setAnchor() ...@@ -3152,17 +3179,17 @@ void MemberDef::setAnchor()
// twice, which is silly, but we keep it this way for backward // twice, which is silly, but we keep it this way for backward
// compatibility. // compatibility.
// include number of template arguments as well, // include number of template arguments as well,
// to distinguish between two template // to distinguish between two template
// specializations that only differ in the template parameters. // specializations that only differ in the template parameters.
if (m_impl->tArgList) if (m_impl->tArgList)
{ {
char buf[20]; char buf[20];
qsnprintf(buf,20,"%d:",m_impl->tArgList->count()); qsnprintf(buf,20,"%d:",m_impl->tArgList->count());
buf[19]='\0'; buf[19]='\0';
memAnchor.prepend(buf); memAnchor.prepend(buf);
} }
// convert to md5 hash // convert to md5 hash
uchar md5_sig[16]; uchar md5_sig[16];
QCString sigStr(33); QCString sigStr(33);
...@@ -3183,12 +3210,12 @@ void MemberDef::setGroupDef(GroupDef *gd,Grouping::GroupPri_t pri, ...@@ -3183,12 +3210,12 @@ void MemberDef::setGroupDef(GroupDef *gd,Grouping::GroupPri_t pri,
m_impl->groupStartLine=startLine; m_impl->groupStartLine=startLine;
m_impl->groupHasDocs=hasDocs; m_impl->groupHasDocs=hasDocs;
m_impl->groupMember=member; m_impl->groupMember=member;
m_isLinkableCached = 0; m_isLinkableCached = 0;
} }
void MemberDef::setEnumScope(MemberDef *md,bool livesInsideEnum) void MemberDef::setEnumScope(MemberDef *md,bool livesInsideEnum)
{ {
m_impl->enumScope=md; m_impl->enumScope=md;
m_impl->livesInsideEnum=livesInsideEnum; m_impl->livesInsideEnum=livesInsideEnum;
if (md->getGroupDef()) if (md->getGroupDef())
{ {
...@@ -3197,22 +3224,22 @@ void MemberDef::setEnumScope(MemberDef *md,bool livesInsideEnum) ...@@ -3197,22 +3224,22 @@ void MemberDef::setEnumScope(MemberDef *md,bool livesInsideEnum)
m_impl->groupFileName=md->getGroupFileName(); m_impl->groupFileName=md->getGroupFileName();
m_impl->groupStartLine=md->getGroupStartLine(); m_impl->groupStartLine=md->getGroupStartLine();
m_impl->groupHasDocs=md->getGroupHasDocs(); m_impl->groupHasDocs=md->getGroupHasDocs();
m_isLinkableCached = 0; m_isLinkableCached = 0;
} }
} }
void MemberDef::setMemberClass(ClassDef *cd) void MemberDef::setMemberClass(ClassDef *cd)
{ {
m_impl->classDef=cd; m_impl->classDef=cd;
m_isLinkableCached = 0; m_isLinkableCached = 0;
m_isConstructorCached = 0; m_isConstructorCached = 0;
setOuterScope(cd); setOuterScope(cd);
} }
void MemberDef::setNamespace(NamespaceDef *nd) void MemberDef::setNamespace(NamespaceDef *nd)
{ {
m_impl->nspace=nd; m_impl->nspace=nd;
setOuterScope(nd); setOuterScope(nd);
} }
MemberDef *MemberDef::createTemplateInstanceMember( MemberDef *MemberDef::createTemplateInstanceMember(
...@@ -3231,7 +3258,7 @@ MemberDef *MemberDef::createTemplateInstanceMember( ...@@ -3231,7 +3258,7 @@ MemberDef *MemberDef::createTemplateInstanceMember(
{ {
arg->type = substituteTemplateArgumentsInString(arg->type,formalArgs,actualArgs); arg->type = substituteTemplateArgumentsInString(arg->type,formalArgs,actualArgs);
} }
actualArgList->trailingReturnType = actualArgList->trailingReturnType =
substituteTemplateArgumentsInString(actualArgList->trailingReturnType,formalArgs,actualArgs); substituteTemplateArgumentsInString(actualArgList->trailingReturnType,formalArgs,actualArgs);
} }
...@@ -3243,9 +3270,9 @@ MemberDef *MemberDef::createTemplateInstanceMember( ...@@ -3243,9 +3270,9 @@ MemberDef *MemberDef::createTemplateInstanceMember(
MemberDef *imd = new MemberDef( MemberDef *imd = new MemberDef(
getDefFileName(),getDefLine(),getDefColumn(), getDefFileName(),getDefLine(),getDefColumn(),
substituteTemplateArgumentsInString(m_impl->type,formalArgs,actualArgs), substituteTemplateArgumentsInString(m_impl->type,formalArgs,actualArgs),
methodName, methodName,
substituteTemplateArgumentsInString(m_impl->args,formalArgs,actualArgs), substituteTemplateArgumentsInString(m_impl->args,formalArgs,actualArgs),
m_impl->exception, m_impl->prot, m_impl->exception, m_impl->prot,
m_impl->virt, m_impl->stat, m_impl->related, m_impl->mtype, 0, 0 m_impl->virt, m_impl->stat, m_impl->related, m_impl->mtype, 0, 0
); );
...@@ -3257,7 +3284,7 @@ MemberDef *MemberDef::createTemplateInstanceMember( ...@@ -3257,7 +3284,7 @@ MemberDef *MemberDef::createTemplateInstanceMember(
// TODO: init other member variables (if needed). // TODO: init other member variables (if needed).
// TODO: reimplemented info // TODO: reimplemented info
return imd; return imd;
} }
bool MemberDef::hasOneLineInitializer() const bool MemberDef::hasOneLineInitializer() const
...@@ -3273,15 +3300,15 @@ bool MemberDef::hasMultiLineInitializer() const ...@@ -3273,15 +3300,15 @@ bool MemberDef::hasMultiLineInitializer() const
{ {
//printf("initLines=%d userInitLines=%d maxInitLines=%d\n", //printf("initLines=%d userInitLines=%d maxInitLines=%d\n",
// initLines,userInitLines,maxInitLines); // initLines,userInitLines,maxInitLines);
return m_impl->initLines>0 && return m_impl->initLines>0 &&
((m_impl->initLines<m_impl->maxInitLines && m_impl->userInitLines==-1) // implicitly enabled ((m_impl->initLines<m_impl->maxInitLines && m_impl->userInitLines==-1) // implicitly enabled
|| m_impl->initLines<m_impl->userInitLines // explicitly enabled || m_impl->initLines<m_impl->userInitLines // explicitly enabled
); );
} }
void MemberDef::setInitializer(const char *initializer) void MemberDef::setInitializer(const char *initializer)
{ {
m_impl->initializer=initializer; m_impl->initializer=initializer;
int l=m_impl->initializer.length(); int l=m_impl->initializer.length();
int p=l-1; int p=l-1;
while (p>=0 && isspace((uchar)m_impl->initializer.at(p))) p--; while (p>=0 && isspace((uchar)m_impl->initializer.at(p))) p--;
...@@ -3295,12 +3322,12 @@ void MemberDef::addListReference(Definition *) ...@@ -3295,12 +3322,12 @@ void MemberDef::addListReference(Definition *)
static bool optimizeOutputForC = Config_getBool("OPTIMIZE_OUTPUT_FOR_C"); static bool optimizeOutputForC = Config_getBool("OPTIMIZE_OUTPUT_FOR_C");
//static bool hideScopeNames = Config_getBool("HIDE_SCOPE_NAMES"); //static bool hideScopeNames = Config_getBool("HIDE_SCOPE_NAMES");
//static bool optimizeOutputJava = Config_getBool("OPTIMIZE_OUTPUT_JAVA"); //static bool optimizeOutputJava = Config_getBool("OPTIMIZE_OUTPUT_JAVA");
//static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); //static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
SrcLangExt lang = getLanguage(); SrcLangExt lang = getLanguage();
visited=TRUE; visited=TRUE;
if (!isLinkableInProject()) return; if (!isLinkableInProject()) return;
QCString memLabel; QCString memLabel;
if (optimizeOutputForC) if (optimizeOutputForC)
{ {
memLabel=theTranslator->trGlobal(TRUE,TRUE); memLabel=theTranslator->trGlobal(TRUE,TRUE);
} }
...@@ -3314,11 +3341,11 @@ void MemberDef::addListReference(Definition *) ...@@ -3314,11 +3341,11 @@ void MemberDef::addListReference(Definition *)
} }
QCString memName = name(); QCString memName = name();
Definition *pd=getOuterScope(); Definition *pd=getOuterScope();
QCString pdName = pd->definitionType()==Definition::TypeClass ? QCString pdName = pd->definitionType()==Definition::TypeClass ?
((ClassDef*)pd)->displayName() : pd->name(); ((ClassDef*)pd)->displayName() : pd->name();
QCString sep = getLanguageSpecificSeparator(lang,TRUE); QCString sep = getLanguageSpecificSeparator(lang,TRUE);
QCString memArgs; QCString memArgs;
if (!isRelated() if (!isRelated()
/* && commented out as a result of bug 597016 /* && commented out as a result of bug 597016
( (
(!hideScopeNames && // there is a scope (!hideScopeNames && // there is a scope
...@@ -3334,7 +3361,7 @@ void MemberDef::addListReference(Definition *) ...@@ -3334,7 +3361,7 @@ void MemberDef::addListReference(Definition *)
{ {
memName = "[" + pd->name() + " " + name() + "]"; memName = "[" + pd->name() + " " + name() + "]";
} }
else else
{ {
if (pd!=Doxygen::globalScope) memName.prepend(pdName+sep); if (pd!=Doxygen::globalScope) memName.prepend(pdName+sep);
memArgs = argsString(); memArgs = argsString();
...@@ -3350,19 +3377,19 @@ void MemberDef::addListReference(Definition *) ...@@ -3350,19 +3377,19 @@ void MemberDef::addListReference(Definition *)
} }
} }
MemberList *MemberDef::getSectionList(Definition *d) const MemberList *MemberDef::getSectionList(Definition *d) const
{ {
char key[20]; char key[20];
sprintf(key,"%p",d); sprintf(key,"%p",d);
return (d!=0 && m_impl->classSectionSDict) ? m_impl->classSectionSDict->find(key) : 0; return (d!=0 && m_impl->classSectionSDict) ? m_impl->classSectionSDict->find(key) : 0;
} }
void MemberDef::setSectionList(Definition *d, MemberList *sl) void MemberDef::setSectionList(Definition *d, MemberList *sl)
{ {
//printf("MemberDef::setSectionList(%p,%p) name=%s\n",d,sl,name().data()); //printf("MemberDef::setSectionList(%p,%p) name=%s\n",d,sl,name().data());
char key[20]; char key[20];
sprintf(key,"%p",d); sprintf(key,"%p",d);
if (m_impl->classSectionSDict==0) if (m_impl->classSectionSDict==0)
{ {
m_impl->classSectionSDict = new SDict<MemberList>(7); m_impl->classSectionSDict = new SDict<MemberList>(7);
} }
...@@ -3371,7 +3398,7 @@ void MemberDef::setSectionList(Definition *d, MemberList *sl) ...@@ -3371,7 +3398,7 @@ void MemberDef::setSectionList(Definition *d, MemberList *sl)
Specifier MemberDef::virtualness(int count) const Specifier MemberDef::virtualness(int count) const
{ {
if (count>25) if (count>25)
{ {
warn(getDefFileName(),getDefLine(), warn(getDefFileName(),getDefLine(),
"Internal inconsistency: recursion detected in overload relation for member %s!" "Internal inconsistency: recursion detected in overload relation for member %s!"
...@@ -3390,7 +3417,7 @@ Specifier MemberDef::virtualness(int count) const ...@@ -3390,7 +3417,7 @@ Specifier MemberDef::virtualness(int count) const
} }
void MemberDef::_writeTagData(const DefType compoundType) void MemberDef::_writeTagData(const DefType compoundType)
{ {
unsigned typeMask = 1 << compoundType; unsigned typeMask = 1 << compoundType;
if ((m_impl->tagDataWritten) & typeMask) return; // member already written for this type if ((m_impl->tagDataWritten) & typeMask) return; // member already written for this type
if (m_impl->mtype==MemberType_EnumValue && m_impl->enumScope && if (m_impl->mtype==MemberType_EnumValue && m_impl->enumScope &&
...@@ -3422,13 +3449,13 @@ void MemberDef::_writeTagData(const DefType compoundType) ...@@ -3422,13 +3449,13 @@ void MemberDef::_writeTagData(const DefType compoundType)
Doxygen::tagFile << "\" protection=\""; Doxygen::tagFile << "\" protection=\"";
if (m_impl->prot==Protected) Doxygen::tagFile << "protected"; if (m_impl->prot==Protected) Doxygen::tagFile << "protected";
else if (m_impl->prot==Package) Doxygen::tagFile << "package"; else if (m_impl->prot==Package) Doxygen::tagFile << "package";
else /* Private */ Doxygen::tagFile << "private"; else /* Private */ Doxygen::tagFile << "private";
} }
if (m_impl->virt!=Normal) if (m_impl->virt!=Normal)
{ {
Doxygen::tagFile << "\" virtualness=\""; Doxygen::tagFile << "\" virtualness=\"";
if (m_impl->virt==Virtual) Doxygen::tagFile << "virtual"; if (m_impl->virt==Virtual) Doxygen::tagFile << "virtual";
else /* Pure */ Doxygen::tagFile << "pure"; else /* Pure */ Doxygen::tagFile << "pure";
} }
if (isStatic()) if (isStatic())
{ {
...@@ -3459,11 +3486,11 @@ void MemberDef::_writeTagData(const DefType compoundType) ...@@ -3459,11 +3486,11 @@ void MemberDef::_writeTagData(const DefType compoundType)
Doxygen::tagFile << " <enumvalue file=\"" << convertToXML(getOutputFileBase()+Doxygen::htmlFileExtension); Doxygen::tagFile << " <enumvalue file=\"" << convertToXML(getOutputFileBase()+Doxygen::htmlFileExtension);
Doxygen::tagFile << "\" anchor=\"" << convertToXML(fmd->anchor()); Doxygen::tagFile << "\" anchor=\"" << convertToXML(fmd->anchor());
QCString idStr = fmd->id(); QCString idStr = fmd->id();
if (!idStr.isEmpty()) if (!idStr.isEmpty())
{ {
Doxygen::tagFile << "\" clangid=\"" << convertToXML(idStr); Doxygen::tagFile << "\" clangid=\"" << convertToXML(idStr);
} }
Doxygen::tagFile << "\">" << convertToXML(fmd->name()) << "</enumvalue>" << endl; Doxygen::tagFile << "\">" << convertToXML(fmd->name()) << "</enumvalue>" << endl;
} }
} }
} }
...@@ -3478,7 +3505,7 @@ void MemberDef::_writeTagData(const DefType compoundType) ...@@ -3478,7 +3505,7 @@ void MemberDef::_writeTagData(const DefType compoundType)
void MemberDef::_computeIsConstructor() void MemberDef::_computeIsConstructor()
{ {
m_isConstructorCached=1; // FALSE m_isConstructorCached=1; // FALSE
if (m_impl->classDef) if (m_impl->classDef)
{ {
if (m_impl->isDMember) // for D if (m_impl->isDMember) // for D
{ {
...@@ -3486,11 +3513,11 @@ void MemberDef::_computeIsConstructor() ...@@ -3486,11 +3513,11 @@ void MemberDef::_computeIsConstructor()
return; return;
} }
else if (getLanguage()==SrcLangExt_PHP) // for PHP else if (getLanguage()==SrcLangExt_PHP) // for PHP
{ {
m_isConstructorCached = name()=="__construct" ? 2 : 1; m_isConstructorCached = name()=="__construct" ? 2 : 1;
return; return;
} }
else if (name()=="__init__" && else if (name()=="__init__" &&
getLanguage()==SrcLangExt_Python) // for Python getLanguage()==SrcLangExt_Python) // for Python
{ {
m_isConstructorCached = 2; // TRUE m_isConstructorCached = 2; // TRUE
...@@ -3518,8 +3545,8 @@ void MemberDef::_computeIsConstructor() ...@@ -3518,8 +3545,8 @@ void MemberDef::_computeIsConstructor()
} }
} }
bool MemberDef::isConstructor() const bool MemberDef::isConstructor() const
{ {
if (m_isConstructorCached==0) if (m_isConstructorCached==0)
{ {
MemberDef *that = (MemberDef*)this; MemberDef *that = (MemberDef*)this;
...@@ -3538,14 +3565,14 @@ void MemberDef::_computeIsDestructor() ...@@ -3538,14 +3565,14 @@ void MemberDef::_computeIsDestructor()
isDestructor = name()=="~this"; isDestructor = name()=="~this";
} }
else if (getLanguage()==SrcLangExt_PHP) // for PHP else if (getLanguage()==SrcLangExt_PHP) // for PHP
{ {
isDestructor = name()=="__destruct"; isDestructor = name()=="__destruct";
} }
else if (getLanguage()==SrcLangExt_Tcl) // for Tcl else if (getLanguage()==SrcLangExt_Tcl) // for Tcl
{ {
isDestructor = name()=="destructor"; isDestructor = name()=="destructor";
} }
else if (name()=="__del__" && else if (name()=="__del__" &&
getLanguage()==SrcLangExt_Python) // for Python getLanguage()==SrcLangExt_Python) // for Python
{ {
isDestructor=TRUE; isDestructor=TRUE;
...@@ -3554,13 +3581,13 @@ void MemberDef::_computeIsDestructor() ...@@ -3554,13 +3581,13 @@ void MemberDef::_computeIsDestructor()
{ {
isDestructor = isDestructor =
(name().find('~')!=-1 || name().find('!')!=-1) // The ! is for C++/CLI (name().find('~')!=-1 || name().find('!')!=-1) // The ! is for C++/CLI
&& name().find("operator")==-1; && name().find("operator")==-1;
} }
m_isDestructorCached = isDestructor ? 2 : 1; m_isDestructorCached = isDestructor ? 2 : 1;
} }
bool MemberDef::isDestructor() const bool MemberDef::isDestructor() const
{ {
if (m_isDestructorCached==0) if (m_isDestructorCached==0)
{ {
MemberDef *that=(MemberDef*)this; MemberDef *that=(MemberDef*)this;
...@@ -3571,7 +3598,7 @@ bool MemberDef::isDestructor() const ...@@ -3571,7 +3598,7 @@ bool MemberDef::isDestructor() const
} }
void MemberDef::writeEnumDeclaration(OutputList &typeDecl, void MemberDef::writeEnumDeclaration(OutputList &typeDecl,
ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd,
const DefType compoundType) const DefType compoundType)
{ {
int enumMemCount=0; int enumMemCount=0;
...@@ -3587,7 +3614,7 @@ void MemberDef::writeEnumDeclaration(OutputList &typeDecl, ...@@ -3587,7 +3614,7 @@ void MemberDef::writeEnumDeclaration(OutputList &typeDecl,
fmd=fmdl->next(); fmd=fmdl->next();
} }
} }
if (numVisibleEnumValues==0 && !isBriefSectionVisible()) if (numVisibleEnumValues==0 && !isBriefSectionVisible())
{ {
return; return;
} }
...@@ -3638,7 +3665,7 @@ void MemberDef::writeEnumDeclaration(OutputList &typeDecl, ...@@ -3638,7 +3665,7 @@ void MemberDef::writeEnumDeclaration(OutputList &typeDecl,
typeDecl.pushGeneratorState(); typeDecl.pushGeneratorState();
typeDecl.disableAllBut(OutputGenerator::Html); typeDecl.disableAllBut(OutputGenerator::Html);
typeDecl.enable(OutputGenerator::Latex); typeDecl.enable(OutputGenerator::Latex);
typeDecl.lineBreak(); typeDecl.lineBreak();
typeDecl.disable(OutputGenerator::Latex); typeDecl.disable(OutputGenerator::Latex);
typeDecl.writeString("&#160;&#160;"); typeDecl.writeString("&#160;&#160;");
typeDecl.popGeneratorState(); typeDecl.popGeneratorState();
...@@ -3665,7 +3692,7 @@ void MemberDef::writeEnumDeclaration(OutputList &typeDecl, ...@@ -3665,7 +3692,7 @@ void MemberDef::writeEnumDeclaration(OutputList &typeDecl,
bool prevVisible = fmdVisible; bool prevVisible = fmdVisible;
fmd=fmdl->next(); fmd=fmdl->next();
if (fmd && (fmdVisible=fmd->isBriefSectionVisible())) if (fmd && (fmdVisible=fmd->isBriefSectionVisible()))
{ {
typeDecl.writeString(", "); typeDecl.writeString(", ");
} }
...@@ -3681,7 +3708,7 @@ void MemberDef::writeEnumDeclaration(OutputList &typeDecl, ...@@ -3681,7 +3708,7 @@ void MemberDef::writeEnumDeclaration(OutputList &typeDecl,
{ {
typeDecl.pushGeneratorState(); typeDecl.pushGeneratorState();
typeDecl.disableAllBut(OutputGenerator::Html); typeDecl.disableAllBut(OutputGenerator::Html);
typeDecl.lineBreak(); typeDecl.lineBreak();
typeDecl.popGeneratorState(); typeDecl.popGeneratorState();
} }
} }
...@@ -3689,8 +3716,8 @@ void MemberDef::writeEnumDeclaration(OutputList &typeDecl, ...@@ -3689,8 +3716,8 @@ void MemberDef::writeEnumDeclaration(OutputList &typeDecl,
} }
} }
void MemberDef::setArgumentList(ArgumentList *al) void MemberDef::setArgumentList(ArgumentList *al)
{ {
if (m_impl->defArgList) delete m_impl->defArgList; if (m_impl->defArgList) delete m_impl->defArgList;
m_impl->defArgList = al; m_impl->defArgList = al;
} }
...@@ -3728,25 +3755,25 @@ void MemberDef::setAccessorType(ClassDef *cd,const char *t) ...@@ -3728,25 +3755,25 @@ void MemberDef::setAccessorType(ClassDef *cd,const char *t)
void MemberDef::findSectionsInDocumentation() void MemberDef::findSectionsInDocumentation()
{ {
docFindSections(documentation(),this,0,docFile()); docFindSections(documentation(),this,0,docFile());
} }
void MemberDef::enableCallGraph(bool e) void MemberDef::enableCallGraph(bool e)
{ {
m_impl->hasCallGraph=e; m_impl->hasCallGraph=e;
if (e) Doxygen::parseSourcesNeeded = TRUE; if (e) Doxygen::parseSourcesNeeded = TRUE;
} }
void MemberDef::enableCallerGraph(bool e) void MemberDef::enableCallerGraph(bool e)
{ {
m_impl->hasCallerGraph=e; m_impl->hasCallerGraph=e;
if (e) Doxygen::parseSourcesNeeded = TRUE; if (e) Doxygen::parseSourcesNeeded = TRUE;
} }
#if 0 #if 0
bool MemberDef::protectionVisible() const bool MemberDef::protectionVisible() const
{ {
return m_impl->prot==Public || return m_impl->prot==Public ||
(m_impl->prot==Private && Config_getBool("EXTRACT_PRIVATE")) || (m_impl->prot==Private && Config_getBool("EXTRACT_PRIVATE")) ||
(m_impl->prot==Protected && Config_getBool("EXTRACT_PROTECTED")) || (m_impl->prot==Protected && Config_getBool("EXTRACT_PROTECTED")) ||
(m_impl->prot==Package && Config_getBool("EXTRACT_PACKAGE")); (m_impl->prot==Package && Config_getBool("EXTRACT_PACKAGE"));
...@@ -3767,13 +3794,13 @@ void MemberDef::setInbodyDocumentation(const char *docs, ...@@ -3767,13 +3794,13 @@ void MemberDef::setInbodyDocumentation(const char *docs,
bool MemberDef::isObjCMethod() const bool MemberDef::isObjCMethod() const
{ {
if (m_impl->classDef && m_impl->classDef->isObjectiveC() && isFunction()) return TRUE; if (m_impl->classDef && m_impl->classDef->isObjectiveC() && isFunction()) return TRUE;
return FALSE; return FALSE;
} }
bool MemberDef::isObjCProperty() const bool MemberDef::isObjCProperty() const
{ {
if (m_impl->classDef && m_impl->classDef->isObjectiveC() && isProperty()) return TRUE; if (m_impl->classDef && m_impl->classDef->isObjectiveC() && isProperty()) return TRUE;
return FALSE; return FALSE;
} }
QCString MemberDef::qualifiedName() const QCString MemberDef::qualifiedName() const
...@@ -3797,7 +3824,7 @@ QCString MemberDef::qualifiedName() const ...@@ -3797,7 +3824,7 @@ QCString MemberDef::qualifiedName() const
else else
{ {
return Definition::qualifiedName(); return Definition::qualifiedName();
} }
} }
void MemberDef::setTagInfo(TagInfo *ti) void MemberDef::setTagInfo(TagInfo *ti)
...@@ -3829,12 +3856,12 @@ QCString MemberDef::objCMethodName(bool localLink,bool showStatic) const ...@@ -3829,12 +3856,12 @@ QCString MemberDef::objCMethodName(bool localLink,bool showStatic) const
} }
const char *MemberDef::declaration() const const char *MemberDef::declaration() const
{ {
return m_impl->decl; return m_impl->decl;
} }
const char *MemberDef::definition() const const char *MemberDef::definition() const
{ {
return m_impl->def; return m_impl->def;
} }
...@@ -3844,133 +3871,133 @@ const char *MemberDef::extraTypeChars() const ...@@ -3844,133 +3871,133 @@ const char *MemberDef::extraTypeChars() const
} }
const char *MemberDef::typeString() const const char *MemberDef::typeString() const
{ {
return m_impl->type; return m_impl->type;
} }
const char *MemberDef::argsString() const const char *MemberDef::argsString() const
{ {
return m_impl->args; return m_impl->args;
} }
const char *MemberDef::excpString() const const char *MemberDef::excpString() const
{ {
return m_impl->exception; return m_impl->exception;
} }
const char *MemberDef::bitfieldString() const const char *MemberDef::bitfieldString() const
{ {
return m_impl->bitfields; return m_impl->bitfields;
} }
const QCString &MemberDef::initializer() const const QCString &MemberDef::initializer() const
{ {
return m_impl->initializer; return m_impl->initializer;
} }
int MemberDef::initializerLines() const int MemberDef::initializerLines() const
{ {
return m_impl->initLines; return m_impl->initLines;
} }
uint64 MemberDef::getMemberSpecifiers() const uint64 MemberDef::getMemberSpecifiers() const
{ {
return m_impl->memSpec; return m_impl->memSpec;
} }
ClassDef *MemberDef::getClassDef() const ClassDef *MemberDef::getClassDef() const
{ {
return m_impl->classDef; return m_impl->classDef;
} }
FileDef *MemberDef::getFileDef() const FileDef *MemberDef::getFileDef() const
{ {
return m_impl->fileDef; return m_impl->fileDef;
} }
NamespaceDef* MemberDef::getNamespaceDef() const NamespaceDef* MemberDef::getNamespaceDef() const
{ {
return m_impl->nspace; return m_impl->nspace;
} }
const char *MemberDef::getReadAccessor() const const char *MemberDef::getReadAccessor() const
{ {
return m_impl->read; return m_impl->read;
} }
const char *MemberDef::getWriteAccessor() const const char *MemberDef::getWriteAccessor() const
{ {
return m_impl->write; return m_impl->write;
} }
GroupDef *MemberDef::getGroupDef() const GroupDef *MemberDef::getGroupDef() const
{ {
return m_impl->group; return m_impl->group;
} }
Grouping::GroupPri_t MemberDef::getGroupPri() const Grouping::GroupPri_t MemberDef::getGroupPri() const
{ {
return m_impl->grouppri; return m_impl->grouppri;
} }
const char *MemberDef::getGroupFileName() const const char *MemberDef::getGroupFileName() const
{ {
return m_impl->groupFileName; return m_impl->groupFileName;
} }
int MemberDef::getGroupStartLine() const int MemberDef::getGroupStartLine() const
{ {
return m_impl->groupStartLine; return m_impl->groupStartLine;
} }
bool MemberDef::getGroupHasDocs() const bool MemberDef::getGroupHasDocs() const
{ {
return m_impl->groupHasDocs; return m_impl->groupHasDocs;
} }
Protection MemberDef::protection() const Protection MemberDef::protection() const
{ {
return m_impl->prot; return m_impl->prot;
} }
MemberType MemberDef::memberType() const MemberType MemberDef::memberType() const
{ {
return m_impl->mtype; return m_impl->mtype;
} }
bool MemberDef::isSignal() const bool MemberDef::isSignal() const
{ {
return m_impl->mtype==MemberType_Signal; return m_impl->mtype==MemberType_Signal;
} }
bool MemberDef::isSlot() const bool MemberDef::isSlot() const
{ {
return m_impl->mtype==MemberType_Slot; return m_impl->mtype==MemberType_Slot;
} }
bool MemberDef::isVariable() const bool MemberDef::isVariable() const
{ {
return m_impl->mtype==MemberType_Variable; return m_impl->mtype==MemberType_Variable;
} }
bool MemberDef::isEnumerate() const bool MemberDef::isEnumerate() const
{ {
return m_impl->mtype==MemberType_Enumeration; return m_impl->mtype==MemberType_Enumeration;
} }
bool MemberDef::isEnumValue() const bool MemberDef::isEnumValue() const
{ {
return m_impl->mtype==MemberType_EnumValue; return m_impl->mtype==MemberType_EnumValue;
} }
bool MemberDef::isTypedef() const bool MemberDef::isTypedef() const
{ {
return m_impl->mtype==MemberType_Typedef; return m_impl->mtype==MemberType_Typedef;
} }
bool MemberDef::isFunction() const bool MemberDef::isFunction() const
{ {
return m_impl->mtype==MemberType_Function; return m_impl->mtype==MemberType_Function;
} }
bool MemberDef::isFunctionPtr() const bool MemberDef::isFunctionPtr() const
...@@ -3979,175 +4006,175 @@ bool MemberDef::isFunctionPtr() const ...@@ -3979,175 +4006,175 @@ bool MemberDef::isFunctionPtr() const
} }
bool MemberDef::isDefine() const bool MemberDef::isDefine() const
{ {
return m_impl->mtype==MemberType_Define; return m_impl->mtype==MemberType_Define;
} }
bool MemberDef::isFriend() const bool MemberDef::isFriend() const
{ {
return m_impl->mtype==MemberType_Friend; return m_impl->mtype==MemberType_Friend;
} }
bool MemberDef::isDCOP() const bool MemberDef::isDCOP() const
{ {
return m_impl->mtype==MemberType_DCOP; return m_impl->mtype==MemberType_DCOP;
} }
bool MemberDef::isProperty() const bool MemberDef::isProperty() const
{ {
return m_impl->mtype==MemberType_Property; return m_impl->mtype==MemberType_Property;
} }
bool MemberDef::isEvent() const bool MemberDef::isEvent() const
{ {
return m_impl->mtype==MemberType_Event; return m_impl->mtype==MemberType_Event;
} }
bool MemberDef::isRelated() const bool MemberDef::isRelated() const
{ {
return m_impl->related == Related; return m_impl->related == Related;
} }
bool MemberDef::isForeign() const bool MemberDef::isForeign() const
{ {
return m_impl->related == Foreign; return m_impl->related == Foreign;
} }
bool MemberDef::isStatic() const bool MemberDef::isStatic() const
{ {
return m_impl->stat; return m_impl->stat;
} }
bool MemberDef::isInline() const bool MemberDef::isInline() const
{ {
return (m_impl->memSpec&Entry::Inline)!=0; return (m_impl->memSpec&Entry::Inline)!=0;
} }
bool MemberDef::isExplicit() const bool MemberDef::isExplicit() const
{ {
return (m_impl->memSpec&Entry::Explicit)!=0; return (m_impl->memSpec&Entry::Explicit)!=0;
} }
bool MemberDef::isMutable() const bool MemberDef::isMutable() const
{ {
return (m_impl->memSpec&Entry::Mutable)!=0; return (m_impl->memSpec&Entry::Mutable)!=0;
} }
bool MemberDef::isGettable() const bool MemberDef::isGettable() const
{ {
return (m_impl->memSpec&Entry::Gettable)!=0; return (m_impl->memSpec&Entry::Gettable)!=0;
} }
bool MemberDef::isSettable() const bool MemberDef::isSettable() const
{ {
return (m_impl->memSpec&Entry::Settable)!=0; return (m_impl->memSpec&Entry::Settable)!=0;
} }
bool MemberDef::isAddable() const bool MemberDef::isAddable() const
{ {
return (m_impl->memSpec&Entry::Addable)!=0; return (m_impl->memSpec&Entry::Addable)!=0;
} }
bool MemberDef::isRemovable() const bool MemberDef::isRemovable() const
{ {
return (m_impl->memSpec&Entry::Removable)!=0; return (m_impl->memSpec&Entry::Removable)!=0;
} }
bool MemberDef::isRaisable() const bool MemberDef::isRaisable() const
{ {
return (m_impl->memSpec&Entry::Raisable)!=0; return (m_impl->memSpec&Entry::Raisable)!=0;
} }
bool MemberDef::isReadable() const bool MemberDef::isReadable() const
{ {
return (m_impl->memSpec&Entry::Readable)!=0; return (m_impl->memSpec&Entry::Readable)!=0;
} }
bool MemberDef::isWritable() const bool MemberDef::isWritable() const
{ {
return (m_impl->memSpec&Entry::Writable)!=0; return (m_impl->memSpec&Entry::Writable)!=0;
} }
bool MemberDef::isFinal() const bool MemberDef::isFinal() const
{ {
return (m_impl->memSpec&Entry::Final)!=0; return (m_impl->memSpec&Entry::Final)!=0;
} }
bool MemberDef::isNew() const bool MemberDef::isNew() const
{ {
return (m_impl->memSpec&Entry::New)!=0; return (m_impl->memSpec&Entry::New)!=0;
} }
bool MemberDef::isSealed() const bool MemberDef::isSealed() const
{ {
return (m_impl->memSpec&Entry::Sealed)!=0; return (m_impl->memSpec&Entry::Sealed)!=0;
} }
bool MemberDef::isOverride() const bool MemberDef::isOverride() const
{ {
return (m_impl->memSpec&Entry::Override)!=0; return (m_impl->memSpec&Entry::Override)!=0;
} }
bool MemberDef::isInitonly() const bool MemberDef::isInitonly() const
{ {
return (m_impl->memSpec&Entry::Initonly)!=0; return (m_impl->memSpec&Entry::Initonly)!=0;
} }
bool MemberDef::isAbstract() const bool MemberDef::isAbstract() const
{ {
return (m_impl->memSpec&Entry::Abstract)!=0; return (m_impl->memSpec&Entry::Abstract)!=0;
} }
bool MemberDef::isOptional() const bool MemberDef::isOptional() const
{ {
return (m_impl->memSpec&Entry::Optional)!=0; return (m_impl->memSpec&Entry::Optional)!=0;
} }
bool MemberDef::isRequired() const bool MemberDef::isRequired() const
{ {
return (m_impl->memSpec&Entry::Required)!=0; return (m_impl->memSpec&Entry::Required)!=0;
} }
bool MemberDef::isNonAtomic() const bool MemberDef::isNonAtomic() const
{ {
return (m_impl->memSpec&Entry::NonAtomic)!=0; return (m_impl->memSpec&Entry::NonAtomic)!=0;
} }
bool MemberDef::isCopy() const bool MemberDef::isCopy() const
{ {
return (m_impl->memSpec&Entry::Copy)!=0; return (m_impl->memSpec&Entry::Copy)!=0;
} }
bool MemberDef::isAssign() const bool MemberDef::isAssign() const
{ {
return (m_impl->memSpec&Entry::Assign)!=0; return (m_impl->memSpec&Entry::Assign)!=0;
} }
bool MemberDef::isRetain() const bool MemberDef::isRetain() const
{ {
return (m_impl->memSpec&Entry::Retain)!=0; return (m_impl->memSpec&Entry::Retain)!=0;
} }
bool MemberDef::isWeak() const bool MemberDef::isWeak() const
{ {
return (m_impl->memSpec&Entry::Weak)!=0; return (m_impl->memSpec&Entry::Weak)!=0;
} }
bool MemberDef::isStrong() const bool MemberDef::isStrong() const
{ {
return (m_impl->memSpec&Entry::Strong)!=0; return (m_impl->memSpec&Entry::Strong)!=0;
} }
bool MemberDef::isStrongEnumValue() const bool MemberDef::isStrongEnumValue() const
{ {
return m_impl->mtype==MemberType_EnumValue && return m_impl->mtype==MemberType_EnumValue &&
m_impl->enumScope && m_impl->enumScope &&
m_impl->enumScope->isStrong(); m_impl->enumScope->isStrong();
} }
bool MemberDef::isUnretained() const bool MemberDef::isUnretained() const
{ {
return (m_impl->memSpec&Entry::Unretained)!=0; return (m_impl->memSpec&Entry::Unretained)!=0;
} }
bool MemberDef::isAlias() const bool MemberDef::isAlias() const
...@@ -4222,356 +4249,356 @@ bool MemberDef::isPublished() const ...@@ -4222,356 +4249,356 @@ bool MemberDef::isPublished() const
bool MemberDef::isImplementation() const bool MemberDef::isImplementation() const
{ {
return m_impl->implOnly; return m_impl->implOnly;
} }
bool MemberDef::isExternal() const bool MemberDef::isExternal() const
{ {
return m_impl->explExt; return m_impl->explExt;
} }
bool MemberDef::isTemplateSpecialization() const bool MemberDef::isTemplateSpecialization() const
{ {
return m_impl->tspec; return m_impl->tspec;
} }
bool MemberDef::hasDocumentedParams() const bool MemberDef::hasDocumentedParams() const
{ {
return m_impl->hasDocumentedParams; return m_impl->hasDocumentedParams;
} }
bool MemberDef::hasDocumentedReturnType() const bool MemberDef::hasDocumentedReturnType() const
{ {
return m_impl->hasDocumentedReturnType; return m_impl->hasDocumentedReturnType;
} }
bool MemberDef::showInCallGraph() const bool MemberDef::showInCallGraph() const
{ {
return isFunction() || return isFunction() ||
isSlot() || isSlot() ||
isConstructor() || isConstructor() ||
isDestructor() || isDestructor() ||
isObjCMethod(); isObjCMethod();
} }
ClassDef *MemberDef::relatedAlso() const ClassDef *MemberDef::relatedAlso() const
{ {
return m_impl->relatedAlso; return m_impl->relatedAlso;
} }
bool MemberDef::hasDocumentedEnumValues() const bool MemberDef::hasDocumentedEnumValues() const
{ {
return m_impl->docEnumValues; return m_impl->docEnumValues;
} }
MemberDef *MemberDef::getAnonymousEnumType() const MemberDef *MemberDef::getAnonymousEnumType() const
{ {
return m_impl->annEnumType; return m_impl->annEnumType;
} }
bool MemberDef::isDocsForDefinition() const bool MemberDef::isDocsForDefinition() const
{ {
return m_impl->docsForDefinition; return m_impl->docsForDefinition;
} }
MemberDef *MemberDef::getEnumScope() const MemberDef *MemberDef::getEnumScope() const
{ {
return m_impl->enumScope; return m_impl->enumScope;
} }
MemberList *MemberDef::enumFieldList() const MemberList *MemberDef::enumFieldList() const
{ {
return m_impl->enumFields; return m_impl->enumFields;
} }
ExampleSDict *MemberDef::getExamples() const ExampleSDict *MemberDef::getExamples() const
{ {
return m_impl->exampleSDict; return m_impl->exampleSDict;
} }
bool MemberDef::isPrototype() const bool MemberDef::isPrototype() const
{ {
return m_impl->proto; return m_impl->proto;
} }
ArgumentList *MemberDef::argumentList() const ArgumentList *MemberDef::argumentList() const
{ {
return m_impl->defArgList; return m_impl->defArgList;
} }
ArgumentList *MemberDef::declArgumentList() const ArgumentList *MemberDef::declArgumentList() const
{ {
return m_impl->declArgList; return m_impl->declArgList;
} }
ArgumentList *MemberDef::templateArguments() const ArgumentList *MemberDef::templateArguments() const
{ {
return m_impl->tArgList; return m_impl->tArgList;
} }
QList<ArgumentList> *MemberDef::definitionTemplateParameterLists() const QList<ArgumentList> *MemberDef::definitionTemplateParameterLists() const
{ {
return m_impl->defTmpArgLists; return m_impl->defTmpArgLists;
} }
int MemberDef::getMemberGroupId() const int MemberDef::getMemberGroupId() const
{ {
return m_impl->grpId; return m_impl->grpId;
} }
MemberGroup *MemberDef::getMemberGroup() const MemberGroup *MemberDef::getMemberGroup() const
{ {
return m_impl->memberGroup; return m_impl->memberGroup;
} }
bool MemberDef::fromAnonymousScope() const bool MemberDef::fromAnonymousScope() const
{ {
return m_impl->annScope; return m_impl->annScope;
} }
bool MemberDef::anonymousDeclShown() const bool MemberDef::anonymousDeclShown() const
{ {
return m_impl->annUsed; return m_impl->annUsed;
} }
void MemberDef::setAnonymousUsed() void MemberDef::setAnonymousUsed()
{ {
m_impl->annUsed = TRUE; m_impl->annUsed = TRUE;
} }
bool MemberDef::hasCallGraph() const bool MemberDef::hasCallGraph() const
{ {
return m_impl->hasCallGraph; return m_impl->hasCallGraph;
} }
bool MemberDef::hasCallerGraph() const bool MemberDef::hasCallerGraph() const
{ {
return m_impl->hasCallerGraph; return m_impl->hasCallerGraph;
} }
MemberDef *MemberDef::templateMaster() const MemberDef *MemberDef::templateMaster() const
{ {
return m_impl->templateMaster; return m_impl->templateMaster;
} }
bool MemberDef::isTypedefValCached() const bool MemberDef::isTypedefValCached() const
{ {
return m_impl->isTypedefValCached; return m_impl->isTypedefValCached;
} }
ClassDef *MemberDef::getCachedTypedefVal() const ClassDef *MemberDef::getCachedTypedefVal() const
{ {
return m_impl->cachedTypedefValue; return m_impl->cachedTypedefValue;
} }
QCString MemberDef::getCachedTypedefTemplSpec() const QCString MemberDef::getCachedTypedefTemplSpec() const
{ {
return m_impl->cachedTypedefTemplSpec; return m_impl->cachedTypedefTemplSpec;
} }
QCString MemberDef::getCachedResolvedTypedef() const QCString MemberDef::getCachedResolvedTypedef() const
{ {
//printf("MemberDef::getCachedResolvedTypedef()=%s m_impl=%p\n",m_impl->cachedResolvedType.data(),m_impl); //printf("MemberDef::getCachedResolvedTypedef()=%s m_impl=%p\n",m_impl->cachedResolvedType.data(),m_impl);
return m_impl->cachedResolvedType; return m_impl->cachedResolvedType;
} }
MemberDef *MemberDef::memberDefinition() const MemberDef *MemberDef::memberDefinition() const
{ {
return m_impl->memDef; return m_impl->memDef;
} }
MemberDef *MemberDef::memberDeclaration() const MemberDef *MemberDef::memberDeclaration() const
{ {
return m_impl->memDec; return m_impl->memDec;
} }
MemberDef *MemberDef::inheritsDocsFrom() const MemberDef *MemberDef::inheritsDocsFrom() const
{ {
return m_impl->docProvider; return m_impl->docProvider;
} }
MemberDef *MemberDef::getGroupAlias() const MemberDef *MemberDef::getGroupAlias() const
{ {
return m_impl->groupAlias; return m_impl->groupAlias;
} }
void MemberDef::setMemberType(MemberType t) void MemberDef::setMemberType(MemberType t)
{ {
m_impl->mtype=t; m_impl->mtype=t;
m_isLinkableCached = 0; m_isLinkableCached = 0;
} }
void MemberDef::setDefinition(const char *d) void MemberDef::setDefinition(const char *d)
{ {
m_impl->def=d; m_impl->def=d;
} }
void MemberDef::setFileDef(FileDef *fd) void MemberDef::setFileDef(FileDef *fd)
{ {
m_impl->fileDef=fd; m_impl->fileDef=fd;
m_isLinkableCached = 0; m_isLinkableCached = 0;
m_isConstructorCached = 0; m_isConstructorCached = 0;
m_isDestructorCached = 0; m_isDestructorCached = 0;
} }
void MemberDef::setProtection(Protection p) void MemberDef::setProtection(Protection p)
{ {
m_impl->prot=p; m_impl->prot=p;
m_isLinkableCached = 0; m_isLinkableCached = 0;
} }
void MemberDef::setMemberSpecifiers(uint64 s) void MemberDef::setMemberSpecifiers(uint64 s)
{ {
m_impl->memSpec=s; m_impl->memSpec=s;
} }
void MemberDef::mergeMemberSpecifiers(uint64 s) void MemberDef::mergeMemberSpecifiers(uint64 s)
{ {
m_impl->memSpec|=s; m_impl->memSpec|=s;
} }
void MemberDef::setBitfields(const char *s) void MemberDef::setBitfields(const char *s)
{ {
m_impl->bitfields = s; m_impl->bitfields = QCString(s).simplifyWhiteSpace();
} }
void MemberDef::setMaxInitLines(int lines) void MemberDef::setMaxInitLines(int lines)
{ {
if (lines!=-1) if (lines!=-1)
{ {
m_impl->userInitLines=lines; m_impl->userInitLines=lines;
} }
} }
void MemberDef::setExplicitExternal(bool b) void MemberDef::setExplicitExternal(bool b)
{ {
m_impl->explExt=b; m_impl->explExt=b;
} }
void MemberDef::setReadAccessor(const char *r) void MemberDef::setReadAccessor(const char *r)
{ {
m_impl->read=r; m_impl->read=r;
} }
void MemberDef::setWriteAccessor(const char *w) void MemberDef::setWriteAccessor(const char *w)
{ {
m_impl->write=w; m_impl->write=w;
} }
void MemberDef::setTemplateSpecialization(bool b) void MemberDef::setTemplateSpecialization(bool b)
{ {
m_impl->tspec=b; m_impl->tspec=b;
} }
void MemberDef::makeRelated() void MemberDef::makeRelated()
{ {
m_impl->related = Related; m_impl->related = Related;
m_isLinkableCached = 0; m_isLinkableCached = 0;
} }
void MemberDef::makeForeign() void MemberDef::makeForeign()
{ {
m_impl->related = Foreign; m_impl->related = Foreign;
m_isLinkableCached = 0; m_isLinkableCached = 0;
} }
void MemberDef::setHasDocumentedParams(bool b) void MemberDef::setHasDocumentedParams(bool b)
{ {
m_impl->hasDocumentedParams = b; m_impl->hasDocumentedParams = b;
} }
void MemberDef::setHasDocumentedReturnType(bool b) void MemberDef::setHasDocumentedReturnType(bool b)
{ {
m_impl->hasDocumentedReturnType = b; m_impl->hasDocumentedReturnType = b;
} }
void MemberDef::setInheritsDocsFrom(MemberDef *md) void MemberDef::setInheritsDocsFrom(MemberDef *md)
{ {
m_impl->docProvider = md; m_impl->docProvider = md;
} }
void MemberDef::setArgsString(const char *as) void MemberDef::setArgsString(const char *as)
{ {
m_impl->args = as; m_impl->args = as;
} }
void MemberDef::setRelatedAlso(ClassDef *cd) void MemberDef::setRelatedAlso(ClassDef *cd)
{ {
m_impl->relatedAlso=cd; m_impl->relatedAlso=cd;
} }
void MemberDef::setEnumClassScope(ClassDef *cd) void MemberDef::setEnumClassScope(ClassDef *cd)
{ {
m_impl->classDef = cd; m_impl->classDef = cd;
m_isLinkableCached = 0; m_isLinkableCached = 0;
m_isConstructorCached = 0; m_isConstructorCached = 0;
} }
void MemberDef::setDocumentedEnumValues(bool value) void MemberDef::setDocumentedEnumValues(bool value)
{ {
m_impl->docEnumValues=value; m_impl->docEnumValues=value;
} }
void MemberDef::setAnonymousEnumType(MemberDef *md) void MemberDef::setAnonymousEnumType(MemberDef *md)
{ {
m_impl->annEnumType = md; m_impl->annEnumType = md;
} }
void MemberDef::setPrototype(bool p) void MemberDef::setPrototype(bool p)
{ {
m_impl->proto=p; m_impl->proto=p;
} }
void MemberDef::setMemberGroupId(int id) void MemberDef::setMemberGroupId(int id)
{ {
m_impl->grpId=id; m_impl->grpId=id;
} }
void MemberDef::makeImplementationDetail() void MemberDef::makeImplementationDetail()
{ {
m_impl->implOnly=TRUE; m_impl->implOnly=TRUE;
} }
void MemberDef::setFromAnonymousScope(bool b) void MemberDef::setFromAnonymousScope(bool b)
{ {
m_impl->annScope=b; m_impl->annScope=b;
} }
void MemberDef::setFromAnonymousMember(MemberDef *m) void MemberDef::setFromAnonymousMember(MemberDef *m)
{ {
m_impl->annMemb=m; m_impl->annMemb=m;
} }
void MemberDef::setTemplateMaster(MemberDef *mt) void MemberDef::setTemplateMaster(MemberDef *mt)
{ {
m_impl->templateMaster=mt; m_impl->templateMaster=mt;
m_isLinkableCached = 0; m_isLinkableCached = 0;
} }
void MemberDef::setDocsForDefinition(bool b) void MemberDef::setDocsForDefinition(bool b)
{ {
m_impl->docsForDefinition = b; m_impl->docsForDefinition = b;
} }
void MemberDef::setGroupAlias(MemberDef *md) void MemberDef::setGroupAlias(MemberDef *md)
{ {
m_impl->groupAlias = md; m_impl->groupAlias = md;
} }
void MemberDef::invalidateTypedefValCache() void MemberDef::invalidateTypedefValCache()
{ {
m_impl->isTypedefValCached=FALSE; m_impl->isTypedefValCached=FALSE;
} }
void MemberDef::setMemberDefinition(MemberDef *md) void MemberDef::setMemberDefinition(MemberDef *md)
{ {
m_impl->memDef=md; m_impl->memDef=md;
} }
void MemberDef::setMemberDeclaration(MemberDef *md) void MemberDef::setMemberDeclaration(MemberDef *md)
{ {
m_impl->memDec=md; m_impl->memDec=md;
} }
ClassDef *MemberDef::category() const ClassDef *MemberDef::category() const
...@@ -4607,9 +4634,9 @@ QCString MemberDef::enumBaseType() const ...@@ -4607,9 +4634,9 @@ QCString MemberDef::enumBaseType() const
void MemberDef::cacheTypedefVal(ClassDef*val, const QCString & templSpec, const QCString &resolvedType) void MemberDef::cacheTypedefVal(ClassDef*val, const QCString & templSpec, const QCString &resolvedType)
{ {
m_impl->isTypedefValCached=TRUE; m_impl->isTypedefValCached=TRUE;
m_impl->cachedTypedefValue=val; m_impl->cachedTypedefValue=val;
m_impl->cachedTypedefTemplSpec=templSpec; m_impl->cachedTypedefTemplSpec=templSpec;
m_impl->cachedResolvedType=resolvedType; m_impl->cachedResolvedType=resolvedType;
//printf("MemberDef::cacheTypedefVal=%s m_impl=%p\n",m_impl->cachedResolvedType.data(),m_impl); //printf("MemberDef::cacheTypedefVal=%s m_impl=%p\n",m_impl->cachedResolvedType.data(),m_impl);
} }
...@@ -4665,9 +4692,9 @@ void MemberDef::invalidateCachedArgumentTypes() ...@@ -4665,9 +4692,9 @@ void MemberDef::invalidateCachedArgumentTypes()
//---------------- //----------------
QCString MemberDef::displayName(bool) const QCString MemberDef::displayName(bool) const
{ {
return Definition::name(); return Definition::name();
} }
void MemberDef::_addToSearchIndex() void MemberDef::_addToSearchIndex()
......
...@@ -241,6 +241,7 @@ class MemberDef : public Definition ...@@ -241,6 +241,7 @@ class MemberDef : public Definition
MemberDef *categoryRelation() const; MemberDef *categoryRelation() const;
QCString displayName(bool=TRUE) const; QCString displayName(bool=TRUE) const;
QCString getDeclType() const;
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
// ---- setters ----- // ---- setters -----
......
...@@ -115,14 +115,15 @@ void NamespaceDef::findSectionsInDocumentation() ...@@ -115,14 +115,15 @@ void NamespaceDef::findSectionsInDocumentation()
} }
} }
void NamespaceDef::insertUsedFile(const char *f) void NamespaceDef::insertUsedFile(FileDef *fd)
{ {
if (files.find(f)==-1) if (fd==0) return;
if (files.find(fd)==-1)
{ {
if (Config_getBool("SORT_MEMBER_DOCS")) if (Config_getBool("SORT_MEMBER_DOCS"))
files.inSort(f); files.inSort(fd);
else else
files.append(f); files.append(fd);
} }
} }
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <qdict.h> #include <qdict.h>
#include "sortdict.h" #include "sortdict.h"
#include "definition.h" #include "definition.h"
#include "filedef.h"
class MemberList; class MemberList;
class ClassDef; class ClassDef;
...@@ -45,7 +46,7 @@ class NamespaceDef : public Definition ...@@ -45,7 +46,7 @@ class NamespaceDef : public Definition
DefType definitionType() const { return TypeNamespace; } DefType definitionType() const { return TypeNamespace; }
QCString getOutputFileBase() const; QCString getOutputFileBase() const;
QCString anchor() const { return QCString(); } QCString anchor() const { return QCString(); }
void insertUsedFile(const char *fname); void insertUsedFile(FileDef *fd);
void writeDocumentation(OutputList &ol); void writeDocumentation(OutputList &ol);
void writeMemberPages(OutputList &ol); void writeMemberPages(OutputList &ol);
...@@ -117,7 +118,7 @@ class NamespaceDef : public Definition ...@@ -117,7 +118,7 @@ class NamespaceDef : public Definition
void addNamespaceAttributes(OutputList &ol); void addNamespaceAttributes(OutputList &ol);
QCString fileName; QCString fileName;
QStrList files; FileList files;
NamespaceSDict *usingDirList; NamespaceSDict *usingDirList;
SDict<Definition> *usingDeclList; SDict<Definition> *usingDeclList;
......
...@@ -36,7 +36,7 @@ static QValueList<QCString> split(const QCString &str,const QCString &sep,bool a ...@@ -36,7 +36,7 @@ static QValueList<QCString> split(const QCString &str,const QCString &sep,bool a
int j = 0; int j = 0;
int i = str.find( sep, j ); int i = str.find( sep, j );
while (i!=-1) while (i!=-1)
{ {
if ( str.mid(j,i-j).length() > 0 ) if ( str.mid(j,i-j).length() > 0 )
{ {
...@@ -109,58 +109,60 @@ class TemplateVariant::Private ...@@ -109,58 +109,60 @@ class TemplateVariant::Private
bool raw; bool raw;
}; };
TemplateVariant::TemplateVariant() TemplateVariant::TemplateVariant()
{ {
p = new Private; p = new Private;
p->type=None; p->type=None;
} }
TemplateVariant::TemplateVariant(bool b) TemplateVariant::TemplateVariant(bool b)
{ {
p = new Private; p = new Private;
p->type = Bool; p->type = Bool;
p->boolVal = b; p->boolVal = b;
} }
TemplateVariant::TemplateVariant(int v) TemplateVariant::TemplateVariant(int v)
{ {
p = new Private; p = new Private;
p->type = Integer; p->type = Integer;
p->intVal = v; p->intVal = v;
} }
TemplateVariant::TemplateVariant(const char *s) TemplateVariant::TemplateVariant(const char *s,bool raw)
{ {
p = new Private; p = new Private;
p->type = String; p->type = String;
p->strVal = s; p->strVal = s;
p->raw = raw;
} }
TemplateVariant::TemplateVariant(const QCString &s) TemplateVariant::TemplateVariant(const QCString &s,bool raw)
{ {
p = new Private; p = new Private;
p->type = String; p->type = String;
p->strVal = s; p->strVal = s;
p->raw = raw;
} }
TemplateVariant::TemplateVariant(const TemplateStructIntf *s) TemplateVariant::TemplateVariant(const TemplateStructIntf *s)
{ {
p = new Private; p = new Private;
p->type = Struct; p->type = Struct;
p->strukt = s; } p->strukt = s; }
TemplateVariant::TemplateVariant(const TemplateListIntf *l) TemplateVariant::TemplateVariant(const TemplateListIntf *l)
{ {
p = new Private; p = new Private;
p->type = List; p->type = List;
p->list = l; p->list = l;
} }
TemplateVariant::TemplateVariant(const void *obj,FuncType f) TemplateVariant::TemplateVariant(const void *obj,FuncType f)
{ {
p = new Private; p = new Private;
p->type = Function; p->type = Function;
p->func = f; p->func = f;
p->obj = obj; p->obj = obj;
} }
...@@ -169,7 +171,7 @@ TemplateVariant::~TemplateVariant() ...@@ -169,7 +171,7 @@ TemplateVariant::~TemplateVariant()
delete p; delete p;
} }
TemplateVariant::TemplateVariant(const TemplateVariant &v) TemplateVariant::TemplateVariant(const TemplateVariant &v)
{ {
p = new Private; p = new Private;
p->type = v.p->type; p->type = v.p->type;
...@@ -182,13 +184,13 @@ TemplateVariant::TemplateVariant(const TemplateVariant &v) ...@@ -182,13 +184,13 @@ TemplateVariant::TemplateVariant(const TemplateVariant &v)
case String: p->strVal = v.p->strVal; break; case String: p->strVal = v.p->strVal; break;
case Struct: p->strukt = v.p->strukt; break; case Struct: p->strukt = v.p->strukt; break;
case List: p->list = v.p->list; break; case List: p->list = v.p->list; break;
case Function: p->func = v.p->func; case Function: p->func = v.p->func;
p->obj = v.p->obj; break; p->obj = v.p->obj; break;
} }
} }
TemplateVariant &TemplateVariant::operator=(const TemplateVariant &v) TemplateVariant &TemplateVariant::operator=(const TemplateVariant &v)
{ {
p->type = v.p->type; p->type = v.p->type;
p->raw = v.p->raw; p->raw = v.p->raw;
switch (p->type) switch (p->type)
...@@ -199,10 +201,10 @@ TemplateVariant &TemplateVariant::operator=(const TemplateVariant &v) ...@@ -199,10 +201,10 @@ TemplateVariant &TemplateVariant::operator=(const TemplateVariant &v)
case String: p->strVal = v.p->strVal; break; case String: p->strVal = v.p->strVal; break;
case Struct: p->strukt = v.p->strukt; break; case Struct: p->strukt = v.p->strukt; break;
case List: p->list = v.p->list; break; case List: p->list = v.p->list; break;
case Function: p->func = v.p->func; case Function: p->func = v.p->func;
p->obj = v.p->obj; break; p->obj = v.p->obj; break;
} }
return *this; return *this;
} }
QCString TemplateVariant::toString() const QCString TemplateVariant::toString() const
...@@ -301,17 +303,17 @@ const TemplateListIntf *TemplateVariant::toList() const ...@@ -301,17 +303,17 @@ const TemplateListIntf *TemplateVariant::toList() const
return p->type==List ? p->list : 0; return p->type==List ? p->list : 0;
} }
QCString TemplateVariant::call(const QValueList<TemplateVariant> &args) TemplateVariant TemplateVariant::call(const QValueList<TemplateVariant> &args)
{ {
if (p->type==Function) return p->func(p->obj,args); if (p->type==Function) return p->func(p->obj,args);
return QCString(); return TemplateVariant();
} }
bool TemplateVariant::operator==(TemplateVariant &other) bool TemplateVariant::operator==(TemplateVariant &other)
{ {
if (p->type==None) if (p->type==None)
{ {
return FALSE; return FALSE;
} }
if (p->type==TemplateVariant::List && other.p->type==TemplateVariant::List) if (p->type==TemplateVariant::List && other.p->type==TemplateVariant::List)
{ {
...@@ -327,14 +329,14 @@ bool TemplateVariant::operator==(TemplateVariant &other) ...@@ -327,14 +329,14 @@ bool TemplateVariant::operator==(TemplateVariant &other)
} }
} }
TemplateVariant::Type TemplateVariant::type() const TemplateVariant::Type TemplateVariant::type() const
{ {
return p->type; return p->type;
} }
bool TemplateVariant::isValid() const bool TemplateVariant::isValid() const
{ {
return p->type!=None; return p->type!=None;
} }
void TemplateVariant::setRaw(bool b) void TemplateVariant::setRaw(bool b)
...@@ -427,7 +429,7 @@ class TemplateListConstIterator : public TemplateListIntf::ConstIterator ...@@ -427,7 +429,7 @@ class TemplateListConstIterator : public TemplateListIntf::ConstIterator
public: public:
TemplateListConstIterator(const TemplateList &l) : m_list(l) { m_index=-1; } TemplateListConstIterator(const TemplateList &l) : m_list(l) { m_index=-1; }
virtual ~TemplateListConstIterator() {} virtual ~TemplateListConstIterator() {}
virtual void toFirst() virtual void toFirst()
{ {
m_it = m_list.p->elems.begin(); m_it = m_list.p->elems.begin();
m_index=0; m_index=0;
...@@ -507,11 +509,12 @@ class Operator ...@@ -507,11 +509,12 @@ class Operator
==, !=, <, >, <=, >= ==, !=, <, >, <=, >=
| |
: :
,
*/ */
enum Type enum Type
{ {
Or, And, Not, In, Equal, NotEqual, Less, Greater, LessEqual, Or, And, Not, In, Equal, NotEqual, Less, Greater, LessEqual,
GreaterEqual, Filter, Colon, Last GreaterEqual, Filter, Colon, Comma, Last
}; };
static const char *toString(Type op) static const char *toString(Type op)
...@@ -530,6 +533,7 @@ class Operator ...@@ -530,6 +533,7 @@ class Operator
case GreaterEqual: return ">="; case GreaterEqual: return ">=";
case Filter: return "|"; case Filter: return "|";
case Colon: return ":"; case Colon: return ":";
case Comma: return ",";
case Last: return "?"; case Last: return "?";
} }
return "?"; return "?";
...@@ -556,24 +560,26 @@ class TemplateBlockContext ...@@ -556,24 +560,26 @@ class TemplateBlockContext
}; };
/** @brief Internal class representing the implementation of a template /** @brief Internal class representing the implementation of a template
* context */ * context */
class TemplateContextImpl : public TemplateContext class TemplateContextImpl : public TemplateContext
{ {
public: public:
TemplateContextImpl(); TemplateContextImpl();
virtual ~TemplateContextImpl(); virtual ~TemplateContextImpl();
// TemplateContext methods // TemplateContext methods
void push(); void push();
void pop(); void pop();
void set(const char *name,const TemplateVariant &v); void set(const char *name,const TemplateVariant &v);
TemplateVariant get(const QCString &name) const; TemplateVariant get(const QCString &name) const;
const TemplateVariant *getRef(const QCString &name) const; const TemplateVariant *getRef(const QCString &name) const;
void setOutputDirectory(const QCString &dir) void setOutputDirectory(const QCString &dir)
{ m_outputDir = dir; } { m_outputDir = dir; }
void setEscapeIntf(TemplateEscapeIntf *intf) void setEscapeIntf(TemplateEscapeIntf *intf)
{ m_escapeIntf = intf; } { m_escapeIntf = intf; }
void setSpacelessIntf(TemplateSpacelessIntf *intf)
{ m_spacelessIntf = intf; }
// internal methods // internal methods
TemplateBlockContext *blockContext(); TemplateBlockContext *blockContext();
...@@ -584,6 +590,9 @@ class TemplateContextImpl : public TemplateContext ...@@ -584,6 +590,9 @@ class TemplateContextImpl : public TemplateContext
int line() const { return m_line; } int line() const { return m_line; }
QCString outputDirectory() const { return m_outputDir; } QCString outputDirectory() const { return m_outputDir; }
TemplateEscapeIntf *escapeIntf() const { return m_escapeIntf; } TemplateEscapeIntf *escapeIntf() const { return m_escapeIntf; }
TemplateSpacelessIntf *spacelessIntf() const { return m_spacelessIntf; }
void enableSpaceless(bool b) { m_spacelessEnabled=b; }
bool spacelessEnabled() const { return m_spacelessEnabled && m_spacelessIntf; }
private: private:
QCString m_templateName; QCString m_templateName;
...@@ -592,6 +601,8 @@ class TemplateContextImpl : public TemplateContext ...@@ -592,6 +601,8 @@ class TemplateContextImpl : public TemplateContext
QList< QDict<TemplateVariant> > m_contextStack; QList< QDict<TemplateVariant> > m_contextStack;
TemplateBlockContext m_blockContext; TemplateBlockContext m_blockContext;
TemplateEscapeIntf *m_escapeIntf; TemplateEscapeIntf *m_escapeIntf;
TemplateSpacelessIntf *m_spacelessIntf;
bool m_spacelessEnabled;
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -802,15 +813,15 @@ static TemplateFilterFactory::AutoRegister<FilterAdd> fAdd("add"); ...@@ -802,15 +813,15 @@ static TemplateFilterFactory::AutoRegister<FilterAdd> fAdd("add");
static TemplateFilterFactory::AutoRegister<FilterPrepend> fPrepend("prepend"); static TemplateFilterFactory::AutoRegister<FilterPrepend> fPrepend("prepend");
static TemplateFilterFactory::AutoRegister<FilterLength> fLength("length"); static TemplateFilterFactory::AutoRegister<FilterLength> fLength("length");
static TemplateFilterFactory::AutoRegister<FilterDefault> fDefault("default"); static TemplateFilterFactory::AutoRegister<FilterDefault> fDefault("default");
static TemplateFilterFactory::AutoRegister<FilterStripPath> fStripPath("strippath"); static TemplateFilterFactory::AutoRegister<FilterStripPath> fStripPath("stripPath");
static TemplateFilterFactory::AutoRegister<FilterNoWrap> fNoWrap("nowrap"); static TemplateFilterFactory::AutoRegister<FilterNoWrap> fNoWrap("nowrap");
//-------------------------------------------------------------------- //--------------------------------------------------------------------
/** @brief Base class for all nodes in the abstract syntax tree of an /** @brief Base class for all nodes in the abstract syntax tree of an
* expression. * expression.
*/ */
class ExprAst class ExprAst
{ {
public: public:
virtual ~ExprAst() {} virtual ~ExprAst() {}
...@@ -821,7 +832,7 @@ class ExprAst ...@@ -821,7 +832,7 @@ class ExprAst
class ExprAstNumber : public ExprAst class ExprAstNumber : public ExprAst
{ {
public: public:
ExprAstNumber(int num) : m_number(num) ExprAstNumber(int num) : m_number(num)
{ TRACE(("ExprAstNumber(%d)\n",num)); } { TRACE(("ExprAstNumber(%d)\n",num)); }
int number() const { return m_number; } int number() const { return m_number; }
virtual TemplateVariant resolve(TemplateContext *) { return TemplateVariant(m_number); } virtual TemplateVariant resolve(TemplateContext *) { return TemplateVariant(m_number); }
...@@ -833,13 +844,13 @@ class ExprAstNumber : public ExprAst ...@@ -833,13 +844,13 @@ class ExprAstNumber : public ExprAst
class ExprAstVariable : public ExprAst class ExprAstVariable : public ExprAst
{ {
public: public:
ExprAstVariable(const char *name) : m_name(name) ExprAstVariable(const char *name) : m_name(name)
{ TRACE(("ExprAstVariable(%s)\n",name)); } { TRACE(("ExprAstVariable(%s)\n",name)); }
const QCString &name() const { return m_name; } const QCString &name() const { return m_name; }
virtual TemplateVariant resolve(TemplateContext *c) virtual TemplateVariant resolve(TemplateContext *c)
{ {
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c); TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
TemplateVariant v = c->get(m_name); TemplateVariant v = c->get(m_name);
if (!v.isValid()) if (!v.isValid())
{ {
warn(ci->templateName(),ci->line(),"undefined variable '%s' in expression",m_name.data()); warn(ci->templateName(),ci->line(),"undefined variable '%s' in expression",m_name.data());
...@@ -850,6 +861,34 @@ class ExprAstVariable : public ExprAst ...@@ -850,6 +861,34 @@ class ExprAstVariable : public ExprAst
QCString m_name; QCString m_name;
}; };
class ExprAstFunctionVariable : public ExprAst
{
public:
ExprAstFunctionVariable(ExprAst *var,const QList<ExprAst> &args)
: m_var(var), m_args(args)
{ TRACE(("ExprAstFunctionVariable(%s)\n",var->name().data()));
m_args.setAutoDelete(TRUE);
}
virtual TemplateVariant resolve(TemplateContext *c)
{
QValueList<TemplateVariant> args;
for (uint i=0;i<m_args.count();i++)
{
TemplateVariant v = m_args.at(i)->resolve(c);
args.append(v);
}
TemplateVariant v = m_var->resolve(c);
if (v.type()==TemplateVariant::Function)
{
v = v.call(args);
}
return v;
}
private:
ExprAst *m_var;
QList<ExprAst> m_args;
};
/** @brief Class representing a filter in the AST */ /** @brief Class representing a filter in the AST */
class ExprAstFilter : public ExprAst class ExprAstFilter : public ExprAst
{ {
...@@ -882,11 +921,11 @@ class ExprAstFilterAppl : public ExprAst ...@@ -882,11 +921,11 @@ class ExprAstFilterAppl : public ExprAst
{ {
public: public:
ExprAstFilterAppl(ExprAst *expr,ExprAstFilter *filter) ExprAstFilterAppl(ExprAst *expr,ExprAstFilter *filter)
: m_expr(expr), m_filter(filter) : m_expr(expr), m_filter(filter)
{ TRACE(("ExprAstFilterAppl\n")); } { TRACE(("ExprAstFilterAppl\n")); }
~ExprAstFilterAppl() { delete m_expr; delete m_filter; } ~ExprAstFilterAppl() { delete m_expr; delete m_filter; }
virtual TemplateVariant resolve(TemplateContext *c) virtual TemplateVariant resolve(TemplateContext *c)
{ {
return m_filter->apply(m_expr->resolve(c),c); return m_filter->apply(m_expr->resolve(c),c);
} }
private: private:
...@@ -898,7 +937,7 @@ class ExprAstFilterAppl : public ExprAst ...@@ -898,7 +937,7 @@ class ExprAstFilterAppl : public ExprAst
class ExprAstLiteral : public ExprAst class ExprAstLiteral : public ExprAst
{ {
public: public:
ExprAstLiteral(const char *lit) : m_literal(lit) ExprAstLiteral(const char *lit) : m_literal(lit)
{ TRACE(("ExprAstLiteral(%s)\n",lit)); } { TRACE(("ExprAstLiteral(%s)\n",lit)); }
const QCString &literal() const { return m_literal; } const QCString &literal() const { return m_literal; }
virtual TemplateVariant resolve(TemplateContext *) { return TemplateVariant(m_literal); } virtual TemplateVariant resolve(TemplateContext *) { return TemplateVariant(m_literal); }
...@@ -910,10 +949,10 @@ class ExprAstLiteral : public ExprAst ...@@ -910,10 +949,10 @@ class ExprAstLiteral : public ExprAst
class ExprAstNegate : public ExprAst class ExprAstNegate : public ExprAst
{ {
public: public:
ExprAstNegate(ExprAst *expr) : m_expr(expr) ExprAstNegate(ExprAst *expr) : m_expr(expr)
{ TRACE(("ExprAstNegate\n")); } { TRACE(("ExprAstNegate\n")); }
~ExprAstNegate() { delete m_expr; } ~ExprAstNegate() { delete m_expr; }
virtual TemplateVariant resolve(TemplateContext *c) virtual TemplateVariant resolve(TemplateContext *c)
{ return TemplateVariant(!m_expr->resolve(c).toBool()); } { return TemplateVariant(!m_expr->resolve(c).toBool()); }
private: private:
ExprAst *m_expr; ExprAst *m_expr;
...@@ -924,10 +963,10 @@ class ExprAstBinary : public ExprAst ...@@ -924,10 +963,10 @@ class ExprAstBinary : public ExprAst
{ {
public: public:
ExprAstBinary(Operator::Type op,ExprAst *lhs,ExprAst *rhs) ExprAstBinary(Operator::Type op,ExprAst *lhs,ExprAst *rhs)
: m_operator(op), m_lhs(lhs), m_rhs(rhs) : m_operator(op), m_lhs(lhs), m_rhs(rhs)
{ TRACE(("ExprAstBinary %s\n",Operator::toString(op))); } { TRACE(("ExprAstBinary %s\n",Operator::toString(op))); }
~ExprAstBinary() { delete m_lhs; delete m_rhs; } ~ExprAstBinary() { delete m_lhs; delete m_rhs; }
virtual TemplateVariant resolve(TemplateContext *c) virtual TemplateVariant resolve(TemplateContext *c)
{ {
TemplateVariant lhs = m_lhs->resolve(c); TemplateVariant lhs = m_lhs->resolve(c);
TemplateVariant rhs = m_rhs ? m_rhs->resolve(c) : TemplateVariant(); TemplateVariant rhs = m_rhs ? m_rhs->resolve(c) : TemplateVariant();
...@@ -994,11 +1033,11 @@ class ExprAstBinary : public ExprAst ...@@ -994,11 +1033,11 @@ class ExprAstBinary : public ExprAst
class ExpressionParser class ExpressionParser
{ {
public: public:
ExpressionParser(const QCString &templateName,int line) ExpressionParser(const QCString &templateName,int line)
: m_templateName(templateName), m_line(line), m_tokenStream(0) : m_templateName(templateName), m_line(line), m_tokenStream(0)
{ {
} }
virtual ~ExpressionParser() virtual ~ExpressionParser()
{ {
} }
...@@ -1050,7 +1089,7 @@ class ExpressionParser ...@@ -1050,7 +1089,7 @@ class ExpressionParser
{ {
TRACE(("{parseOrExpression(%s)\n",m_tokenStream)); TRACE(("{parseOrExpression(%s)\n",m_tokenStream));
ExprAst *lhs = parseAndExpression(); ExprAst *lhs = parseAndExpression();
if (lhs) if (lhs)
{ {
while (m_curToken.type==ExprToken::Operator && while (m_curToken.type==ExprToken::Operator &&
m_curToken.op==Operator::Or) m_curToken.op==Operator::Or)
...@@ -1068,7 +1107,7 @@ class ExpressionParser ...@@ -1068,7 +1107,7 @@ class ExpressionParser
{ {
TRACE(("{parseAndExpression(%s)\n",m_tokenStream)); TRACE(("{parseAndExpression(%s)\n",m_tokenStream));
ExprAst *lhs = parseNotExpression(); ExprAst *lhs = parseNotExpression();
if (lhs) if (lhs)
{ {
while (m_curToken.type==ExprToken::Operator && while (m_curToken.type==ExprToken::Operator &&
m_curToken.op==Operator::And) m_curToken.op==Operator::And)
...@@ -1189,11 +1228,38 @@ class ExpressionParser ...@@ -1189,11 +1228,38 @@ class ExpressionParser
return lit; return lit;
} }
ExprAst *parseIdentifierOptionalArgs()
{
TRACE(("{parseIdentifierOptionalArgs(%s)\n",m_curToken.id.data()));
ExprAst *expr = parseIdentifier();
if (expr)
{
if (m_curToken.type==ExprToken::Operator &&
m_curToken.op==Operator::Colon)
{
getNextToken();
ExprAst *argExpr = parsePrimaryExpression();
QList<ExprAst> args;
args.append(argExpr);
while (m_curToken.type==ExprToken::Operator &&
m_curToken.op==Operator::Comma)
{
getNextToken();
argExpr = parsePrimaryExpression();
args.append(argExpr);
}
expr = new ExprAstFunctionVariable(expr,args);
}
}
TRACE(("}parseIdentifierOptionalArgs()\n"));
return expr;
}
ExprAst *parseFilteredVariable() ExprAst *parseFilteredVariable()
{ {
TRACE(("{parseFilteredVariable()\n")); TRACE(("{parseFilteredVariable()\n"));
ExprAst *expr = parseIdentifier(); ExprAst *expr = parseIdentifierOptionalArgs();
if (expr) if (expr)
{ {
while (m_curToken.type==ExprToken::Operator && while (m_curToken.type==ExprToken::Operator &&
m_curToken.op==Operator::Filter) m_curToken.op==Operator::Filter)
...@@ -1300,6 +1366,12 @@ class ExpressionParser ...@@ -1300,6 +1366,12 @@ class ExpressionParser
m_curToken.op = Operator::Colon; m_curToken.op = Operator::Colon;
p++; p++;
} }
else if (c==',')
{
m_curToken.type = ExprToken::Operator;
m_curToken.op = Operator::Comma;
p++;
}
else if ((c=='-' && *(p+1)>='0' && *(p+1)<='9') || (c>='0' && c<='9')) else if ((c=='-' && *(p+1)>='0' && *(p+1)<='9') || (c>='0' && c<='9'))
{ {
m_curToken.type = ExprToken::Number; m_curToken.type = ExprToken::Number;
...@@ -1321,17 +1393,17 @@ class ExpressionParser ...@@ -1321,17 +1393,17 @@ class ExpressionParser
s[0]=c; s[0]=c;
m_curToken.id = s; m_curToken.id = s;
p++; p++;
while ((c=*p) && while ((c=*p) &&
(c=='_' || c=='.' || (c=='_' || c=='.' ||
(c>='a' && c<='z') || (c>='a' && c<='z') ||
(c>='A' && c<='Z') || (c>='A' && c<='Z') ||
(c>='0' && c<='9')) (c>='0' && c<='9'))
) )
{ {
s[0]=c; s[0]=c;
m_curToken.id+=s; m_curToken.id+=s;
p++; p++;
} }
} }
else if (c=='"' || c=='\'') else if (c=='"' || c=='\'')
{ {
...@@ -1470,9 +1542,10 @@ class TemplateImpl : public TemplateNode, public Template ...@@ -1470,9 +1542,10 @@ class TemplateImpl : public TemplateNode, public Template
//---------------------------------------------------------- //----------------------------------------------------------
TemplateContextImpl::TemplateContextImpl() TemplateContextImpl::TemplateContextImpl()
: m_templateName("<unknown>"), m_line(1), m_escapeIntf(0) : m_templateName("<unknown>"), m_line(1), m_escapeIntf(0),
{ m_spacelessIntf(0), m_spacelessEnabled(FALSE)
{
m_contextStack.setAutoDelete(TRUE); m_contextStack.setAutoDelete(TRUE);
push(); push();
} }
...@@ -1497,7 +1570,7 @@ TemplateVariant TemplateContextImpl::get(const QCString &name) const ...@@ -1497,7 +1570,7 @@ TemplateVariant TemplateContextImpl::get(const QCString &name) const
int i=name.find('.'); int i=name.find('.');
if (i==-1) // simple name if (i==-1) // simple name
{ {
return getPrimary(name); return getPrimary(name);
} }
else // obj.prop else // obj.prop
{ {
...@@ -1576,7 +1649,7 @@ const TemplateVariant *TemplateContextImpl::getRef(const QCString &name) const ...@@ -1576,7 +1649,7 @@ const TemplateVariant *TemplateContextImpl::getRef(const QCString &name) const
TemplateVariant TemplateContextImpl::getPrimary(const QCString &name) const TemplateVariant TemplateContextImpl::getPrimary(const QCString &name) const
{ {
const TemplateVariant *v = getRef(name); const TemplateVariant *v = getRef(name);
return v ? *v : TemplateVariant(); return v ? *v : TemplateVariant();
} }
void TemplateContextImpl::push() void TemplateContextImpl::push()
...@@ -1605,16 +1678,24 @@ TemplateBlockContext *TemplateContextImpl::blockContext() ...@@ -1605,16 +1678,24 @@ TemplateBlockContext *TemplateContextImpl::blockContext()
class TemplateNodeText : public TemplateNode class TemplateNodeText : public TemplateNode
{ {
public: public:
TemplateNodeText(TemplateParser *,TemplateNode *parent,int,const QCString &data) TemplateNodeText(TemplateParser *,TemplateNode *parent,int,const QCString &data)
: TemplateNode(parent), m_data(data) : TemplateNode(parent), m_data(data)
{ {
TRACE(("TemplateNodeText('%s')\n",replace(data,'\n',' ').data())); TRACE(("TemplateNodeText('%s')\n",replace(data,'\n',' ').data()));
} }
void render(FTextStream &ts, TemplateContext *) void render(FTextStream &ts, TemplateContext *c)
{ {
//printf("TemplateNodeText::render(%s)\n",m_data.data()); //printf("TemplateNodeText::render(%s)\n",m_data.data());
ts << m_data; TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci->spacelessEnabled())
{
ts << ci->spacelessIntf()->remove(m_data);
}
else
{
ts << m_data;
}
} }
private: private:
QCString m_data; QCString m_data;
...@@ -1626,30 +1707,12 @@ class TemplateNodeText : public TemplateNode ...@@ -1626,30 +1707,12 @@ class TemplateNodeText : public TemplateNode
class TemplateNodeVariable : public TemplateNode class TemplateNodeVariable : public TemplateNode
{ {
public: public:
TemplateNodeVariable(TemplateParser *parser,TemplateNode *parent,int line,const QCString &var) TemplateNodeVariable(TemplateParser *parser,TemplateNode *parent,int line,const QCString &var)
: TemplateNode(parent), m_templateName(parser->templateName()), m_line(line) : TemplateNode(parent), m_templateName(parser->templateName()), m_line(line)
{ {
TRACE(("TemplateNodeVariable(%s)\n",var.data())); TRACE(("TemplateNodeVariable(%s)\n",var.data()));
ExpressionParser expParser(m_templateName,line); ExpressionParser expParser(m_templateName,line);
int i=var.find(':'); m_var = expParser.parseVariable(var);
int j=var.find('|');
if (i==-1 || (j!=-1 && j<i)) // no arguments or arg belongs to filter
{
m_var = expParser.parseVariable(var);
}
else
{
QValueList<QCString> args = split(var.mid(i+1),",");
for (uint j=0;j<args.count();j++)
{
ExprAst *expr = expParser.parsePrimary(args[j]);
if (expr)
{
m_args.append(expr);
}
}
m_var = expParser.parseVariable(var.left(i));
}
} }
~TemplateNodeVariable() ~TemplateNodeVariable()
{ {
...@@ -1660,30 +1723,19 @@ class TemplateNodeVariable : public TemplateNode ...@@ -1660,30 +1723,19 @@ class TemplateNodeVariable : public TemplateNode
{ {
TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c); TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c);
ci->setLocation(m_templateName,m_line); ci->setLocation(m_templateName,m_line);
QValueList<TemplateVariant> args;
for (uint i=0;i<m_args.count();i++)
{
TemplateVariant v = m_args.at(i)->resolve(c);
args.append(v);
}
TemplateVariant v = m_var->resolve(c); TemplateVariant v = m_var->resolve(c);
QCString value;
if (v.type()==TemplateVariant::Function) if (v.type()==TemplateVariant::Function)
{ {
value = v.call(args); v = v.call(QValueList<TemplateVariant>());
}
else
{
value = v.toString();
} }
//printf("TemplateNodeVariable::render(%s) raw=%d\n",value.data(),v.raw()); //printf("TemplateNodeVariable::render(%s) raw=%d\n",value.data(),v.raw());
if (ci->escapeIntf() && !v.raw()) if (ci->escapeIntf() && !v.raw())
{ {
ts << ci->escapeIntf()->escape(value); ts << ci->escapeIntf()->escape(v.toString());
} }
else else
{ {
ts << value; ts << v.toString();
} }
} }
...@@ -1696,13 +1748,13 @@ class TemplateNodeVariable : public TemplateNode ...@@ -1696,13 +1748,13 @@ class TemplateNodeVariable : public TemplateNode
//---------------------------------------------------------- //----------------------------------------------------------
/** @brief Helper class for creating template AST tag nodes and returning /** @brief Helper class for creating template AST tag nodes and returning
* the template for a given node. * the template for a given node.
*/ */
template<class T> class TemplateNodeCreator : public TemplateNode template<class T> class TemplateNodeCreator : public TemplateNode
{ {
public: public:
TemplateNodeCreator(TemplateParser *parser,TemplateNode *parent,int line) TemplateNodeCreator(TemplateParser *parser,TemplateNode *parent,int line)
: TemplateNode(parent), m_templateName(parser->templateName()), m_line(line) {} : TemplateNode(parent), m_templateName(parser->templateName()), m_line(line) {}
static TemplateNode *createInstance(TemplateParser *parser, static TemplateNode *createInstance(TemplateParser *parser,
TemplateNode *parent, TemplateNode *parent,
...@@ -1790,7 +1842,7 @@ class TemplateNodeIf : public TemplateNodeCreator<TemplateNodeIf> ...@@ -1790,7 +1842,7 @@ class TemplateNodeIf : public TemplateNodeCreator<TemplateNodeIf>
class TemplateNodeFor : public TemplateNodeCreator<TemplateNodeFor> class TemplateNodeFor : public TemplateNodeCreator<TemplateNodeFor>
{ {
public: public:
TemplateNodeFor(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data) TemplateNodeFor(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeFor>(parser,parent,line) : TemplateNodeCreator<TemplateNodeFor>(parser,parent,line)
{ {
TRACE(("{TemplateNodeFor(%s)\n",data.data())); TRACE(("{TemplateNodeFor(%s)\n",data.data()));
...@@ -1899,7 +1951,7 @@ class TemplateNodeFor : public TemplateNodeCreator<TemplateNodeFor> ...@@ -1899,7 +1951,7 @@ class TemplateNodeFor : public TemplateNodeCreator<TemplateNodeFor>
{ {
c->set(m_vars[vi++],v); c->set(m_vars[vi++],v);
} }
else if (m_vars.count()>1 && v.type()==TemplateVariant::Struct) else if (m_vars.count()>1 && v.type()==TemplateVariant::Struct)
// loop variables represent elements in a list item // loop variables represent elements in a list item
{ {
for (uint i=0;i<m_vars.count();i++,vi++) for (uint i=0;i<m_vars.count();i++,vi++)
...@@ -1935,13 +1987,44 @@ class TemplateNodeFor : public TemplateNodeCreator<TemplateNodeFor> ...@@ -1935,13 +1987,44 @@ class TemplateNodeFor : public TemplateNodeCreator<TemplateNodeFor>
TemplateNodeList m_emptyNodes; TemplateNodeList m_emptyNodes;
}; };
//----------------------------------------------------------
/** @brief Class representing an 'markers' tag in a template */
class TemplateNodeMsg : public TemplateNodeCreator<TemplateNodeMsg>
{
public:
TemplateNodeMsg(TemplateParser *parser,TemplateNode *parent,int line,const QCString &)
: TemplateNodeCreator<TemplateNodeMsg>(parser,parent,line)
{
TRACE(("{TemplateNodeMsg()\n"));
QStrList stopAt;
stopAt.append("endmsg");
parser->parse(this,line,stopAt,m_nodes);
parser->removeNextToken(); // skip over endmarkers
TRACE(("}TemplateNodeMsg()\n"));
}
void render(FTextStream &, TemplateContext *c)
{
TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c);
TemplateEscapeIntf *escIntf = ci->escapeIntf();
ci->setEscapeIntf(0); // avoid escaping things we send to standard out
FTextStream ts(stdout);
m_nodes.render(ts,c);
ts << endl;
ci->setEscapeIntf(escIntf);
}
private:
TemplateNodeList m_nodes;
};
//---------------------------------------------------------- //----------------------------------------------------------
/** @brief Class representing a 'block' tag in a template */ /** @brief Class representing a 'block' tag in a template */
class TemplateNodeBlock : public TemplateNodeCreator<TemplateNodeBlock> class TemplateNodeBlock : public TemplateNodeCreator<TemplateNodeBlock>
{ {
public: public:
TemplateNodeBlock(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data) TemplateNodeBlock(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeBlock>(parser,parent,line) : TemplateNodeCreator<TemplateNodeBlock>(parser,parent,line)
{ {
TRACE(("{TemplateNodeBlock(%s)\n",data.data())); TRACE(("{TemplateNodeBlock(%s)\n",data.data()));
...@@ -2014,7 +2097,7 @@ class TemplateNodeBlock : public TemplateNodeCreator<TemplateNodeBlock> ...@@ -2014,7 +2097,7 @@ class TemplateNodeBlock : public TemplateNodeCreator<TemplateNodeBlock>
class TemplateNodeExtend : public TemplateNodeCreator<TemplateNodeExtend> class TemplateNodeExtend : public TemplateNodeCreator<TemplateNodeExtend>
{ {
public: public:
TemplateNodeExtend(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data) TemplateNodeExtend(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeExtend>(parser,parent,line) : TemplateNodeCreator<TemplateNodeExtend>(parser,parent,line)
{ {
TRACE(("{TemplateNodeExtend(%s)\n",data.data())); TRACE(("{TemplateNodeExtend(%s)\n",data.data()));
...@@ -2065,6 +2148,11 @@ class TemplateNodeExtend : public TemplateNodeCreator<TemplateNodeExtend> ...@@ -2065,6 +2148,11 @@ class TemplateNodeExtend : public TemplateNodeCreator<TemplateNodeExtend>
{ {
bc->add(nb); bc->add(nb);
} }
TemplateNodeMsg *msg = dynamic_cast<TemplateNodeMsg*>(n);
if (msg)
{
msg->render(ts,c);
}
} }
// render the base template with the given context // render the base template with the given context
...@@ -2090,7 +2178,7 @@ class TemplateNodeExtend : public TemplateNodeCreator<TemplateNodeExtend> ...@@ -2090,7 +2178,7 @@ class TemplateNodeExtend : public TemplateNodeCreator<TemplateNodeExtend>
class TemplateNodeInclude : public TemplateNodeCreator<TemplateNodeInclude> class TemplateNodeInclude : public TemplateNodeCreator<TemplateNodeInclude>
{ {
public: public:
TemplateNodeInclude(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data) TemplateNodeInclude(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeInclude>(parser,parent,line) : TemplateNodeCreator<TemplateNodeInclude>(parser,parent,line)
{ {
TRACE(("TemplateNodeInclude(%s)\n",data.data())); TRACE(("TemplateNodeInclude(%s)\n",data.data()));
...@@ -2140,11 +2228,11 @@ class TemplateNodeInclude : public TemplateNodeCreator<TemplateNodeInclude> ...@@ -2140,11 +2228,11 @@ class TemplateNodeInclude : public TemplateNodeCreator<TemplateNodeInclude>
//---------------------------------------------------------- //----------------------------------------------------------
/** @brief Class representing an 'instantiate' tag in a template */ /** @brief Class representing an 'create' tag in a template */
class TemplateNodeCreate : public TemplateNodeCreator<TemplateNodeCreate> class TemplateNodeCreate : public TemplateNodeCreator<TemplateNodeCreate>
{ {
public: public:
TemplateNodeCreate(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data) TemplateNodeCreate(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeCreate>(parser,parent,line) : TemplateNodeCreator<TemplateNodeCreate>(parser,parent,line)
{ {
TRACE(("TemplateNodeCreate(%s)\n",data.data())); TRACE(("TemplateNodeCreate(%s)\n",data.data()));
...@@ -2237,19 +2325,19 @@ class TemplateNodeCreate : public TemplateNodeCreator<TemplateNodeCreate> ...@@ -2237,19 +2325,19 @@ class TemplateNodeCreate : public TemplateNodeCreator<TemplateNodeCreate>
//---------------------------------------------------------- //----------------------------------------------------------
/** @brief Class representing an 'instantiate' tag in a template */ /** @brief Class representing an 'tree' tag in a template */
class TemplateNodeTree : public TemplateNodeCreator<TemplateNodeTree> class TemplateNodeTree : public TemplateNodeCreator<TemplateNodeTree>
{ {
struct TreeContext struct TreeContext
{ {
TreeContext(TemplateNodeTree *o,const TemplateListIntf *l,TemplateContext *c) TreeContext(TemplateNodeTree *o,const TemplateListIntf *l,TemplateContext *c)
: object(o), list(l), templateCtx(c) {} : object(o), list(l), templateCtx(c) {}
TemplateNodeTree *object; TemplateNodeTree *object;
const TemplateListIntf *list; const TemplateListIntf *list;
TemplateContext *templateCtx; TemplateContext *templateCtx;
}; };
public: public:
TemplateNodeTree(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data) TemplateNodeTree(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeTree>(parser,parent,line) : TemplateNodeCreator<TemplateNodeTree>(parser,parent,line)
{ {
TRACE(("{TemplateNodeTree(%s)\n",data.data())); TRACE(("{TemplateNodeTree(%s)\n",data.data()));
...@@ -2269,9 +2357,10 @@ class TemplateNodeTree : public TemplateNodeCreator<TemplateNodeTree> ...@@ -2269,9 +2357,10 @@ class TemplateNodeTree : public TemplateNodeCreator<TemplateNodeTree>
{ {
delete m_treeExpr; delete m_treeExpr;
} }
static QCString renderChildrenStub(const void *ctx, const QValueList<TemplateVariant> &) static TemplateVariant renderChildrenStub(const void *ctx, const QValueList<TemplateVariant> &)
{ {
return ((TreeContext*)ctx)->object->renderChildren((const TreeContext*)ctx); return TemplateVariant(((TreeContext*)ctx)->object->
renderChildren((const TreeContext*)ctx),TRUE);
} }
QCString renderChildren(const TreeContext *ctx) QCString renderChildren(const TreeContext *ctx)
{ {
...@@ -2305,7 +2394,7 @@ class TemplateNodeTree : public TemplateNodeCreator<TemplateNodeTree> ...@@ -2305,7 +2394,7 @@ class TemplateNodeTree : public TemplateNodeCreator<TemplateNodeTree>
} }
} }
} }
if (!hasChildren) if (!hasChildren)
{ {
c->set("children",TemplateVariant("")); // provide default c->set("children",TemplateVariant("")); // provide default
m_treeNodes.render(ss,c); m_treeNodes.render(ss,c);
...@@ -2339,7 +2428,7 @@ class TemplateNodeTree : public TemplateNodeCreator<TemplateNodeTree> ...@@ -2339,7 +2428,7 @@ class TemplateNodeTree : public TemplateNodeCreator<TemplateNodeTree>
//---------------------------------------------------------- //----------------------------------------------------------
/** @brief Class representing an 'instantiate' tag in a template */ /** @brief Class representing an 'with' tag in a template */
class TemplateNodeWith : public TemplateNodeCreator<TemplateNodeWith> class TemplateNodeWith : public TemplateNodeCreator<TemplateNodeWith>
{ {
struct Mapping struct Mapping
...@@ -2350,9 +2439,10 @@ class TemplateNodeWith : public TemplateNodeCreator<TemplateNodeWith> ...@@ -2350,9 +2439,10 @@ class TemplateNodeWith : public TemplateNodeCreator<TemplateNodeWith>
ExprAst *value; ExprAst *value;
}; };
public: public:
TemplateNodeWith(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data) TemplateNodeWith(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeWith>(parser,parent,line) : TemplateNodeCreator<TemplateNodeWith>(parser,parent,line)
{ {
TRACE(("{TemplateNodeWith(%s)\n",data.data()));
m_args.setAutoDelete(TRUE); m_args.setAutoDelete(TRUE);
ExpressionParser expParser(parser->templateName(),line); ExpressionParser expParser(parser->templateName(),line);
QValueList<QCString> args = split(data," "); QValueList<QCString> args = split(data," ");
...@@ -2379,6 +2469,7 @@ class TemplateNodeWith : public TemplateNodeCreator<TemplateNodeWith> ...@@ -2379,6 +2469,7 @@ class TemplateNodeWith : public TemplateNodeCreator<TemplateNodeWith>
stopAt.append("endwith"); stopAt.append("endwith");
parser->parse(this,line,stopAt,m_nodes); parser->parse(this,line,stopAt,m_nodes);
parser->removeNextToken(); // skip over endwith parser->removeNextToken(); // skip over endwith
TRACE(("}TemplateNodeWith(%s)\n",data.data()));
} }
~TemplateNodeWith() ~TemplateNodeWith()
{ {
...@@ -2404,7 +2495,130 @@ class TemplateNodeWith : public TemplateNodeCreator<TemplateNodeWith> ...@@ -2404,7 +2495,130 @@ class TemplateNodeWith : public TemplateNodeCreator<TemplateNodeWith>
//---------------------------------------------------------- //----------------------------------------------------------
/** @brief Factory class for creating tag AST nodes found in a template */ /** @brief Class representing an 'spaceless' tag in a template */
class TemplateNodeSpaceless : public TemplateNodeCreator<TemplateNodeSpaceless>
{
public:
TemplateNodeSpaceless(TemplateParser *parser,TemplateNode *parent,int line,const QCString &)
: TemplateNodeCreator<TemplateNodeSpaceless>(parser,parent,line)
{
TRACE(("{TemplateNodeSpaceless()\n"));
QStrList stopAt;
stopAt.append("endspaceless");
parser->parse(this,line,stopAt,m_nodes);
parser->removeNextToken(); // skip over endwith
TRACE(("}TemplateNodeSpaceless()\n"));
}
void render(FTextStream &ts, TemplateContext *c)
{
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
bool wasSpaceless = ci->spacelessEnabled();
ci->enableSpaceless(TRUE);
m_nodes.render(ts,c);
ci->enableSpaceless(wasSpaceless);
}
private:
TemplateNodeList m_nodes;
};
//----------------------------------------------------------
/** @brief Class representing an 'markers' tag in a template */
class TemplateNodeMarkers : public TemplateNodeCreator<TemplateNodeMarkers>
{
public:
TemplateNodeMarkers(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeMarkers>(parser,parent,line)
{
TRACE(("{TemplateNodeMarkers(%s)\n",data.data()));
int i = data.find(" in ");
int w = data.find(" with ");
if (i==-1 || w==-1 || w<i)
{
warn(m_templateName,line,"markers tag as wrong format. Expected: markers <var> in <list> with <string_with_markers>");
}
else
{
ExpressionParser expParser(parser->templateName(),line);
m_var = data.left(i);
m_listExpr = expParser.parseVariable(data.mid(i+4,w-i-4));
m_patternExpr = expParser.parseVariable(data.right(data.length()-w-6));
}
QStrList stopAt;
stopAt.append("endmarkers");
parser->parse(this,line,stopAt,m_nodes);
parser->removeNextToken(); // skip over endmarkers
TRACE(("}TemplateNodeMarkers(%s)\n",data.data()));
}
void render(FTextStream &ts, TemplateContext *c)
{
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
ci->setLocation(m_templateName,m_line);
if (!m_var.isEmpty() && m_listExpr && m_patternExpr)
{
TemplateVariant v = m_listExpr->resolve(c);
const TemplateListIntf *list = v.toList();
TemplateVariant patternStr = m_patternExpr->resolve(c);
if (list)
{
if (patternStr.type()==TemplateVariant::String)
{
TemplateListIntf::ConstIterator *it = list->createIterator();
c->push();
QCString str = patternStr.toString();
QRegExp marker("@[0-9]+"); // pattern for a marker, i.e. @0, @1 ... @12, etc
int index=0,newIndex,matchLen;
while ((newIndex=marker.match(str,index,&matchLen))!=-1)
{
ts << str.mid(index,newIndex-index); // write text before marker
bool ok;
uint entryIndex = str.mid(newIndex+1,matchLen-1).toUInt(&ok); // get marker id
TemplateVariant var;
uint i=0;
// search for list element at position id
for (it->toFirst(); (it->current(var)) && i<entryIndex; it->toNext(),i++) {}
if (ok && i==entryIndex) // found element
{
c->set(m_var,var); // define local variable to hold element of list type
bool wasSpaceless = ci->spacelessEnabled();
ci->enableSpaceless(TRUE);
m_nodes.render(ts,c);
ci->enableSpaceless(wasSpaceless);
}
else if (!ok)
{
warn(m_templateName,m_line,"markers pattern string has invalid markers '%s'",str.data());
}
else if (i<entryIndex)
{
warn(m_templateName,m_line,"markers list does not an element for marker position %d",i);
}
index=newIndex+matchLen; // set index just after marker
}
ts << str.right(str.length()-index); // write text after last marker
c->pop();
}
else
{
warn(m_templateName,m_line,"markers requires a parameter of string type after 'with'!");
}
}
else
{
warn(m_templateName,m_line,"markers requires a parameter of list type after 'in'!");
}
}
}
private:
TemplateNodeList m_nodes;
QCString m_var;
ExprAst *m_listExpr;
ExprAst *m_patternExpr;
};
//----------------------------------------------------------
/** @brief Factory class for creating tag AST nodes found in a template */
class TemplateNodeFactory class TemplateNodeFactory
{ {
public: public:
...@@ -2450,20 +2664,23 @@ class TemplateNodeFactory ...@@ -2450,20 +2664,23 @@ class TemplateNodeFactory
}; };
// register a handler for each start tag we support // register a handler for each start tag we support
static TemplateNodeFactory::AutoRegister<TemplateNodeIf> autoRefIf("if"); static TemplateNodeFactory::AutoRegister<TemplateNodeIf> autoRefIf("if");
static TemplateNodeFactory::AutoRegister<TemplateNodeFor> autoRefFor("for"); static TemplateNodeFactory::AutoRegister<TemplateNodeFor> autoRefFor("for");
static TemplateNodeFactory::AutoRegister<TemplateNodeTree> autoRefTree("recursetree"); static TemplateNodeFactory::AutoRegister<TemplateNodeMsg> autoRefMsg("msg");
static TemplateNodeFactory::AutoRegister<TemplateNodeWith> autoRefWith("with"); static TemplateNodeFactory::AutoRegister<TemplateNodeTree> autoRefTree("recursetree");
static TemplateNodeFactory::AutoRegister<TemplateNodeBlock> autoRefBlock("block"); static TemplateNodeFactory::AutoRegister<TemplateNodeWith> autoRefWith("with");
static TemplateNodeFactory::AutoRegister<TemplateNodeExtend> autoRefExtend("extend"); static TemplateNodeFactory::AutoRegister<TemplateNodeBlock> autoRefBlock("block");
static TemplateNodeFactory::AutoRegister<TemplateNodeCreate> autoRefCreate("create"); static TemplateNodeFactory::AutoRegister<TemplateNodeExtend> autoRefExtend("extend");
static TemplateNodeFactory::AutoRegister<TemplateNodeInclude> autoRefInclude("include"); static TemplateNodeFactory::AutoRegister<TemplateNodeCreate> autoRefCreate("create");
static TemplateNodeFactory::AutoRegister<TemplateNodeInclude> autoRefInclude("include");
static TemplateNodeFactory::AutoRegister<TemplateNodeMarkers> autoRefMarkers("markers");
static TemplateNodeFactory::AutoRegister<TemplateNodeSpaceless> autoRefSpaceless("spaceless");
//---------------------------------------------------------- //----------------------------------------------------------
TemplateBlockContext::TemplateBlockContext() : m_blocks(257) TemplateBlockContext::TemplateBlockContext() : m_blocks(257)
{ {
m_blocks.setAutoDelete(TRUE); m_blocks.setAutoDelete(TRUE);
} }
TemplateNodeBlock *TemplateBlockContext::get(const QCString &name) const TemplateNodeBlock *TemplateBlockContext::get(const QCString &name) const
...@@ -2552,7 +2769,7 @@ class TemplateLexer ...@@ -2552,7 +2769,7 @@ class TemplateLexer
QCString m_data; QCString m_data;
}; };
TemplateLexer::TemplateLexer(const QCString &fileName,const QCString &data) : TemplateLexer::TemplateLexer(const QCString &fileName,const QCString &data) :
m_fileName(fileName), m_data(data) m_fileName(fileName), m_data(data)
{ {
} }
...@@ -2585,7 +2802,7 @@ void TemplateLexer::tokenize(QList<TemplateToken> &tokens) ...@@ -2585,7 +2802,7 @@ void TemplateLexer::tokenize(QList<TemplateToken> &tokens)
{ {
switch (state) switch (state)
{ {
case StateText: case StateText:
if (c=='{') // {{ or {% or {# or something else if (c=='{') // {{ or {% or {# or something else
{ {
state=StateBeginTemplate; state=StateBeginTemplate;
...@@ -2728,7 +2945,7 @@ void TemplateLexer::tokenize(QList<TemplateToken> &tokens) ...@@ -2728,7 +2945,7 @@ void TemplateLexer::tokenize(QList<TemplateToken> &tokens)
{ {
state=StateText; state=StateText;
startLinePos=pos+1; startLinePos=pos+1;
// if the current line only contain commands and whitespace, // if the current line only contain commands and whitespace,
// then skip it in the output by moving lastTokenPos // then skip it in the output by moving lastTokenPos
if (markStartPos!=-1 && emptyOutputLine) lastTokenPos = startLinePos; if (markStartPos!=-1 && emptyOutputLine) lastTokenPos = startLinePos;
// reset markers // reset markers
...@@ -2813,10 +3030,11 @@ void TemplateParser::parse( ...@@ -2813,10 +3030,11 @@ void TemplateParser::parse(
{ {
nodes.append(node); nodes.append(node);
} }
else if (command=="empty" || command=="else" || else if (command=="empty" || command=="else" ||
command=="endif" || command=="endfor" || command=="endif" || command=="endfor" ||
command=="endblock" || command=="endwith" || command=="endblock" || command=="endwith" ||
command=="endrecursetree") command=="endrecursetree" || command=="endspaceless" ||
command=="endmarkers" || command=="endmsg")
{ {
warn(m_templateName,tok->line,"Found tag '%s' without matching start tag",command.data()); warn(m_templateName,tok->line,"Found tag '%s' without matching start tag",command.data());
} }
...@@ -2888,8 +3106,8 @@ TemplateImpl::TemplateImpl(TemplateEngine *engine,const QCString &name,const QCS ...@@ -2888,8 +3106,8 @@ TemplateImpl::TemplateImpl(TemplateEngine *engine,const QCString &name,const QCS
parser.parse(this,1,QStrList(),m_nodes); parser.parse(this,1,QStrList(),m_nodes);
} }
void TemplateImpl::render(FTextStream &ts, TemplateContext *c) void TemplateImpl::render(FTextStream &ts, TemplateContext *c)
{ {
if (!m_nodes.isEmpty()) if (!m_nodes.isEmpty())
{ {
TemplateNodeExtend *ne = dynamic_cast<TemplateNodeExtend*>(m_nodes.getFirst()); TemplateNodeExtend *ne = dynamic_cast<TemplateNodeExtend*>(m_nodes.getFirst());
...@@ -2908,7 +3126,7 @@ void TemplateImpl::render(FTextStream &ts, TemplateContext *c) ...@@ -2908,7 +3126,7 @@ void TemplateImpl::render(FTextStream &ts, TemplateContext *c)
} }
} }
} }
m_nodes.render(ts,c); m_nodes.render(ts,c);
} }
} }
......
...@@ -42,8 +42,10 @@ class TemplateEngine; ...@@ -42,8 +42,10 @@ class TemplateEngine;
* - `for ... empty ... endfor` * - `for ... empty ... endfor`
* - `if ... else ... endif` * - `if ... else ... endif`
* - `block ... endblock` * - `block ... endblock`
* - `extends` * - `extend`
* - `include` * - `include`
* - `with ... endwith`
* - `spaceless ... endspaceless`
* *
* Supported Django filters: * Supported Django filters:
* - `default` * - `default`
...@@ -53,6 +55,13 @@ class TemplateEngine; ...@@ -53,6 +55,13 @@ class TemplateEngine;
* Extension tags: * Extension tags:
* - `create` which instantiates a template and writes the result to a file. * - `create` which instantiates a template and writes the result to a file.
* The syntax is `{% create 'filename' from 'template' %}`. * The syntax is `{% create 'filename' from 'template' %}`.
* - `recursetree`
* - `markers`
*
* Extension filters:
* - `stripPath`
* - `nowrap`
* - `prepend`
* *
* @{ * @{
*/ */
...@@ -62,7 +71,7 @@ class TemplateVariant ...@@ -62,7 +71,7 @@ class TemplateVariant
{ {
public: public:
/** Signature of the callback function, used for function type variants */ /** Signature of the callback function, used for function type variants */
typedef QCString (*FuncType)(const void *obj, const QValueList<TemplateVariant> &args); typedef TemplateVariant (*FuncType)(const void *obj, const QValueList<TemplateVariant> &args);
/** Types of data that can be stored in a TemplateVariant */ /** Types of data that can be stored in a TemplateVariant */
enum Type { None, Bool, Integer, String, Struct, List, Function }; enum Type { None, Bool, Integer, String, Struct, List, Function };
...@@ -83,10 +92,10 @@ class TemplateVariant ...@@ -83,10 +92,10 @@ class TemplateVariant
TemplateVariant(int v); TemplateVariant(int v);
/** Constructs a new variant with a string value \a s. */ /** Constructs a new variant with a string value \a s. */
TemplateVariant(const char *s); TemplateVariant(const char *s,bool raw=FALSE);
/** Constructs a new variant with a string value \a s. */ /** Constructs a new variant with a string value \a s. */
TemplateVariant(const QCString &s); TemplateVariant(const QCString &s,bool raw=FALSE);
/** Constructs a new variant with a struct value \a s. /** Constructs a new variant with a struct value \a s.
* @note. Only a pointer to the struct is stored. The caller * @note. Only a pointer to the struct is stored. The caller
...@@ -146,7 +155,7 @@ class TemplateVariant ...@@ -146,7 +155,7 @@ class TemplateVariant
/** Return the result of apply this function with \a args. /** Return the result of apply this function with \a args.
* Returns an empty string if the variant type is not a function. * Returns an empty string if the variant type is not a function.
*/ */
QCString call(const QValueList<TemplateVariant> &args); TemplateVariant call(const QValueList<TemplateVariant> &args);
/** Sets whether or not the value of the Variant should be /** Sets whether or not the value of the Variant should be
* escaped or written as-is (raw). * escaped or written as-is (raw).
...@@ -283,6 +292,16 @@ class TemplateEscapeIntf ...@@ -283,6 +292,16 @@ class TemplateEscapeIntf
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** @brief Interface used to remove redundant spaces inside a spaceless block */
class TemplateSpacelessIntf
{
public:
/** Returns the \a input after removing redundant whitespace */
virtual QCString remove(const QCString &input) = 0;
};
//------------------------------------------------------------------------
/** @brief Abstract interface for a template context. /** @brief Abstract interface for a template context.
* *
* A Context consists of a stack of dictionaries. * A Context consists of a stack of dictionaries.
...@@ -333,6 +352,11 @@ class TemplateContext ...@@ -333,6 +352,11 @@ class TemplateContext
* of variable expansion before writing it to the output. * of variable expansion before writing it to the output.
*/ */
virtual void setEscapeIntf(TemplateEscapeIntf *intf) = 0; virtual void setEscapeIntf(TemplateEscapeIntf *intf) = 0;
/** Sets the interface that will be used inside a spaceless block
* to remove any redundant whitespace.
*/
virtual void setSpacelessIntf(TemplateSpacelessIntf *intf) = 0;
}; };
//------------------------------------------------------------------------ //------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment