My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Functions
classdef.cpp File Reference
#include <stdio.h>
#include <qfile.h>
#include <qregexp.h>
#include "classdef.h"
#include "classlist.h"
#include "entry.h"
#include "doxygen.h"
#include "membername.h"
#include "message.h"
#include "config.h"
#include "util.h"
#include "diagram.h"
#include "language.h"
#include "htmlhelp.h"
#include "example.h"
#include "outputlist.h"
#include "dot.h"
#include "defargs.h"
#include "debug.h"
#include "docparser.h"
#include "searchindex.h"
#include "vhdldocgen.h"
#include "layout.h"
#include "arguments.h"
#include "memberlist.h"
#include "groupdef.h"
#include "filedef.h"
#include "namespacedef.h"
#include "membergroup.h"

Go to the source code of this file.

Classes

class  ClassDefImpl
 

Functions

static void writeInheritanceSpecifier (OutputList &ol, BaseClassDef *bcd)
 
static void searchTemplateSpecs (Definition *d, QList< ArgumentList > &result, QCString &name, SrcLangExt lang)
 
static void writeTemplateSpec (OutputList &ol, Definition *d, const QCString &type, SrcLangExt lang)
 
static bool isStandardFunc (MemberDef *md)
 

Function Documentation

static bool isStandardFunc ( MemberDef md)
static

Definition at line 2848 of file classdef.cpp.

References MemberDef::isConstructor(), MemberDef::isDestructor(), and Definition::name().

Referenced by ClassDef::mergeMembers().

{
return md->name()=="operator=" || // assignment operator
md->isConstructor() || // constructor
md->isDestructor(); // destructor
}
static void searchTemplateSpecs ( Definition d,
QList< ArgumentList > &  result,
QCString &  name,
SrcLangExt  lang 
)
static

Definition at line 875 of file classdef.cpp.

References DefinitionIntf::definitionType(), Definition::getOuterScope(), isSpecialization(), Definition::localName(), Definition::qualifiedName(), tempArgListToString(), ClassDef::templateArguments(), and DefinitionIntf::TypeClass.

Referenced by writeTemplateSpec().

{
{
if (d->getOuterScope())
{
searchTemplateSpecs(d->getOuterScope(),result,name,lang);
}
ClassDef *cd=(ClassDef *)d;
if (!name.isEmpty()) name+="::";
QCString clName = d->localName();
if (/*clName.right(2)=="-g" ||*/ clName.right(2)=="-p")
{
clName = clName.left(clName.length()-2);
}
name+=clName;
bool isSpecialization = d->localName().find('<')!=-1;
if (cd->templateArguments())
{
result.append(cd->templateArguments());
if (!isSpecialization)
{
}
}
}
else
{
name+=d->qualifiedName();
}
}
static void writeInheritanceSpecifier ( OutputList ol,
BaseClassDef bcd 
)
static

Definition at line 814 of file classdef.cpp.

References OutputList::docify(), OutputList::endTypewriter(), Normal, Private, BaseClassDef::prot, Protected, Public, OutputList::startTypewriter(), BaseClassDef::virt, and Virtual.

Referenced by ClassDef::writeInheritanceGraph().

{
if (bcd->prot!=Public || bcd->virt!=Normal)
{
ol.docify(" [");
QStrList sl;
if (bcd->prot==Protected) sl.append("protected");
else if (bcd->prot==Private) sl.append("private");
if (bcd->virt==Virtual) sl.append("virtual");
const char *s=sl.first();
while (s)
{
ol.docify(s);
s=sl.next();
if (s) ol.docify(", ");
}
ol.docify("]");
}
}
static void writeTemplateSpec ( OutputList ol,
Definition d,
const QCString &  type,
SrcLangExt  lang 
)
static

Definition at line 910 of file classdef.cpp.

References Argument::defval, OutputList::docify(), OutputList::endSubsubsection(), OutputList::lineBreak(), Argument::name, searchTemplateSpecs(), OutputList::startSubsubsection(), Argument::type, and OutputList::writeString().

Referenced by ClassDef::writeDetailedDocumentationBody().

{
QList<ArgumentList> specs;
QCString name;
searchTemplateSpecs(d,specs,name,lang);
if (specs.count()>0) // class has template scope specifiers
{
QListIterator<ArgumentList> spi(specs);
for (spi.toFirst();(al=spi.current());++spi)
{
ol.docify("template<");
QListIterator<Argument> ali(*al);
while ((a=ali.current()))
{
ol.docify(a->type);
if (!a->name.isEmpty())
{
ol.docify(" ");
ol.docify(a->name);
}
if (a->defval.length()!=0)
{
ol.docify(" = ");
ol.docify(a->defval);
}
++ali;
a=ali.current();
if (a) ol.docify(", ");
}
ol.docify(">");
ol.lineBreak();
}
ol.docify(type.lower()+" "+name);
ol.writeString("\n");
}
}