Doxygen
Loading...
Searching...
No Matches
doxygen.h File Reference
#include <mutex>
#include "containers.h"
#include "membergroup.h"
#include "dirdef.h"
#include "memberlist.h"
#include "define.h"
#include "cache.h"
#include "symbolmap.h"
#include "searchindex.h"
+ Include dependency graph for doxygen.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

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

Macros

#define THREAD_LOCAL   thread_local
 
#define AtomicInt   std::atomic_int
 

Typedefs

using InputFileEncodingList = std::vector<InputFileEncoding>
 
using ClangUsrMap = std::unordered_map<std::string,const Definition *>
 
using StaticInitMap = std::unordered_map<std::string,BodyInfo>
 
using NamespaceAliasInfoMap = std::unordered_map<std::string,NamespaceAliasInfo>
 

Functions

void initDoxygen ()
 
void readConfiguration (int argc, char **argv)
 
void checkConfiguration ()
 check and resolve config options
 
void adjustConfiguration ()
 adjust globals that depend on configuration settings.
 
void parseInput ()
 
void generateOutput ()
 
void cleanUpDoxygen ()
 
void readFileOrDirectory (const QCString &s, FileNameLinkedMap *fnDict, StringUnorderedSet *exclSet, const StringVector *patList, const StringVector *exclPatList, StringVector *resultList, StringUnorderedSet *resultSet, bool recursive, bool errorIfNotExist=TRUE, StringUnorderedSet *killSet=nullptr, StringUnorderedSet *paths=nullptr)
 

Macro Definition Documentation

◆ AtomicInt

#define AtomicInt   std::atomic_int

Definition at line 31 of file doxygen.h.

◆ THREAD_LOCAL

#define THREAD_LOCAL   thread_local

Definition at line 30 of file doxygen.h.

Referenced by LatexCodeGenerator::codify(), and removeRedundantWhiteSpace().

Typedef Documentation

◆ ClangUsrMap

using ClangUsrMap = std::unordered_map<std::string,const Definition *>

Definition at line 83 of file doxygen.h.

◆ InputFileEncodingList

Definition at line 81 of file doxygen.h.

◆ NamespaceAliasInfoMap

using NamespaceAliasInfoMap = std::unordered_map<std::string,NamespaceAliasInfo>

Definition at line 87 of file doxygen.h.

◆ StaticInitMap

using StaticInitMap = std::unordered_map<std::string,BodyInfo>

Definition at line 85 of file doxygen.h.

Function Documentation

◆ adjustConfiguration()

void adjustConfiguration ( )

adjust globals that depend on configuration settings.

Definition at line 11871 of file doxygen.cpp.

11872{
11873 AUTO_TRACE();
11874 Doxygen::globalNamespaceDef = createNamespaceDef("<globalScope>",1,1,"<globalScope>");
11884
11885 setTranslator(Config_getEnum(OUTPUT_LANGUAGE));
11886
11887 /* Set the global html file extension. */
11888 Doxygen::htmlFileExtension = Config_getString(HTML_FILE_EXTENSION);
11889
11890
11892 Config_getBool(CALLER_GRAPH) ||
11893 Config_getBool(REFERENCES_RELATION) ||
11894 Config_getBool(REFERENCED_BY_RELATION);
11895
11896 /**************************************************************************
11897 * Add custom extension mappings
11898 **************************************************************************/
11899
11900 const StringVector &extMaps = Config_getList(EXTENSION_MAPPING);
11901 for (const auto &mapping : extMaps)
11902 {
11903 QCString mapStr = mapping.c_str();
11904 int i=mapStr.find('=');
11905 if (i==-1)
11906 {
11907 continue;
11908 }
11909 else
11910 {
11911 QCString ext = mapStr.left(i).stripWhiteSpace().lower();
11912 QCString language = mapStr.mid(i+1).stripWhiteSpace().lower();
11913 if (ext.isEmpty() || language.isEmpty())
11914 {
11915 continue;
11916 }
11917
11918 if (!updateLanguageMapping(ext,language))
11919 {
11920 err("Failed to map file extension '%s' to unsupported language '%s'.\n"
11921 "Check the EXTENSION_MAPPING setting in the config file.\n",
11922 qPrint(ext),qPrint(language));
11923 }
11924 else
11925 {
11926 msg("Adding custom extension mapping: '%s' will be treated as language '%s'\n",
11927 qPrint(ext),qPrint(language));
11928 }
11929 }
11930 }
11931 // create input file exncodings
11932
11933 // check INPUT_ENCODING
11934 void *cd = portable_iconv_open("UTF-8",Config_getString(INPUT_ENCODING).data());
11935 if (cd==reinterpret_cast<void *>(-1))
11936 {
11937 term("unsupported character conversion: '%s'->'%s': %s\n"
11938 "Check the 'INPUT_ENCODING' setting in the config file!\n",
11939 qPrint(Config_getString(INPUT_ENCODING)),qPrint("UTF-8"),strerror(errno));
11940 }
11941 else
11942 {
11944 }
11945
11946 // check and split INPUT_FILE_ENCODING
11947 const StringVector &fileEncod = Config_getList(INPUT_FILE_ENCODING);
11948 for (const auto &mapping : fileEncod)
11949 {
11950 QCString mapStr = mapping.c_str();
11951 int i=mapStr.find('=');
11952 if (i==-1)
11953 {
11954 continue;
11955 }
11956 else
11957 {
11958 QCString pattern = mapStr.left(i).stripWhiteSpace().lower();
11959 QCString encoding = mapStr.mid(i+1).stripWhiteSpace().lower();
11960 if (pattern.isEmpty() || encoding.isEmpty())
11961 {
11962 continue;
11963 }
11964 cd = portable_iconv_open("UTF-8",encoding.data());
11965 if (cd==reinterpret_cast<void *>(-1))
11966 {
11967 term("unsupported character conversion: '%s'->'%s': %s\n"
11968 "Check the 'INPUT_FILE_ENCODING' setting in the config file!\n",
11969 qPrint(encoding),qPrint("UTF-8"),strerror(errno));
11970 }
11971 else
11972 {
11974 }
11975
11976 Doxygen::inputFileEncodingList.emplace_back(pattern, encoding);
11977 }
11978 }
11979
11980 // add predefined macro name to a dictionary
11981 const StringVector &expandAsDefinedList =Config_getList(EXPAND_AS_DEFINED);
11982 for (const auto &s : expandAsDefinedList)
11983 {
11984 Doxygen::expandAsDefinedSet.insert(s.c_str());
11985 }
11986
11987 // read aliases and store them in a dictionary
11988 readAliases();
11989
11990 // store number of spaces in a tab into Doxygen::spaces
11991 int tabSize = Config_getInt(TAB_SIZE);
11992 Doxygen::spaces.resize(tabSize);
11993 for (int sp=0; sp<tabSize; sp++) Doxygen::spaces.at(sp)=' ';
11994 Doxygen::spaces.at(tabSize)='\0';
11995}
void readAliases()
Definition aliases.cpp:170
static FileNameLinkedMap * plantUmlFileNameLinkedMap
Definition doxygen.h:110
static bool parseSourcesNeeded
Definition doxygen.h:123
static StringUnorderedSet expandAsDefinedSet
Definition doxygen.h:119
static FileNameLinkedMap * inputNameLinkedMap
Definition doxygen.h:105
static InputFileEncodingList inputFileEncodingList
Definition doxygen.h:140
static FileNameLinkedMap * dotFileNameLinkedMap
Definition doxygen.h:107
static NamespaceDefMutable * globalScope
Definition doxygen.h:121
static FileNameLinkedMap * imageNameLinkedMap
Definition doxygen.h:106
static FileNameLinkedMap * mscFileNameLinkedMap
Definition doxygen.h:108
static QCString spaces
Definition doxygen.h:135
static FileNameLinkedMap * diaFileNameLinkedMap
Definition doxygen.h:109
static QCString htmlFileExtension
Definition doxygen.h:122
static std::unique_ptr< NamespaceDef > globalNamespaceDef
Definition doxygen.h:120
static FileNameLinkedMap * includeNameLinkedMap
Definition doxygen.h:102
static FileNameLinkedMap * exampleNameLinkedMap
Definition doxygen.h:103
Ordered dictionary of FileName objects.
Definition filename.h:73
This is an alternative implementation of QCString.
Definition qcstring.h:101
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:226
QCString lower() const
Definition qcstring.h:234
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:245
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:159
QCString left(size_t len) const
Definition qcstring.h:214
#define Config_getInt(name)
Definition config.h:34
#define Config_getList(name)
Definition config.h:38
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
#define Config_getEnum(name)
Definition config.h:35
std::vector< std::string > StringVector
Definition containers.h:33
#define AUTO_TRACE(...)
Definition docnode.cpp:46
void setTranslator(OUTPUT_LANGUAGE_t langName)
Definition language.cpp:73
void msg(const char *fmt,...)
Definition message.cpp:98
#define err(fmt,...)
Definition message.h:84
#define term(fmt,...)
Definition message.h:94
std::unique_ptr< NamespaceDef > createNamespaceDef(const QCString &defFileName, int defLine, int defColumn, const QCString &name, const QCString &ref, const QCString &refFile, const QCString &type, bool isPublished)
Factory method to create new NamespaceDef instance.
NamespaceDefMutable * toNamespaceDefMutable(Definition *d)
int portable_iconv_close(void *cd)
void * portable_iconv_open(const char *tocode, const char *fromcode)
const char * qPrint(const char *s)
Definition qcstring.h:672
bool updateLanguageMapping(const QCString &extension, const QCString &language)
Definition util.cpp:5444

References AUTO_TRACE, Config_getBool, Config_getEnum, Config_getInt, Config_getList, Config_getString, createNamespaceDef(), QCString::data(), Doxygen::diaFileNameLinkedMap, Doxygen::dotFileNameLinkedMap, err, Doxygen::exampleNameLinkedMap, Doxygen::expandAsDefinedSet, QCString::find(), Doxygen::globalNamespaceDef, Doxygen::globalScope, Doxygen::htmlFileExtension, Doxygen::imageNameLinkedMap, Doxygen::includeNameLinkedMap, Doxygen::inputFileEncodingList, Doxygen::inputNameLinkedMap, QCString::isEmpty(), QCString::left(), QCString::lower(), QCString::mid(), Doxygen::mscFileNameLinkedMap, msg(), Doxygen::parseSourcesNeeded, Doxygen::plantUmlFileNameLinkedMap, portable_iconv_close(), portable_iconv_open(), qPrint(), readAliases(), setTranslator(), Doxygen::spaces, QCString::stripWhiteSpace(), term, toNamespaceDefMutable(), and updateLanguageMapping().

Referenced by main().

◆ checkConfiguration()

void checkConfiguration ( )

check and resolve config options

Definition at line 11860 of file doxygen.cpp.

11861{
11862 AUTO_TRACE();
11863
11868}
void initWarningFormat()
Definition message.cpp:41
void postProcess(bool clearHeaderAndFooter, CompareMode compareMode=CompareMode::Full)
void checkAndCorrect(bool quiet, const bool check)
void updateObsolete()
#define FALSE
Definition qcstring.h:34

References AUTO_TRACE, Config::checkAndCorrect(), Config_getBool, FALSE, initWarningFormat(), Config::postProcess(), and Config::updateObsolete().

Referenced by main().

◆ cleanUpDoxygen()

void cleanUpDoxygen ( )

Definition at line 11386 of file doxygen.cpp.

11387{
11391
11392 delete Doxygen::indexList;
11401 Doxygen::mainPage.reset();
11405 Doxygen::globalScope = nullptr;
11407 delete theTranslator;
11408 delete g_outputList;
11409
11414 delete Doxygen::dirLinkedMap;
11415 delete Doxygen::symbolMap;
11416}
static NamespaceLinkedMap * namespaceLinkedMap
Definition doxygen.h:115
static std::unique_ptr< PageDef > mainPage
Definition doxygen.h:101
static ParserManager * parserManager
Definition doxygen.h:131
static MemberNameLinkedMap * functionNameLinkedMap
Definition doxygen.h:112
static PageLinkedMap * exampleLinkedMap
Definition doxygen.h:99
static IndexList * indexList
Definition doxygen.h:134
static PageLinkedMap * pageLinkedMap
Definition doxygen.h:100
static DirLinkedMap * dirLinkedMap
Definition doxygen.h:129
static MemberNameLinkedMap * memberNameLinkedMap
Definition doxygen.h:111
static SymbolMap< Definition > * symbolMap
Definition doxygen.h:125
static GroupLinkedMap * groupLinkedMap
Definition doxygen.h:114
static FormulaManager & instance()
Definition formula.cpp:54
void clear()
Definition linkedmap.h:212
static ModuleManager & instance()
static SectionManager & instance()
returns a reference to the singleton
Definition section.h:175
static OutputList * g_outputList
Definition doxygen.cpp:181
Translator * theTranslator
Definition language.cpp:71

References FormulaManager::clear(), LinkedMap< T, Hash, KeyEqual, Map >::clear(), ModuleManager::clear(), Doxygen::diaFileNameLinkedMap, Doxygen::dirLinkedMap, Doxygen::dotFileNameLinkedMap, Doxygen::exampleLinkedMap, Doxygen::exampleNameLinkedMap, Doxygen::functionNameLinkedMap, g_outputList, Doxygen::globalNamespaceDef, Doxygen::globalScope, Doxygen::groupLinkedMap, Doxygen::imageNameLinkedMap, Doxygen::includeNameLinkedMap, Doxygen::indexList, Doxygen::inputNameLinkedMap, FormulaManager::instance(), ModuleManager::instance(), SectionManager::instance(), Doxygen::mainPage, Doxygen::memberNameLinkedMap, Doxygen::mscFileNameLinkedMap, Doxygen::namespaceLinkedMap, Doxygen::pageLinkedMap, Doxygen::parserManager, Doxygen::plantUmlFileNameLinkedMap, Doxygen::symbolMap, and theTranslator.

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

◆ generateOutput()

void generateOutput ( )

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

Definition at line 13033 of file doxygen.cpp.

13034{
13035 AUTO_TRACE();
13036 /**************************************************************************
13037 * Initialize output generators *
13038 **************************************************************************/
13039
13040 /// add extra languages for which we can only produce syntax highlighted code
13042
13043 //// dump all symbols
13044 if (g_dumpSymbolMap)
13045 {
13046 dumpSymbolMap();
13047 exit(0);
13048 }
13049
13050 bool generateHtml = Config_getBool(GENERATE_HTML);
13051 bool generateLatex = Config_getBool(GENERATE_LATEX);
13052 bool generateMan = Config_getBool(GENERATE_MAN);
13053 bool generateRtf = Config_getBool(GENERATE_RTF);
13054 bool generateDocbook = Config_getBool(GENERATE_DOCBOOK);
13055
13056
13058 if (generateHtml)
13059 {
13063 }
13064 if (generateLatex)
13065 {
13068 }
13069 if (generateDocbook)
13070 {
13073 }
13074 if (generateMan)
13075 {
13076 g_outputList->add<ManGenerator>();
13078 }
13079 if (generateRtf)
13080 {
13081 g_outputList->add<RTFGenerator>();
13083 }
13084 if (Config_getBool(USE_HTAGS))
13085 {
13087 QCString htmldir = Config_getString(HTML_OUTPUT);
13088 if (!Htags::execute(htmldir))
13089 err("USE_HTAGS is YES but htags(1) failed. \n");
13090 else if (!Htags::loadFilemap(htmldir))
13091 err("htags(1) ended normally but failed to load the filemap. \n");
13092 }
13093
13094 /**************************************************************************
13095 * Generate documentation *
13096 **************************************************************************/
13097
13098 g_s.begin("Generating style sheet...\n");
13099 //printf("writing style info\n");
13100 g_outputList->writeStyleInfo(0); // write first part
13101 g_s.end();
13102
13103 bool searchEngine = Config_getBool(SEARCHENGINE);
13104 bool serverBasedSearch = Config_getBool(SERVER_BASED_SEARCH);
13105
13106 g_s.begin("Generating search indices...\n");
13107 if (searchEngine && !serverBasedSearch && generateHtml)
13108 {
13110 }
13111
13112 // generate search indices (need to do this before writing other HTML
13113 // pages as these contain a drop down menu with options depending on
13114 // what categories we find in this function.
13115 if (generateHtml && searchEngine)
13116 {
13117 QCString searchDirName = Config_getString(HTML_OUTPUT)+"/search";
13118 Dir searchDir(searchDirName.str());
13119 if (!searchDir.exists() && !searchDir.mkdir(searchDirName.str()))
13120 {
13121 term("Could not create search results directory '%s' $PWD='%s'\n",
13122 qPrint(searchDirName),Dir::currentDirPath().c_str());
13123 }
13124 HtmlGenerator::writeSearchData(searchDirName);
13125 if (!serverBasedSearch) // client side search index
13126 {
13128 }
13129 }
13130 g_s.end();
13131
13132 // copy static stuff
13133 if (generateHtml)
13134 {
13137 copyLogo(Config_getString(HTML_OUTPUT));
13138 copyIcon(Config_getString(HTML_OUTPUT));
13139 copyExtraFiles(Config_getList(HTML_EXTRA_FILES),"HTML_EXTRA_FILES",Config_getString(HTML_OUTPUT));
13140 }
13141 if (generateLatex)
13142 {
13144 copyLogo(Config_getString(LATEX_OUTPUT));
13145 copyIcon(Config_getString(LATEX_OUTPUT));
13146 copyExtraFiles(Config_getList(LATEX_EXTRA_FILES),"LATEX_EXTRA_FILES",Config_getString(LATEX_OUTPUT));
13147 }
13148 if (generateDocbook)
13149 {
13150 copyLogo(Config_getString(DOCBOOK_OUTPUT));
13151 copyIcon(Config_getString(DOCBOOK_OUTPUT));
13152 }
13153 if (generateRtf)
13154 {
13155 copyLogo(Config_getString(RTF_OUTPUT));
13156 copyIcon(Config_getString(RTF_OUTPUT));
13157 copyExtraFiles(Config_getList(RTF_EXTRA_FILES),"RTF_EXTRA_FILES",Config_getString(RTF_OUTPUT));
13158 }
13159
13161 if (fm.hasFormulas() && generateHtml
13162 && !Config_getBool(USE_MATHJAX))
13163 {
13164 g_s.begin("Generating images for formulas in HTML...\n");
13165 fm.generateImages(Config_getString(HTML_OUTPUT), Config_getEnum(HTML_FORMULA_FORMAT)==HTML_FORMULA_FORMAT_t::svg ?
13167 g_s.end();
13168 }
13169 if (fm.hasFormulas() && generateRtf)
13170 {
13171 g_s.begin("Generating images for formulas in RTF...\n");
13173 g_s.end();
13174 }
13175
13176 if (fm.hasFormulas() && generateDocbook)
13177 {
13178 g_s.begin("Generating images for formulas in Docbook...\n");
13180 g_s.end();
13181 }
13182
13183 g_s.begin("Generating example documentation...\n");
13185 g_s.end();
13186
13187 g_s.begin("Generating file sources...\n");
13189 g_s.end();
13190
13191 g_s.begin("Generating file documentation...\n");
13193 g_s.end();
13194
13195 g_s.begin("Generating page documentation...\n");
13197 g_s.end();
13198
13199 g_s.begin("Generating group documentation...\n");
13201 g_s.end();
13202
13203 g_s.begin("Generating class documentation...\n");
13205 g_s.end();
13206
13207 g_s.begin("Generating concept documentation...\n");
13209 g_s.end();
13210
13211 g_s.begin("Generating module documentation...\n");
13213 g_s.end();
13214
13215 g_s.begin("Generating namespace documentation...\n");
13217 g_s.end();
13218
13219 if (Config_getBool(GENERATE_LEGEND))
13220 {
13221 g_s.begin("Generating graph info page...\n");
13223 g_s.end();
13224 }
13225
13226 g_s.begin("Generating directory documentation...\n");
13228 g_s.end();
13229
13230 if (g_outputList->size()>0)
13231 {
13233 }
13234
13235 g_s.begin("finalizing index lists...\n");
13236 Doxygen::indexList->finalize();
13237 g_s.end();
13238
13239 g_s.begin("writing tag file...\n");
13240 writeTagFile();
13241 g_s.end();
13242
13243 if (Config_getBool(GENERATE_XML))
13244 {
13245 g_s.begin("Generating XML output...\n");
13247 generateXML();
13249 g_s.end();
13250 }
13251 if (Config_getBool(GENERATE_SQLITE3))
13252 {
13253 g_s.begin("Generating SQLITE3 output...\n");
13255 g_s.end();
13256 }
13257
13258 if (Config_getBool(GENERATE_AUTOGEN_DEF))
13259 {
13260 g_s.begin("Generating AutoGen DEF output...\n");
13261 generateDEF();
13262 g_s.end();
13263 }
13264 if (Config_getBool(GENERATE_PERLMOD))
13265 {
13266 g_s.begin("Generating Perl module output...\n");
13268 g_s.end();
13269 }
13270 if (generateHtml && searchEngine && serverBasedSearch)
13271 {
13272 g_s.begin("Generating search index\n");
13273 if (Doxygen::searchIndex.kind()==SearchIndexIntf::Internal) // write own search index
13274 {
13276 Doxygen::searchIndex.write(Config_getString(HTML_OUTPUT)+"/search/search.idx");
13277 }
13278 else // write data for external search index
13279 {
13281 QCString searchDataFile = Config_getString(SEARCHDATA_FILE);
13282 if (searchDataFile.isEmpty())
13283 {
13284 searchDataFile="searchdata.xml";
13285 }
13286 if (!Portable::isAbsolutePath(searchDataFile.data()))
13287 {
13288 searchDataFile.prepend(Config_getString(OUTPUT_DIRECTORY)+"/");
13289 }
13290 Doxygen::searchIndex.write(searchDataFile);
13291 }
13292 g_s.end();
13293 }
13294
13295 if (generateRtf)
13296 {
13297 g_s.begin("Combining RTF output...\n");
13298 if (!RTFGenerator::preProcessFileInplace(Config_getString(RTF_OUTPUT),"refman.rtf"))
13299 {
13300 err("An error occurred during post-processing the RTF files!\n");
13301 }
13302 g_s.end();
13303 }
13304
13305 g_s.begin("Running plantuml with JAVA...\n");
13307 g_s.end();
13308
13309 if (Config_getBool(HAVE_DOT))
13310 {
13311 g_s.begin("Running dot...\n");
13313 g_s.end();
13314 }
13315
13316 if (generateHtml &&
13317 Config_getBool(GENERATE_HTMLHELP) &&
13318 !Config_getString(HHC_LOCATION).isEmpty())
13319 {
13320 g_s.begin("Running html help compiler...\n");
13322 g_s.end();
13323 }
13324
13325 if ( generateHtml &&
13326 Config_getBool(GENERATE_QHP) &&
13327 !Config_getString(QHG_LOCATION).isEmpty())
13328 {
13329 g_s.begin("Running qhelpgenerator...\n");
13331 g_s.end();
13332 }
13333
13334 g_outputList->cleanup();
13335
13336 msg("type lookup cache used %zu/%zu hits=%" PRIu64 " misses=%" PRIu64 "\n",
13338 Doxygen::typeLookupCache->capacity(),
13340 Doxygen::typeLookupCache->misses());
13341 msg("symbol lookup cache used %zu/%zu hits=%" PRIu64 " misses=%" PRIu64 "\n",
13343 Doxygen::symbolLookupCache->capacity(),
13345 Doxygen::symbolLookupCache->misses());
13346 int typeCacheParam = computeIdealCacheParam(static_cast<size_t>(Doxygen::typeLookupCache->misses()*2/3)); // part of the cache is flushed, hence the 2/3 correction factor
13347 int symbolCacheParam = computeIdealCacheParam(static_cast<size_t>(Doxygen::symbolLookupCache->misses()));
13348 int cacheParam = std::max(typeCacheParam,symbolCacheParam);
13349 if (cacheParam>Config_getInt(LOOKUP_CACHE_SIZE))
13350 {
13351 msg("Note: based on cache misses the ideal setting for LOOKUP_CACHE_SIZE is %d at the cost of higher memory usage.\n",cacheParam);
13352 }
13353
13355 {
13356
13357 std::size_t numThreads = static_cast<std::size_t>(Config_getInt(NUM_PROC_THREADS));
13358 if (numThreads<1) numThreads=1;
13359 msg("Total elapsed time: %.6f seconds\n(of which an average of %.6f seconds per thread waiting for external tools to finish)\n",
13360 (static_cast<double>(Debug::elapsedTime())),
13361 Portable::getSysElapsedTime()/static_cast<double>(numThreads)
13362 );
13363 g_s.print();
13364
13366 msg("finished...\n");
13368 }
13369 else
13370 {
13371 msg("finished...\n");
13372 }
13373
13374
13375 /**************************************************************************
13376 * Start cleaning up *
13377 **************************************************************************/
13378
13380
13382 Dir thisDir;
13383 thisDir.remove(Doxygen::filterDBFileName.str());
13385 exitTracing();
13387 delete Doxygen::clangUsrMap;
13389
13390 //dumpDocNodeSizes();
13391}
@ Time
Definition debug.h:34
static void clearFlag(const DebugMask mask)
Definition debug.cpp:125
static bool isFlagSet(const DebugMask mask)
Definition debug.cpp:135
static double elapsedTime()
Definition debug.cpp:204
static void setFlag(const DebugMask mask)
Definition debug.cpp:120
Class representing a directory in the file system.
Definition dir.h:75
static std::string currentDirPath()
Definition dir.cpp:340
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Definition dir.cpp:314
static void init()
bool run()
Definition dot.cpp:128
static DotManager * instance()
Definition dot.cpp:78
static Cache< std::string, LookupInfo > * typeLookupCache
Definition doxygen.h:127
static Cache< std::string, LookupInfo > * symbolLookupCache
Definition doxygen.h:128
static QCString filterDBFileName
Definition doxygen.h:133
static bool generatingXmlOutput
Definition doxygen.h:136
static SearchIndexIntf searchIndex
Definition doxygen.h:124
static ClangUsrMap * clangUsrMap
Definition doxygen.h:126
static void generateTreeViewImages()
Definition ftvhelp.cpp:851
bool hasFormulas() const
Definition formula.cpp:720
void generateImages(const QCString &outputDir, Format format, HighDPI hd=HighDPI::Off)
Definition formula.cpp:636
Generator for HTML output.
Definition htmlgen.h:95
static void init()
Definition htmlgen.cpp:1135
static void writeSearchPage()
Definition htmlgen.cpp:3071
static void writeTabData()
Additional initialization after indices have been created.
Definition htmlgen.cpp:1291
static void writeSearchData(const QCString &dir)
Definition htmlgen.cpp:1329
static void writeExternalSearchPage()
Definition htmlgen.cpp:3162
Generator for LaTeX output.
Definition latexgen.h:94
static void init()
Definition latexgen.cpp:628
Generator for Man page output.
Definition mangen.h:69
static void init()
Definition mangen.cpp:272
void writeDocumentation(OutputList &ol)
Class representing a list of output generators that are written to in parallel.
Definition outputlist.h:314
static PlantumlManager & instance()
Definition plantuml.cpp:156
void run()
Run plant UML tool for all images.
Definition plantuml.cpp:314
QCString & prepend(const char *s)
Definition qcstring.h:407
const std::string & str() const
Definition qcstring.h:537
Generator for RTF output.
Definition rtfgen.h:80
static void init()
Definition rtfgen.cpp:458
static bool preProcessFileInplace(const QCString &path, const QCString &name)
This is an API to a VERY brittle RTF preprocessor that combines nested RTF files.
Definition rtfgen.cpp:2457
void generateDEF()
Definition defgen.cpp:525
void generateDirDocs(OutputList &ol)
Definition dirdef.cpp:1146
static void copyLatexStyleSheet()
static void runQHelpGenerator()
class Statistics g_s
static void copyStyleSheet()
static void generateGroupDocs()
Definition doxygen.cpp:9999
static void generateExampleDocs()
Definition doxygen.cpp:9954
static void dumpSymbolMap()
static void generateFileDocs()
Definition doxygen.cpp:8616
static void copyIcon(const QCString &outputOption)
static void generatePageDocs()
Definition doxygen.cpp:9806
static void generateFileSources()
Definition doxygen.cpp:8450
static void copyLogo(const QCString &outputOption)
static void generateClassDocs()
Definition doxygen.cpp:9035
static int computeIdealCacheParam(size_t v)
static void copyExtraFiles(const StringVector &files, const QCString &filesOption, const QCString &outputOption)
static void runHtmlHelpCompiler()
static bool g_dumpSymbolMap
Definition doxygen.cpp:184
static bool g_successfulRun
Definition doxygen.cpp:183
static void generateNamespaceDocs()
static void writeTagFile()
void cleanUpDoxygen()
static void generateConceptDocs()
Definition doxygen.cpp:9061
void writeGraphInfo(OutputList &ol)
Definition index.cpp:3946
void writeIndexHierarchy(OutputList &ol)
Definition index.cpp:5587
void finishWarnExit()
Definition message.cpp:310
void deinit()
bool isAbsolutePath(const QCString &fileName)
Definition portable.cpp:514
double getSysElapsedTime()
Definition portable.cpp:98
void generatePerlMod()
#define TRUE
Definition qcstring.h:37
void finalizeSearchIndexer()
void createJavaScriptSearchIndex()
void writeJavaScriptSearchIndex()
void generateSqlite3()
static bool execute(const QCString &htmldir)
Definition htags.cpp:38
static bool loadFilemap(const QCString &htmldir)
Definition htags.cpp:107
static bool useHtags
Definition htags.h:23
void exitTracing()
Definition trace.cpp:52
void addCodeOnlyMappings()
Definition util.cpp:5543
void generateXML()
Definition xmlgen.cpp:2178

References addCodeOnlyMappings(), AUTO_TRACE, FormulaManager::Bitmap, Doxygen::clangUsrMap, cleanUpDoxygen(), Debug::clearFlag(), computeIdealCacheParam(), Config_getBool, Config_getEnum, Config_getInt, Config_getList, Config_getString, copyExtraFiles(), copyIcon(), copyLatexStyleSheet(), copyLogo(), copyStyleSheet(), createJavaScriptSearchIndex(), Dir::currentDirPath(), QCString::data(), Config::deinit(), dumpSymbolMap(), Debug::elapsedTime(), err, Htags::execute(), Dir::exists(), exitTracing(), FALSE, Doxygen::filterDBFileName, finalizeSearchIndexer(), finishWarnExit(), g_dumpSymbolMap, g_outputList, g_s, g_successfulRun, generateClassDocs(), generateConceptDocs(), generateDEF(), generateDirDocs(), generateExampleDocs(), generateFileDocs(), generateFileSources(), generateGroupDocs(), FormulaManager::generateImages(), generateNamespaceDocs(), generatePageDocs(), generatePerlMod(), generateSqlite3(), FTVHelp::generateTreeViewImages(), generateXML(), Doxygen::generatingXmlOutput, Portable::getSysElapsedTime(), FormulaManager::hasFormulas(), Doxygen::indexList, DocbookGenerator::init(), HtmlGenerator::init(), LatexGenerator::init(), ManGenerator::init(), RTFGenerator::init(), DotManager::instance(), FormulaManager::instance(), ModuleManager::instance(), PlantumlManager::instance(), SearchIndexIntf::Internal, Portable::isAbsolutePath(), QCString::isEmpty(), Debug::isFlagSet(), Htags::loadFilemap(), Dir::mkdir(), msg(), FormulaManager::On, QCString::prepend(), RTFGenerator::preProcessFileInplace(), qPrint(), Dir::remove(), DotManager::run(), PlantumlManager::run(), runHtmlHelpCompiler(), runQHelpGenerator(), Doxygen::searchIndex, Debug::setFlag(), QCString::str(), Doxygen::symbolLookupCache, term, Debug::Time, TRUE, Doxygen::typeLookupCache, Htags::useHtags, FormulaManager::Vector, ModuleManager::writeDocumentation(), HtmlGenerator::writeExternalSearchPage(), writeGraphInfo(), writeIndexHierarchy(), writeJavaScriptSearchIndex(), HtmlGenerator::writeSearchData(), HtmlGenerator::writeSearchPage(), HtmlGenerator::writeTabData(), and writeTagFile().

Referenced by main().

◆ initDoxygen()

void initDoxygen ( )

Definition at line 11317 of file doxygen.cpp.

11318{
11319 initResources();
11320 QCString lang = Portable::getenv("LC_ALL");
11321 if (!lang.isEmpty()) Portable::setenv("LANG",lang);
11322 std::setlocale(LC_ALL,"");
11323 std::setlocale(LC_CTYPE,"C"); // to get isspace(0xA0)==0, needed for UTF-8
11324 std::setlocale(LC_NUMERIC,"C");
11325
11327
11351
11352 // register any additional parsers here...
11353
11355
11356#if USE_LIBCLANG
11358#endif
11367 Doxygen::pageLinkedMap = new PageLinkedMap; // all doc pages
11368 Doxygen::exampleLinkedMap = new PageLinkedMap; // all examples
11369 //Doxygen::tagDestinationDict.setAutoDelete(TRUE);
11371
11372 // initialization of these globals depends on
11373 // configuration switches so we need to postpone these
11374 Doxygen::globalScope = nullptr;
11383
11384}
static void startTimer()
Definition debug.cpp:199
A linked map of directories.
Definition dirdef.h:172
static ConceptLinkedMap * conceptLinkedMap
Definition doxygen.h:98
static ClassLinkedMap * classLinkedMap
Definition doxygen.h:96
static ClassLinkedMap * hiddenClassLinkedMap
Definition doxygen.h:97
A list of index interfaces.
Definition indexlist.h:63
Ordered dictionary of MemberName objects.
Definition membername.h:63
Manages programming language parsers.
Definition parserintf.h:147
Class implementing a symbol map that maps symbol names to objects.
Definition symbolmap.h:32
std::function< std::unique_ptr< T >() > make_parser_factory()
void initResources()
std::unordered_map< std::string, const Definition * > ClangUsrMap
Definition doxygen.h:83
void setenv(const QCString &variable, const QCString &value)
Definition portable.cpp:303
QCString getenv(const QCString &variable)
Definition portable.cpp:338
void initDefaultExtensionMapping()
Definition util.cpp:5476

References Doxygen::clangUsrMap, Doxygen::classLinkedMap, Doxygen::conceptLinkedMap, Doxygen::diaFileNameLinkedMap, Doxygen::dirLinkedMap, Doxygen::dotFileNameLinkedMap, Doxygen::exampleLinkedMap, Doxygen::exampleNameLinkedMap, Doxygen::functionNameLinkedMap, Portable::getenv(), Doxygen::globalScope, Doxygen::groupLinkedMap, Doxygen::hiddenClassLinkedMap, Doxygen::imageNameLinkedMap, Doxygen::includeNameLinkedMap, Doxygen::indexList, initDefaultExtensionMapping(), initResources(), Doxygen::inputNameLinkedMap, QCString::isEmpty(), make_parser_factory(), Doxygen::memberNameLinkedMap, Doxygen::mscFileNameLinkedMap, Doxygen::namespaceLinkedMap, Doxygen::pageLinkedMap, Doxygen::parserManager, Doxygen::plantUmlFileNameLinkedMap, Portable::setenv(), Debug::startTimer(), and Doxygen::symbolMap.

Referenced by main().

◆ parseInput()

void parseInput ( )

Definition at line 12358 of file doxygen.cpp.

12359{
12360 AUTO_TRACE();
12361 std::atexit(exitDoxygen);
12362
12363 Portable::correctPath(Config_getList(EXTERNAL_TOOL_PATH));
12364
12365#if USE_LIBCLANG
12366 Doxygen::clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING);
12367#endif
12368
12369 // we would like to show the versionString earlier, but we first have to handle the configuration file
12370 // to know the value of the QUIET setting.
12371 QCString versionString = getFullVersion();
12372 msg("Doxygen version used: %s\n",qPrint(versionString));
12373
12375
12376 /**************************************************************************
12377 * Make sure the output directory exists
12378 **************************************************************************/
12379 QCString outputDirectory = Config_getString(OUTPUT_DIRECTORY);
12380 if (!g_singleComment)
12381 {
12382 if (outputDirectory.isEmpty())
12383 {
12384 outputDirectory = Config_updateString(OUTPUT_DIRECTORY,Dir::currentDirPath().c_str());
12385 }
12386 else
12387 {
12388 Dir dir(outputDirectory.str());
12389 if (!dir.exists())
12390 {
12391 dir.setPath(Dir::currentDirPath());
12392 if (!dir.mkdir(outputDirectory.str()))
12393 {
12394 term("tag OUTPUT_DIRECTORY: Output directory '%s' does not "
12395 "exist and cannot be created\n",qPrint(outputDirectory));
12396 }
12397 else
12398 {
12399 msg("Notice: Output directory '%s' does not exist. "
12400 "I have created it for you.\n", qPrint(outputDirectory));
12401 }
12402 dir.setPath(outputDirectory.str());
12403 }
12404 outputDirectory = Config_updateString(OUTPUT_DIRECTORY,dir.absPath().c_str());
12405 }
12406 }
12407 AUTO_TRACE_ADD("outputDirectory={}",outputDirectory);
12408
12409 /**************************************************************************
12410 * Initialize global lists and dictionaries
12411 **************************************************************************/
12412
12413 // also scale lookup cache with SYMBOL_CACHE_SIZE
12414 int cacheSize = Config_getInt(LOOKUP_CACHE_SIZE);
12415 if (cacheSize<0) cacheSize=0;
12416 if (cacheSize>9) cacheSize=9;
12417 uint32_t lookupSize = 65536 << cacheSize;
12420
12421#ifdef HAS_SIGNALS
12422 signal(SIGINT, stopDoxygen);
12423#endif
12424
12425 uint32_t pid = Portable::pid();
12426 Doxygen::filterDBFileName.sprintf("doxygen_filterdb_%d.tmp",pid);
12427 Doxygen::filterDBFileName.prepend(outputDirectory+"/");
12428
12429 /**************************************************************************
12430 * Check/create output directories *
12431 **************************************************************************/
12432
12433 bool generateHtml = Config_getBool(GENERATE_HTML);
12434 bool generateDocbook = Config_getBool(GENERATE_DOCBOOK);
12435 bool generateXml = Config_getBool(GENERATE_XML);
12436 bool generateLatex = Config_getBool(GENERATE_LATEX);
12437 bool generateRtf = Config_getBool(GENERATE_RTF);
12438 bool generateMan = Config_getBool(GENERATE_MAN);
12439 bool generateSql = Config_getBool(GENERATE_SQLITE3);
12440 QCString htmlOutput;
12441 QCString docbookOutput;
12442 QCString xmlOutput;
12443 QCString latexOutput;
12444 QCString rtfOutput;
12445 QCString manOutput;
12446 QCString sqlOutput;
12447
12448 if (!g_singleComment)
12449 {
12450 if (generateHtml)
12451 {
12452 htmlOutput = createOutputDirectory(outputDirectory,Config_getString(HTML_OUTPUT),"/html");
12453 Config_updateString(HTML_OUTPUT,htmlOutput);
12454
12455 QCString sitemapUrl = Config_getString(SITEMAP_URL);
12456 bool generateSitemap = !sitemapUrl.isEmpty();
12457 if (generateSitemap && !sitemapUrl.endsWith("/"))
12458 {
12459 Config_updateString(SITEMAP_URL,sitemapUrl+"/");
12460 }
12461
12462 // add HTML indexers that are enabled
12463 bool generateHtmlHelp = Config_getBool(GENERATE_HTMLHELP);
12464 bool generateEclipseHelp = Config_getBool(GENERATE_ECLIPSEHELP);
12465 bool generateQhp = Config_getBool(GENERATE_QHP);
12466 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
12467 bool generateDocSet = Config_getBool(GENERATE_DOCSET);
12468 if (generateEclipseHelp) Doxygen::indexList->addIndex<EclipseHelp>();
12469 if (generateHtmlHelp) Doxygen::indexList->addIndex<HtmlHelp>();
12470 if (generateQhp) Doxygen::indexList->addIndex<Qhp>();
12471 if (generateSitemap) Doxygen::indexList->addIndex<Sitemap>();
12472 if (generateTreeView) Doxygen::indexList->addIndex<FTVHelp>(TRUE);
12473 if (generateDocSet) Doxygen::indexList->addIndex<DocSets>();
12474 Doxygen::indexList->addIndex<Crawlmap>();
12475 Doxygen::indexList->initialize();
12476 }
12477
12478 if (generateDocbook)
12479 {
12480 docbookOutput = createOutputDirectory(outputDirectory,Config_getString(DOCBOOK_OUTPUT),"/docbook");
12481 Config_updateString(DOCBOOK_OUTPUT,docbookOutput);
12482 }
12483
12484 if (generateXml)
12485 {
12486 xmlOutput = createOutputDirectory(outputDirectory,Config_getString(XML_OUTPUT),"/xml");
12487 Config_updateString(XML_OUTPUT,xmlOutput);
12488 }
12489
12490 if (generateLatex)
12491 {
12492 latexOutput = createOutputDirectory(outputDirectory,Config_getString(LATEX_OUTPUT), "/latex");
12493 Config_updateString(LATEX_OUTPUT,latexOutput);
12494 }
12495
12496 if (generateRtf)
12497 {
12498 rtfOutput = createOutputDirectory(outputDirectory,Config_getString(RTF_OUTPUT),"/rtf");
12499 Config_updateString(RTF_OUTPUT,rtfOutput);
12500 }
12501
12502 if (generateMan)
12503 {
12504 manOutput = createOutputDirectory(outputDirectory,Config_getString(MAN_OUTPUT),"/man");
12505 Config_updateString(MAN_OUTPUT,manOutput);
12506 }
12507
12508 if (generateSql)
12509 {
12510 sqlOutput = createOutputDirectory(outputDirectory,Config_getString(SQLITE3_OUTPUT),"/sqlite3");
12511 Config_updateString(SQLITE3_OUTPUT,sqlOutput);
12512 }
12513 }
12514
12515 if (Config_getBool(HAVE_DOT))
12516 {
12517 QCString curFontPath = Config_getString(DOT_FONTPATH);
12518 if (curFontPath.isEmpty())
12519 {
12520 Portable::getenv("DOTFONTPATH");
12521 QCString newFontPath = ".";
12522 if (!curFontPath.isEmpty())
12523 {
12524 newFontPath+=Portable::pathListSeparator();
12525 newFontPath+=curFontPath;
12526 }
12527 Portable::setenv("DOTFONTPATH",qPrint(newFontPath));
12528 }
12529 else
12530 {
12531 Portable::setenv("DOTFONTPATH",qPrint(curFontPath));
12532 }
12533 }
12534
12535 /**************************************************************************
12536 * Handle layout file *
12537 **************************************************************************/
12538
12540 QCString layoutFileName = Config_getString(LAYOUT_FILE);
12541 bool defaultLayoutUsed = FALSE;
12542 if (layoutFileName.isEmpty())
12543 {
12544 layoutFileName = Config_updateString(LAYOUT_FILE,"DoxygenLayout.xml");
12545 defaultLayoutUsed = TRUE;
12546 }
12547 AUTO_TRACE_ADD("defaultLayoutUsed={}, layoutFileName={}",defaultLayoutUsed,layoutFileName);
12548
12549 FileInfo fi(layoutFileName.str());
12550 if (fi.exists())
12551 {
12552 msg("Parsing layout file %s...\n",qPrint(layoutFileName));
12553 LayoutDocManager::instance().parse(layoutFileName);
12554 }
12555 else if (!defaultLayoutUsed)
12556 {
12557 warn_uncond("failed to open layout file '%s' for reading! Using default settings.\n",qPrint(layoutFileName));
12558 }
12559 printLayout();
12560
12561 /**************************************************************************
12562 * Read and preprocess input *
12563 **************************************************************************/
12564
12565 // prevent search in the output directories
12566 StringVector exclPatterns = Config_getList(EXCLUDE_PATTERNS);
12567 if (generateHtml) exclPatterns.push_back(htmlOutput.str());
12568 if (generateDocbook) exclPatterns.push_back(docbookOutput.str());
12569 if (generateXml) exclPatterns.push_back(xmlOutput.str());
12570 if (generateLatex) exclPatterns.push_back(latexOutput.str());
12571 if (generateRtf) exclPatterns.push_back(rtfOutput.str());
12572 if (generateMan) exclPatterns.push_back(manOutput.str());
12573 Config_updateList(EXCLUDE_PATTERNS,exclPatterns);
12574
12575 if (!g_singleComment)
12576 {
12578
12580 }
12581
12582 // Notice: the order of the function calls below is very important!
12583
12584 if (generateHtml && !Config_getBool(USE_MATHJAX))
12585 {
12587 }
12588 if (generateRtf)
12589 {
12591 }
12592 if (generateDocbook)
12593 {
12595 }
12596
12598
12599 /**************************************************************************
12600 * Handle Tag Files *
12601 **************************************************************************/
12602
12603 std::shared_ptr<Entry> root = std::make_shared<Entry>();
12604
12605 if (!g_singleComment)
12606 {
12607 msg("Reading and parsing tag files\n");
12608 const StringVector &tagFileList = Config_getList(TAGFILES);
12609 for (const auto &s : tagFileList)
12610 {
12611 readTagFile(root,s.c_str());
12612 }
12613 }
12614
12615 /**************************************************************************
12616 * Parse source files *
12617 **************************************************************************/
12618
12619 addSTLSupport(root);
12620
12621 g_s.begin("Parsing files\n");
12622 if (g_singleComment)
12623 {
12624 //printf("Parsing comment %s\n",qPrint(g_commentFileName));
12625 if (g_commentFileName=="-")
12626 {
12627 std::string text = fileToString(g_commentFileName).str();
12628 addTerminalCharIfMissing(text,'\n');
12629 generateHtmlForComment("stdin.md",text);
12630 }
12631 else if (FileInfo(g_commentFileName.str()).isFile())
12632 {
12633 std::string text;
12635 addTerminalCharIfMissing(text,'\n');
12637 }
12638 else
12639 {
12640 }
12642 exit(0);
12643 }
12644 else
12645 {
12646 if (Config_getInt(NUM_PROC_THREADS)==1)
12647 {
12649 }
12650 else
12651 {
12653 }
12654 }
12655 g_s.end();
12656
12657 /**************************************************************************
12658 * Gather information *
12659 **************************************************************************/
12660
12661 g_s.begin("Building macro definition list...\n");
12663 g_s.end();
12664
12665 g_s.begin("Building group list...\n");
12666 buildGroupList(root.get());
12667 organizeSubGroups(root.get());
12668 g_s.end();
12669
12670 g_s.begin("Building directory list...\n");
12672 findDirDocumentation(root.get());
12673 g_s.end();
12674
12675 g_s.begin("Building namespace list...\n");
12676 buildNamespaceList(root.get());
12677 findUsingDirectives(root.get());
12678 g_s.end();
12679
12680 g_s.begin("Building file list...\n");
12681 buildFileList(root.get());
12682 g_s.end();
12683
12684 g_s.begin("Building class list...\n");
12685 buildClassList(root.get());
12686 g_s.end();
12687
12688 g_s.begin("Building concept list...\n");
12689 buildConceptList(root.get());
12690 g_s.end();
12691
12692 // build list of using declarations here (global list)
12693 buildListOfUsingDecls(root.get());
12694 g_s.end();
12695
12696 g_s.begin("Computing nesting relations for classes...\n");
12698 g_s.end();
12699 // 1.8.2-20121111: no longer add nested classes to the group as well
12700 //distributeClassGroupRelations();
12701
12702 // calling buildClassList may result in cached relations that
12703 // become invalid after resolveClassNestingRelations(), that's why
12704 // we need to clear the cache here
12705 Doxygen::typeLookupCache->clear();
12706 // we don't need the list of using declaration anymore
12707 g_usingDeclarations.clear();
12708
12709 g_s.begin("Associating documentation with classes...\n");
12710 buildClassDocList(root.get());
12711 g_s.end();
12712
12713 g_s.begin("Associating documentation with concepts...\n");
12714 buildConceptDocList(root.get());
12716 g_s.end();
12717
12718 g_s.begin("Associating documentation with modules...\n");
12719 findModuleDocumentation(root.get());
12720 g_s.end();
12721
12722 g_s.begin("Building example list...\n");
12723 buildExampleList(root.get());
12724 g_s.end();
12725
12726 g_s.begin("Searching for enumerations...\n");
12727 findEnums(root.get());
12728 g_s.end();
12729
12730 // Since buildVarList calls isVarWithConstructor
12731 // and this calls getResolvedClass we need to process
12732 // typedefs first so the relations between classes via typedefs
12733 // are properly resolved. See bug 536385 for an example.
12734 g_s.begin("Searching for documented typedefs...\n");
12735 buildTypedefList(root.get());
12736 g_s.end();
12737
12738 if (Config_getBool(OPTIMIZE_OUTPUT_SLICE))
12739 {
12740 g_s.begin("Searching for documented sequences...\n");
12741 buildSequenceList(root.get());
12742 g_s.end();
12743
12744 g_s.begin("Searching for documented dictionaries...\n");
12745 buildDictionaryList(root.get());
12746 g_s.end();
12747 }
12748
12749 g_s.begin("Searching for members imported via using declarations...\n");
12750 // this should be after buildTypedefList in order to properly import
12751 // used typedefs
12752 findUsingDeclarations(root.get(),TRUE); // do for python packages first
12753 findUsingDeclarations(root.get(),FALSE); // then the rest
12754 g_s.end();
12755
12756 g_s.begin("Searching for included using directives...\n");
12758 g_s.end();
12759
12760 g_s.begin("Searching for documented variables...\n");
12761 buildVarList(root.get());
12762 g_s.end();
12763
12764 g_s.begin("Building interface member list...\n");
12765 buildInterfaceAndServiceList(root.get()); // UNO IDL
12766
12767 g_s.begin("Building member list...\n"); // using class info only !
12768 buildFunctionList(root.get());
12769 g_s.end();
12770
12771 g_s.begin("Searching for friends...\n");
12772 findFriends();
12773 g_s.end();
12774
12775 g_s.begin("Searching for documented defines...\n");
12776 findDefineDocumentation(root.get());
12777 g_s.end();
12778
12779 g_s.begin("Computing class inheritance relations...\n");
12780 findClassEntries(root.get());
12782 g_s.end();
12783
12784 g_s.begin("Computing class usage relations...\n");
12786 g_s.end();
12787
12788 if (Config_getBool(INLINE_SIMPLE_STRUCTS))
12789 {
12790 g_s.begin("Searching for tag less structs...\n");
12792 g_s.end();
12793 }
12794
12795 g_s.begin("Flushing cached template relations that have become invalid...\n");
12797 g_s.end();
12798
12799 g_s.begin("Warn for undocumented namespaces...\n");
12801 g_s.end();
12802
12803 g_s.begin("Computing class relations...\n");
12806 if (Config_getBool(OPTIMIZE_OUTPUT_VHDL))
12807 {
12809 }
12811 g_classEntries.clear();
12812 g_s.end();
12813
12814 g_s.begin("Add enum values to enums...\n");
12815 addEnumValuesToEnums(root.get());
12816 findEnumDocumentation(root.get());
12817 g_s.end();
12818
12819 g_s.begin("Searching for member function documentation...\n");
12820 findObjCMethodDefinitions(root.get());
12821 findMemberDocumentation(root.get()); // may introduce new members !
12822 findUsingDeclImports(root.get()); // may introduce new members !
12823 g_usingClassMap.clear();
12827 g_s.end();
12828
12829 // moved to after finding and copying documentation,
12830 // as this introduces new members see bug 722654
12831 g_s.begin("Creating members for template instances...\n");
12833 g_s.end();
12834
12835 g_s.begin("Building page list...\n");
12836 buildPageList(root.get());
12837 g_s.end();
12838
12839 g_s.begin("Search for main page...\n");
12840 findMainPage(root.get());
12841 findMainPageTagFiles(root.get());
12842 g_s.end();
12843
12844 g_s.begin("Computing page relations...\n");
12845 computePageRelations(root.get());
12847 g_s.end();
12848
12849 g_s.begin("Determining the scope of groups...\n");
12850 findGroupScope(root.get());
12851 g_s.end();
12852
12853 g_s.begin("Computing module relations...\n");
12854 auto &mm = ModuleManager::instance();
12855 mm.resolvePartitions();
12856 mm.resolveImports();
12857 mm.collectExportedSymbols();
12858 g_s.end();
12859
12860 auto memberNameComp = [](const MemberNameLinkedMap::Ptr &n1,const MemberNameLinkedMap::Ptr &n2)
12861 {
12862 return qstricmp_sort(n1->memberName().data()+getPrefixIndex(n1->memberName()),
12863 n2->memberName().data()+getPrefixIndex(n2->memberName())
12864 )<0;
12865 };
12866
12867 auto classComp = [](const ClassLinkedMap::Ptr &c1,const ClassLinkedMap::Ptr &c2)
12868 {
12869 if (Config_getBool(SORT_BY_SCOPE_NAME))
12870 {
12871 return qstricmp_sort(c1->name(), c2->name())<0;
12872 }
12873 else
12874 {
12875 int i = qstricmp_sort(c1->className(), c2->className());
12876 return i==0 ? qstricmp_sort(c1->name(), c2->name())<0 : i<0;
12877 }
12878 };
12879
12880 auto namespaceComp = [](const NamespaceLinkedMap::Ptr &n1,const NamespaceLinkedMap::Ptr &n2)
12881 {
12882 return qstricmp_sort(n1->name(),n2->name())<0;
12883 };
12884
12885 auto conceptComp = [](const ConceptLinkedMap::Ptr &c1,const ConceptLinkedMap::Ptr &c2)
12886 {
12887 return qstricmp_sort(c1->name(),c2->name())<0;
12888 };
12889
12890 g_s.begin("Sorting lists...\n");
12891 std::stable_sort(Doxygen::memberNameLinkedMap->begin(),
12893 memberNameComp);
12894 std::stable_sort(Doxygen::functionNameLinkedMap->begin(),
12896 memberNameComp);
12897 std::stable_sort(Doxygen::hiddenClassLinkedMap->begin(),
12899 classComp);
12900 std::stable_sort(Doxygen::classLinkedMap->begin(),
12902 classComp);
12903 std::stable_sort(Doxygen::conceptLinkedMap->begin(),
12905 conceptComp);
12906 std::stable_sort(Doxygen::namespaceLinkedMap->begin(),
12908 namespaceComp);
12909 g_s.end();
12910
12911 g_s.begin("Determining which enums are documented\n");
12913 g_s.end();
12914
12915 g_s.begin("Computing member relations...\n");
12918 g_s.end();
12919
12920 g_s.begin("Building full member lists recursively...\n");
12922 g_s.end();
12923
12924 g_s.begin("Adding members to member groups.\n");
12926 g_s.end();
12927
12928 if (Config_getBool(DISTRIBUTE_GROUP_DOC))
12929 {
12930 g_s.begin("Distributing member group documentation.\n");
12932 g_s.end();
12933 }
12934
12935 g_s.begin("Computing member references...\n");
12937 g_s.end();
12938
12939 if (Config_getBool(INHERIT_DOCS))
12940 {
12941 g_s.begin("Inheriting documentation...\n");
12943 g_s.end();
12944 }
12945
12946
12947 // compute the shortest possible names of all files
12948 // without losing the uniqueness of the file names.
12949 g_s.begin("Generating disk names...\n");
12951 g_s.end();
12952
12953 g_s.begin("Adding source references...\n");
12955 g_s.end();
12956
12957 g_s.begin("Adding xrefitems...\n");
12960 g_s.end();
12961
12962 g_s.begin("Sorting member lists...\n");
12964 g_s.end();
12965
12966 g_s.begin("Setting anonymous enum type...\n");
12968 g_s.end();
12969
12970 g_s.begin("Computing dependencies between directories...\n");
12972 g_s.end();
12973
12974 g_s.begin("Generating citations page...\n");
12976 g_s.end();
12977
12978 g_s.begin("Counting members...\n");
12979 countMembers();
12980 g_s.end();
12981
12982 g_s.begin("Counting data structures...\n");
12984 g_s.end();
12985
12986 g_s.begin("Resolving user defined references...\n");
12988 g_s.end();
12989
12990 g_s.begin("Finding anchors and sections in the documentation...\n");
12992 g_s.end();
12993
12994 g_s.begin("Transferring function references...\n");
12996 g_s.end();
12997
12998 g_s.begin("Combining using relations...\n");
13000 g_s.end();
13001
13003 g_s.begin("Adding members to index pages...\n");
13005 addToIndices();
13006 g_s.end();
13007
13008 g_s.begin("Correcting members for VHDL...\n");
13010 g_s.end();
13011
13012 g_s.begin("Computing tooltip texts...\n");
13014 g_s.end();
13015
13016 if (Config_getBool(SORT_GROUP_NAMES))
13017 {
13018 std::stable_sort(Doxygen::groupLinkedMap->begin(),
13020 [](const auto &g1,const auto &g2)
13021 { return g1->groupTitle() < g2->groupTitle(); });
13022
13023 for (const auto &gd : *Doxygen::groupLinkedMap)
13024 {
13025 gd->sortSubGroups();
13026 }
13027 }
13028
13029 printNavTree(root.get(),0);
13031}
Definition cache.h:32
static CitationManager & instance()
Definition cite.cpp:80
void generatePage()
Generate the citations page.
Definition cite.cpp:327
A class that generates docset files.
Definition docsets.h:36
static bool clangAssistedParsing
Definition doxygen.h:138
Generator for Eclipse help files.
Definition eclipsehelp.h:44
A class that generates a dynamic tree view side panel.
Definition ftvhelp.h:41
Minimal replacement for QFileInfo.
Definition fileinfo.h:23
bool isFile() const
Definition fileinfo.cpp:63
void initFromRepository(const QCString &dir)
Definition formula.cpp:60
void checkRepositories()
Definition formula.cpp:173
A class that generated the HTML Help specific files.
Definition htmlhelp.h:36
static Index & instance()
Definition index.cpp:106
void countDataStructures()
Definition index.cpp:262
static LayoutDocManager & instance()
Returns a reference to this singleton.
Definition layout.cpp:1423
void parse(const QCString &fileName, const char *data=nullptr)
Parses a user provided layout.
Definition layout.cpp:1459
std::unique_ptr< MemberName > Ptr
Definition linkedmap.h:38
bool endsWith(const char *s) const
Definition qcstring.h:509
Definition qhp.h:27
static void computeVhdlComponentRelations()
#define Config_updateString(name, value)
Definition config.h:39
#define Config_updateList(name,...)
Definition config.h:43
DirIterator begin(DirIterator it) noexcept
Definition dir.cpp:170
DirIterator end(const DirIterator &) noexcept
Definition dir.cpp:175
void buildDirectories()
Definition dirdef.cpp:1055
void computeDirDependencies()
Definition dirdef.cpp:1129
#define AUTO_TRACE_ADD(...)
Definition docnode.cpp:47
static void findInheritedTemplateInstances()
Definition doxygen.cpp:5203
void printNavTree(Entry *root, int indent)
Definition doxygen.cpp:9856
static void buildGroupList(const Entry *root)
Definition doxygen.cpp:418
static void findUsingDeclarations(const Entry *root, bool filterPythonPackages)
Definition doxygen.cpp:1984
static void flushCachedTemplateRelations()
Definition doxygen.cpp:9272
static void computeTemplateClassRelations()
Definition doxygen.cpp:5299
void printSectionsTree()
Definition doxygen.cpp:9937
static void generateXRefPages()
Definition doxygen.cpp:5471
static void findUsingDeclImports(const Entry *root)
Definition doxygen.cpp:2137
static void findDirDocumentation(const Entry *root)
Definition doxygen.cpp:9516
static void warnUndocumentedNamespaces()
Definition doxygen.cpp:5250
static void buildConceptList(const Entry *root)
Definition doxygen.cpp:1254
static void resolveClassNestingRelations()
Definition doxygen.cpp:1309
static void findClassEntries(const Entry *root)
Definition doxygen.cpp:5173
static void vhdlCorrectMemberProperties()
Definition doxygen.cpp:8254
static void stopDoxygen(int)
static void computeMemberReferences()
Definition doxygen.cpp:5368
static void transferRelatedFunctionDocumentation()
Definition doxygen.cpp:4332
static void addMembersToMemberGroup()
Definition doxygen.cpp:9142
static void findMainPageTagFiles(Entry *root)
Definition doxygen.cpp:9676
static void distributeConceptGroups()
Definition doxygen.cpp:1276
static void transferFunctionDocumentation()
Definition doxygen.cpp:4251
static void setAnonymousEnumType()
Definition doxygen.cpp:8889
static void sortMemberLists()
Definition doxygen.cpp:8794
static void createTemplateInstanceMembers()
Definition doxygen.cpp:8379
void transferStaticInstanceInitializers()
Definition doxygen.cpp:4381
static void findObjCMethodDefinitions(const Entry *root)
Definition doxygen.cpp:7412
static void buildTypedefList(const Entry *root)
Definition doxygen.cpp:3326
static void findGroupScope(const Entry *root)
Definition doxygen.cpp:433
static void findDefineDocumentation(Entry *root)
Definition doxygen.cpp:9423
static void findMemberDocumentation(const Entry *root)
Definition doxygen.cpp:7382
static void distributeMemberGroupDocumentation()
Definition doxygen.cpp:9180
static void addEnumValuesToEnums(const Entry *root)
Definition doxygen.cpp:7611
static void resolveUserReferences()
Definition doxygen.cpp:9738
static void buildVarList(const Entry *root)
Definition doxygen.cpp:3462
static void buildSequenceList(const Entry *root)
Definition doxygen.cpp:3425
static void buildNamespaceList(const Entry *root)
Definition doxygen.cpp:1649
static void readTagFile(const std::shared_ptr< Entry > &root, const QCString &tagLine)
static void findIncludedUsingDirectives()
Definition doxygen.cpp:2387
static void countMembers()
Definition doxygen.cpp:8903
static void organizeSubGroups(const Entry *root)
Definition doxygen.cpp:477
void searchInputFiles()
static void findFriends()
Definition doxygen.cpp:4154
static void findEnums(const Entry *root)
Definition doxygen.cpp:7440
static void addListReferences()
Definition doxygen.cpp:5402
static void exitDoxygen() noexcept
static void addMembersToIndex()
Definition doxygen.cpp:8044
static void findMainPage(Entry *root)
Definition doxygen.cpp:9606
static void findUsingDirectives(const Entry *root)
Definition doxygen.cpp:1829
static void addSourceReferences()
Definition doxygen.cpp:8676
static void buildExampleList(Entry *root)
Definition doxygen.cpp:9823
static void inheritDocumentation()
Definition doxygen.cpp:9082
static void flushUnresolvedRelations()
Definition doxygen.cpp:9326
static QCString g_commentFileName
Definition doxygen.cpp:185
static void findDocumentedEnumValues()
Definition doxygen.cpp:8036
static void findTagLessClasses()
Definition doxygen.cpp:1625
static void generateDiskNames()
static void addToIndices()
Definition doxygen.cpp:8086
static void computeClassRelations()
Definition doxygen.cpp:5270
static void buildFunctionList(const Entry *root)
Definition doxygen.cpp:3852
static void checkPageRelations()
Definition doxygen.cpp:9718
static void findModuleDocumentation(const Entry *root)
Definition doxygen.cpp:1244
static void findEnumDocumentation(const Entry *root)
Definition doxygen.cpp:7921
static void computePageRelations(Entry *root)
Definition doxygen.cpp:9688
static QCString createOutputDirectory(const QCString &baseDirName, const QCString &formatDirName, const char *defaultDirName)
static StringSet g_usingDeclarations
Definition doxygen.cpp:182
static void buildDictionaryList(const Entry *root)
Definition doxygen.cpp:3443
static void buildClassDocList(const Entry *root)
Definition doxygen.cpp:1115
static void buildPageList(Entry *root)
Definition doxygen.cpp:9579
static void computeVerifiedDotPath()
static bool g_singleComment
Definition doxygen.cpp:186
static void findSectionsInDocumentation()
Definition doxygen.cpp:9218
static void mergeCategories()
Definition doxygen.cpp:8398
void printLayout()
Definition doxygen.cpp:9894
static void buildFileList(const Entry *root)
Definition doxygen.cpp:489
static void buildClassList(const Entry *root)
Definition doxygen.cpp:1105
static void findUsedTemplateInstances()
Definition doxygen.cpp:5234
static void computeTooltipTexts()
Definition doxygen.cpp:8843
static void parseFilesSingleThreading(const std::shared_ptr< Entry > &root)
parse the list of input files
static void buildCompleteMemberLists()
Definition doxygen.cpp:8420
static void combineUsingRelations()
Definition doxygen.cpp:9117
static void checkMarkdownMainfile()
static std::unordered_map< std::string, std::vector< ClassDefMutable * > > g_usingClassMap
Definition doxygen.cpp:2135
static void buildConceptDocList(const Entry *root)
Definition doxygen.cpp:1264
static void parseFilesMultiThreading(const std::shared_ptr< Entry > &root)
parse the list of input files
static void transferFunctionReferences()
Definition doxygen.cpp:4284
static void buildDefineList()
Definition doxygen.cpp:8755
static void buildInterfaceAndServiceList(const Entry *root)
Definition doxygen.cpp:3556
static void computeMemberRelations()
Definition doxygen.cpp:8363
static void buildListOfUsingDecls(const Entry *root)
Definition doxygen.cpp:1971
static std::multimap< std::string, const Entry * > g_classEntries
Definition doxygen.cpp:179
#define warn_uncond(fmt,...)
Definition message.h:79
void correctPath(const StringVector &list)
Correct a possible wrong PATH variable.
Definition portable.cpp:533
QCString pathListSeparator()
Definition portable.cpp:400
uint32_t pid()
Definition portable.cpp:265
int qstricmp_sort(const char *str1, const char *str2)
Definition qcstring.h:86
void initSearchIndexer()
void generateHtmlForComment(const std::string &fn, const std::string &text)
Helper for implemented the -c option of doxygen, which produces HTML output for a given doxygen forma...
void addSTLSupport(std::shared_ptr< Entry > &root)
Add stub entries for the most used classes in the standard template library.
void addTerminalCharIfMissing(std::string &s, char c)
Definition stringutil.h:84
bool readInputFile(const QCString &fileName, std::string &contents, bool filter, bool isSourceCode)
read a file name fileName and optionally filter and transcode it
Definition util.cpp:5841
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
Definition util.cpp:1414
int getPrefixIndex(const QCString &name)
Definition util.cpp:3590

References Dir::absPath(), addEnumValuesToEnums(), addListReferences(), addMembersToIndex(), addMembersToMemberGroup(), addSourceReferences(), addSTLSupport(), addTerminalCharIfMissing(), addToIndices(), AUTO_TRACE, AUTO_TRACE_ADD, begin(), buildClassDocList(), buildClassList(), buildCompleteMemberLists(), buildConceptDocList(), buildConceptList(), buildDefineList(), buildDictionaryList(), buildDirectories(), buildExampleList(), buildFileList(), buildFunctionList(), buildGroupList(), buildInterfaceAndServiceList(), buildListOfUsingDecls(), buildNamespaceList(), buildPageList(), buildSequenceList(), buildTypedefList(), buildVarList(), checkMarkdownMainfile(), checkPageRelations(), FormulaManager::checkRepositories(), Doxygen::clangAssistedParsing, Doxygen::classLinkedMap, cleanUpDoxygen(), combineUsingRelations(), computeClassRelations(), computeDirDependencies(), computeMemberReferences(), computeMemberRelations(), computePageRelations(), computeTemplateClassRelations(), computeTooltipTexts(), computeVerifiedDotPath(), VhdlDocGen::computeVhdlComponentRelations(), Doxygen::conceptLinkedMap, Config_getBool, Config_getInt, Config_getList, Config_getString, Config_updateList, Config_updateString, Portable::correctPath(), Index::countDataStructures(), countMembers(), createOutputDirectory(), createTemplateInstanceMembers(), Dir::currentDirPath(), distributeConceptGroups(), distributeMemberGroupDocumentation(), end(), QCString::endsWith(), Dir::exists(), FileInfo::exists(), exitDoxygen(), FALSE, fileToString(), Doxygen::filterDBFileName, findClassEntries(), findDefineDocumentation(), findDirDocumentation(), findDocumentedEnumValues(), findEnumDocumentation(), findEnums(), findFriends(), findGroupScope(), findIncludedUsingDirectives(), findInheritedTemplateInstances(), findMainPage(), findMainPageTagFiles(), findMemberDocumentation(), findModuleDocumentation(), findObjCMethodDefinitions(), findSectionsInDocumentation(), findTagLessClasses(), findUsedTemplateInstances(), findUsingDeclarations(), findUsingDeclImports(), findUsingDirectives(), flushCachedTemplateRelations(), flushUnresolvedRelations(), Doxygen::functionNameLinkedMap, g_classEntries, g_commentFileName, g_s, g_singleComment, g_usingClassMap, g_usingDeclarations, generateDiskNames(), generateHtmlForComment(), CitationManager::generatePage(), generateXRefPages(), Portable::getenv(), getPrefixIndex(), Doxygen::groupLinkedMap, Doxygen::hiddenClassLinkedMap, Doxygen::indexList, inheritDocumentation(), LayoutDocManager::init(), FormulaManager::initFromRepository(), initSearchIndexer(), CitationManager::instance(), FormulaManager::instance(), Index::instance(), LayoutDocManager::instance(), ModuleManager::instance(), QCString::isEmpty(), FileInfo::isFile(), Doxygen::memberNameLinkedMap, mergeCategories(), Dir::mkdir(), msg(), Doxygen::namespaceLinkedMap, organizeSubGroups(), LayoutDocManager::parse(), parseFilesMultiThreading(), parseFilesSingleThreading(), Portable::pathListSeparator(), Portable::pid(), printLayout(), printNavTree(), printSectionsTree(), qPrint(), qstricmp_sort(), readInputFile(), readTagFile(), resolveClassNestingRelations(), resolveUserReferences(), searchInputFiles(), setAnonymousEnumType(), Portable::setenv(), Dir::setPath(), sortMemberLists(), stopDoxygen(), QCString::str(), Doxygen::symbolLookupCache, term, transferFunctionDocumentation(), transferFunctionReferences(), transferRelatedFunctionDocumentation(), transferStaticInstanceInitializers(), TRUE, Doxygen::typeLookupCache, vhdlCorrectMemberProperties(), warn_uncond, and warnUndocumentedNamespaces().

Referenced by main().

◆ readConfiguration()

void readConfiguration ( int argc,
char ** argv )

Definition at line 11430 of file doxygen.cpp.

11431{
11432 QCString versionString = getFullVersion();
11433
11434 // helper that calls \a func to write to file \a fileName via a TextStream
11435 auto writeFile = [](const char *fileName,std::function<void(TextStream&)> func) -> bool
11436 {
11437 std::ofstream f;
11438 if (openOutputFile(fileName,f))
11439 {
11440 TextStream t(&f);
11441 func(t);
11442 return true;
11443 }
11444 return false;
11445 };
11446
11447
11448 /**************************************************************************
11449 * Handle arguments *
11450 **************************************************************************/
11451
11452 int optInd=1;
11453 QCString configName;
11454 QCString traceName;
11455 bool genConfig=false;
11456 bool shortList=false;
11457 bool traceTiming=false;
11459 bool updateConfig=false;
11460 bool quiet = false;
11461 while (optInd<argc && argv[optInd][0]=='-' &&
11462 (isalpha(argv[optInd][1]) || argv[optInd][1]=='?' ||
11463 argv[optInd][1]=='-')
11464 )
11465 {
11466 switch(argv[optInd][1])
11467 {
11468 case 'g':
11469 {
11470 genConfig=TRUE;
11471 }
11472 break;
11473 case 'l':
11474 {
11475 QCString layoutName;
11476 if (optInd+1>=argc)
11477 {
11478 layoutName="DoxygenLayout.xml";
11479 }
11480 else
11481 {
11482 layoutName=argv[optInd+1];
11483 }
11484 writeDefaultLayoutFile(layoutName);
11486 exit(0);
11487 }
11488 break;
11489 case 'c':
11490 if (optInd+1>=argc) // no file name given
11491 {
11492 err("option \"-c\" is missing the file name to read\n");
11493 devUsage();
11495 exit(1);
11496 }
11497 else
11498 {
11499 g_commentFileName=argv[optInd+1];
11500 optInd++;
11501 }
11502 g_singleComment=true;
11503 quiet=true;
11504 break;
11505 case 'd':
11506 {
11507 QCString debugLabel=getArg(argc,argv,optInd);
11508 if (debugLabel.isEmpty())
11509 {
11510 devUsage();
11512 exit(0);
11513 }
11514 int retVal = Debug::setFlagStr(debugLabel);
11515 if (!retVal)
11516 {
11517 err("option \"-d\" has unknown debug specifier: \"%s\".\n",qPrint(debugLabel));
11518 devUsage();
11520 exit(1);
11521 }
11522 }
11523 break;
11524 case 't':
11525 {
11526#if ENABLE_TRACING
11527 if (!strcmp(argv[optInd]+1,"t_time"))
11528 {
11529 traceTiming = true;
11530 }
11531 else if (!strcmp(argv[optInd]+1,"t"))
11532 {
11533 traceTiming = false;
11534 }
11535 else
11536 {
11537 err("option should be \"-t\" or \"-t_time\", found: \"%s\".\n",argv[optInd]);
11539 exit(1);
11540 }
11541 if (optInd+1>=argc || argv[optInd+1][0] == '-') // no file name given
11542 {
11543 traceName="stdout";
11544 }
11545 else
11546 {
11547 traceName=argv[optInd+1];
11548 optInd++;
11549 }
11550#else
11551 err("support for option \"-t\" has not been compiled in (use a debug build or a release build with tracing enabled).\n");
11553 exit(1);
11554#endif
11555 }
11556 break;
11557 case 'x':
11558 if (!strcmp(argv[optInd]+1,"x_noenv")) diffList=Config::CompareMode::CompressedNoEnv;
11559 else if (!strcmp(argv[optInd]+1,"x")) diffList=Config::CompareMode::Compressed;
11560 else
11561 {
11562 err("option should be \"-x\" or \"-x_noenv\", found: \"%s\".\n",argv[optInd]);
11564 exit(1);
11565 }
11566 break;
11567 case 's':
11568 shortList=TRUE;
11569 break;
11570 case 'u':
11571 updateConfig=TRUE;
11572 break;
11573 case 'e':
11574 {
11575 QCString formatName=getArg(argc,argv,optInd);
11576 if (formatName.isEmpty())
11577 {
11578 err("option \"-e\" is missing format specifier rtf.\n");
11580 exit(1);
11581 }
11582 if (qstricmp(formatName.data(),"rtf")==0)
11583 {
11584 if (optInd+1>=argc)
11585 {
11586 err("option \"-e rtf\" is missing an extensions file name\n");
11588 exit(1);
11589 }
11590 writeFile(argv[optInd+1],RTFGenerator::writeExtensionsFile);
11592 exit(0);
11593 }
11594 err("option \"-e\" has invalid format specifier.\n");
11596 exit(1);
11597 }
11598 break;
11599 case 'f':
11600 {
11601 QCString listName=getArg(argc,argv,optInd);
11602 if (listName.isEmpty())
11603 {
11604 err("option \"-f\" is missing list specifier.\n");
11606 exit(1);
11607 }
11608 if (qstricmp(listName.data(),"emoji")==0)
11609 {
11610 if (optInd+1>=argc)
11611 {
11612 err("option \"-f emoji\" is missing an output file name\n");
11614 exit(1);
11615 }
11616 writeFile(argv[optInd+1],[](TextStream &t) { EmojiEntityMapper::instance().writeEmojiFile(t); });
11618 exit(0);
11619 }
11620 err("option \"-f\" has invalid list specifier.\n");
11622 exit(1);
11623 }
11624 break;
11625 case 'w':
11626 {
11627 QCString formatName=getArg(argc,argv,optInd);
11628 if (formatName.isEmpty())
11629 {
11630 err("option \"-w\" is missing format specifier rtf, html or latex\n");
11632 exit(1);
11633 }
11634 if (qstricmp(formatName.data(),"rtf")==0)
11635 {
11636 if (optInd+1>=argc)
11637 {
11638 err("option \"-w rtf\" is missing a style sheet file name\n");
11640 exit(1);
11641 }
11642 if (!writeFile(argv[optInd+1],RTFGenerator::writeStyleSheetFile))
11643 {
11644 err("error opening RTF style sheet file %s!\n",argv[optInd+1]);
11646 exit(1);
11647 }
11649 exit(0);
11650 }
11651 else if (qstricmp(formatName.data(),"html")==0)
11652 {
11653 Config::init();
11654 if (optInd+4<argc || FileInfo("Doxyfile").exists() || FileInfo("doxyfile").exists())
11655 // explicit config file mentioned or default found on disk
11656 {
11657 QCString df = optInd+4<argc ? argv[optInd+4] : (FileInfo("Doxyfile").exists() ? QCString("Doxyfile") : QCString("doxyfile"));
11658 if (!Config::parse(df)) // parse the config file
11659 {
11660 err("error opening or reading configuration file %s!\n",argv[optInd+4]);
11662 exit(1);
11663 }
11664 }
11665 if (optInd+3>=argc)
11666 {
11667 err("option \"-w html\" does not have enough arguments\n");
11669 exit(1);
11670 }
11674 setTranslator(Config_getEnum(OUTPUT_LANGUAGE));
11675 writeFile(argv[optInd+1],[&](TextStream &t) { HtmlGenerator::writeHeaderFile(t,argv[optInd+3]); });
11676 writeFile(argv[optInd+2],HtmlGenerator::writeFooterFile);
11677 writeFile(argv[optInd+3],HtmlGenerator::writeStyleSheetFile);
11679 exit(0);
11680 }
11681 else if (qstricmp(formatName.data(),"latex")==0)
11682 {
11683 Config::init();
11684 if (optInd+4<argc || FileInfo("Doxyfile").exists() || FileInfo("doxyfile").exists())
11685 {
11686 QCString df = optInd+4<argc ? argv[optInd+4] : (FileInfo("Doxyfile").exists() ? QCString("Doxyfile") : QCString("doxyfile"));
11687 if (!Config::parse(df))
11688 {
11689 err("error opening or reading configuration file %s!\n",argv[optInd+4]);
11691 exit(1);
11692 }
11693 }
11694 if (optInd+3>=argc)
11695 {
11696 err("option \"-w latex\" does not have enough arguments\n");
11698 exit(1);
11699 }
11703 setTranslator(Config_getEnum(OUTPUT_LANGUAGE));
11704 writeFile(argv[optInd+1],LatexGenerator::writeHeaderFile);
11705 writeFile(argv[optInd+2],LatexGenerator::writeFooterFile);
11706 writeFile(argv[optInd+3],LatexGenerator::writeStyleSheetFile);
11708 exit(0);
11709 }
11710 else
11711 {
11712 err("Illegal format specifier \"%s\": should be one of rtf, html or latex\n",qPrint(formatName));
11714 exit(1);
11715 }
11716 }
11717 break;
11718 case 'm':
11720 break;
11721 case 'v':
11722 version(false);
11724 exit(0);
11725 break;
11726 case 'V':
11727 version(true);
11729 exit(0);
11730 break;
11731 case '-':
11732 if (qstrcmp(&argv[optInd][2],"help")==0)
11733 {
11734 usage(argv[0],versionString);
11735 exit(0);
11736 }
11737 else if (qstrcmp(&argv[optInd][2],"version")==0)
11738 {
11739 version(false);
11741 exit(0);
11742 }
11743 else if ((qstrcmp(&argv[optInd][2],"Version")==0) ||
11744 (qstrcmp(&argv[optInd][2],"VERSION")==0))
11745 {
11746 version(true);
11748 exit(0);
11749 }
11750 else
11751 {
11752 err("Unknown option \"-%s\"\n",&argv[optInd][1]);
11753 usage(argv[0],versionString);
11754 exit(1);
11755 }
11756 break;
11757 case 'b':
11758 setvbuf(stdout,nullptr,_IONBF,0);
11759 break;
11760 case 'q':
11761 quiet = true;
11762 break;
11763 case 'h':
11764 case '?':
11765 usage(argv[0],versionString);
11766 exit(0);
11767 break;
11768 default:
11769 err("Unknown option \"-%c\"\n",argv[optInd][1]);
11770 usage(argv[0],versionString);
11771 exit(1);
11772 }
11773 optInd++;
11774 }
11775
11776 /**************************************************************************
11777 * Parse or generate the config file *
11778 **************************************************************************/
11779
11780 initTracing(traceName.data(),traceTiming);
11781 TRACE("Doxygen version used: {}",getFullVersion());
11782 Config::init();
11783
11784 FileInfo configFileInfo1("Doxyfile"),configFileInfo2("doxyfile");
11785 if (optInd>=argc)
11786 {
11787 if (configFileInfo1.exists())
11788 {
11789 configName="Doxyfile";
11790 }
11791 else if (configFileInfo2.exists())
11792 {
11793 configName="doxyfile";
11794 }
11795 else if (genConfig)
11796 {
11797 configName="Doxyfile";
11798 }
11799 else
11800 {
11801 err("Doxyfile not found and no input file specified!\n");
11802 usage(argv[0],versionString);
11803 exit(1);
11804 }
11805 }
11806 else
11807 {
11808 FileInfo fi(argv[optInd]);
11809 if (fi.exists() || qstrcmp(argv[optInd],"-")==0 || genConfig)
11810 {
11811 configName=argv[optInd];
11812 }
11813 else
11814 {
11815 err("configuration file %s not found!\n",argv[optInd]);
11816 usage(argv[0],versionString);
11817 exit(1);
11818 }
11819 }
11820
11821 if (genConfig)
11822 {
11823 generateConfigFile(configName,shortList);
11825 exit(0);
11826 }
11827
11828 if (!Config::parse(configName,updateConfig,diffList))
11829 {
11830 err("could not open or read configuration file %s!\n",qPrint(configName));
11832 exit(1);
11833 }
11834
11835 if (diffList!=Config::CompareMode::Full)
11836 {
11838 compareDoxyfile(diffList);
11840 exit(0);
11841 }
11842
11843 if (updateConfig)
11844 {
11846 generateConfigFile(configName,shortList,TRUE);
11848 exit(0);
11849 }
11850
11851 /* Perlmod wants to know the path to the config file.*/
11852 FileInfo configFileInfo(configName.str());
11853 setPerlModDoxyfile(configFileInfo.absFilePath());
11854
11855 /* handle -q option */
11856 if (quiet) Config_updateBool(QUIET,TRUE);
11857}
static bool setFlagStr(const QCString &label)
Definition debug.cpp:106
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
Definition emoji.cpp:1978
void writeEmojiFile(TextStream &t)
Writes the list of supported emojis to the given file.
Definition emoji.cpp:1999
bool exists() const
Definition fileinfo.cpp:30
static void writeFooterFile(TextStream &t)
Definition htmlgen.cpp:1457
static void writeStyleSheetFile(TextStream &t)
Definition htmlgen.cpp:1445
static void writeHeaderFile(TextStream &t, const QCString &cssname)
Definition htmlgen.cpp:1451
static void writeFooterFile(TextStream &t)
Definition latexgen.cpp:688
static void writeStyleSheetFile(TextStream &t)
Definition latexgen.cpp:694
static void writeHeaderFile(TextStream &t)
Definition latexgen.cpp:682
static void writeStyleSheetFile(TextStream &t)
Definition rtfgen.cpp:391
static void writeExtensionsFile(TextStream &t)
Definition rtfgen.cpp:406
Text streaming class that buffers data.
Definition textstream.h:36
#define Config_updateBool(name, value)
Definition config.h:40
static void generateConfigFile(const QCString &configFile, bool shortList, bool updateOnly=FALSE)
static void compareDoxyfile(Config::CompareMode diffList)
static void usage(const QCString &name, const QCString &versionString)
static void devUsage()
static void version(const bool extended)
static const char * getArg(int argc, char **argv, int &optInd)
void writeDefaultLayoutFile(const QCString &fileName)
Definition layout.cpp:1479
CompareMode
Definition config.h:54
bool parse(const QCString &fileName, bool update=FALSE, CompareMode compareMode=CompareMode::Full)
void init()
void setPerlModDoxyfile(const QCString &qs)
int qstricmp(const char *s1, const char *s2)
Definition qcstring.cpp:442
int qstrcmp(const char *str1, const char *str2)
Definition qcstring.h:69
void initTracing(const QCString &logFile, bool timing)
Definition trace.cpp:22
#define TRACE(...)
Definition trace.h:77
bool openOutputFile(const QCString &outFile, std::ofstream &f)
Definition util.cpp:6624

References FileInfo::absFilePath(), Config::checkAndCorrect(), cleanUpDoxygen(), compareDoxyfile(), Config::Compressed, Config::CompressedNoEnv, Config_getBool, Config_getEnum, Config_updateBool, QCString::data(), devUsage(), err, FileInfo::exists(), Config::Full, g_commentFileName, g_dumpSymbolMap, g_singleComment, generateConfigFile(), getArg(), Config::init(), initTracing(), EmojiEntityMapper::instance(), QCString::isEmpty(), openOutputFile(), Config::parse(), Config::postProcess(), qPrint(), qstrcmp(), qstricmp(), Debug::setFlagStr(), setPerlModDoxyfile(), setTranslator(), QCString::str(), TRACE, TRUE, Config::updateObsolete(), usage(), version(), writeDefaultLayoutFile(), EmojiEntityMapper::writeEmojiFile(), RTFGenerator::writeExtensionsFile(), HtmlGenerator::writeFooterFile(), LatexGenerator::writeFooterFile(), HtmlGenerator::writeHeaderFile(), LatexGenerator::writeHeaderFile(), HtmlGenerator::writeStyleSheetFile(), LatexGenerator::writeStyleSheetFile(), and RTFGenerator::writeStyleSheetFile().

Referenced by main().

◆ readFileOrDirectory()

void readFileOrDirectory ( const QCString & s,
FileNameLinkedMap * fnDict,
StringUnorderedSet * exclSet,
const StringVector * patList,
const StringVector * exclPatList,
StringVector * resultList,
StringUnorderedSet * resultSet,
bool recursive,
bool errorIfNotExist = TRUE,
StringUnorderedSet * killSet = nullptr,
StringUnorderedSet * paths = nullptr )

Definition at line 11080 of file doxygen.cpp.

11092{
11093 //printf("killSet count=%d\n",killSet ? (int)killSet->size() : -1);
11094 // strip trailing slashes
11095 if (s.isEmpty()) return;
11096
11097 g_pathsVisited.clear();
11098
11099 FileInfo fi(s.str());
11100 //printf("readFileOrDirectory(%s)\n",s);
11101 {
11102 if (exclSet==nullptr || exclSet->find(fi.absFilePath())==exclSet->end())
11103 {
11104 if (Config_getBool(EXCLUDE_SYMLINKS) && fi.isSymLink())
11105 {
11106 }
11107 else if (!fi.exists() || !fi.isReadable())
11108 {
11109 if (errorIfNotExist)
11110 {
11111 warn_uncond("source '%s' is not a readable file or directory... skipping.\n",qPrint(s));
11112 }
11113 }
11114 else if (fi.isFile())
11115 {
11116 std::string dirPath = fi.dirPath(true);
11117 std::string filePath = fi.absFilePath();
11118 if (paths && !dirPath.empty())
11119 {
11120 paths->insert(dirPath);
11121 }
11122 //printf("killSet.find(%s)=%d\n",qPrint(fi.absFilePath()),killSet.find(fi.absFilePath())!=killSet.end());
11123 if (killSet==nullptr || killSet->find(filePath)==killSet->end())
11124 {
11125 std::string name=fi.fileName();
11126 if (fnMap)
11127 {
11128 auto fd = createFileDef(QCString(dirPath+"/"),QCString(name));
11129 if (!name.empty())
11130 {
11131 FileName *fn = fnMap->add(QCString(name),QCString(filePath));
11132 fn->push_back(std::move(fd));
11133 }
11134 }
11135 if (resultList || resultSet)
11136 {
11137 if (resultList) resultList->push_back(filePath);
11138 if (resultSet) resultSet->insert(filePath);
11139 }
11140
11141 if (killSet) killSet->insert(fi.absFilePath());
11142 }
11143 }
11144 else if (fi.isDir()) // readable dir
11145 {
11146 readDir(&fi,fnMap,exclSet,patList,
11147 exclPatList,resultList,resultSet,errorIfNotExist,
11148 recursive,killSet,paths);
11149 }
11150 }
11151 }
11152}
Class representing all files with a certain base name.
Definition filename.h:30
static StringUnorderedSet g_pathsVisited(1009)
static void readDir(FileInfo *fi, FileNameLinkedMap *fnMap, StringUnorderedSet *exclSet, const StringVector *patList, const StringVector *exclPatList, StringVector *resultList, StringUnorderedSet *resultSet, bool errorIfNotExist, bool recursive, StringUnorderedSet *killSet, StringUnorderedSet *paths)
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition filedef.cpp:267

References FileInfo::absFilePath(), LinkedMap< T, Hash, KeyEqual, Map >::add(), Config_getBool, createFileDef(), FileInfo::dirPath(), FileInfo::exists(), FileInfo::fileName(), g_pathsVisited(), FileInfo::isDir(), QCString::isEmpty(), FileInfo::isFile(), FileInfo::isReadable(), FileInfo::isSymLink(), qPrint(), readDir(), QCString::str(), and warn_uncond.

Referenced by searchInputFiles().