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

Go to the source code of this file.

Functions

void generateDocbook ()
 

Function Documentation

void generateDocbook ( )

MAINPAGE DOCUMENTATION

MODULE GROUP DOCUMENTATION

Definition at line 1760 of file docbookgen.cpp.

References Doxygen::classSDict, Config_getBool, Config_getString, createSubDirs(), Doxygen::directories, endl(), err(), Doxygen::exampleSDict, generateDocbookForClass(), generateDocbookForDir(), generateDocbookForFile(), generateDocbookForGroup(), generateDocbookForNamespace(), generateDocbookForPage(), Doxygen::groupSDict, Doxygen::inputNameList, SDict< DirDef >::Iterator, SDict< ClassDef >::Iterator, SDict< GroupDef >::Iterator, SDict< PageDef >::Iterator, SDict< NamespaceDef >::Iterator, Doxygen::mainPage, msg(), FileDef::name(), Definition::name(), Doxygen::namespaceSDict, Doxygen::pageSDict, theTranslator, Translator::trClassDocumentation(), Translator::trDirDocumentation(), Translator::trExampleDocumentation(), Translator::trFileDocumentation(), and Translator::trModuleDocumentation().

Referenced by generateOutput(), and parseInput().

{
// + classes
// + namespaces
// + files
// + groups
// + related pages
// - examples
QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT);
if (outputDirectory.isEmpty())
{
outputDirectory=QDir::currentDirPath().utf8();
}
else
{
QDir dir(outputDirectory);
if (!dir.exists())
{
dir.setPath(QDir::currentDirPath());
if (!dir.mkdir(outputDirectory))
{
err("tag DOCBOOK_OUTPUT: Output directory `%s' does not "
"exist and cannot be created\n",outputDirectory.data());
exit(1);
}
else
{
msg("Notice: Output directory `%s' does not exist. "
"I have created it for you.\n", outputDirectory.data());
}
dir.cd(outputDirectory);
}
outputDirectory=dir.absPath().utf8();
}
QDir dir(outputDirectory);
if (!dir.exists())
{
dir.setPath(QDir::currentDirPath());
if (!dir.mkdir(outputDirectory))
{
err("Cannot create directory %s\n",outputDirectory.data());
return;
}
}
QDir docbookDir(outputDirectory);
createSubDirs(docbookDir);
QCString fileName=outputDirectory+"/index.xml";
QCString dbk_projectName = Config_getString(PROJECT_NAME);
QFile f(fileName);
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 for Docbook which calls the structure file
t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << endl;;
t << "<book xmlns=\"http://docbook.org/ns/docbook\" version=\"5.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">" << endl;
t << " <info>" << endl;
t << " <title>" << dbk_projectName << "</title>" << endl;
t << " </info>" << endl;
// NAMESPACE DOCUMENTATION
//Namespace Documentation index header
if (nli.toFirst())
{
t << " <chapter>" << endl;
t << " <title>Namespace Documentation</title>" << endl;
}
for (nli.toFirst();(nd=nli.current());++nli)
{
msg("Generating Docbook output for namespace %s\n",nd->name().data());
}
//Namespace Documentation index footer
if (nli.toFirst())
{
t << " </chapter>" << endl;
}
{
msg("Generating Docbook output for the main page\n");
}
// PAGE DOCUMENTATION
{
PageDef *pd=0;
for (pdi.toFirst();(pd=pdi.current());++pdi)
{
msg("Generating Docbook output for page %s\n",pd->name().data());
}
}
GroupDef *gd;
//Module group Documentation index header
if (gli.toFirst())
{
t << " <chapter>" << endl;
t << " <title>" << theTranslator->trModuleDocumentation() << "</title>" << endl;
}
for (;(gd=gli.current());++gli)
{
msg("Generating Docbook output for group %s\n",gd->name().data());
}
//Module group Documentation index footer
if (gli.toFirst())
{
t << " </chapter>" << endl;
}
//CLASS DOCUMENTATION
{
ClassDef *cd;
//Class Documentation index header
if (cli.toFirst())
{
t << " <chapter>" << endl;
t << " <title>" << theTranslator->trClassDocumentation() << "</title>" << endl;
}
for (cli.toFirst();(cd=cli.current());++cli)
{
}
//Class Documentation index footer
if (cli.toFirst())
{
t << " </chapter>" << endl;
}
}
// FILE DOCUMENTATION
static bool showFiles = Config_getBool(SHOW_FILES);
if (showFiles)
{
FileName *fn;
//File Documentation index header
if (fnli.toFirst())
{
t << " <chapter>" << endl;
t << " <title>" << theTranslator->trFileDocumentation() << "</title>" << endl;
}
for (;(fn=fnli.current());++fnli)
{
FileNameIterator fni(*fn);
FileDef *fd;
for (;(fd=fni.current());++fni)
{
msg("Generating Docbook output for file %s\n",fd->name().data());
}
}
//File Documentation index footer
if (fnli.toFirst())
{
t << " </chapter>" << endl;
}
}
// DIRECTORY DOCUMENTATION
if (Config_getBool(DIRECTORY_GRAPH) && Config_getBool(HAVE_DOT))
{
DirDef *dir;
//Directory Documentation index header
if (sdi.toFirst())
{
t << " <chapter>" << endl;
t << " <title>" << theTranslator->trDirDocumentation() << "</title>" << endl;
}
for (sdi.toFirst();(dir=sdi.current());++sdi)
{
msg("Generate Docbook output for dir %s\n",dir->name().data());
}
//Module group Documentation index footer
if (sdi.toFirst())
{
t << " </chapter>" << endl;
}
}
// EXAMPLE PAGE DOCUMENTATION
{
PageDef *pd=0;
//Example Page Documentation index header
if (pdi.toFirst())
{
t << " <chapter>" << endl;
t << " <title>" << theTranslator->trExampleDocumentation() << "</title>" << endl;
}
for (pdi.toFirst();(pd=pdi.current());++pdi)
{
msg("Generating Docbook output for example %s\n",pd->name().data());
}
//Example Page Documentation index footer
if (pdi.toFirst())
{
t << " </chapter>" << endl;
}
}
t << "</book>" << endl;
}