My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
xmlgen.h File Reference

Go to the source code of this file.

Functions

void generateXML ()
 

Function Documentation

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;
}