My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Typedefs | Functions | Variables
doxygen.h File Reference
#include <qdatetime.h>
#include <qcache.h>
#include <qstrlist.h>
#include <qdict.h>
#include <qintdict.h>
#include "ftextstream.h"
#include "sortdict.h"
#include "membergroup.h"
#include "dirdef.h"
#include "memberlist.h"

Go to the source code of this file.

Classes

class  StringDict
 
struct  LookupInfo
 
class  Doxygen
 This class serves as a namespace for global variables used by doxygen. More...
 

Typedefs

typedef QList< QCString > StringList
 
typedef QListIterator< QCString > StringListIterator
 

Functions

void initDoxygen ()
 
void readConfiguration (int argc, char **argv)
 
void checkConfiguration ()
 
void adjustConfiguration ()
 
void searchInputFiles (StringList &inputFiles)
 
void parseInput ()
 
void generateOutput ()
 
void readAliases ()
 
void readFormulaRepository ()
 
void cleanUpDoxygen ()
 
int readFileOrDirectory (const char *s, FileNameList *fnList, FileNameDict *fnDict, StringDict *exclDict, QStrList *patList, QStrList *exclPatList, StringList *resultList, StringDict *resultDict, bool recursive, bool errorIfNotExist=TRUE, QDict< void > *killDict=0, QDict< void > *paths=0)
 
int readDir (QFileInfo *fi, FileNameList *fnList, FileNameDict *fnDict, StringDict *exclDict, QStrList *patList, QStrList *exclPatList, StringList *resultList, StringDict *resultDict, bool errorIfNotExist, bool recursive, QDict< void > *killDict)
 
void copyAndFilterFile (const char *fileName, BufStr &dest)
 

Variables

QCString g_spaces
 

Typedef Documentation

typedef QList<QCString> StringList

Definition at line 62 of file doxygen.h.

typedef QListIterator<QCString> StringListIterator

Definition at line 65 of file doxygen.h.

Function Documentation

void adjustConfiguration ( )

adjust globals that depend on configuration settings.

Definition at line 10499 of file doxygen.cpp.

References addSearchDir(), Config_getBool, Config_getEnum, Config_getInt, Config_getList, Config_getString, err(), Doxygen::expandAsDefinedDict, Doxygen::htmlFileExtension, Doxygen::markdownSupport, msg(), Doxygen::parseSourcesNeeded, readAliases(), setTranslator(), Doxygen::spaces, updateLanguageMapping(), warn_uncond(), and Doxygen::xrefLists.

Referenced by main().

{
Doxygen::globalScope = new NamespaceDef("<globalScope>",1,1,"<globalScope>");
Doxygen::exampleNameDict->setAutoDelete(TRUE);
Doxygen::imageNameDict->setAutoDelete(TRUE);
QCString outputLanguage=Config_getEnum(OUTPUT_LANGUAGE);
if (!setTranslator(outputLanguage))
{
warn_uncond("Output language %s not supported! Using English instead.\n",
outputLanguage.data());
}
QStrList &includePath = Config_getList(INCLUDE_PATH);
char *s=includePath.first();
while (s)
{
QFileInfo fi(s);
addSearchDir(fi.absFilePath().utf8());
s=includePath.next();
}
/* Set the global html file extension. */
Doxygen::xrefLists->setAutoDelete(TRUE);
Config_getBool(CALLER_GRAPH) ||
Config_getBool(REFERENCES_RELATION) ||
Config_getBool(REFERENCED_BY_RELATION);
/**************************************************************************
* Add custom extension mappings
**************************************************************************/
QStrList &extMaps = Config_getList(EXTENSION_MAPPING);
char *mapping = extMaps.first();
while (mapping)
{
QCString mapStr = mapping;
int i;
if ((i=mapStr.find('='))!=-1)
{
QCString ext=mapStr.left(i).stripWhiteSpace().lower();
QCString language=mapStr.mid(i+1).stripWhiteSpace().lower();
if (!updateLanguageMapping(ext,language))
{
err("Failed to map file extension '%s' to unsupported language '%s'.\n"
"Check the EXTENSION_MAPPING setting in the config file.\n",
ext.data(),language.data());
}
else
{
msg("Adding custom extension mapping: .%s will be treated as language %s\n",
ext.data(),language.data());
}
}
mapping = extMaps.next();
}
// add predefined macro name to a dictionary
QStrList &expandAsDefinedList =Config_getList(EXPAND_AS_DEFINED);
s=expandAsDefinedList.first();
while (s)
{
{
Doxygen::expandAsDefinedDict.insert(s,(void *)666);
}
s=expandAsDefinedList.next();
}
// read aliases and store them in a dictionary
// store number of spaces in a tab into Doxygen::spaces
int &tabSize = Config_getInt(TAB_SIZE);
Doxygen::spaces.resize(tabSize+1);
int sp;for (sp=0;sp<tabSize;sp++) Doxygen::spaces.at(sp)=' ';
Doxygen::spaces.at(tabSize)='\0';
}
void checkConfiguration ( )

check and resolve config options

Definition at line 10490 of file doxygen.cpp.

References Config::checkAndCorrect(), initWarningFormat(), and Config::postProcess().

Referenced by main().

void cleanUpDoxygen ( )

Definition at line 10073 of file doxygen.cpp.

References Doxygen::classSDict, cleanUpPreprocessor(), codeFreeScanner(), DefinitionIntf::definitionType(), Doxygen::diaFileNameDict, Doxygen::directories, Doxygen::dotFileNameDict, Doxygen::exampleNameDict, Doxygen::exampleSDict, Doxygen::formulaDict, Doxygen::formulaList, Doxygen::formulaNameDict, Mappers::freeMappers(), Doxygen::functionNameSDict, g_outputList, Doxygen::genericsDict, Doxygen::globalScope, Doxygen::groupSDict, Doxygen::hiddenClasses, Doxygen::imageNameDict, Doxygen::includeNameDict, Doxygen::indexList, Doxygen::inputNameDict, Doxygen::inputNameList, Doxygen::mainPage, Doxygen::memberNameSDict, Doxygen::mscFileNameDict, Doxygen::namespaceSDict, Doxygen::pageSDict, Doxygen::parserManager, Doxygen::sectionDict, Doxygen::symbolMap, theTranslator, languages::tmp, DefinitionIntf::TypeSymbolList, and Doxygen::xrefLists.

Referenced by createOutputDirectory(), generateOutput(), parseInput(), and readConfiguration().

{
delete theTranslator;
delete g_outputList;
{
// iterate through Doxygen::symbolMap and delete all
// DefinitionList objects, since they have no owner
QDictIterator<DefinitionIntf> dli(*Doxygen::symbolMap);
for (dli.toFirst();(di=dli.current());)
{
{
DefinitionIntf *tmp = Doxygen::symbolMap->take(dli.currentKey());
delete (DefinitionList *)tmp;
}
else
{
++dli;
}
}
}
//delete Doxygen::symbolMap; <- we cannot do this unless all static lists
// (such as Doxygen::namespaceSDict)
// with objects based on Definition are made
// dynamic first
}
void copyAndFilterFile ( const char *  fileName,
BufStr dest 
)
void generateOutput ( )

add extra languages for which we can only produce syntax highlighted code

Definition at line 11386 of file doxygen.cpp.

References OutputList::add(), addCodeOnlyMappings(), IndexList::addIndex(), Statistics::begin(), Doxygen::clangUsrMap, cleanUpDoxygen(), Store::close(), computeIdealCacheParam(), Config_getBool, Config_getInt, Config_getList, Config_getString, copyExtraFiles(), copyLatexStyleSheet(), copyLogo(), copyStyleSheet(), OutputList::count(), createJavascriptSearchIndex(), Config::deinit(), dumpSymbolMap(), Statistics::end(), err(), Htags::execute(), Debug::ExtCmd, IndexList::finalize(), finializeSearchIndexer(), g_dumpSymbolMap, g_s, g_successfulRun, g_useOutputTemplate, FormulaList::generateBitmaps(), generateClassDocs(), generateDEF(), generateDirDocs(), generateDocbook(), generateExampleDocs(), generateFileDocs(), generateFileSources(), generateGroupDocs(), generateNamespaceDocs(), generateOutputViaTemplate(), generatePageDocs(), generatePerlMod(), generateSqlite3(), FTVHelp::generateTreeViewImages(), generateXML(), Doxygen::generatingXmlOutput, getQchFileName(), Qhp::getQhpFileName(), RTFGenerator::init(), ManGenerator::init(), LatexGenerator::init(), HtmlGenerator::init(), IndexList::initialize(), initSearchIndexer(), DotManager::instance(), SearchIndexIntf::Internal, Debug::isFlagSet(), SDict< GroupDef >::Iterator, Htags::loadFilemap(), Doxygen::lookupCache, msg(), Doxygen::objDBFileName, portable_getSysElapsedTime(), portable_isAbsolutePath(), portable_system(), portable_sysTimerStart(), portable_sysTimerStop(), RTFGenerator::preProcessFileInplace(), Statistics::print(), removeDoxFont(), DotManager::run(), Doxygen::runningTime, SDict< T >::sort(), GroupDef::sortSubGroups(), Doxygen::symbolMap, Doxygen::symbolStorage, Debug::Time, Htags::useHtags, SearchIndexIntf::write(), writeDoxFont(), HtmlGenerator::writeExternalSearchPage(), writeGraphInfo(), writeIndexHierarchy(), writeJavascriptSearchIndex(), HtmlGenerator::writeSearchData(), HtmlGenerator::writeSearchPage(), OutputList::writeStyleInfo(), HtmlGenerator::writeTabData(), and writeTagFile().

Referenced by main().

{
/**************************************************************************
* Initialize output generators *
**************************************************************************/
{
exit(0);
}
bool generateHtml = Config_getBool(GENERATE_HTML);
bool generateLatex = Config_getBool(GENERATE_LATEX);
bool generateMan = Config_getBool(GENERATE_MAN);
bool generateRtf = Config_getBool(GENERATE_RTF);
g_outputList = new OutputList(TRUE);
if (generateHtml)
{
// add HTML indexers that are enabled
bool generateHtmlHelp = Config_getBool(GENERATE_HTMLHELP);
bool generateEclipseHelp = Config_getBool(GENERATE_ECLIPSEHELP);
bool generateQhp = Config_getBool(GENERATE_QHP);
bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
bool generateDocSet = Config_getBool(GENERATE_DOCSET);
if (generateEclipseHelp) Doxygen::indexList->addIndex(new EclipseHelp);
if (generateHtmlHelp) Doxygen::indexList->addIndex(new HtmlHelp);
if (generateQhp) Doxygen::indexList->addIndex(new Qhp);
if (generateTreeView) Doxygen::indexList->addIndex(new FTVHelp(TRUE));
if (generateDocSet) Doxygen::indexList->addIndex(new DocSets);
}
if (generateLatex)
{
}
if (generateMan)
{
}
if (generateRtf)
{
}
if (Config_getBool(USE_HTAGS))
{
QCString htmldir = Config_getString(HTML_OUTPUT);
if (!Htags::execute(htmldir))
err("USE_HTAGS is YES but htags(1) failed. \n");
if (!Htags::loadFilemap(htmldir))
err("htags(1) ended normally but failed to load the filemap. \n");
}
/**************************************************************************
* Generate documentation *
**************************************************************************/
if (generateHtml) writeDoxFont(Config_getString(HTML_OUTPUT));
if (generateLatex) writeDoxFont(Config_getString(LATEX_OUTPUT));
if (generateRtf) writeDoxFont(Config_getString(RTF_OUTPUT));
g_s.begin("Generating style sheet...\n");
//printf("writing style info\n");
g_outputList->writeStyleInfo(0); // write first part
g_s.end();
static bool searchEngine = Config_getBool(SEARCHENGINE);
static bool serverBasedSearch = Config_getBool(SERVER_BASED_SEARCH);
g_s.begin("Generating search indices...\n");
if (searchEngine && !serverBasedSearch && (generateHtml || g_useOutputTemplate))
{
}
// generate search indices (need to do this before writing other HTML
// pages as these contain a drop down menu with options depending on
// what categories we find in this function.
if (generateHtml && searchEngine)
{
QCString searchDirName = Config_getString(HTML_OUTPUT)+"/search";
QDir searchDir(searchDirName);
if (!searchDir.exists() && !searchDir.mkdir(searchDirName))
{
err("Could not create search results directory '%s' $PWD='%s'\n",
searchDirName.data(),QDir::currentDirPath().data());
exit(1);
}
if (!serverBasedSearch) // client side search index
{
}
}
g_s.end();
g_s.begin("Generating example documentation...\n");
g_s.end();
{
g_s.begin("Generating file sources...\n");
g_s.end();
}
g_s.begin("Generating file documentation...\n");
g_s.end();
g_s.begin("Generating page documentation...\n");
g_s.end();
g_s.begin("Generating group documentation...\n");
g_s.end();
g_s.begin("Generating class documentation...\n");
g_s.end();
g_s.begin("Generating namespace index...\n");
g_s.end();
if (Config_getBool(GENERATE_LEGEND))
{
g_s.begin("Generating graph info page...\n");
g_s.end();
}
g_s.begin("Generating directory documentation...\n");
g_s.end();
if (Doxygen::formulaList->count()>0 && generateHtml
&& !Config_getBool(USE_MATHJAX))
{
g_s.begin("Generating bitmaps for formulas in HTML...\n");
g_s.end();
}
if (Config_getBool(SORT_GROUP_NAMES))
{
GroupDef *gd;
for (gli.toFirst();(gd=gli.current());++gli)
{
}
}
if (g_outputList->count()>0)
{
}
g_s.begin("finalizing index lists...\n");
g_s.end();
g_s.begin("writing tag file...\n");
g_s.end();
if (Config_getBool(DOT_CLEANUP))
{
if (generateHtml)
if (generateRtf)
if (generateLatex)
}
if (Config_getBool(GENERATE_XML))
{
g_s.begin("Generating XML output...\n");
g_s.end();
}
if (USE_SQLITE3)
{
g_s.begin("Generating SQLITE3 output...\n");
g_s.end();
}
if (Config_getBool(GENERATE_DOCBOOK))
{
g_s.begin("Generating Docbook output...\n");
g_s.end();
}
if (Config_getBool(GENERATE_AUTOGEN_DEF))
{
g_s.begin("Generating AutoGen DEF output...\n");
g_s.end();
}
if (Config_getBool(GENERATE_PERLMOD))
{
g_s.begin("Generating Perl module output...\n");
g_s.end();
}
if (generateHtml && searchEngine && serverBasedSearch)
{
g_s.begin("Generating search index\n");
if (Doxygen::searchIndex->kind()==SearchIndexIntf::Internal) // write own search index
{
Doxygen::searchIndex->write(Config_getString(HTML_OUTPUT)+"/search/search.idx");
}
else // write data for external search index
{
QCString searchDataFile = Config_getString(SEARCHDATA_FILE);
if (searchDataFile.isEmpty())
{
searchDataFile="searchdata.xml";
}
if (!portable_isAbsolutePath(searchDataFile))
{
searchDataFile.prepend(Config_getString(OUTPUT_DIRECTORY)+"/");
}
Doxygen::searchIndex->write(searchDataFile);
}
g_s.end();
}
if (generateRtf)
{
g_s.begin("Combining RTF output...\n");
if (!RTFGenerator::preProcessFileInplace(Config_getString(RTF_OUTPUT),"refman.rtf"))
{
err("An error occurred during post-processing the RTF files!\n");
}
g_s.end();
}
if (Config_getBool(HAVE_DOT))
{
g_s.begin("Running dot...\n");
g_s.end();
}
// copy static stuff
if (generateHtml)
{
copyLogo(Config_getString(HTML_OUTPUT));
copyExtraFiles(Config_getList(HTML_EXTRA_FILES),"HTML_EXTRA_FILES",Config_getString(HTML_OUTPUT));
}
if (generateLatex)
{
copyLogo(Config_getString(LATEX_OUTPUT));
copyExtraFiles(Config_getList(LATEX_EXTRA_FILES),"LATEX_EXTRA_FILES",Config_getString(LATEX_OUTPUT));
}
if (generateRtf)
{
copyLogo(Config_getString(RTF_OUTPUT));
}
if (generateHtml &&
Config_getBool(GENERATE_HTMLHELP) &&
!Config_getString(HHC_LOCATION).isEmpty())
{
g_s.begin("Running html help compiler...\n");
QString oldDir = QDir::currentDirPath();
QDir::setCurrent(Config_getString(HTML_OUTPUT));
if (portable_system(Config_getString(HHC_LOCATION), "index.hhp", Debug::isFlagSet(Debug::ExtCmd))!=1)
{
err("failed to run html help compiler on index.hhp\n");
}
QDir::setCurrent(oldDir);
g_s.end();
}
if ( generateHtml &&
Config_getBool(GENERATE_QHP) &&
!Config_getString(QHG_LOCATION).isEmpty())
{
g_s.begin("Running qhelpgenerator...\n");
QCString const qhpFileName = Qhp::getQhpFileName();
QCString const qchFileName = getQchFileName();
QCString const args = QCString().sprintf("%s -o \"%s\"", qhpFileName.data(), qchFileName.data());
QString const oldDir = QDir::currentDirPath();
QDir::setCurrent(Config_getString(HTML_OUTPUT));
if (portable_system(Config_getString(QHG_LOCATION), args.data(), FALSE))
{
err("failed to run qhelpgenerator on index.qhp\n");
}
QDir::setCurrent(oldDir);
g_s.end();
}
int cacheParam;
msg("lookup cache used %d/%d hits=%d misses=%d\n",
cacheParam = computeIdealCacheParam(Doxygen::lookupCache->misses()*2/3); // part of the cache is flushed, hence the 2/3 correction factor
if (cacheParam>Config_getInt(LOOKUP_CACHE_SIZE))
{
msg("Note: based on cache misses the ideal setting for LOOKUP_CACHE_SIZE is %d at the cost of higher memory usage.\n",cacheParam);
}
{
msg("Total elapsed time: %.3f seconds\n(of which %.3f seconds waiting for external tools to finish)\n",
((double)Doxygen::runningTime.elapsed())/1000.0,
);
}
else
{
msg("finished...\n");
}
/**************************************************************************
* Start cleaning up *
**************************************************************************/
QDir thisDir;
thisDir.remove(Doxygen::objDBFileName);
QTextCodec::deleteAllCodecs();
}
void initDoxygen ( )

Definition at line 9981 of file doxygen.cpp.

References Doxygen::clangUsrMap, Doxygen::dirRelations, g_compoundKeywordDict(), initClassMemberIndices(), initDefaultExtensionMapping(), initFileMemberIndices(), initNamespaceMemberIndices(), initPreprocessor(), initResources(), Doxygen::memGrpInfoDict, portable_getenv(), portable_setenv(), ParserManager::registerDefaultParser(), ParserManager::registerParser(), Doxygen::runningTime, SDict< T >::setAutoDelete(), Doxygen::symbolMap, and Doxygen::tagDestinationDict.

Referenced by main().

{
const char *lang = portable_getenv("LC_ALL");
if (lang) portable_setenv("LANG",lang);
setlocale(LC_ALL,"");
setlocale(LC_CTYPE,"C"); // to get isspace(0xA0)==0, needed for UTF-8
setlocale(LC_NUMERIC,"C");
// register any additional parsers here...
Doxygen::symbolMap = new QDict<DefinitionIntf>(50177);
#ifdef USE_LIBCLANG
Doxygen::clangUsrMap = new QDict<Definition>(50177);
#endif
Doxygen::inputNameList->setAutoDelete(TRUE);
Doxygen::pageSDict = new PageSDict(1009); // all doc pages
Doxygen::exampleSDict = new PageSDict(1009); // all examples
Doxygen::memGrpInfoDict.setAutoDelete(TRUE);
Doxygen::tagDestinationDict.setAutoDelete(TRUE);
// initialisation of these globals depends on
// configuration switches so we need to postpone these
/**************************************************************************
* Initialize some global constants
**************************************************************************/
g_compoundKeywordDict.insert("template class",(void *)8);
g_compoundKeywordDict.insert("template struct",(void *)8);
g_compoundKeywordDict.insert("class",(void *)8);
g_compoundKeywordDict.insert("struct",(void *)8);
g_compoundKeywordDict.insert("union",(void *)8);
g_compoundKeywordDict.insert("interface",(void *)8);
g_compoundKeywordDict.insert("exception",(void *)8);
}
void parseInput ( )

Definition at line 10885 of file doxygen.cpp.

References addEnumValuesToEnums(), addListReferences(), addMembersToIndex(), addMembersToMemberGroup(), addSourceReferences(), addSTLClasses(), Statistics::begin(), buildClassDocList(), buildClassList(), buildCompleteMemberLists(), buildDirectories(), buildExampleList(), buildFileList(), buildFunctionList(), buildGroupList(), buildInterfaceAndServiceList(), buildListOfUsingDecls(), buildNamespaceList(), buildPageList(), buildTypedefList(), buildVarList(), checkPageRelations(), cleanUpDoxygen(), FileStorage::close(), combineUsingRelations(), computeClassRelations(), computeDirDependencies(), computeMemberReferences(), computeMemberRelations(), computePageRelations(), computeTemplateClassRelations(), VhdlDocGen::computeVhdlComponentRelations(), Config_getBool, Config_getInt, Config_getList, Config_getString, countDataStructures(), Entry::createNavigationIndex(), createOutputDirectory(), createTemplateInstanceMembers(), distributeMemberGroupDocumentation(), Statistics::end(), Doxygen::entryDBFileName, err(), exitDoxygen(), findClassEntries(), findDefineDocumentation(), findDirDocumentation(), findDocumentedEnumValues(), findEnumDocumentation(), findEnums(), findFriends(), findGroupScope(), findIncludedUsingDirectives(), findInheritedTemplateInstances(), findMainPage(), findMainPageTagFiles(), findMemberDocumentation(), findObjCMethodDefinitions(), findSectionsInDocumentation(), findTagLessClasses(), findUsedTemplateInstances(), findUsingDeclarations(), findUsingDeclImports(), findUsingDirectives(), flushCachedTemplateRelations(), flushUnresolvedRelations(), g_classEntries(), g_s, g_storage, g_useOutputTemplate, g_usingDeclarations(), FileNameList::generateDiskNames(), generateDocbook(), CiteDict::generatePage(), generateXRefPages(), inheritDocumentation(), LayoutDocManager::init(), LayoutDocManager::instance(), Doxygen::lookupCache, mergeCategories(), msg(), Doxygen::objDBFileName, FileStorage::open(), organizeSubGroups(), LayoutDocManager::parse(), parseFiles(), portable_getenv(), portable_pathListSeparator(), portable_pid(), portable_setenv(), preFreeScanner(), pyscanFreeScanner(), readFormulaRepository(), readTagFile(), resolveClassNestingRelations(), resolveUserReferences(), scanFreeScanner(), searchInputFiles(), EntryNav::setEntry(), FileStorage::setName(), SDict< T >::sort(), sortMemberLists(), stopDoxygen(), transferFunctionDocumentation(), transferFunctionReferences(), transferRelatedFunctionDocumentation(), and warn_uncond().

Referenced by main().

{
atexit(exitDoxygen);
/**************************************************************************
* Make sure the output directory exists
**************************************************************************/
QCString &outputDirectory = Config_getString(OUTPUT_DIRECTORY);
if (outputDirectory.isEmpty())
{
outputDirectory=QDir::currentDirPath().utf8();
}
else
{
QDir dir(outputDirectory);
if (!dir.exists())
{
dir.setPath(QDir::currentDirPath());
if (!dir.mkdir(outputDirectory))
{
err("tag OUTPUT_DIRECTORY: 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();
}
/**************************************************************************
* Initialize global lists and dictionaries
**************************************************************************/
// also scale lookup cache with SYMBOL_CACHE_SIZE
int cacheSize = Config_getInt(LOOKUP_CACHE_SIZE);
if (cacheSize<0) cacheSize=0;
if (cacheSize>9) cacheSize=9;
uint lookupSize = 65536 << cacheSize;
Doxygen::lookupCache = new QCache<LookupInfo>(lookupSize,lookupSize);
Doxygen::lookupCache->setAutoDelete(TRUE);
#ifdef HAS_SIGNALS
signal(SIGINT, stopDoxygen);
#endif
uint pid = portable_pid();
Doxygen::objDBFileName.sprintf("doxygen_objdb_%d.tmp",pid);
Doxygen::objDBFileName.prepend(outputDirectory+"/");
Doxygen::entryDBFileName.sprintf("doxygen_entrydb_%d.tmp",pid);
Doxygen::entryDBFileName.prepend(outputDirectory+"/");
{
err("Failed to open temporary file %s\n",Doxygen::objDBFileName.data());
exit(1);
}
/**************************************************************************
* Check/create output directorties *
**************************************************************************/
QCString htmlOutput;
bool &generateHtml = Config_getBool(GENERATE_HTML);
if (generateHtml || g_useOutputTemplate /* TODO: temp hack */)
htmlOutput = createOutputDirectory(outputDirectory,Config_getString(HTML_OUTPUT),"/html");
QCString docbookOutput;
bool &generateDocbook = Config_getBool(GENERATE_DOCBOOK);
if (generateDocbook)
docbookOutput = createOutputDirectory(outputDirectory,Config_getString(DOCBOOK_OUTPUT),"/docbook");
QCString xmlOutput;
bool &generateXml = Config_getBool(GENERATE_XML);
if (generateXml)
xmlOutput = createOutputDirectory(outputDirectory,Config_getString(XML_OUTPUT),"/xml");
QCString latexOutput;
bool &generateLatex = Config_getBool(GENERATE_LATEX);
if (generateLatex)
latexOutput = createOutputDirectory(outputDirectory,Config_getString(LATEX_OUTPUT),"/latex");
QCString rtfOutput;
bool &generateRtf = Config_getBool(GENERATE_RTF);
if (generateRtf)
rtfOutput = createOutputDirectory(outputDirectory,Config_getString(RTF_OUTPUT),"/rtf");
QCString manOutput;
bool &generateMan = Config_getBool(GENERATE_MAN);
if (generateMan)
manOutput = createOutputDirectory(outputDirectory,Config_getString(MAN_OUTPUT),"/man");
//QCString sqlOutput;
//bool &generateSql = Config_getBool(GENERATE_SQLITE3);
//if (generateSql)
// sqlOutput = createOutputDirectory(outputDirectory,"SQLITE3_OUTPUT","/sqlite3");
if (Config_getBool(HAVE_DOT))
{
QCString curFontPath = Config_getString(DOT_FONTPATH);
if (curFontPath.isEmpty())
{
portable_getenv("DOTFONTPATH");
QCString newFontPath = ".";
if (!curFontPath.isEmpty())
{
newFontPath+=curFontPath;
}
portable_setenv("DOTFONTPATH",newFontPath);
}
else
{
portable_setenv("DOTFONTPATH",curFontPath);
}
}
/**************************************************************************
* Handle layout file *
**************************************************************************/
QCString &layoutFileName = Config_getString(LAYOUT_FILE);
bool defaultLayoutUsed = FALSE;
if (layoutFileName.isEmpty())
{
layoutFileName = "DoxygenLayout.xml";
defaultLayoutUsed = TRUE;
}
QFile layoutFile(layoutFileName);
if (layoutFile.open(IO_ReadOnly))
{
msg("Parsing layout file %s...\n",layoutFileName.data());
QTextStream t(&layoutFile);
t.setEncoding(QTextStream::Latin1);
LayoutDocManager::instance().parse(t,layoutFileName);
}
else if (!defaultLayoutUsed)
{
warn_uncond("failed to open layout file '%s' for reading!\n",layoutFileName.data());
}
/**************************************************************************
* Read and preprocess input *
**************************************************************************/
// prevent search in the output directories
QStrList &exclPatterns = Config_getList(EXCLUDE_PATTERNS);
if (generateHtml) exclPatterns.append(htmlOutput);
if (generateDocbook) exclPatterns.append(docbookOutput);
if (generateXml) exclPatterns.append(xmlOutput);
if (generateLatex) exclPatterns.append(latexOutput);
if (generateRtf) exclPatterns.append(rtfOutput);
if (generateMan) exclPatterns.append(manOutput);
// Notice: the order of the function calls below is very important!
if (Config_getBool(GENERATE_HTML))
{
}
/**************************************************************************
* Handle Tag Files *
**************************************************************************/
if (!g_storage->open(IO_WriteOnly))
{
err("Failed to create temporary storage file %s\n",
exit(1);
}
Entry *root=new Entry;
EntryNav *rootNav = new EntryNav(0,root);
rootNav->setEntry(root);
msg("Reading and parsing tag files\n");
QStrList &tagFileList = Config_getList(TAGFILES);
char *s=tagFileList.first();
while (s)
{
readTagFile(root,s);
root->createNavigationIndex(rootNav,g_storage,0);
s=tagFileList.next();
}
/**************************************************************************
* Parse source files *
**************************************************************************/
if (Config_getBool(BUILTIN_STL_SUPPORT))
{
addSTLClasses(rootNav);
}
g_s.begin("Parsing files\n");
parseFiles(root,rootNav);
g_s.end();
// we are done with input scanning now, so free up the buffers used by flex
// (can be around 4MB)
if (!g_storage->open(IO_ReadOnly))
{
err("Failed to open temporary storage file %s for reading",
exit(1);
}
/**************************************************************************
* Gather information *
**************************************************************************/
g_s.begin("Building group list...\n");
buildGroupList(rootNav);
g_s.end();
g_s.begin("Building directory list...\n");
g_s.end();
g_s.begin("Building namespace list...\n");
g_s.end();
g_s.begin("Building file list...\n");
buildFileList(rootNav);
g_s.end();
//generateFileTree();
g_s.begin("Building class list...\n");
buildClassList(rootNav);
g_s.end();
g_s.begin("Associating documentation with classes...\n");
// build list of using declarations here (global list)
g_s.end();
g_s.begin("Computing nesting relations for classes...\n");
g_s.end();
// 1.8.2-20121111: no longer add nested classes to the group as well
//distributeClassGroupRelations();
// calling buildClassList may result in cached relations that
// become invalid after resolveClassNestingRelations(), that's why
// we need to clear the cache here
// we don't need the list of using declaration anymore
g_s.begin("Building example list...\n");
buildExampleList(rootNav);
g_s.end();
g_s.begin("Searching for enumerations...\n");
findEnums(rootNav);
g_s.end();
// Since buildVarList calls isVarWithConstructor
// and this calls getResolvedClass we need to process
// typedefs first so the relations between classes via typedefs
// are properly resolved. See bug 536385 for an example.
g_s.begin("Searching for documented typedefs...\n");
buildTypedefList(rootNav);
g_s.end();
g_s.begin("Searching for members imported via using declarations...\n");
// this should be after buildTypedefList in order to properly import
// used typedefs
g_s.end();
g_s.begin("Searching for included using directives...\n");
g_s.end();
g_s.begin("Searching for documented variables...\n");
buildVarList(rootNav);
g_s.end();
g_s.begin("Building interface member list...\n");
buildInterfaceAndServiceList(rootNav); // UNO IDL
g_s.begin("Building member list...\n"); // using class info only !
g_s.end();
g_s.begin("Searching for friends...\n");
g_s.end();
g_s.begin("Searching for documented defines...\n");
g_s.end();
g_s.begin("Computing class inheritance relations...\n");
findClassEntries(rootNav);
g_s.end();
g_s.begin("Computing class usage relations...\n");
g_s.end();
if (Config_getBool(INLINE_SIMPLE_STRUCTS))
{
g_s.begin("Searching for tag less structs...\n");
g_s.end();
}
g_s.begin("Flushing cached template relations that have become invalid...\n");
g_s.end();
g_s.begin("Computing class relations...\n");
if (Config_getBool(OPTIMIZE_OUTPUT_VHDL))
{
}
g_classEntries.clear();
g_s.end();
g_s.begin("Add enum values to enums...\n");
g_s.end();
g_s.begin("Searching for member function documentation...\n");
findMemberDocumentation(rootNav); // may introduce new members !
g_s.end();
// moved to after finding and copying documentation,
// as this introduces new members see bug 722654
g_s.begin("Creating members for template instances...\n");
g_s.end();
g_s.begin("Building page list...\n");
buildPageList(rootNav);
g_s.end();
g_s.begin("Search for main page...\n");
findMainPage(rootNav);
g_s.end();
g_s.begin("Computing page relations...\n");
g_s.end();
g_s.begin("Determining the scope of groups...\n");
findGroupScope(rootNav);
g_s.end();
g_s.begin("Sorting lists...\n");
g_s.end();
msg("Freeing entry tree\n");
delete rootNav;
delete g_storage;
QDir thisDir;
thisDir.remove(Doxygen::entryDBFileName);
g_s.begin("Determining which enums are documented\n");
g_s.end();
g_s.begin("Computing member relations...\n");
g_s.end();
g_s.begin("Building full member lists recursively...\n");
g_s.end();
g_s.begin("Adding members to member groups.\n");
g_s.end();
if (Config_getBool(DISTRIBUTE_GROUP_DOC))
{
g_s.begin("Distributing member group documentation.\n");
g_s.end();
}
g_s.begin("Computing member references...\n");
g_s.end();
if (Config_getBool(INHERIT_DOCS))
{
g_s.begin("Inheriting documentation...\n");
g_s.end();
}
// compute the shortest possible names of all files
// without losing the uniqueness of the file names.
g_s.begin("Generating disk names...\n");
g_s.end();
g_s.begin("Adding source references...\n");
g_s.end();
g_s.begin("Adding xrefitems...\n");
g_s.end();
g_s.begin("Sorting member lists...\n");
g_s.end();
if (Config_getBool(DIRECTORY_GRAPH))
{
g_s.begin("Computing dependencies between directories...\n");
g_s.end();
}
//g_s.begin("Resolving citations...\n");
//Doxygen::citeDict->resolve();
g_s.begin("Generating citations page...\n");
g_s.end();
g_s.begin("Counting data structures...\n");
g_s.end();
g_s.begin("Resolving user defined references...\n");
g_s.end();
g_s.begin("Finding anchors and sections in the documentation...\n");
g_s.end();
g_s.begin("Transferring function references...\n");
g_s.end();
g_s.begin("Combining using relations...\n");
g_s.end();
g_s.begin("Adding members to index pages...\n");
g_s.end();
}
void readAliases ( )

Definition at line 9833 of file doxygen.cpp.

References Doxygen::aliasDict, Config_getList, escapeAliases(), and expandAliases().

Referenced by adjustConfiguration().

{
// add aliases to a dictionary
Doxygen::aliasDict.setAutoDelete(TRUE);
QStrList &aliasList = Config_getList(ALIASES);
const char *s=aliasList.first();
while (s)
{
if (Doxygen::aliasDict[s]==0)
{
QCString alias=s;
int i=alias.find('=');
if (i>0)
{
QCString name=alias.left(i).stripWhiteSpace();
QCString value=alias.right(alias.length()-i-1);
//printf("Alias: found name=`%s' value=`%s'\n",name.data(),value.data());
if (!name.isEmpty())
{
QCString *dn=Doxygen::aliasDict[name];
if (dn==0) // insert new alias
{
Doxygen::aliasDict.insert(name,new QCString(value));
}
else // overwrite previous alias
{
*dn=value;
}
}
}
}
s=aliasList.next();
}
}
void readConfiguration ( int  argc,
char **  argv 
)

Definition at line 10147 of file doxygen.cpp.

References Config::checkAndCorrect(), cleanUpDoxygen(), Config_getEnum, devUsage(), err(), g_dumpSymbolMap, g_useOutputTemplate, generateConfigFile(), generateTemplateFiles(), getArg(), Config::init(), msg(), openOutputFile(), Doxygen::outputToWizard, Config::parse(), Config::postProcess(), Debug::setFlag(), setPerlModDoxyfile(), setTranslator(), usage(), versionString, warn_uncond(), writeDefaultLayoutFile(), RTFGenerator::writeExtensionsFile(), LatexGenerator::writeFooterFile(), HtmlGenerator::writeFooterFile(), LatexGenerator::writeHeaderFile(), HtmlGenerator::writeHeaderFile(), RTFGenerator::writeStyleSheetFile(), LatexGenerator::writeStyleSheetFile(), and HtmlGenerator::writeStyleSheetFile().

Referenced by main().

{
/**************************************************************************
* Handle arguments *
**************************************************************************/
int optind=1;
const char *configName=0;
const char *layoutName=0;
const char *debugLabel;
const char *formatName;
bool genConfig=FALSE;
bool shortList=FALSE;
bool updateConfig=FALSE;
bool genLayout=FALSE;
int retVal;
while (optind<argc && argv[optind][0]=='-' &&
(isalpha(argv[optind][1]) || argv[optind][1]=='?' ||
argv[optind][1]=='-')
)
{
switch(argv[optind][1])
{
case 'g':
genConfig=TRUE;
configName=getArg(argc,argv,optind);
if (optind+1<argc && qstrcmp(argv[optind+1],"-")==0)
{ configName="-"; optind++; }
if (!configName)
{ configName="Doxyfile"; }
break;
case 'l':
genLayout=TRUE;
layoutName=getArg(argc,argv,optind);
if (!layoutName)
{ layoutName="DoxygenLayout.xml"; }
break;
case 'd':
debugLabel=getArg(argc,argv,optind);
if (!debugLabel)
{
err("option \"-d\" is missing debug specifier.\n");
exit(1);
}
retVal = Debug::setFlag(debugLabel);
if (!retVal)
{
err("option \"-d\" has unknown debug specifier: \"%s\".\n",debugLabel);
exit(1);
}
break;
case 's':
shortList=TRUE;
break;
case 'u':
updateConfig=TRUE;
break;
case 'e':
formatName=getArg(argc,argv,optind);
if (!formatName)
{
err("option \"-e\" is missing format specifier rtf.\n");
exit(1);
}
if (qstricmp(formatName,"rtf")==0)
{
if (optind+1>=argc)
{
err("option \"-e rtf\" is missing an extensions file name\n");
exit(1);
}
QFile f;
if (openOutputFile(argv[optind+1],f))
{
}
exit(0);
}
err("option \"-e\" has invalid format specifier.\n");
exit(1);
break;
case 'w':
formatName=getArg(argc,argv,optind);
if (!formatName)
{
err("option \"-w\" is missing format specifier rtf, html or latex\n");
exit(1);
}
if (qstricmp(formatName,"rtf")==0)
{
if (optind+1>=argc)
{
err("option \"-w rtf\" is missing a style sheet file name\n");
exit(1);
}
QFile f;
if (openOutputFile(argv[optind+1],f))
{
}
exit(1);
}
else if (qstricmp(formatName,"html")==0)
{
if (optind+4<argc || QFileInfo("Doxyfile").exists())
// explicit config file mentioned or default found on disk
{
QCString df = optind+4<argc ? argv[optind+4] : QCString("Doxyfile");
if (!Config::parse(df)) // parse the config file
{
err("error opening or reading configuration file %s!\n",argv[optind+4]);
exit(1);
}
}
if (optind+3>=argc)
{
err("option \"-w html\" does not have enough arguments\n");
exit(1);
}
QCString outputLanguage=Config_getEnum(OUTPUT_LANGUAGE);
if (!setTranslator(outputLanguage))
{
warn_uncond("Output language %s not supported! Using English instead.\n", outputLanguage.data());
}
QFile f;
if (openOutputFile(argv[optind+1],f))
{
HtmlGenerator::writeHeaderFile(f, argv[optind+3]);
}
f.close();
if (openOutputFile(argv[optind+2],f))
{
}
f.close();
if (openOutputFile(argv[optind+3],f))
{
}
exit(0);
}
else if (qstricmp(formatName,"latex")==0)
{
if (optind+4<argc || QFileInfo("Doxyfile").exists())
{
QCString df = optind+4<argc ? argv[optind+4] : QCString("Doxyfile");
if (!Config::parse(df))
{
err("error opening or reading configuration file %s!\n",argv[optind+4]);
exit(1);
}
}
if (optind+3>=argc)
{
err("option \"-w latex\" does not have enough arguments\n");
exit(1);
}
QCString outputLanguage=Config_getEnum(OUTPUT_LANGUAGE);
if (!setTranslator(outputLanguage))
{
warn_uncond("Output language %s not supported! Using English instead.\n", outputLanguage.data());
}
QFile f;
if (openOutputFile(argv[optind+1],f))
{
}
f.close();
if (openOutputFile(argv[optind+2],f))
{
}
f.close();
if (openOutputFile(argv[optind+3],f))
{
}
exit(0);
}
else
{
err("Illegal format specifier \"%s\": should be one of rtf, html or latex\n",formatName);
exit(1);
}
break;
case 'm':
break;
case 'v':
msg("%s\n",versionString);
exit(0);
break;
case '-':
if (qstrcmp(&argv[optind][2],"help")==0)
{
usage(argv[0]);
exit(0);
}
else if (qstrcmp(&argv[optind][2],"version")==0)
{
msg("%s\n",versionString);
exit(0);
}
else
{
err("Unknown option \"-%s\"\n",&argv[optind][1]);
usage(argv[0]);
exit(1);
}
break;
case 'b':
setvbuf(stdout,NULL,_IONBF,0);
break;
case 'T':
msg("Warning: this option activates output generation via Django like template files. "
"This option is scheduled for doxygen 2.0, is currently incomplete and highly experimental! "
"Only use if you are a doxygen developer\n");
break;
case 'h':
case '?':
usage(argv[0]);
exit(0);
break;
default:
err("Unknown option \"-%c\"\n",argv[optind][1]);
usage(argv[0]);
exit(1);
}
optind++;
}
/**************************************************************************
* Parse or generate the config file *
**************************************************************************/
if (genConfig && g_useOutputTemplate)
{
generateTemplateFiles("templates");
exit(0);
}
if (genConfig)
{
generateConfigFile(configName,shortList);
exit(0);
}
if (genLayout)
{
exit(0);
}
QFileInfo configFileInfo1("Doxyfile"),configFileInfo2("doxyfile");
if (optind>=argc)
{
if (configFileInfo1.exists())
{
configName="Doxyfile";
}
else if (configFileInfo2.exists())
{
configName="doxyfile";
}
else
{
err("Doxyfile not found and no input file specified!\n");
usage(argv[0]);
exit(1);
}
}
else
{
QFileInfo fi(argv[optind]);
if (fi.exists() || qstrcmp(argv[optind],"-")==0)
{
configName=argv[optind];
}
else
{
err("configuration file %s not found!\n",argv[optind]);
usage(argv[0]);
exit(1);
}
}
if (!Config::parse(configName,updateConfig))
{
err("could not open or read configuration file %s!\n",configName);
exit(1);
}
if (updateConfig)
{
generateConfigFile(configName,shortList,TRUE);
exit(0);
}
/* Perlmod wants to know the path to the config file.*/
QFileInfo configFileInfo(configName);
setPerlModDoxyfile(configFileInfo.absFilePath().data());
}
int readDir ( QFileInfo *  fi,
FileNameList fnList,
FileNameDict fnDict,
StringDict exclDict,
QStrList *  patList,
QStrList *  exclPatList,
StringList resultList,
StringDict resultDict,
bool  errorIfNotExist,
bool  recursive,
QDict< void > *  killDict 
)
int readFileOrDirectory ( const char *  s,
FileNameList fnList,
FileNameDict fnDict,
StringDict exclDict,
QStrList *  patList,
QStrList *  exclPatList,
StringList resultList,
StringDict resultDict,
bool  recursive,
bool  errorIfNotExist = TRUE,
QDict< void > *  killDict = 0,
QDict< void > *  paths = 0 
)

Definition at line 9661 of file doxygen.cpp.

References Config_getBool, readDir(), and warn_uncond().

Referenced by searchInputFiles().

{
//printf("killDict=%p count=%d\n",killDict,killDict->count());
// strip trailing slashes
if (s==0) return 0;
QCString fs = s;
char lc = fs.at(fs.length()-1);
if (lc=='/' || lc=='\\') fs = fs.left(fs.length()-1);
QFileInfo fi(fs);
//printf("readFileOrDirectory(%s)\n",s);
int totalSize=0;
{
if (exclDict==0 || exclDict->find(fi.absFilePath().utf8())==0)
{
if (!fi.exists() || !fi.isReadable())
{
if (errorIfNotExist)
{
warn_uncond("source %s is not a readable file or directory... skipping.\n",s);
}
}
else if (!Config_getBool(EXCLUDE_SYMLINKS) || !fi.isSymLink())
{
if (fi.isFile())
{
QCString dirPath = fi.dirPath(TRUE).utf8();
QCString filePath = fi.absFilePath().utf8();
if (paths && paths->find(dirPath))
{
paths->insert(dirPath,(void*)0x8);
}
//printf("killDict->find(%s)\n",fi.absFilePath().data());
if (killDict==0 || killDict->find(filePath)==0)
{
totalSize+=fi.size()+fi.absFilePath().length()+4; //readFile(&fi,fiList,input);
//fiList->inSort(new FileInfo(fi));
QCString name=fi.fileName().utf8();
//printf("New file %s\n",name.data());
if (fnDict)
{
FileDef *fd=new FileDef(dirPath+"/",name);
FileName *fn=0;
if (!name.isEmpty() && (fn=(*fnDict)[name]))
{
fn->append(fd);
}
else
{
fn = new FileName(filePath,name);
fn->append(fd);
if (fnList) fnList->inSort(fn);
fnDict->insert(name,fn);
}
}
QCString *rs=0;
if (resultList || resultDict)
{
rs=new QCString(filePath);
if (resultList) resultList->append(rs);
if (resultDict) resultDict->insert(filePath,rs);
}
if (killDict) killDict->insert(fi.absFilePath().utf8(),(void *)0x8);
}
}
else if (fi.isDir()) // readable dir
{
totalSize+=readDir(&fi,fnList,fnDict,exclDict,patList,
exclPatList,resultList,resultDict,errorIfNotExist,
recursive,killDict,paths);
}
}
}
}
return totalSize;
}
void readFormulaRepository ( )

Definition at line 9753 of file doxygen.cpp.

References Config_getString, msg(), and warn_uncond().

Referenced by parseInput().

{
QFile f(Config_getString(HTML_OUTPUT)+"/formula.repository");
if (f.open(IO_ReadOnly)) // open repository
{
msg("Reading formula repository...\n");
QTextStream t(&f);
QCString line;
while (!t.eof())
{
line=t.readLine().utf8();
int se=line.find(':'); // find name and text separator.
if (se==-1)
{
warn_uncond("formula.repository is corrupted!\n");
break;
}
else
{
QCString formName = line.left(se);
QCString formText = line.right(line.length()-se-1);
Formula *f=new Formula(formText);
Doxygen::formulaList->setAutoDelete(TRUE);
Doxygen::formulaDict->insert(formText,f);
Doxygen::formulaNameDict->insert(formName,f);
}
}
}
}
void searchInputFiles ( StringList inputFiles)

Variable Documentation

QCString g_spaces