My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Macros | Functions | Variables
xmlgen.cpp File Reference
#include <stdlib.h>
#include <qdir.h>
#include <qfile.h>
#include <qtextstream.h>
#include <qintdict.h>
#include "xmlgen.h"
#include "doxygen.h"
#include "message.h"
#include "config.h"
#include "classlist.h"
#include "util.h"
#include "defargs.h"
#include "outputgen.h"
#include "dot.h"
#include "pagedef.h"
#include "filename.h"
#include "version.h"
#include "xmldocvisitor.h"
#include "docparser.h"
#include "language.h"
#include "parserintf.h"
#include "arguments.h"
#include "memberlist.h"
#include "groupdef.h"
#include "memberdef.h"
#include "namespacedef.h"
#include "membername.h"
#include "membergroup.h"
#include "dirdef.h"
#include "section.h"
#include "htmlentity.h"
#include "resourcemgr.h"

Go to the source code of this file.

Classes

class  XmlSectionMapper
 
class  TextGeneratorXMLImpl
 
class  XMLCodeGenerator
 

Macros

#define XML_DB(x)   do {} while(0)
 

Functions

void writeXMLString (FTextStream &t, const char *s)
 
void writeXMLCodeString (FTextStream &t, const char *s, int &col)
 
static void writeXMLHeader (FTextStream &t)
 
static void writeCombineScript ()
 
void writeXMLLink (FTextStream &t, const char *extRef, const char *compoundId, const char *anchorId, const char *text, const char *tooltip)
 
static void writeTemplateArgumentList (ArgumentList *al, FTextStream &t, Definition *scope, FileDef *fileScope, int indent)
 
static void writeMemberTemplateLists (MemberDef *md, FTextStream &t)
 
static void writeTemplateList (ClassDef *cd, FTextStream &t)
 
static void writeXMLDocBlock (FTextStream &t, const QCString &fileName, int lineNr, Definition *scope, MemberDef *md, const QCString &text)
 
void writeXMLCodeBlock (FTextStream &t, FileDef *fd)
 
static void writeMemberReference (FTextStream &t, Definition *def, MemberDef *rmd, const char *tagName)
 
static void stripQualifiers (QCString &typeStr)
 
static QCString classOutputFileBase (ClassDef *cd)
 
static QCString memberOutputFileBase (MemberDef *md)
 
static void generateXMLForMember (MemberDef *md, FTextStream &ti, FTextStream &t, Definition *def)
 
static void generateXMLSection (Definition *d, FTextStream &ti, FTextStream &t, MemberList *ml, const char *kind, const char *header=0, const char *documentation=0)
 
static void writeListOfAllMembers (ClassDef *cd, FTextStream &t)
 
static void writeInnerClasses (const ClassSDict *cl, FTextStream &t)
 
static void writeInnerNamespaces (const NamespaceSDict *nl, FTextStream &t)
 
static void writeInnerFiles (const FileList *fl, FTextStream &t)
 
static void writeInnerPages (const PageSDict *pl, FTextStream &t)
 
static void writeInnerGroups (const GroupList *gl, FTextStream &t)
 
static void writeInnerDirs (const DirList *dl, FTextStream &t)
 
static void generateXMLForClass (ClassDef *cd, FTextStream &ti)
 
static void generateXMLForNamespace (NamespaceDef *nd, FTextStream &ti)
 
static void generateXMLForFile (FileDef *fd, FTextStream &ti)
 
static void generateXMLForGroup (GroupDef *gd, FTextStream &ti)
 
static void generateXMLForDir (DirDef *dd, FTextStream &ti)
 
static void generateXMLForPage (PageDef *pd, FTextStream &ti, bool isExample)
 
void generateXML ()
 

Variables

static XmlSectionMapper g_xmlSectionMapper
 

Macro Definition Documentation

#define XML_DB (   x)    do {} while(0)

Function Documentation

static QCString classOutputFileBase ( ClassDef cd)
static

Definition at line 506 of file xmlgen.cpp.

References ClassDef::getOutputFileBase().

Referenced by generateXMLForClass(), and writeInnerClasses().

{
//static bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES);
//if (inlineGroupedClasses && cd->partOfGroups()!=0)
return cd->getOutputFileBase();
//else
// return cd->getOutputFileBase();
}
void generateXML ( )

Definition at line 1840 of file xmlgen.cpp.

References Doxygen::classSDict, Config_getString, ResourceMgr::copyResource(), createSubDirs(), Doxygen::directories, endl(), err(), Doxygen::exampleSDict, generateXMLForClass(), generateXMLForDir(), generateXMLForFile(), generateXMLForGroup(), generateXMLForNamespace(), generateXMLForPage(), ResourceMgr::getAsString(), Doxygen::groupSDict, Doxygen::inputNameList, HtmlEntityMapper::instance(), ResourceMgr::instance(), SDict< GroupDef >::Iterator, SDict< NamespaceDef >::Iterator, SDict< DirDef >::Iterator, SDict< ClassDef >::Iterator, SDict< PageDef >::Iterator, Doxygen::mainPage, msg(), FileDef::name(), Definition::name(), Doxygen::namespaceSDict, Doxygen::pageSDict, versionString, writeCombineScript(), and HtmlEntityMapper::writeXMLSchema().

Referenced by generateOutput().

{
// + classes
// + namespaces
// + files
// + groups
// + related pages
// - examples
QCString outputDirectory = Config_getString(XML_OUTPUT);
QDir xmlDir(outputDirectory);
createSubDirs(xmlDir);
ResourceMgr::instance().copyResource("index.xsd",outputDirectory);
QCString fileName=outputDirectory+"/compound.xsd";
QFile f(fileName);
if (!f.open(IO_WriteOnly))
{
err("Cannot open file %s for writing!\n",fileName.data());
return;
}
// write compound.xsd, but replace special marker with the entities
QCString compound_xsd = ResourceMgr::instance().getAsString("compound.xsd");
const char *startLine = compound_xsd.data();
while (*startLine)
{
// find end of the line
const char *endLine = startLine+1;
while (*endLine && *(endLine-1)!='\n') endLine++; // skip to end of the line including \n
int len=endLine-startLine;
if (len>0)
{
QCString s(len+1);
qstrncpy(s.rawData(),startLine,len);
s[len]='\0';
if (s.find("<!-- Automatically insert here the HTML entities -->")!=-1)
{
FTextStream t(&f);
}
else
{
f.writeBlock(startLine,len);
}
}
startLine=endLine;
}
f.close();
fileName=outputDirectory+"/index.xml";
f.setName(fileName);
if (!f.open(IO_WriteOnly))
{
err("Cannot open file %s for writing!\n",fileName.data());
return;
}
FTextStream t(&f);
//t.setEncoding(FTextStream::UnicodeUTF8);
// write index header
t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << endl;;
t << "<doxygenindex xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
t << "xsi:noNamespaceSchemaLocation=\"index.xsd\" ";
t << "version=\"" << versionString << "\">" << endl;
{
ClassDef *cd;
for (cli.toFirst();(cd=cli.current());++cli)
{
}
}
//{
// ClassSDict::Iterator cli(Doxygen::hiddenClasses);
// ClassDef *cd;
// for (cli.toFirst();(cd=cli.current());++cli)
// {
// msg("Generating XML output for class %s\n",cd->name().data());
// generateXMLForClass(cd,t);
// }
//}
for (nli.toFirst();(nd=nli.current());++nli)
{
msg("Generating XML output for namespace %s\n",nd->name().data());
}
FileName *fn;
for (;(fn=fnli.current());++fnli)
{
FileNameIterator fni(*fn);
FileDef *fd;
for (;(fd=fni.current());++fni)
{
msg("Generating XML output for file %s\n",fd->name().data());
}
}
GroupDef *gd;
for (;(gd=gli.current());++gli)
{
msg("Generating XML output for group %s\n",gd->name().data());
}
{
PageDef *pd=0;
for (pdi.toFirst();(pd=pdi.current());++pdi)
{
msg("Generating XML output for page %s\n",pd->name().data());
generateXMLForPage(pd,t,FALSE);
}
}
{
DirDef *dir;
for (sdi.toFirst();(dir=sdi.current());++sdi)
{
msg("Generate XML output for dir %s\n",dir->name().data());
}
}
{
PageDef *pd=0;
for (pdi.toFirst();(pd=pdi.current());++pdi)
{
msg("Generating XML output for example %s\n",pd->name().data());
generateXMLForPage(pd,t,TRUE);
}
}
{
msg("Generating XML output for the main page\n");
}
//t << " </compoundlist>" << endl;
t << "</doxygenindex>" << endl;
}
static void generateXMLForClass ( ClassDef cd,
FTextStream ti 
)
static

Definition at line 1216 of file xmlgen.cpp.

References FileDef::absFilePath(), ClassDef::baseClasses(), Definition::briefDescription(), Definition::briefFile(), Definition::briefLine(), classOutputFileBase(), DotNode::Collaboration, ClassDef::compoundTypeString(), Config_getString, convertToXML(), Definition::docFile(), Definition::docLine(), FileDef::docName(), Definition::documentation(), endl(), err(), IncludeInfo::fileDef, generateXMLSection(), Definition::getBodyDef(), ClassDef::getClassSDict(), Definition::getDefColumn(), Definition::getDefFileName(), Definition::getDefLine(), Definition::getEndBodyLine(), Definition::getLanguage(), ClassDef::getMemberGroupSDict(), ClassDef::getMemberLists(), FileDef::getOutputFileBase(), Definition::getStartBodyLine(), ClassDef::includeInfo(), IncludeInfo::includeName, DotNode::Inheritance, insertTemplateSpecifierInScope(), ClassDef::isAbstract(), Definition::isArtificial(), ClassDef::isFinal(), Definition::isHidden(), ClassDef::isReference(), Definition::isReference(), ClassDef::isSealed(), DotClassGraph::isTrivial(), SIntDict< MemberGroup >::Iterator, langToString(), IncludeInfo::local, MemberListType_detailedLists, msg(), Definition::name(), Normal, Package, Private, Protected, ClassDef::protection(), Public, Pure, stripFromPath(), ClassDef::subClasses(), ClassDef::templateMaster(), Virtual, writeInnerClasses(), writeListOfAllMembers(), writeTemplateList(), DotClassGraph::writeXML(), writeXMLDocBlock(), writeXMLHeader(), and writeXMLString().

Referenced by generateXML().

{
// + brief description
// + detailed description
// + template argument list(s)
// - include file
// + member groups
// + inheritance diagram
// + list of direct super classes
// + list of direct sub classes
// + list of inner classes
// + collaboration diagram
// + list of all members
// + user defined member sections
// + standard member sections
// + detailed member documentation
// - examples using the class
if (cd->isReference()) return; // skip external references.
if (cd->isHidden()) return; // skip hidden classes.
if (cd->name().find('@')!=-1) return; // skip anonymous compounds.
if (cd->templateMaster()!=0) return; // skip generated template instances.
if (cd->isArtificial()) return; // skip artificially created classes
msg("Generating XML output for class %s\n",cd->name().data());
ti << " <compound refid=\"" << classOutputFileBase(cd)
<< "\" kind=\"" << cd->compoundTypeString()
<< "\"><name>" << convertToXML(cd->name()) << "</name>" << endl;
QCString outputDirectory = Config_getString(XML_OUTPUT);
QCString fileName=outputDirectory+"/"+ classOutputFileBase(cd)+".xml";
QFile f(fileName);
if (!f.open(IO_WriteOnly))
{
err("Cannot open file %s for writing!\n",fileName.data());
return;
}
FTextStream t(&f);
//t.setEncoding(FTextStream::UnicodeUTF8);
t << " <compounddef id=\""
<< classOutputFileBase(cd) << "\" kind=\""
<< cd->compoundTypeString() << "\" language=\""
<< langToString(cd->getLanguage()) << "\" prot=\"";
switch (cd->protection())
{
case Public: t << "public"; break;
case Protected: t << "protected"; break;
case Private: t << "private"; break;
case Package: t << "package"; break;
}
if (cd->isFinal()) t << "\" final=\"yes";
if (cd->isSealed()) t << "\" sealed=\"yes";
if (cd->isAbstract()) t << "\" abstract=\"yes";
t << "\">" << endl;
t << " <compoundname>";
writeXMLString(t,cd->name());
t << "</compoundname>" << endl;
if (cd->baseClasses())
{
for (bcli.toFirst();(bcd=bcli.current());++bcli)
{
t << " <basecompoundref ";
if (bcd->classDef->isLinkable())
{
t << "refid=\"" << classOutputFileBase(bcd->classDef) << "\" ";
}
t << "prot=\"";
switch (bcd->prot)
{
case Public: t << "public"; break;
case Protected: t << "protected"; break;
case Private: t << "private"; break;
case Package: ASSERT(0); break;
}
t << "\" virt=\"";
switch(bcd->virt)
{
case Normal: t << "non-virtual"; break;
case Virtual: t << "virtual"; break;
case Pure: t <<"pure-virtual"; break;
}
t << "\">";
if (!bcd->templSpecifiers.isEmpty())
{
bcd->classDef->name(),bcd->templSpecifiers)
);
}
else
{
t << convertToXML(bcd->classDef->displayName());
}
t << "</basecompoundref>" << endl;
}
}
if (cd->subClasses())
{
for (bcli.toFirst();(bcd=bcli.current());++bcli)
{
t << " <derivedcompoundref refid=\""
<< classOutputFileBase(bcd->classDef)
<< "\" prot=\"";
switch (bcd->prot)
{
case Public: t << "public"; break;
case Protected: t << "protected"; break;
case Private: t << "private"; break;
case Package: ASSERT(0); break;
}
t << "\" virt=\"";
switch(bcd->virt)
{
case Normal: t << "non-virtual"; break;
case Virtual: t << "virtual"; break;
case Pure: t << "pure-virtual"; break;
}
t << "\">" << convertToXML(bcd->classDef->displayName())
<< "</derivedcompoundref>" << endl;
}
}
if (ii)
{
QCString nm = ii->includeName;
if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName();
if (!nm.isEmpty())
{
t << " <includes";
if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references
{
t << " refid=\"" << ii->fileDef->getOutputFileBase() << "\"";
}
t << " local=\"" << (ii->local ? "yes" : "no") << "\">";
t << nm;
t << "</includes>" << endl;
}
}
{
for (;(mg=mgli.current());++mgli)
{
generateXMLSection(cd,ti,t,mg->members(),"user-defined",mg->header(),
mg->documentation());
}
}
QListIterator<MemberList> mli(cd->getMemberLists());
for (mli.toFirst();(ml=mli.current());++mli)
{
if ((ml->listType()&MemberListType_detailedLists)==0)
{
generateXMLSection(cd,ti,t,ml,g_xmlSectionMapper.find(ml->listType()));
}
}
t << " <briefdescription>" << endl;
t << " </briefdescription>" << endl;
t << " <detaileddescription>" << endl;
writeXMLDocBlock(t,cd->docFile(),cd->docLine(),cd,0,cd->documentation());
t << " </detaileddescription>" << endl;
DotClassGraph inheritanceGraph(cd,DotNode::Inheritance);
if (!inheritanceGraph.isTrivial())
{
t << " <inheritancegraph>" << endl;
inheritanceGraph.writeXML(t);
t << " </inheritancegraph>" << endl;
}
DotClassGraph collaborationGraph(cd,DotNode::Collaboration);
if (!collaborationGraph.isTrivial())
{
t << " <collaborationgraph>" << endl;
collaborationGraph.writeXML(t);
t << " </collaborationgraph>" << endl;
}
t << " <location file=\""
<< stripFromPath(cd->getDefFileName()) << "\" line=\""
<< cd->getDefLine() << "\"" << " column=\""
<< cd->getDefColumn() << "\"" ;
if (cd->getStartBodyLine()!=-1)
{
FileDef *bodyDef = cd->getBodyDef();
if (bodyDef)
{
t << " bodyfile=\"" << stripFromPath(bodyDef->absFilePath()) << "\"";
}
t << " bodystart=\"" << cd->getStartBodyLine() << "\" bodyend=\""
<< cd->getEndBodyLine() << "\"";
}
t << "/>" << endl;
t << " </compounddef>" << endl;
t << "</doxygen>" << endl;
ti << " </compound>" << endl;
}
static void generateXMLForDir ( DirDef dd,
FTextStream ti 
)
static

Definition at line 1720 of file xmlgen.cpp.

References Definition::briefDescription(), Definition::briefFile(), Definition::briefLine(), Config_getString, convertToXML(), DirDef::displayName(), Definition::docFile(), Definition::docLine(), Definition::documentation(), endl(), err(), DirDef::getFiles(), DirDef::getOutputFileBase(), Definition::isReference(), Definition::name(), stripFromPath(), DirDef::subDirs(), writeInnerDirs(), writeInnerFiles(), writeXMLDocBlock(), and writeXMLHeader().

Referenced by generateXML().

{
if (dd->isReference()) return; // skip external references
ti << " <compound refid=\"" << dd->getOutputFileBase()
<< "\" kind=\"dir\"><name>" << convertToXML(dd->displayName())
<< "</name>" << endl;
QCString outputDirectory = Config_getString(XML_OUTPUT);
QCString fileName=outputDirectory+"/"+dd->getOutputFileBase()+".xml";
QFile f(fileName);
if (!f.open(IO_WriteOnly))
{
err("Cannot open file %s for writing!\n",fileName.data());
return;
}
FTextStream t(&f);
//t.setEncoding(FTextStream::UnicodeUTF8);
t << " <compounddef id=\""
<< dd->getOutputFileBase() << "\" kind=\"dir\">" << endl;
t << " <compoundname>" << convertToXML(dd->displayName()) << "</compoundname>" << endl;
t << " <briefdescription>" << endl;
t << " </briefdescription>" << endl;
t << " <detaileddescription>" << endl;
writeXMLDocBlock(t,dd->docFile(),dd->docLine(),dd,0,dd->documentation());
t << " </detaileddescription>" << endl;
t << " <location file=\"" << stripFromPath(dd->name()) << "\"/>" << endl;
t << " </compounddef>" << endl;
t << "</doxygen>" << endl;
ti << " </compound>" << endl;
}
static void generateXMLForFile ( FileDef fd,
FTextStream ti 
)
static

Definition at line 1505 of file xmlgen.cpp.

References Definition::briefDescription(), Definition::briefFile(), Definition::briefLine(), Config_getBool, Config_getString, convertToXML(), Definition::docFile(), Definition::docLine(), Definition::documentation(), endl(), err(), IncludeInfo::fileDef, generateXMLSection(), FileDef::getClassSDict(), Definition::getDefFileName(), Definition::getLanguage(), FileDef::getMemberGroupSDict(), FileDef::getMemberLists(), FileDef::getNamespaceSDict(), FileDef::getOutputFileBase(), FileDef::includedByFileList(), FileDef::includeFileList(), IncludeInfo::includeName, Definition::isReference(), DotInclDepGraph::isTrivial(), SIntDict< MemberGroup >::Iterator, langToString(), IncludeInfo::local, MemberListType_declarationLists, FileDef::name(), stripFromPath(), writeInnerClasses(), writeInnerNamespaces(), DotInclDepGraph::writeXML(), writeXMLCodeBlock(), writeXMLDocBlock(), writeXMLHeader(), and writeXMLString().

Referenced by generateXML().

{
// + includes files
// + includedby files
// + include graph
// + included by graph
// + contained class definitions
// + contained namespace definitions
// + member groups
// + normal members
// + brief desc
// + detailed desc
// + source code
// + location
// - number of lines
if (fd->isReference()) return; // skip external references
ti << " <compound refid=\"" << fd->getOutputFileBase()
<< "\" kind=\"file\"><name>" << convertToXML(fd->name())
<< "</name>" << endl;
QCString outputDirectory = Config_getString(XML_OUTPUT);
QCString fileName=outputDirectory+"/"+fd->getOutputFileBase()+".xml";
QFile f(fileName);
if (!f.open(IO_WriteOnly))
{
err("Cannot open file %s for writing!\n",fileName.data());
return;
}
FTextStream t(&f);
//t.setEncoding(FTextStream::UnicodeUTF8);
t << " <compounddef id=\"" << fd->getOutputFileBase()
<< "\" kind=\"file\" language=\""
<< langToString(fd->getLanguage()) << "\">" << endl;
t << " <compoundname>";
writeXMLString(t,fd->name());
t << "</compoundname>" << endl;
if (fd->includeFileList())
{
QListIterator<IncludeInfo> ili1(*fd->includeFileList());
for (ili1.toFirst();(inc=ili1.current());++ili1)
{
t << " <includes";
if (inc->fileDef && !inc->fileDef->isReference()) // TODO: support external references
{
t << " refid=\"" << inc->fileDef->getOutputFileBase() << "\"";
}
t << " local=\"" << (inc->local ? "yes" : "no") << "\">";
t << inc->includeName;
t << "</includes>" << endl;
}
}
if (fd->includedByFileList())
{
QListIterator<IncludeInfo> ili2(*fd->includedByFileList());
for (ili2.toFirst();(inc=ili2.current());++ili2)
{
t << " <includedby";
if (inc->fileDef && !inc->fileDef->isReference()) // TODO: support external references
{
t << " refid=\"" << inc->fileDef->getOutputFileBase() << "\"";
}
t << " local=\"" << (inc->local ? "yes" : "no") << "\">";
t << inc->includeName;
t << "</includedby>" << endl;
}
}
DotInclDepGraph incDepGraph(fd,FALSE);
if (!incDepGraph.isTrivial())
{
t << " <incdepgraph>" << endl;
incDepGraph.writeXML(t);
t << " </incdepgraph>" << endl;
}
DotInclDepGraph invIncDepGraph(fd,TRUE);
if (!invIncDepGraph.isTrivial())
{
t << " <invincdepgraph>" << endl;
invIncDepGraph.writeXML(t);
t << " </invincdepgraph>" << endl;
}
if (fd->getClassSDict())
{
}
if (fd->getNamespaceSDict())
{
}
{
for (;(mg=mgli.current());++mgli)
{
generateXMLSection(fd,ti,t,mg->members(),"user-defined",mg->header(),
mg->documentation());
}
}
QListIterator<MemberList> mli(fd->getMemberLists());
for (mli.toFirst();(ml=mli.current());++mli)
{
if ((ml->listType()&MemberListType_declarationLists)!=0)
{
generateXMLSection(fd,ti,t,ml,g_xmlSectionMapper.find(ml->listType()));
}
}
t << " <briefdescription>" << endl;
t << " </briefdescription>" << endl;
t << " <detaileddescription>" << endl;
writeXMLDocBlock(t,fd->docFile(),fd->docLine(),fd,0,fd->documentation());
t << " </detaileddescription>" << endl;
if (Config_getBool(XML_PROGRAMLISTING))
{
t << " <programlisting>" << endl;
t << " </programlisting>" << endl;
}
t << " <location file=\"" << stripFromPath(fd->getDefFileName()) << "\"/>" << endl;
t << " </compounddef>" << endl;
t << "</doxygen>" << endl;
ti << " </compound>" << endl;
}
static void generateXMLForGroup ( GroupDef gd,
FTextStream ti 
)
static

Definition at line 1645 of file xmlgen.cpp.

References Definition::briefDescription(), Definition::briefFile(), Definition::briefLine(), Config_getString, convertToXML(), Definition::docFile(), Definition::docLine(), Definition::documentation(), endl(), err(), generateXMLSection(), GroupDef::getClasses(), GroupDef::getFiles(), GroupDef::getMemberGroupSDict(), GroupDef::getMemberLists(), GroupDef::getNamespaces(), GroupDef::getOutputFileBase(), GroupDef::getPages(), GroupDef::getSubGroups(), GroupDef::groupTitle(), Definition::isReference(), SIntDict< MemberGroup >::Iterator, MemberListType_declarationLists, Definition::name(), writeInnerClasses(), writeInnerFiles(), writeInnerGroups(), writeInnerNamespaces(), writeInnerPages(), writeXMLDocBlock(), and writeXMLHeader().

Referenced by generateXML().

{
// + members
// + member groups
// + files
// + classes
// + namespaces
// - packages
// + pages
// + child groups
// - examples
// + brief description
// + detailed description
if (gd->isReference()) return; // skip external references
ti << " <compound refid=\"" << gd->getOutputFileBase()
<< "\" kind=\"group\"><name>" << convertToXML(gd->name()) << "</name>" << endl;
QCString outputDirectory = Config_getString(XML_OUTPUT);
QCString fileName=outputDirectory+"/"+gd->getOutputFileBase()+".xml";
QFile f(fileName);
if (!f.open(IO_WriteOnly))
{
err("Cannot open file %s for writing!\n",fileName.data());
return;
}
FTextStream t(&f);
//t.setEncoding(FTextStream::UnicodeUTF8);
t << " <compounddef id=\""
<< gd->getOutputFileBase() << "\" kind=\"group\">" << endl;
t << " <compoundname>" << convertToXML(gd->name()) << "</compoundname>" << endl;
t << " <title>" << convertToXML(gd->groupTitle()) << "</title>" << endl;
{
for (;(mg=mgli.current());++mgli)
{
generateXMLSection(gd,ti,t,mg->members(),"user-defined",mg->header(),
mg->documentation());
}
}
QListIterator<MemberList> mli(gd->getMemberLists());
for (mli.toFirst();(ml=mli.current());++mli)
{
if ((ml->listType()&MemberListType_declarationLists)!=0)
{
generateXMLSection(gd,ti,t,ml,g_xmlSectionMapper.find(ml->listType()));
}
}
t << " <briefdescription>" << endl;
t << " </briefdescription>" << endl;
t << " <detaileddescription>" << endl;
writeXMLDocBlock(t,gd->docFile(),gd->docLine(),gd,0,gd->documentation());
t << " </detaileddescription>" << endl;
t << " </compounddef>" << endl;
t << "</doxygen>" << endl;
ti << " </compound>" << endl;
}
static void generateXMLForMember ( MemberDef md,
FTextStream ti,
FTextStream t,
Definition def 
)
static

Definition at line 526 of file xmlgen.cpp.

References FileDef::absFilePath(), MemberDef::anchor(), MemberDef::argsString(), MemberDef::argumentList(), Argument::array, Argument::attrib, MemberDef::bitfieldString(), MemberDef::briefDescription(), Definition::briefFile(), Definition::briefLine(), ArgumentList::constSpecifier, convertToXML(), MemberDef::declArgumentList(), MemberDef::definition(), DefinitionIntf::definitionType(), Argument::defval, Definition::docFile(), Definition::docLine(), Argument::docs, MemberDef::documentation(), endl(), MemberDef::enumFieldList(), MemberDef::excpString(), Definition::getBodyDef(), MemberDef::getClassDef(), Definition::getDefColumn(), Definition::getDefFileName(), Definition::getDefLine(), Definition::getEndBodyLine(), MemberDef::getGroupDef(), MemberDef::getNamespaceDef(), Definition::getOuterScope(), GroupDef::getOutputFileBase(), MemberDef::getReadAccessor(), Definition::getReferencedByMembers(), Definition::getReferencesMembers(), Definition::getStartBodyLine(), MemberDef::getWriteAccessor(), Argument::hasDocumentation(), MemberDef::hasMultiLineInitializer(), MemberDef::hasOneLineInitializer(), Definition::inbodyDocumentation(), Definition::inbodyLine(), MemberDef::initializer(), MemberDef::isAddable(), MemberDef::isAssign(), MemberDef::isAttribute(), MemberDef::isBound(), MemberDef::isConstrained(), MemberDef::isCopy(), MemberDef::isExplicit(), MemberDef::isFinal(), MemberDef::isGettable(), Definition::isHidden(), MemberDef::isInitonly(), MemberDef::isInline(), MemberDef::isMaybeAmbiguous(), MemberDef::isMaybeDefault(), MemberDef::isMaybeVoid(), MemberDef::isMutable(), MemberDef::isNew(), MemberDef::isOptional(), MemberDef::isPrivateGettable(), MemberDef::isPrivateSettable(), MemberDef::isProtectedGettable(), MemberDef::isProtectedSettable(), MemberDef::isRaisable(), MemberDef::isReadable(), MemberDef::isReadonly(), MemberDef::isRemovable(), MemberDef::isRequired(), MemberDef::isRetain(), MemberDef::isSealed(), MemberDef::isSettable(), MemberDef::isStatic(), MemberDef::isStrong(), MemberDef::isTransient(), MemberDef::isUNOProperty(), MemberDef::isWeak(), MemberDef::isWritable(), SDict< MemberDef >::Iterator, linkifyText(), memberOutputFileBase(), MemberDef::memberType(), MemberType_DCOP, MemberType_Define, MemberType_Enumeration, MemberType_EnumValue, MemberType_Event, MemberType_Friend, MemberType_Function, MemberType_Interface, MemberType_Property, MemberType_Service, MemberType_Signal, MemberType_Slot, MemberType_Typedef, MemberType_Variable, Argument::name, Definition::name(), Normal, Package, Private, Protected, MemberDef::protection(), Public, Pure, MemberDef::reimplementedBy(), MemberDef::reimplements(), stripFromPath(), stripQualifiers(), Argument::type, DefinitionIntf::TypeGroup, MemberDef::typeString(), Virtual, MemberDef::virtualness(), ArgumentList::volatileSpecifier, writeMemberReference(), writeMemberTemplateLists(), writeXMLDocBlock(), and writeXMLString().

Referenced by generateXMLSection().

{
// + declaration/definition arg lists
// + reimplements
// + reimplementedBy
// + exceptions
// + const/volatile specifiers
// - examples
// + source definition
// + source references
// + source referenced by
// - body code
// + template arguments
// (templateArguments(), definitionTemplateParameterLists())
// - call graph
// enum values are written as part of the enum
if (md->memberType()==MemberType_EnumValue) return;
if (md->isHidden()) return;
//if (md->name().at(0)=='@') return; // anonymous member
// group members are only visible in their group
//if (def->definitionType()!=Definition::TypeGroup && md->getGroupDef()) return;
QCString memType;
bool isFunc=FALSE;
switch (md->memberType())
{
case MemberType_Define: memType="define"; break;
case MemberType_Function: memType="function"; isFunc=TRUE; break;
case MemberType_Variable: memType="variable"; break;
case MemberType_Typedef: memType="typedef"; break;
case MemberType_Enumeration: memType="enum"; break;
case MemberType_EnumValue: ASSERT(0); break;
case MemberType_Signal: memType="signal"; isFunc=TRUE; break;
case MemberType_Slot: memType="slot"; isFunc=TRUE; break;
case MemberType_Friend: memType="friend"; isFunc=TRUE; break;
case MemberType_DCOP: memType="dcop"; isFunc=TRUE; break;
case MemberType_Property: memType="property"; break;
case MemberType_Event: memType="event"; break;
case MemberType_Interface: memType="interface"; break;
case MemberType_Service: memType="service"; break;
}
ti << " <member refid=\"" << memberOutputFileBase(md)
<< "_1" << md->anchor() << "\" kind=\"" << memType << "\"><name>"
<< convertToXML(md->name()) << "</name></member>" << endl;
QCString scopeName;
if (md->getClassDef())
scopeName=md->getClassDef()->name();
else if (md->getNamespaceDef())
scopeName=md->getNamespaceDef()->name();
t << " <memberdef kind=\"";
//enum { define_t,variable_t,typedef_t,enum_t,function_t } xmlType = function_t;
t << memType << "\" id=\"";
{
}
else
{
}
t << "_1" // encoded `:' character (see util.cpp:convertNameToFile)
<< md->anchor();
t << "\" prot=\"";
switch(md->protection())
{
case Public: t << "public"; break;
case Protected: t << "protected"; break;
case Private: t << "private"; break;
case Package: t << "package"; break;
}
t << "\"";
t << " static=\"";
if (md->isStatic()) t << "yes"; else t << "no";
t << "\"";
if (isFunc)
{
t << " const=\"";
if (al!=0 && al->constSpecifier) t << "yes"; else t << "no";
t << "\"";
t << " explicit=\"";
if (md->isExplicit()) t << "yes"; else t << "no";
t << "\"";
t << " inline=\"";
if (md->isInline()) t << "yes"; else t << "no";
t << "\"";
if (md->isFinal())
{
t << " final=\"yes\"";
}
if (md->isSealed())
{
t << " sealed=\"yes\"";
}
if (md->isNew())
{
t << " new=\"yes\"";
}
if (md->isOptional())
{
t << " optional=\"yes\"";
}
if (md->isRequired())
{
t << " required=\"yes\"";
}
if (al && al->volatileSpecifier)
{
t << " volatile=\"yes\"";
}
t << " virt=\"";
switch (md->virtualness())
{
case Normal: t << "non-virtual"; break;
case Virtual: t << "virtual"; break;
case Pure: t << "pure-virtual"; break;
default: ASSERT(0);
}
t << "\"";
}
{
//ArgumentList *al = md->argumentList();
//t << " volatile=\"";
//if (al && al->volatileSpecifier) t << "yes"; else t << "no";
t << " mutable=\"";
if (md->isMutable()) t << "yes"; else t << "no";
t << "\"";
if (md->isInitonly())
{
t << " initonly=\"yes\"";
}
if (md->isAttribute())
{
t << " attribute=\"yes\"";
}
if (md->isUNOProperty())
{
t << " property=\"yes\"";
}
if (md->isReadonly())
{
t << " readonly=\"yes\"";
}
if (md->isBound())
{
t << " bound=\"yes\"";
}
if (md->isRemovable())
{
t << " removable=\"yes\"";
}
if (md->isConstrained())
{
t << " constrained=\"yes\"";
}
if (md->isTransient())
{
t << " transient=\"yes\"";
}
if (md->isMaybeVoid())
{
t << " maybevoid=\"yes\"";
}
if (md->isMaybeDefault())
{
t << " maybedefault=\"yes\"";
}
if (md->isMaybeAmbiguous())
{
t << " maybeambiguous=\"yes\"";
}
}
else if (md->memberType() == MemberType_Property)
{
t << " readable=\"";
if (md->isReadable()) t << "yes"; else t << "no";
t << "\"";
t << " writable=\"";
if (md->isWritable()) t << "yes"; else t << "no";
t << "\"";
t << " gettable=\"";
if (md->isGettable()) t << "yes"; else t << "no";
t << "\"";
t << " privategettable=\"";
if (md->isPrivateGettable()) t << "yes"; else t << "no";
t << "\"";
t << " protectedgettable=\"";
if (md->isProtectedGettable()) t << "yes"; else t << "no";
t << "\"";
t << " settable=\"";
if (md->isSettable()) t << "yes"; else t << "no";
t << "\"";
t << " privatesettable=\"";
if (md->isPrivateSettable()) t << "yes"; else t << "no";
t << "\"";
t << " protectedsettable=\"";
if (md->isProtectedSettable()) t << "yes"; else t << "no";
t << "\"";
if (md->isAssign() || md->isCopy() || md->isRetain() || md->isStrong() || md->isWeak())
{
t << " accessor=\"";
if (md->isAssign()) t << "assign";
else if (md->isCopy()) t << "copy";
else if (md->isRetain()) t << "retain";
else if (md->isStrong()) t << "strong";
else if (md->isWeak()) t << "weak";
t << "\"";
}
}
else if (md->memberType() == MemberType_Event)
{
t << " add=\"";
if (md->isAddable()) t << "yes"; else t << "no";
t << "\"";
t << " remove=\"";
if (md->isRemovable()) t << "yes"; else t << "no";
t << "\"";
t << " raise=\"";
if (md->isRaisable()) t << "yes"; else t << "no";
t << "\"";
}
t << ">" << endl;
)
{
{
}
QCString typeStr = md->typeString(); //replaceAnonymousScopes(md->typeString());
stripQualifiers(typeStr);
t << " <type>";
linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,typeStr);
t << "</type>" << endl;
t << " <definition>" << convertToXML(md->definition()) << "</definition>" << endl;
t << " <argsstring>" << convertToXML(md->argsString()) << "</argsstring>" << endl;
}
t << " <name>" << convertToXML(md->name()) << "</name>" << endl;
{
if (md->isReadable())
t << " <read>" << convertToXML(md->getReadAccessor()) << "</read>" << endl;
if (md->isWritable())
t << " <write>" << convertToXML(md->getWriteAccessor()) << "</write>" << endl;
}
{
QCString bitfield = md->bitfieldString();
if (bitfield.at(0)==':') bitfield=bitfield.mid(1);
t << " <bitfield>" << convertToXML(bitfield) << "</bitfield>" << endl;
}
MemberDef *rmd = md->reimplements();
if (rmd)
{
t << " <reimplements refid=\""
<< memberOutputFileBase(rmd) << "_1" << rmd->anchor() << "\">"
<< convertToXML(rmd->name()) << "</reimplements>" << endl;
}
MemberList *rbml = md->reimplementedBy();
if (rbml)
{
MemberListIterator mli(*rbml);
for (mli.toFirst();(rmd=mli.current());++mli)
{
t << " <reimplementedby refid=\""
<< memberOutputFileBase(rmd) << "_1" << rmd->anchor() << "\">"
<< convertToXML(rmd->name()) << "</reimplementedby>" << endl;
}
}
if (isFunc) //function
{
ArgumentList *declAl = md->declArgumentList();
ArgumentList *defAl = md->argumentList();
if (declAl && declAl->count()>0)
{
ArgumentListIterator declAli(*declAl);
ArgumentListIterator defAli(*defAl);
for (declAli.toFirst();(a=declAli.current());++declAli)
{
Argument *defArg = defAli.current();
t << " <param>" << endl;
if (!a->attrib.isEmpty())
{
t << " <attributes>";
t << "</attributes>" << endl;
}
if (!a->type.isEmpty())
{
t << " <type>";
t << "</type>" << endl;
}
if (!a->name.isEmpty())
{
t << " <declname>";
t << "</declname>" << endl;
}
if (defArg && !defArg->name.isEmpty() && defArg->name!=a->name)
{
t << " <defname>";
writeXMLString(t,defArg->name);
t << "</defname>" << endl;
}
if (!a->array.isEmpty())
{
t << " <array>";
t << "</array>" << endl;
}
if (!a->defval.isEmpty())
{
t << " <defval>";
t << "</defval>" << endl;
}
if (defArg && defArg->hasDocumentation())
{
t << " <briefdescription>";
md->getOuterScope(),md,defArg->docs);
t << "</briefdescription>" << endl;
}
t << " </param>" << endl;
if (defArg) ++defAli;
}
}
}
else if (md->memberType()==MemberType_Define &&
md->argsString()) // define
{
if (md->argumentList()->count()==0) // special case for "foo()" to
// disguish it from "foo".
{
t << " <param></param>" << endl;
}
else
{
for (ali.toFirst();(a=ali.current());++ali)
{
t << " <param><defname>" << a->type << "</defname></param>" << endl;
}
}
}
{
t << " <initializer>";
t << "</initializer>" << endl;
}
if (md->excpString())
{
t << " <exceptions>";
t << "</exceptions>" << endl;
}
if (md->memberType()==MemberType_Enumeration) // enum
{
MemberList *enumFields = md->enumFieldList();
if (enumFields)
{
MemberListIterator emli(*enumFields);
MemberDef *emd;
for (emli.toFirst();(emd=emli.current());++emli)
{
ti << " <member refid=\"" << memberOutputFileBase(emd)
<< "_1" << emd->anchor() << "\" kind=\"enumvalue\"><name>"
<< convertToXML(emd->name()) << "</name></member>" << endl;
t << " <enumvalue id=\"" << memberOutputFileBase(emd) << "_1"
<< emd->anchor() << "\" prot=\"";
switch (emd->protection())
{
case Public: t << "public"; break;
case Protected: t << "protected"; break;
case Private: t << "private"; break;
case Package: t << "package"; break;
}
t << "\">" << endl;
t << " <name>";
writeXMLString(t,emd->name());
t << "</name>" << endl;
if (!emd->initializer().isEmpty())
{
t << " <initializer>";
t << "</initializer>" << endl;
}
t << " <briefdescription>" << endl;
t << " </briefdescription>" << endl;
t << " <detaileddescription>" << endl;
writeXMLDocBlock(t,emd->docFile(),emd->docLine(),emd->getOuterScope(),emd,emd->documentation());
t << " </detaileddescription>" << endl;
t << " </enumvalue>" << endl;
}
}
}
t << " <briefdescription>" << endl;
t << " </briefdescription>" << endl;
t << " <detaileddescription>" << endl;
t << " </detaileddescription>" << endl;
t << " <inbodydescription>" << endl;
t << " </inbodydescription>" << endl;
if (md->getDefLine()!=-1)
{
t << " <location file=\""
<< stripFromPath(md->getDefFileName()) << "\" line=\""
<< md->getDefLine() << "\"" << " column=\""
<< md->getDefColumn() << "\"" ;
if (md->getStartBodyLine()!=-1)
{
FileDef *bodyDef = md->getBodyDef();
if (bodyDef)
{
t << " bodyfile=\"" << stripFromPath(bodyDef->absFilePath()) << "\"";
}
t << " bodystart=\"" << md->getStartBodyLine() << "\" bodyend=\""
<< md->getEndBodyLine() << "\"";
}
t << "/>" << endl;
}
//printf("md->getReferencesMembers()=%p\n",md->getReferencesMembers());
if (mdict)
{
MemberSDict::Iterator mdi(*mdict);
MemberDef *rmd;
for (mdi.toFirst();(rmd=mdi.current());++mdi)
{
writeMemberReference(t,def,rmd,"references");
}
}
mdict = md->getReferencedByMembers();
if (mdict)
{
MemberSDict::Iterator mdi(*mdict);
MemberDef *rmd;
for (mdi.toFirst();(rmd=mdi.current());++mdi)
{
writeMemberReference(t,def,rmd,"referencedby");
}
}
t << " </memberdef>" << endl;
}
static void generateXMLForNamespace ( NamespaceDef nd,
FTextStream ti 
)
static

Definition at line 1429 of file xmlgen.cpp.

References Definition::briefDescription(), Definition::briefFile(), Definition::briefLine(), Config_getString, convertToXML(), Definition::docFile(), Definition::docLine(), Definition::documentation(), endl(), err(), generateXMLSection(), NamespaceDef::getClassSDict(), Definition::getDefColumn(), Definition::getDefFileName(), Definition::getDefLine(), Definition::getLanguage(), NamespaceDef::getMemberGroupSDict(), NamespaceDef::getMemberLists(), NamespaceDef::getNamespaceSDict(), NamespaceDef::getOutputFileBase(), Definition::isHidden(), Definition::isReference(), SIntDict< MemberGroup >::Iterator, langToString(), MemberListType_declarationLists, Definition::name(), stripFromPath(), writeInnerClasses(), writeInnerNamespaces(), writeXMLDocBlock(), writeXMLHeader(), and writeXMLString().

Referenced by generateXML().

{
// + contained class definitions
// + contained namespace definitions
// + member groups
// + normal members
// + brief desc
// + detailed desc
// + location
// - files containing (parts of) the namespace definition
if (nd->isReference() || nd->isHidden()) return; // skip external references
ti << " <compound refid=\"" << nd->getOutputFileBase()
<< "\" kind=\"namespace\"" << "><name>"
<< convertToXML(nd->name()) << "</name>" << endl;
QCString outputDirectory = Config_getString(XML_OUTPUT);
QCString fileName=outputDirectory+"/"+nd->getOutputFileBase()+".xml";
QFile f(fileName);
if (!f.open(IO_WriteOnly))
{
err("Cannot open file %s for writing!\n",fileName.data());
return;
}
FTextStream t(&f);
//t.setEncoding(FTextStream::UnicodeUTF8);
t << " <compounddef id=\"" << nd->getOutputFileBase()
<< "\" kind=\"namespace\" language=\""
<< langToString(nd->getLanguage()) << "\">" << endl;
t << " <compoundname>";
writeXMLString(t,nd->name());
t << "</compoundname>" << endl;
{
for (;(mg=mgli.current());++mgli)
{
generateXMLSection(nd,ti,t,mg->members(),"user-defined",mg->header(),
mg->documentation());
}
}
QListIterator<MemberList> mli(nd->getMemberLists());
for (mli.toFirst();(ml=mli.current());++mli)
{
if ((ml->listType()&MemberListType_declarationLists)!=0)
{
generateXMLSection(nd,ti,t,ml,g_xmlSectionMapper.find(ml->listType()));
}
}
t << " <briefdescription>" << endl;
t << " </briefdescription>" << endl;
t << " <detaileddescription>" << endl;
writeXMLDocBlock(t,nd->docFile(),nd->docLine(),nd,0,nd->documentation());
t << " </detaileddescription>" << endl;
t << " <location file=\""
<< stripFromPath(nd->getDefFileName()) << "\" line=\""
<< nd->getDefLine() << "\"" << " column=\""
<< nd->getDefColumn() << "\"/>" << endl ;
t << " </compounddef>" << endl;
t << "</doxygen>" << endl;
ti << " </compound>" << endl;
}
static void generateXMLForPage ( PageDef pd,
FTextStream ti,
bool  isExample 
)
static

Definition at line 1759 of file xmlgen.cpp.

References Config_getString, convertCharEntitiesToUTF8(), convertToXML(), Definition::docFile(), Definition::docLine(), Definition::documentation(), endl(), err(), filterTitle(), SDict< T >::find(), PageDef::getGroupDef(), PageDef::getOutputFileBase(), PageDef::getSubPages(), Definition::isReference(), Doxygen::mainPage, Definition::name(), Doxygen::sectionDict, PageDef::title(), SectionInfo::title, writeInnerPages(), writeXMLDocBlock(), and writeXMLHeader().

Referenced by generateXML().

{
// + name
// + title
// + documentation
const char *kindName = isExample ? "example" : "page";
if (pd->isReference()) return;
QCString pageName = pd->getOutputFileBase();
if (pd->getGroupDef())
{
pageName+=(QCString)"_"+pd->name();
}
if (pageName=="index") pageName="indexpage"; // to prevent overwriting the generated index page.
ti << " <compound refid=\"" << pageName
<< "\" kind=\"" << kindName << "\"><name>" << convertToXML(pd->name())
<< "</name>" << endl;
QCString outputDirectory = Config_getString(XML_OUTPUT);
QCString fileName=outputDirectory+"/"+pageName+".xml";
QFile f(fileName);
if (!f.open(IO_WriteOnly))
{
err("Cannot open file %s for writing!\n",fileName.data());
return;
}
FTextStream t(&f);
//t.setEncoding(FTextStream::UnicodeUTF8);
t << " <compounddef id=\"" << pageName;
t << "\" kind=\"" << kindName << "\">" << endl;
t << " <compoundname>" << convertToXML(pd->name())
<< "</compoundname>" << endl;
if (pd==Doxygen::mainPage) // main page is special
{
QCString title;
if (!pd->title().isEmpty() && pd->title().lower()!="notitle")
{
}
else
{
title = Config_getString(PROJECT_NAME);
}
t << " <title>" << convertToXML(convertCharEntitiesToUTF8(title))
<< "</title>" << endl;
}
else
{
if (si)
{
<< "</title>" << endl;
}
}
t << " <detaileddescription>" << endl;
if (isExample)
{
writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,0,
pd->documentation()+"\n\\include "+pd->name());
}
else
{
writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,0,
pd->documentation());
}
t << " </detaileddescription>" << endl;
t << " </compounddef>" << endl;
t << "</doxygen>" << endl;
ti << " </compound>" << endl;
}
static void generateXMLSection ( Definition d,
FTextStream ti,
FTextStream t,
MemberList ml,
const char *  kind,
const char *  header = 0,
const char *  documentation = 0 
)
static

Definition at line 1023 of file xmlgen.cpp.

References convertToXML(), DefinitionIntf::definitionType(), Definition::docFile(), Definition::docLine(), endl(), generateXMLForMember(), MemberDef::getNamespaceDef(), DefinitionIntf::TypeFile, and writeXMLDocBlock().

Referenced by generateXMLForClass(), generateXMLForFile(), generateXMLForGroup(), and generateXMLForNamespace().

{
if (ml==0) return;
MemberDef *md;
int count=0;
for (mli.toFirst();(md=mli.current());++mli)
{
// namespace members are also inserted in the file scope, but
// to prevent this duplication in the XML output, we filter those here.
{
count++;
}
}
if (count==0) return; // empty list
t << " <sectiondef kind=\"" << kind << "\">" << endl;
if (header)
{
t << " <header>" << convertToXML(header) << "</header>" << endl;
}
if (documentation)
{
t << " <description>";
writeXMLDocBlock(t,d->docFile(),d->docLine(),d,0,documentation);
t << "</description>" << endl;
}
for (mli.toFirst();(md=mli.current());++mli)
{
// namespace members are also inserted in the file scope, but
// to prevent this duplication in the XML output, we filter those here.
{
}
}
t << " </sectiondef>" << endl;
}
static QCString memberOutputFileBase ( MemberDef md)
static

Definition at line 515 of file xmlgen.cpp.

References MemberDef::getOutputFileBase().

Referenced by generateXMLForMember(), and writeListOfAllMembers().

{
//static bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES);
//if (inlineGroupedClasses && md->getClassDef() && md->getClassDef()->partOfGroups()!=0)
// return md->getClassDef()->getXmlOutputFileBase();
//else
// return md->getOutputFileBase();
return md->getOutputFileBase();
}
static void stripQualifiers ( QCString &  typeStr)
static

Definition at line 493 of file xmlgen.cpp.

Referenced by generateXMLForMember().

{
bool done=FALSE;
while (!done)
{
if (typeStr.stripPrefix("static "));
else if (typeStr.stripPrefix("virtual "));
else if (typeStr.stripPrefix("volatile "));
else if (typeStr=="virtual") typeStr="";
else done=TRUE;
}
}
static void writeCombineScript ( )
static

Definition at line 154 of file xmlgen.cpp.

References Config_getString, and err().

Referenced by generateXML().

{
QCString outputDirectory = Config_getString(XML_OUTPUT);
QCString fileName=outputDirectory+"/combine.xslt";
QFile f(fileName);
if (!f.open(IO_WriteOnly))
{
err("Cannot open file %s for writing!\n",fileName.data());
return;
}
FTextStream t(&f);
//t.setEncoding(FTextStream::UnicodeUTF8);
t <<
"<!-- XSLT script to combine the generated output into a single file. \n"
" If you have xsltproc you could use:\n"
" xsltproc combine.xslt index.xml >all.xml\n"
"-->\n"
"<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">\n"
" <xsl:output method=\"xml\" version=\"1.0\" indent=\"no\" standalone=\"yes\" />\n"
" <xsl:template match=\"/\">\n"
" <doxygen version=\"{doxygenindex/@version}\">\n"
" <!-- Load all doxgen generated xml files -->\n"
" <xsl:for-each select=\"doxygenindex/compound\">\n"
" <xsl:copy-of select=\"document( concat( @refid, '.xml' ) )/doxygen/*\" />\n"
" </xsl:for-each>\n"
" </doxygen>\n"
" </xsl:template>\n"
"</xsl:stylesheet>\n";
}
static void writeInnerClasses ( const ClassSDict cl,
FTextStream t 
)
static

Definition at line 1113 of file xmlgen.cpp.

References classOutputFileBase(), convertToXML(), endl(), Definition::isHidden(), SDict< ClassDef >::Iterator, Definition::name(), Package, Private, Protected, ClassDef::protection(), and Public.

Referenced by generateXMLForClass(), generateXMLForFile(), generateXMLForGroup(), and generateXMLForNamespace().

{
if (cl)
{
ClassDef *cd;
for (cli.toFirst();(cd=cli.current());++cli)
{
if (!cd->isHidden() && cd->name().find('@')==-1) // skip anonymous scopes
{
t << " <innerclass refid=\"" << classOutputFileBase(cd)
<< "\" prot=\"";
switch(cd->protection())
{
case Public: t << "public"; break;
case Protected: t << "protected"; break;
case Private: t << "private"; break;
case Package: t << "package"; break;
}
t << "\">" << convertToXML(cd->name()) << "</innerclass>" << endl;
}
}
}
}
static void writeInnerDirs ( const DirList dl,
FTextStream t 
)
static

Definition at line 1202 of file xmlgen.cpp.

References convertToXML(), DirDef::displayName(), endl(), and DirDef::getOutputFileBase().

Referenced by generateXMLForDir().

{
if (dl)
{
QListIterator<DirDef> subdirs(*dl);
DirDef *subdir;
for (subdirs.toFirst();(subdir=subdirs.current());++subdirs)
{
t << " <innerdir refid=\"" << subdir->getOutputFileBase()
<< "\">" << convertToXML(subdir->displayName()) << "</innerdir>" << endl;
}
}
}
static void writeInnerFiles ( const FileList fl,
FTextStream t 
)
static

Definition at line 1155 of file xmlgen.cpp.

References convertToXML(), endl(), FileDef::getOutputFileBase(), and FileDef::name().

Referenced by generateXMLForDir(), and generateXMLForGroup().

{
if (fl)
{
QListIterator<FileDef> fli(*fl);
FileDef *fd;
for (fli.toFirst();(fd=fli.current());++fli)
{
t << " <innerfile refid=\"" << fd->getOutputFileBase()
<< "\">" << convertToXML(fd->name()) << "</innerfile>" << endl;
}
}
}
static void writeInnerGroups ( const GroupList gl,
FTextStream t 
)
static

Definition at line 1187 of file xmlgen.cpp.

References convertToXML(), endl(), GroupDef::getOutputFileBase(), and GroupDef::groupTitle().

Referenced by generateXMLForGroup().

{
if (gl)
{
GroupDef *sgd;
for (gli.toFirst();(sgd=gli.current());++gli)
{
t << " <innergroup refid=\"" << sgd->getOutputFileBase()
<< "\">" << convertToXML(sgd->groupTitle())
<< "</innergroup>" << endl;
}
}
}
static void writeInnerNamespaces ( const NamespaceSDict nl,
FTextStream t 
)
static

Definition at line 1138 of file xmlgen.cpp.

References convertToXML(), endl(), NamespaceDef::getOutputFileBase(), Definition::isHidden(), SDict< NamespaceDef >::Iterator, and Definition::name().

Referenced by generateXMLForFile(), generateXMLForGroup(), and generateXMLForNamespace().

{
if (nl)
{
for (nli.toFirst();(nd=nli.current());++nli)
{
if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymouse scopes
{
t << " <innernamespace refid=\"" << nd->getOutputFileBase()
<< "\">" << convertToXML(nd->name()) << "</innernamespace>" << endl;
}
}
}
}
static void writeInnerPages ( const PageSDict pl,
FTextStream t 
)
static

Definition at line 1169 of file xmlgen.cpp.

References convertToXML(), endl(), PageDef::getGroupDef(), PageDef::getOutputFileBase(), SDict< PageDef >::Iterator, Definition::name(), and PageDef::title().

Referenced by generateXMLForGroup(), and generateXMLForPage().

{
if (pl)
{
PageDef *pd;
for (pli.toFirst();(pd=pli.current());++pli)
{
t << " <innerpage refid=\"" << pd->getOutputFileBase();
if (pd->getGroupDef())
{
t << "_" << pd->name();
}
t << "\">" << convertToXML(pd->title()) << "</innerpage>" << endl;
}
}
}
static void writeListOfAllMembers ( ClassDef cd,
FTextStream t 
)
static

Definition at line 1065 of file xmlgen.cpp.

References MemberInfo::ambiguityResolutionScope, MemberDef::anchor(), convertToXML(), endl(), SDict< MemberNameInfo >::Iterator, MemberInfo::memberDef, ClassDef::memberNameInfoSDict(), memberOutputFileBase(), Definition::name(), Normal, Package, Private, MemberInfo::prot, Protected, Public, Pure, Virtual, and MemberDef::virtualness().

Referenced by generateXMLForClass().

{
t << " <listofallmembers>" << endl;
{
for (mnii.toFirst();(mni=mnii.current());++mnii)
{
for (mii.toFirst();(mi=mii.current());++mii)
{
if (md->name().at(0)!='@') // skip anonymous members
{
Protection prot = mi->prot;
Specifier virt=md->virtualness();
t << " <member refid=\"" << memberOutputFileBase(md) << "_1" <<
md->anchor() << "\" prot=\"";
switch (prot)
{
case Public: t << "public"; break;
case Protected: t << "protected"; break;
case Private: t << "private"; break;
case Package: t << "package"; break;
}
t << "\" virt=\"";
switch(virt)
{
case Normal: t << "non-virtual"; break;
case Virtual: t << "virtual"; break;
case Pure: t << "pure-virtual"; break;
}
t << "\"";
if (!mi->ambiguityResolutionScope.isEmpty())
{
t << " ambiguityscope=\"" << convertToXML(mi->ambiguityResolutionScope) << "\"";
}
t << "><scope>" << convertToXML(cd->name()) << "</scope><name>" <<
convertToXML(md->name()) << "</name></member>" << endl;
}
}
}
}
t << " </listofallmembers>" << endl;
}
static void writeMemberReference ( FTextStream t,
Definition def,
MemberDef rmd,
const char *  tagName 
)
static

Definition at line 470 of file xmlgen.cpp.

References MemberDef::anchor(), convertToXML(), endl(), Definition::getBodyDef(), Definition::getEndBodyLine(), Definition::getLanguage(), getLanguageSpecificSeparator(), MemberDef::getOutputFileBase(), FileDef::getOutputFileBase(), MemberDef::getScopeString(), Definition::getStartBodyLine(), and Definition::name().

Referenced by generateXMLForMember().

{
QCString scope = rmd->getScopeString();
QCString name = rmd->name();
if (!scope.isEmpty() && scope!=def->name())
{
name.prepend(scope+getLanguageSpecificSeparator(rmd->getLanguage()));
}
t << " <" << tagName << " refid=\"";
t << rmd->getOutputFileBase() << "_1" << rmd->anchor() << "\"";
if (rmd->getStartBodyLine()!=-1 && rmd->getBodyDef())
{
t << " compoundref=\"" << rmd->getBodyDef()->getOutputFileBase() << "\"";
t << " startline=\"" << rmd->getStartBodyLine() << "\"";
if (rmd->getEndBodyLine()!=-1)
{
t << " endline=\"" << rmd->getEndBodyLine() << "\"";
}
}
t << ">" << convertToXML(name) << "</" << tagName << ">" << endl;
}
static void writeMemberTemplateLists ( MemberDef md,
FTextStream t 
)
static

Definition at line 409 of file xmlgen.cpp.

References MemberDef::getClassDef(), MemberDef::getFileDef(), MemberDef::templateArguments(), and writeTemplateArgumentList().

Referenced by generateXMLForMember().

{
ArgumentList *templMd = md->templateArguments();
if (templMd) // function template prefix
{
}
}
static void writeTemplateArgumentList ( ArgumentList al,
FTextStream t,
Definition scope,
FileDef fileScope,
int  indent 
)
static

Definition at line 364 of file xmlgen.cpp.

References Argument::defval, endl(), linkifyText(), Argument::name, Argument::type, and Argument::typeConstraint.

Referenced by writeMemberTemplateLists(), and writeTemplateList().

{
QCString indentStr;
indentStr.fill(' ',indent);
if (al)
{
t << indentStr << "<templateparamlist>" << endl;
for (ali.toFirst();(a=ali.current());++ali)
{
t << indentStr << " <param>" << endl;
if (!a->type.isEmpty())
{
t << indentStr << " <type>";
linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a->type);
t << "</type>" << endl;
}
if (!a->name.isEmpty())
{
t << indentStr << " <declname>" << a->name << "</declname>" << endl;
t << indentStr << " <defname>" << a->name << "</defname>" << endl;
}
if (!a->defval.isEmpty())
{
t << indentStr << " <defval>";
linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a->defval);
t << "</defval>" << endl;
}
if (!a->typeConstraint.isEmpty())
{
t << indentStr << " <typeconstraint>";
t << "</typeconstraint>" << endl;
}
t << indentStr << " </param>" << endl;
}
t << indentStr << "</templateparamlist>" << endl;
}
}
static void writeTemplateList ( ClassDef cd,
FTextStream t 
)
static

Definition at line 418 of file xmlgen.cpp.

References ClassDef::templateArguments(), and writeTemplateArgumentList().

Referenced by generateXMLForClass().

void writeXMLCodeBlock ( FTextStream t,
FileDef fd 
)

Definition at line 447 of file xmlgen.cpp.

References FileDef::absFilePath(), Config_getBool, fileToString(), XMLCodeGenerator::finish(), Definition::getDefFileExtension(), getLanguageFromFileName(), ParserManager::getParser(), ParserInterface::parseCode(), Doxygen::parserManager, and ParserInterface::resetCodeParserState().

Referenced by generateXMLForFile().

{
pIntf->parseCode(*xmlGen, // codeOutIntf
0, // scopeName
fileToString(fd->absFilePath(),Config_getBool(FILTER_SOURCE_FILES)),
langExt, // lang
FALSE, // isExampleBlock
0, // exampleName
fd, // fileDef
-1, // startLine
-1, // endLine
FALSE, // inlineFragement
0, // memberDef
TRUE // showLineNumbers
);
xmlGen->finish();
delete xmlGen;
}
void writeXMLCodeString ( FTextStream t,
const char *  s,
int &  col 
)
inline

Definition at line 114 of file xmlgen.cpp.

References Config_getInt, and writeUtf8Char().

Referenced by XMLCodeGenerator::codify().

{
char c;
while ((c=*s++))
{
switch(c)
{
case '\t':
{
static int tabSize = Config_getInt(TAB_SIZE);
int spacesToNextTabStop = tabSize - (col%tabSize);
col+=spacesToNextTabStop;
while (spacesToNextTabStop--) t << "<sp/>";
break;
}
case ' ': t << "<sp/>"; col++; break;
case '<': t << "&lt;"; col++; break;
case '>': t << "&gt;"; col++; break;
case '&': t << "&amp;"; col++; break;
case '\'': t << "&apos;"; col++; break;
case '"': t << "&quot;"; col++; break;
case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18:
case 19: case 20: case 21: case 22: case 23: case 24: case 25: case 26:
case 27: case 28: case 29: case 30: case 31:
break; // skip invalid XML characters (see http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char)
default: s=writeUtf8Char(t,s-1); col++; break;
}
}
}
static void writeXMLDocBlock ( FTextStream t,
const QCString &  fileName,
int  lineNr,
Definition scope,
MemberDef md,
const QCString &  text 
)
static

Definition at line 423 of file xmlgen.cpp.

References DocNode::accept(), and validatingParseDoc().

Referenced by generateXMLForClass(), generateXMLForDir(), generateXMLForFile(), generateXMLForGroup(), generateXMLForMember(), generateXMLForNamespace(), generateXMLForPage(), and generateXMLSection().

{
QCString stext = text.stripWhiteSpace();
if (stext.isEmpty()) return;
// convert the documentation string into an abstract syntax tree
DocNode *root = validatingParseDoc(fileName,lineNr,scope,md,text,FALSE,FALSE);
// create a code generator
XMLCodeGenerator *xmlCodeGen = new XMLCodeGenerator(t);
// create a parse tree visitor for XML
XmlDocVisitor *visitor = new XmlDocVisitor(t,*xmlCodeGen);
// visit all nodes
root->accept(visitor);
// clean up
delete visitor;
delete xmlCodeGen;
delete root;
}
static void writeXMLHeader ( FTextStream t)
static

Definition at line 146 of file xmlgen.cpp.

References endl(), and versionString.

Referenced by generateXMLForClass(), generateXMLForDir(), generateXMLForFile(), generateXMLForGroup(), generateXMLForNamespace(), and generateXMLForPage().

{
t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << endl;;
t << "<doxygen xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
t << "xsi:noNamespaceSchemaLocation=\"compound.xsd\" ";
t << "version=\"" << versionString << "\">" << endl;
}
void writeXMLLink ( FTextStream t,
const char *  extRef,
const char *  compoundId,
const char *  anchorId,
const char *  text,
const char *  tooltip 
)

Definition at line 186 of file xmlgen.cpp.

References convertToXML(), and writeXMLString().

Referenced by XMLCodeGenerator::writeCodeLink(), and TextGeneratorXMLImpl::writeLink().

{
t << "<ref refid=\"" << compoundId;
if (anchorId) t << "_1" << anchorId;
t << "\" kindref=\"";
if (anchorId) t << "member"; else t << "compound";
t << "\"";
if (extRef) t << " external=\"" << extRef << "\"";
if (tooltip) t << " tooltip=\"" << convertToXML(tooltip) << "\"";
t << ">";
writeXMLString(t,text);
t << "</ref>";
}
void writeXMLString ( FTextStream t,
const char *  s 
)
inline

Variable Documentation

XmlSectionMapper g_xmlSectionMapper
static

Definition at line 106 of file xmlgen.cpp.