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 11860 of file doxygen.cpp.

11861{
11862 AUTO_TRACE();
11863 Doxygen::globalNamespaceDef = createNamespaceDef("<globalScope>",1,1,"<globalScope>");
11873
11874 setTranslator(Config_getEnum(OUTPUT_LANGUAGE));
11875
11876 /* Set the global html file extension. */
11877 Doxygen::htmlFileExtension = Config_getString(HTML_FILE_EXTENSION);
11878
11879
11881 Config_getBool(CALLER_GRAPH) ||
11882 Config_getBool(REFERENCES_RELATION) ||
11883 Config_getBool(REFERENCED_BY_RELATION);
11884
11885 /**************************************************************************
11886 * Add custom extension mappings
11887 **************************************************************************/
11888
11889 const StringVector &extMaps = Config_getList(EXTENSION_MAPPING);
11890 for (const auto &mapping : extMaps)
11891 {
11892 QCString mapStr = mapping.c_str();
11893 int i=mapStr.find('=');
11894 if (i==-1)
11895 {
11896 continue;
11897 }
11898 else
11899 {
11900 QCString ext = mapStr.left(i).stripWhiteSpace().lower();
11901 QCString language = mapStr.mid(i+1).stripWhiteSpace().lower();
11902 if (ext.isEmpty() || language.isEmpty())
11903 {
11904 continue;
11905 }
11906
11907 if (!updateLanguageMapping(ext,language))
11908 {
11909 err("Failed to map file extension '{}' to unsupported language '{}'.\n"
11910 "Check the EXTENSION_MAPPING setting in the config file.\n",
11911 ext,language);
11912 }
11913 else
11914 {
11915 msg("Adding custom extension mapping: '{}' will be treated as language '{}'\n",
11916 ext,language);
11917 }
11918 }
11919 }
11920 // create input file exncodings
11921
11922 // check INPUT_ENCODING
11923 void *cd = portable_iconv_open("UTF-8",Config_getString(INPUT_ENCODING).data());
11924 if (cd==reinterpret_cast<void *>(-1))
11925 {
11926 term("unsupported character conversion: '{}'->'UTF-8': {}\n"
11927 "Check the 'INPUT_ENCODING' setting in the config file!\n",
11928 Config_getString(INPUT_ENCODING),strerror(errno));
11929 }
11930 else
11931 {
11933 }
11934
11935 // check and split INPUT_FILE_ENCODING
11936 const StringVector &fileEncod = Config_getList(INPUT_FILE_ENCODING);
11937 for (const auto &mapping : fileEncod)
11938 {
11939 QCString mapStr = mapping.c_str();
11940 int i=mapStr.find('=');
11941 if (i==-1)
11942 {
11943 continue;
11944 }
11945 else
11946 {
11947 QCString pattern = mapStr.left(i).stripWhiteSpace().lower();
11948 QCString encoding = mapStr.mid(i+1).stripWhiteSpace().lower();
11949 if (pattern.isEmpty() || encoding.isEmpty())
11950 {
11951 continue;
11952 }
11953 cd = portable_iconv_open("UTF-8",encoding.data());
11954 if (cd==reinterpret_cast<void *>(-1))
11955 {
11956 term("unsupported character conversion: '{}'->'UTF-8': {}\n"
11957 "Check the 'INPUT_FILE_ENCODING' setting in the config file!\n",
11958 encoding,strerror(errno));
11959 }
11960 else
11961 {
11963 }
11964
11965 Doxygen::inputFileEncodingList.emplace_back(pattern, encoding);
11966 }
11967 }
11968
11969 // add predefined macro name to a dictionary
11970 const StringVector &expandAsDefinedList =Config_getList(EXPAND_AS_DEFINED);
11971 for (const auto &s : expandAsDefinedList)
11972 {
11973 Doxygen::expandAsDefinedSet.insert(s.c_str());
11974 }
11975
11976 // read aliases and store them in a dictionary
11977 readAliases();
11978
11979 // store number of spaces in a tab into Doxygen::spaces
11980 int tabSize = Config_getInt(TAB_SIZE);
11981 Doxygen::spaces.resize(tabSize);
11982 for (int sp=0; sp<tabSize; sp++) Doxygen::spaces.at(sp)=' ';
11983 Doxygen::spaces.at(tabSize)='\0';
11984}
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
#define msg(fmt,...)
Definition message.h:94
#define err(fmt,...)
Definition message.h:127
#define term(fmt,...)
Definition message.h:137
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)
bool updateLanguageMapping(const QCString &extension, const QCString &language)
Definition util.cpp:5540

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(), readAliases(), setTranslator(), Doxygen::spaces, QCString::stripWhiteSpace(), term, toNamespaceDefMutable(), and updateLanguageMapping().

Referenced by main().

◆ checkConfiguration()

void checkConfiguration ( )

check and resolve config options

Definition at line 11849 of file doxygen.cpp.

11850{
11851 AUTO_TRACE();
11852
11857}
void initWarningFormat()
Definition message.cpp:218
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 11375 of file doxygen.cpp.

11376{
11380
11381 delete Doxygen::indexList;
11390 Doxygen::mainPage.reset();
11394 Doxygen::globalScope = nullptr;
11396 delete theTranslator;
11397 delete g_outputList;
11398
11403 delete Doxygen::dirLinkedMap;
11404 delete Doxygen::symbolMap;
11405}
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:188
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 13020 of file doxygen.cpp.

13021{
13022 AUTO_TRACE();
13023 /**************************************************************************
13024 * Initialize output generators *
13025 **************************************************************************/
13026
13027 /// add extra languages for which we can only produce syntax highlighted code
13029
13030 //// dump all symbols
13031 if (g_dumpSymbolMap)
13032 {
13033 dumpSymbolMap();
13034 exit(0);
13035 }
13036
13037 bool generateHtml = Config_getBool(GENERATE_HTML);
13038 bool generateLatex = Config_getBool(GENERATE_LATEX);
13039 bool generateMan = Config_getBool(GENERATE_MAN);
13040 bool generateRtf = Config_getBool(GENERATE_RTF);
13041 bool generateDocbook = Config_getBool(GENERATE_DOCBOOK);
13042
13043
13045 if (generateHtml)
13046 {
13050 }
13051 if (generateLatex)
13052 {
13055 }
13056 if (generateDocbook)
13057 {
13060 }
13061 if (generateMan)
13062 {
13063 g_outputList->add<ManGenerator>();
13065 }
13066 if (generateRtf)
13067 {
13068 g_outputList->add<RTFGenerator>();
13070 }
13071 if (Config_getBool(USE_HTAGS))
13072 {
13074 QCString htmldir = Config_getString(HTML_OUTPUT);
13075 if (!Htags::execute(htmldir))
13076 err("USE_HTAGS is YES but htags(1) failed. \n");
13077 else if (!Htags::loadFilemap(htmldir))
13078 err("htags(1) ended normally but failed to load the filemap. \n");
13079 }
13080
13081 /**************************************************************************
13082 * Generate documentation *
13083 **************************************************************************/
13084
13085 g_s.begin("Generating style sheet...\n");
13086 //printf("writing style info\n");
13087 g_outputList->writeStyleInfo(0); // write first part
13088 g_s.end();
13089
13090 bool searchEngine = Config_getBool(SEARCHENGINE);
13091 bool serverBasedSearch = Config_getBool(SERVER_BASED_SEARCH);
13092
13093 g_s.begin("Generating search indices...\n");
13094 if (searchEngine && !serverBasedSearch && generateHtml)
13095 {
13097 }
13098
13099 // generate search indices (need to do this before writing other HTML
13100 // pages as these contain a drop down menu with options depending on
13101 // what categories we find in this function.
13102 if (generateHtml && searchEngine)
13103 {
13104 QCString searchDirName = Config_getString(HTML_OUTPUT)+"/search";
13105 Dir searchDir(searchDirName.str());
13106 if (!searchDir.exists() && !searchDir.mkdir(searchDirName.str()))
13107 {
13108 term("Could not create search results directory '{}' $PWD='{}'\n",
13109 searchDirName,Dir::currentDirPath());
13110 }
13111 HtmlGenerator::writeSearchData(searchDirName);
13112 if (!serverBasedSearch) // client side search index
13113 {
13115 }
13116 }
13117 g_s.end();
13118
13119 // copy static stuff
13120 if (generateHtml)
13121 {
13124 copyLogo(Config_getString(HTML_OUTPUT));
13125 copyIcon(Config_getString(HTML_OUTPUT));
13126 copyExtraFiles(Config_getList(HTML_EXTRA_FILES),"HTML_EXTRA_FILES",Config_getString(HTML_OUTPUT));
13127 }
13128 if (generateLatex)
13129 {
13131 copyLogo(Config_getString(LATEX_OUTPUT));
13132 copyIcon(Config_getString(LATEX_OUTPUT));
13133 copyExtraFiles(Config_getList(LATEX_EXTRA_FILES),"LATEX_EXTRA_FILES",Config_getString(LATEX_OUTPUT));
13134 }
13135 if (generateDocbook)
13136 {
13137 copyLogo(Config_getString(DOCBOOK_OUTPUT));
13138 copyIcon(Config_getString(DOCBOOK_OUTPUT));
13139 }
13140 if (generateRtf)
13141 {
13142 copyLogo(Config_getString(RTF_OUTPUT));
13143 copyIcon(Config_getString(RTF_OUTPUT));
13144 copyExtraFiles(Config_getList(RTF_EXTRA_FILES),"RTF_EXTRA_FILES",Config_getString(RTF_OUTPUT));
13145 }
13146
13148 if (fm.hasFormulas() && generateHtml
13149 && !Config_getBool(USE_MATHJAX))
13150 {
13151 g_s.begin("Generating images for formulas in HTML...\n");
13152 fm.generateImages(Config_getString(HTML_OUTPUT), Config_getEnum(HTML_FORMULA_FORMAT)==HTML_FORMULA_FORMAT_t::svg ?
13154 g_s.end();
13155 }
13156 if (fm.hasFormulas() && generateRtf)
13157 {
13158 g_s.begin("Generating images for formulas in RTF...\n");
13160 g_s.end();
13161 }
13162
13163 if (fm.hasFormulas() && generateDocbook)
13164 {
13165 g_s.begin("Generating images for formulas in Docbook...\n");
13167 g_s.end();
13168 }
13169
13170 g_s.begin("Generating example documentation...\n");
13172 g_s.end();
13173
13174 g_s.begin("Generating file sources...\n");
13176 g_s.end();
13177
13178 g_s.begin("Generating file documentation...\n");
13180 g_s.end();
13181
13182 g_s.begin("Generating page documentation...\n");
13184 g_s.end();
13185
13186 g_s.begin("Generating group documentation...\n");
13188 g_s.end();
13189
13190 g_s.begin("Generating class documentation...\n");
13192 g_s.end();
13193
13194 g_s.begin("Generating concept documentation...\n");
13196 g_s.end();
13197
13198 g_s.begin("Generating module documentation...\n");
13200 g_s.end();
13201
13202 g_s.begin("Generating namespace documentation...\n");
13204 g_s.end();
13205
13206 if (Config_getBool(GENERATE_LEGEND))
13207 {
13208 g_s.begin("Generating graph info page...\n");
13210 g_s.end();
13211 }
13212
13213 g_s.begin("Generating directory documentation...\n");
13215 g_s.end();
13216
13217 if (g_outputList->size()>0)
13218 {
13220 }
13221
13222 g_s.begin("finalizing index lists...\n");
13223 Doxygen::indexList->finalize();
13224 g_s.end();
13225
13226 g_s.begin("writing tag file...\n");
13227 writeTagFile();
13228 g_s.end();
13229
13230 if (Config_getBool(GENERATE_XML))
13231 {
13232 g_s.begin("Generating XML output...\n");
13234 generateXML();
13236 g_s.end();
13237 }
13238 if (Config_getBool(GENERATE_SQLITE3))
13239 {
13240 g_s.begin("Generating SQLITE3 output...\n");
13242 g_s.end();
13243 }
13244
13245 if (Config_getBool(GENERATE_AUTOGEN_DEF))
13246 {
13247 g_s.begin("Generating AutoGen DEF output...\n");
13248 generateDEF();
13249 g_s.end();
13250 }
13251 if (Config_getBool(GENERATE_PERLMOD))
13252 {
13253 g_s.begin("Generating Perl module output...\n");
13255 g_s.end();
13256 }
13257 if (generateHtml && searchEngine && serverBasedSearch)
13258 {
13259 g_s.begin("Generating search index\n");
13260 if (Doxygen::searchIndex.kind()==SearchIndexIntf::Internal) // write own search index
13261 {
13263 Doxygen::searchIndex.write(Config_getString(HTML_OUTPUT)+"/search/search.idx");
13264 }
13265 else // write data for external search index
13266 {
13268 QCString searchDataFile = Config_getString(SEARCHDATA_FILE);
13269 if (searchDataFile.isEmpty())
13270 {
13271 searchDataFile="searchdata.xml";
13272 }
13273 if (!Portable::isAbsolutePath(searchDataFile.data()))
13274 {
13275 searchDataFile.prepend(Config_getString(OUTPUT_DIRECTORY)+"/");
13276 }
13277 Doxygen::searchIndex.write(searchDataFile);
13278 }
13279 g_s.end();
13280 }
13281
13282 if (generateRtf)
13283 {
13284 g_s.begin("Combining RTF output...\n");
13285 if (!RTFGenerator::preProcessFileInplace(Config_getString(RTF_OUTPUT),"refman.rtf"))
13286 {
13287 err("An error occurred during post-processing the RTF files!\n");
13288 }
13289 g_s.end();
13290 }
13291
13292 g_s.begin("Running plantuml with JAVA...\n");
13294 g_s.end();
13295
13296 if (Config_getBool(HAVE_DOT))
13297 {
13298 g_s.begin("Running dot...\n");
13300 g_s.end();
13301 }
13302
13303 if (generateHtml &&
13304 Config_getBool(GENERATE_HTMLHELP) &&
13305 !Config_getString(HHC_LOCATION).isEmpty())
13306 {
13307 g_s.begin("Running html help compiler...\n");
13309 g_s.end();
13310 }
13311
13312 if ( generateHtml &&
13313 Config_getBool(GENERATE_QHP) &&
13314 !Config_getString(QHG_LOCATION).isEmpty())
13315 {
13316 g_s.begin("Running qhelpgenerator...\n");
13318 g_s.end();
13319 }
13320
13321 g_outputList->cleanup();
13322
13323 msg("type lookup cache used {}/{} hits={} misses={}\n",
13325 Doxygen::typeLookupCache->capacity(),
13327 Doxygen::typeLookupCache->misses());
13328 msg("symbol lookup cache used {}/{} hits={} misses={}\n",
13330 Doxygen::symbolLookupCache->capacity(),
13332 Doxygen::symbolLookupCache->misses());
13333 int typeCacheParam = computeIdealCacheParam(static_cast<size_t>(Doxygen::typeLookupCache->misses()*2/3)); // part of the cache is flushed, hence the 2/3 correction factor
13334 int symbolCacheParam = computeIdealCacheParam(static_cast<size_t>(Doxygen::symbolLookupCache->misses()));
13335 int cacheParam = std::max(typeCacheParam,symbolCacheParam);
13336 if (cacheParam>Config_getInt(LOOKUP_CACHE_SIZE))
13337 {
13338 msg("Note: based on cache misses the ideal setting for LOOKUP_CACHE_SIZE is {} at the cost of higher memory usage.\n",cacheParam);
13339 }
13340
13342 {
13343
13344 std::size_t numThreads = static_cast<std::size_t>(Config_getInt(NUM_PROC_THREADS));
13345 if (numThreads<1) numThreads=1;
13346 msg("Total elapsed time: {:.6f} seconds\n(of which an average of {:.6f} seconds per thread waiting for external tools to finish)\n",
13347 (static_cast<double>(Debug::elapsedTime())),
13348 Portable::getSysElapsedTime()/static_cast<double>(numThreads)
13349 );
13350 g_s.print();
13351
13353 msg("finished...\n");
13355 }
13356 else
13357 {
13358 msg("finished...\n");
13359 }
13360
13361
13362 /**************************************************************************
13363 * Start cleaning up *
13364 **************************************************************************/
13365
13367
13369 Dir thisDir;
13370 thisDir.remove(Doxygen::filterDBFileName.str());
13372 exitTracing();
13374 delete Doxygen::clangUsrMap;
13376
13377 //dumpDocNodeSizes();
13378}
@ Time
Definition debug.h:35
static void clearFlag(const DebugMask mask)
Definition debug.cpp:122
static bool isFlagSet(const DebugMask mask)
Definition debug.cpp:132
static double elapsedTime()
Definition debug.cpp:201
static void setFlag(const DebugMask mask)
Definition debug.cpp:117
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:2458
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:9987
static void generateExampleDocs()
Definition doxygen.cpp:9942
static void dumpSymbolMap()
static void generateFileDocs()
Definition doxygen.cpp:8668
static void copyIcon(const QCString &outputOption)
static void generatePageDocs()
Definition doxygen.cpp:9857
static void generateFileSources()
Definition doxygen.cpp:8502
static void copyLogo(const QCString &outputOption)
static void generateClassDocs()
Definition doxygen.cpp:9094
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:191
static bool g_successfulRun
Definition doxygen.cpp:190
static void generateNamespaceDocs()
static void writeTagFile()
void cleanUpDoxygen()
static void generateConceptDocs()
Definition doxygen.cpp:9120
void writeGraphInfo(OutputList &ol)
Definition index.cpp:3945
void writeIndexHierarchy(OutputList &ol)
Definition index.cpp:5585
void finishWarnExit()
Definition message.cpp:276
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:5639
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(), 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 11306 of file doxygen.cpp.

11307{
11308 initResources();
11309 QCString lang = Portable::getenv("LC_ALL");
11310 if (!lang.isEmpty()) Portable::setenv("LANG",lang);
11311 std::setlocale(LC_ALL,"");
11312 std::setlocale(LC_CTYPE,"C"); // to get isspace(0xA0)==0, needed for UTF-8
11313 std::setlocale(LC_NUMERIC,"C");
11314
11316
11340
11341 // register any additional parsers here...
11342
11344
11345#if USE_LIBCLANG
11347#endif
11356 Doxygen::pageLinkedMap = new PageLinkedMap; // all doc pages
11357 Doxygen::exampleLinkedMap = new PageLinkedMap; // all examples
11358 //Doxygen::tagDestinationDict.setAutoDelete(TRUE);
11360
11361 // initialization of these globals depends on
11362 // configuration switches so we need to postpone these
11363 Doxygen::globalScope = nullptr;
11372
11373}
static void startTimer()
Definition debug.cpp:196
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
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:5572

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 12345 of file doxygen.cpp.

12346{
12347 AUTO_TRACE();
12348 std::atexit(exitDoxygen);
12349
12350 Portable::correctPath(Config_getList(EXTERNAL_TOOL_PATH));
12351
12352#if USE_LIBCLANG
12353 Doxygen::clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING);
12354#endif
12355
12356 // we would like to show the versionString earlier, but we first have to handle the configuration file
12357 // to know the value of the QUIET setting.
12358 QCString versionString = getFullVersion();
12359 msg("Doxygen version used: {}\n",versionString);
12360
12362
12363 /**************************************************************************
12364 * Make sure the output directory exists
12365 **************************************************************************/
12366 QCString outputDirectory = Config_getString(OUTPUT_DIRECTORY);
12367 if (!g_singleComment)
12368 {
12369 if (outputDirectory.isEmpty())
12370 {
12371 outputDirectory = Config_updateString(OUTPUT_DIRECTORY,Dir::currentDirPath().c_str());
12372 }
12373 else
12374 {
12375 Dir dir(outputDirectory.str());
12376 if (!dir.exists())
12377 {
12378 dir.setPath(Dir::currentDirPath());
12379 if (!dir.mkdir(outputDirectory.str()))
12380 {
12381 term("tag OUTPUT_DIRECTORY: Output directory '{}' does not "
12382 "exist and cannot be created\n",outputDirectory);
12383 }
12384 else
12385 {
12386 msg("Notice: Output directory '{}' does not exist. "
12387 "I have created it for you.\n", outputDirectory);
12388 }
12389 dir.setPath(outputDirectory.str());
12390 }
12391 outputDirectory = Config_updateString(OUTPUT_DIRECTORY,dir.absPath().c_str());
12392 }
12393 }
12394 AUTO_TRACE_ADD("outputDirectory={}",outputDirectory);
12395
12396 /**************************************************************************
12397 * Initialize global lists and dictionaries
12398 **************************************************************************/
12399
12400 // also scale lookup cache with SYMBOL_CACHE_SIZE
12401 int cacheSize = Config_getInt(LOOKUP_CACHE_SIZE);
12402 if (cacheSize<0) cacheSize=0;
12403 if (cacheSize>9) cacheSize=9;
12404 uint32_t lookupSize = 65536 << cacheSize;
12407
12408#ifdef HAS_SIGNALS
12409 signal(SIGINT, stopDoxygen);
12410#endif
12411
12412 uint32_t pid = Portable::pid();
12413 Doxygen::filterDBFileName.sprintf("doxygen_filterdb_%d.tmp",pid);
12414 Doxygen::filterDBFileName.prepend(outputDirectory+"/");
12415
12416 /**************************************************************************
12417 * Check/create output directories *
12418 **************************************************************************/
12419
12420 bool generateHtml = Config_getBool(GENERATE_HTML);
12421 bool generateDocbook = Config_getBool(GENERATE_DOCBOOK);
12422 bool generateXml = Config_getBool(GENERATE_XML);
12423 bool generateLatex = Config_getBool(GENERATE_LATEX);
12424 bool generateRtf = Config_getBool(GENERATE_RTF);
12425 bool generateMan = Config_getBool(GENERATE_MAN);
12426 bool generateSql = Config_getBool(GENERATE_SQLITE3);
12427 QCString htmlOutput;
12428 QCString docbookOutput;
12429 QCString xmlOutput;
12430 QCString latexOutput;
12431 QCString rtfOutput;
12432 QCString manOutput;
12433 QCString sqlOutput;
12434
12435 if (!g_singleComment)
12436 {
12437 if (generateHtml)
12438 {
12439 htmlOutput = createOutputDirectory(outputDirectory,Config_getString(HTML_OUTPUT),"/html");
12440 Config_updateString(HTML_OUTPUT,htmlOutput);
12441
12442 QCString sitemapUrl = Config_getString(SITEMAP_URL);
12443 bool generateSitemap = !sitemapUrl.isEmpty();
12444 if (generateSitemap && !sitemapUrl.endsWith("/"))
12445 {
12446 Config_updateString(SITEMAP_URL,sitemapUrl+"/");
12447 }
12448
12449 // add HTML indexers that are enabled
12450 bool generateHtmlHelp = Config_getBool(GENERATE_HTMLHELP);
12451 bool generateEclipseHelp = Config_getBool(GENERATE_ECLIPSEHELP);
12452 bool generateQhp = Config_getBool(GENERATE_QHP);
12453 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
12454 bool generateDocSet = Config_getBool(GENERATE_DOCSET);
12455 if (generateEclipseHelp) Doxygen::indexList->addIndex<EclipseHelp>();
12456 if (generateHtmlHelp) Doxygen::indexList->addIndex<HtmlHelp>();
12457 if (generateQhp) Doxygen::indexList->addIndex<Qhp>();
12458 if (generateSitemap) Doxygen::indexList->addIndex<Sitemap>();
12459 if (generateTreeView) Doxygen::indexList->addIndex<FTVHelp>(TRUE);
12460 if (generateDocSet) Doxygen::indexList->addIndex<DocSets>();
12461 Doxygen::indexList->addIndex<Crawlmap>();
12462 Doxygen::indexList->initialize();
12463 }
12464
12465 if (generateDocbook)
12466 {
12467 docbookOutput = createOutputDirectory(outputDirectory,Config_getString(DOCBOOK_OUTPUT),"/docbook");
12468 Config_updateString(DOCBOOK_OUTPUT,docbookOutput);
12469 }
12470
12471 if (generateXml)
12472 {
12473 xmlOutput = createOutputDirectory(outputDirectory,Config_getString(XML_OUTPUT),"/xml");
12474 Config_updateString(XML_OUTPUT,xmlOutput);
12475 }
12476
12477 if (generateLatex)
12478 {
12479 latexOutput = createOutputDirectory(outputDirectory,Config_getString(LATEX_OUTPUT), "/latex");
12480 Config_updateString(LATEX_OUTPUT,latexOutput);
12481 }
12482
12483 if (generateRtf)
12484 {
12485 rtfOutput = createOutputDirectory(outputDirectory,Config_getString(RTF_OUTPUT),"/rtf");
12486 Config_updateString(RTF_OUTPUT,rtfOutput);
12487 }
12488
12489 if (generateMan)
12490 {
12491 manOutput = createOutputDirectory(outputDirectory,Config_getString(MAN_OUTPUT),"/man");
12492 Config_updateString(MAN_OUTPUT,manOutput);
12493 }
12494
12495 if (generateSql)
12496 {
12497 sqlOutput = createOutputDirectory(outputDirectory,Config_getString(SQLITE3_OUTPUT),"/sqlite3");
12498 Config_updateString(SQLITE3_OUTPUT,sqlOutput);
12499 }
12500 }
12501
12502 if (Config_getBool(HAVE_DOT))
12503 {
12504 QCString curFontPath = Config_getString(DOT_FONTPATH);
12505 if (curFontPath.isEmpty())
12506 {
12507 Portable::getenv("DOTFONTPATH");
12508 QCString newFontPath = ".";
12509 if (!curFontPath.isEmpty())
12510 {
12511 newFontPath+=Portable::pathListSeparator();
12512 newFontPath+=curFontPath;
12513 }
12514 Portable::setenv("DOTFONTPATH",qPrint(newFontPath));
12515 }
12516 else
12517 {
12518 Portable::setenv("DOTFONTPATH",qPrint(curFontPath));
12519 }
12520 }
12521
12522 /**************************************************************************
12523 * Handle layout file *
12524 **************************************************************************/
12525
12527 QCString layoutFileName = Config_getString(LAYOUT_FILE);
12528 bool defaultLayoutUsed = FALSE;
12529 if (layoutFileName.isEmpty())
12530 {
12531 layoutFileName = Config_updateString(LAYOUT_FILE,"DoxygenLayout.xml");
12532 defaultLayoutUsed = TRUE;
12533 }
12534 AUTO_TRACE_ADD("defaultLayoutUsed={}, layoutFileName={}",defaultLayoutUsed,layoutFileName);
12535
12536 FileInfo fi(layoutFileName.str());
12537 if (fi.exists())
12538 {
12539 msg("Parsing layout file {}...\n",layoutFileName);
12540 LayoutDocManager::instance().parse(layoutFileName);
12541 }
12542 else if (!defaultLayoutUsed)
12543 {
12544 warn_uncond("failed to open layout file '{}' for reading! Using default settings.\n",layoutFileName);
12545 }
12546 printLayout();
12547
12548 /**************************************************************************
12549 * Read and preprocess input *
12550 **************************************************************************/
12551
12552 // prevent search in the output directories
12553 StringVector exclPatterns = Config_getList(EXCLUDE_PATTERNS);
12554 if (generateHtml) exclPatterns.push_back(htmlOutput.str());
12555 if (generateDocbook) exclPatterns.push_back(docbookOutput.str());
12556 if (generateXml) exclPatterns.push_back(xmlOutput.str());
12557 if (generateLatex) exclPatterns.push_back(latexOutput.str());
12558 if (generateRtf) exclPatterns.push_back(rtfOutput.str());
12559 if (generateMan) exclPatterns.push_back(manOutput.str());
12560 Config_updateList(EXCLUDE_PATTERNS,exclPatterns);
12561
12562 if (!g_singleComment)
12563 {
12565
12567 }
12568
12569 // Notice: the order of the function calls below is very important!
12570
12571 if (generateHtml && !Config_getBool(USE_MATHJAX))
12572 {
12574 }
12575 if (generateRtf)
12576 {
12578 }
12579 if (generateDocbook)
12580 {
12582 }
12583
12585
12586 /**************************************************************************
12587 * Handle Tag Files *
12588 **************************************************************************/
12589
12590 std::shared_ptr<Entry> root = std::make_shared<Entry>();
12591
12592 if (!g_singleComment)
12593 {
12594 msg("Reading and parsing tag files\n");
12595 const StringVector &tagFileList = Config_getList(TAGFILES);
12596 for (const auto &s : tagFileList)
12597 {
12598 readTagFile(root,s.c_str());
12599 }
12600 }
12601
12602 /**************************************************************************
12603 * Parse source files *
12604 **************************************************************************/
12605
12606 addSTLSupport(root);
12607
12608 g_s.begin("Parsing files\n");
12609 if (g_singleComment)
12610 {
12611 //printf("Parsing comment %s\n",qPrint(g_commentFileName));
12612 if (g_commentFileName=="-")
12613 {
12614 std::string text = fileToString(g_commentFileName).str();
12615 addTerminalCharIfMissing(text,'\n');
12616 generateHtmlForComment("stdin.md",text);
12617 }
12618 else if (FileInfo(g_commentFileName.str()).isFile())
12619 {
12620 std::string text;
12622 addTerminalCharIfMissing(text,'\n');
12624 }
12625 else
12626 {
12627 }
12629 exit(0);
12630 }
12631 else
12632 {
12633 if (Config_getInt(NUM_PROC_THREADS)==1)
12634 {
12636 }
12637 else
12638 {
12640 }
12641 }
12642 g_s.end();
12643
12644 /**************************************************************************
12645 * Gather information *
12646 **************************************************************************/
12647
12648 g_s.begin("Building macro definition list...\n");
12650 g_s.end();
12651
12652 g_s.begin("Building group list...\n");
12653 buildGroupList(root.get());
12654 organizeSubGroups(root.get());
12655 g_s.end();
12656
12657 g_s.begin("Building directory list...\n");
12659 findDirDocumentation(root.get());
12660 g_s.end();
12661
12662 g_s.begin("Building namespace list...\n");
12663 buildNamespaceList(root.get());
12664 findUsingDirectives(root.get());
12665 g_s.end();
12666
12667 g_s.begin("Building file list...\n");
12668 buildFileList(root.get());
12669 g_s.end();
12670
12671 g_s.begin("Building class list...\n");
12672 buildClassList(root.get());
12673 g_s.end();
12674
12675 g_s.begin("Building concept list...\n");
12676 buildConceptList(root.get());
12677 g_s.end();
12678
12679 // build list of using declarations here (global list)
12680 buildListOfUsingDecls(root.get());
12681 g_s.end();
12682
12683 g_s.begin("Computing nesting relations for classes...\n");
12685 g_s.end();
12686 // 1.8.2-20121111: no longer add nested classes to the group as well
12687 //distributeClassGroupRelations();
12688
12689 // calling buildClassList may result in cached relations that
12690 // become invalid after resolveClassNestingRelations(), that's why
12691 // we need to clear the cache here
12692 Doxygen::typeLookupCache->clear();
12693 // we don't need the list of using declaration anymore
12694 g_usingDeclarations.clear();
12695
12696 g_s.begin("Associating documentation with classes...\n");
12697 buildClassDocList(root.get());
12698 g_s.end();
12699
12700 g_s.begin("Associating documentation with concepts...\n");
12701 buildConceptDocList(root.get());
12703 g_s.end();
12704
12705 g_s.begin("Associating documentation with modules...\n");
12706 findModuleDocumentation(root.get());
12707 g_s.end();
12708
12709 g_s.begin("Building example list...\n");
12710 buildExampleList(root.get());
12711 g_s.end();
12712
12713 g_s.begin("Searching for enumerations...\n");
12714 findEnums(root.get());
12715 g_s.end();
12716
12717 // Since buildVarList calls isVarWithConstructor
12718 // and this calls getResolvedClass we need to process
12719 // typedefs first so the relations between classes via typedefs
12720 // are properly resolved. See bug 536385 for an example.
12721 g_s.begin("Searching for documented typedefs...\n");
12722 buildTypedefList(root.get());
12723 g_s.end();
12724
12725 if (Config_getBool(OPTIMIZE_OUTPUT_SLICE))
12726 {
12727 g_s.begin("Searching for documented sequences...\n");
12728 buildSequenceList(root.get());
12729 g_s.end();
12730
12731 g_s.begin("Searching for documented dictionaries...\n");
12732 buildDictionaryList(root.get());
12733 g_s.end();
12734 }
12735
12736 g_s.begin("Searching for members imported via using declarations...\n");
12737 // this should be after buildTypedefList in order to properly import
12738 // used typedefs
12739 findUsingDeclarations(root.get(),TRUE); // do for python packages first
12740 findUsingDeclarations(root.get(),FALSE); // then the rest
12741 g_s.end();
12742
12743 g_s.begin("Searching for included using directives...\n");
12745 g_s.end();
12746
12747 g_s.begin("Searching for documented variables...\n");
12748 buildVarList(root.get());
12749 g_s.end();
12750
12751 g_s.begin("Building interface member list...\n");
12752 buildInterfaceAndServiceList(root.get()); // UNO IDL
12753
12754 g_s.begin("Building member list...\n"); // using class info only !
12755 buildFunctionList(root.get());
12756 g_s.end();
12757
12758 g_s.begin("Searching for friends...\n");
12759 findFriends();
12760 g_s.end();
12761
12762 g_s.begin("Searching for documented defines...\n");
12763 findDefineDocumentation(root.get());
12764 g_s.end();
12765
12766 g_s.begin("Computing class inheritance relations...\n");
12767 findClassEntries(root.get());
12769 g_s.end();
12770
12771 g_s.begin("Computing class usage relations...\n");
12773 g_s.end();
12774
12775 if (Config_getBool(INLINE_SIMPLE_STRUCTS))
12776 {
12777 g_s.begin("Searching for tag less structs...\n");
12779 g_s.end();
12780 }
12781
12782 g_s.begin("Flushing cached template relations that have become invalid...\n");
12784 g_s.end();
12785
12786 g_s.begin("Warn for undocumented namespaces...\n");
12788 g_s.end();
12789
12790 g_s.begin("Computing class relations...\n");
12793 if (Config_getBool(OPTIMIZE_OUTPUT_VHDL))
12794 {
12796 }
12798 g_classEntries.clear();
12799 g_s.end();
12800
12801 g_s.begin("Add enum values to enums...\n");
12802 addEnumValuesToEnums(root.get());
12803 findEnumDocumentation(root.get());
12804 g_s.end();
12805
12806 g_s.begin("Searching for member function documentation...\n");
12807 findObjCMethodDefinitions(root.get());
12808 findMemberDocumentation(root.get()); // may introduce new members !
12809 findUsingDeclImports(root.get()); // may introduce new members !
12810 g_usingClassMap.clear();
12814 g_s.end();
12815
12816 // moved to after finding and copying documentation,
12817 // as this introduces new members see bug 722654
12818 g_s.begin("Creating members for template instances...\n");
12820 g_s.end();
12821
12822 g_s.begin("Building page list...\n");
12823 buildPageList(root.get());
12824 g_s.end();
12825
12826 g_s.begin("Search for main page...\n");
12827 findMainPage(root.get());
12828 findMainPageTagFiles(root.get());
12829 g_s.end();
12830
12831 g_s.begin("Computing page relations...\n");
12832 computePageRelations(root.get());
12834 g_s.end();
12835
12836 g_s.begin("Determining the scope of groups...\n");
12837 findGroupScope(root.get());
12838 g_s.end();
12839
12840 g_s.begin("Computing module relations...\n");
12841 auto &mm = ModuleManager::instance();
12842 mm.resolvePartitions();
12843 mm.resolveImports();
12844 mm.collectExportedSymbols();
12845 g_s.end();
12846
12847 auto memberNameComp = [](const MemberNameLinkedMap::Ptr &n1,const MemberNameLinkedMap::Ptr &n2)
12848 {
12849 return qstricmp_sort(n1->memberName().data()+getPrefixIndex(n1->memberName()),
12850 n2->memberName().data()+getPrefixIndex(n2->memberName())
12851 )<0;
12852 };
12853
12854 auto classComp = [](const ClassLinkedMap::Ptr &c1,const ClassLinkedMap::Ptr &c2)
12855 {
12856 if (Config_getBool(SORT_BY_SCOPE_NAME))
12857 {
12858 return qstricmp_sort(c1->name(), c2->name())<0;
12859 }
12860 else
12861 {
12862 int i = qstricmp_sort(c1->className(), c2->className());
12863 return i==0 ? qstricmp_sort(c1->name(), c2->name())<0 : i<0;
12864 }
12865 };
12866
12867 auto namespaceComp = [](const NamespaceLinkedMap::Ptr &n1,const NamespaceLinkedMap::Ptr &n2)
12868 {
12869 return qstricmp_sort(n1->name(),n2->name())<0;
12870 };
12871
12872 auto conceptComp = [](const ConceptLinkedMap::Ptr &c1,const ConceptLinkedMap::Ptr &c2)
12873 {
12874 return qstricmp_sort(c1->name(),c2->name())<0;
12875 };
12876
12877 g_s.begin("Sorting lists...\n");
12878 std::stable_sort(Doxygen::memberNameLinkedMap->begin(),
12880 memberNameComp);
12881 std::stable_sort(Doxygen::functionNameLinkedMap->begin(),
12883 memberNameComp);
12884 std::stable_sort(Doxygen::hiddenClassLinkedMap->begin(),
12886 classComp);
12887 std::stable_sort(Doxygen::classLinkedMap->begin(),
12889 classComp);
12890 std::stable_sort(Doxygen::conceptLinkedMap->begin(),
12892 conceptComp);
12893 std::stable_sort(Doxygen::namespaceLinkedMap->begin(),
12895 namespaceComp);
12896 g_s.end();
12897
12898 g_s.begin("Determining which enums are documented\n");
12900 g_s.end();
12901
12902 g_s.begin("Computing member relations...\n");
12905 g_s.end();
12906
12907 g_s.begin("Building full member lists recursively...\n");
12909 g_s.end();
12910
12911 g_s.begin("Adding members to member groups.\n");
12913 g_s.end();
12914
12915 if (Config_getBool(DISTRIBUTE_GROUP_DOC))
12916 {
12917 g_s.begin("Distributing member group documentation.\n");
12919 g_s.end();
12920 }
12921
12922 g_s.begin("Computing member references...\n");
12924 g_s.end();
12925
12926 if (Config_getBool(INHERIT_DOCS))
12927 {
12928 g_s.begin("Inheriting documentation...\n");
12930 g_s.end();
12931 }
12932
12933
12934 // compute the shortest possible names of all files
12935 // without losing the uniqueness of the file names.
12936 g_s.begin("Generating disk names...\n");
12938 g_s.end();
12939
12940 g_s.begin("Adding source references...\n");
12942 g_s.end();
12943
12944 g_s.begin("Adding xrefitems...\n");
12947 g_s.end();
12948
12949 g_s.begin("Sorting member lists...\n");
12951 g_s.end();
12952
12953 g_s.begin("Setting anonymous enum type...\n");
12955 g_s.end();
12956
12957 g_s.begin("Computing dependencies between directories...\n");
12959 g_s.end();
12960
12961 g_s.begin("Generating citations page...\n");
12963 g_s.end();
12964
12965 g_s.begin("Counting members...\n");
12966 countMembers();
12967 g_s.end();
12968
12969 g_s.begin("Counting data structures...\n");
12971 g_s.end();
12972
12973 g_s.begin("Resolving user defined references...\n");
12975 g_s.end();
12976
12977 g_s.begin("Finding anchors and sections in the documentation...\n");
12979 g_s.end();
12980
12981 g_s.begin("Transferring function references...\n");
12983 g_s.end();
12984
12985 g_s.begin("Combining using relations...\n");
12987 g_s.end();
12988
12990 g_s.begin("Adding members to index pages...\n");
12992 addToIndices();
12993 g_s.end();
12994
12995 g_s.begin("Correcting members for VHDL...\n");
12997 g_s.end();
12998
12999 g_s.begin("Computing tooltip texts...\n");
13001 g_s.end();
13002
13003 if (Config_getBool(SORT_GROUP_NAMES))
13004 {
13005 std::stable_sort(Doxygen::groupLinkedMap->begin(),
13007 [](const auto &g1,const auto &g2)
13008 { return g1->groupTitle() < g2->groupTitle(); });
13009
13010 for (const auto &gd : *Doxygen::groupLinkedMap)
13011 {
13012 gd->sortSubGroups();
13013 }
13014 }
13015
13016 printNavTree(root.get(),0);
13018}
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:1435
void parse(const QCString &fileName, const char *data=nullptr)
Parses a user provided layout.
Definition layout.cpp:1468
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:5249
void printNavTree(Entry *root, int indent)
Definition doxygen.cpp:9903
static void buildGroupList(const Entry *root)
Definition doxygen.cpp:425
static void findUsingDeclarations(const Entry *root, bool filterPythonPackages)
Definition doxygen.cpp:2006
static void flushCachedTemplateRelations()
Definition doxygen.cpp:9331
static void computeTemplateClassRelations()
Definition doxygen.cpp:5341
void printSectionsTree()
Definition doxygen.cpp:9926
static void generateXRefPages()
Definition doxygen.cpp:5513
static void findUsingDeclImports(const Entry *root)
Definition doxygen.cpp:2159
static void findDirDocumentation(const Entry *root)
Definition doxygen.cpp:9568
static void warnUndocumentedNamespaces()
Definition doxygen.cpp:5296
static void buildConceptList(const Entry *root)
Definition doxygen.cpp:1276
static void resolveClassNestingRelations()
Definition doxygen.cpp:1331
static void findClassEntries(const Entry *root)
Definition doxygen.cpp:5212
static void vhdlCorrectMemberProperties()
Definition doxygen.cpp:8303
static void stopDoxygen(int)
static void computeMemberReferences()
Definition doxygen.cpp:5410
static void transferRelatedFunctionDocumentation()
Definition doxygen.cpp:4368
static void addMembersToMemberGroup()
Definition doxygen.cpp:9201
static void findMainPageTagFiles(Entry *root)
Definition doxygen.cpp:9727
static void distributeConceptGroups()
Definition doxygen.cpp:1298
static void transferFunctionDocumentation()
Definition doxygen.cpp:4287
static void setAnonymousEnumType()
Definition doxygen.cpp:8941
static void sortMemberLists()
Definition doxygen.cpp:8846
static void createTemplateInstanceMembers()
Definition doxygen.cpp:8431
void transferStaticInstanceInitializers()
Definition doxygen.cpp:4417
static void findObjCMethodDefinitions(const Entry *root)
Definition doxygen.cpp:7447
static void buildTypedefList(const Entry *root)
Definition doxygen.cpp:3355
static void findGroupScope(const Entry *root)
Definition doxygen.cpp:440
static void findDefineDocumentation(Entry *root)
Definition doxygen.cpp:9482
static void findMemberDocumentation(const Entry *root)
Definition doxygen.cpp:7417
static void distributeMemberGroupDocumentation()
Definition doxygen.cpp:9239
static void addEnumValuesToEnums(const Entry *root)
Definition doxygen.cpp:7650
static void resolveUserReferences()
Definition doxygen.cpp:9789
static void buildVarList(const Entry *root)
Definition doxygen.cpp:3491
static void buildSequenceList(const Entry *root)
Definition doxygen.cpp:3454
static void buildNamespaceList(const Entry *root)
Definition doxygen.cpp:1671
static void readTagFile(const std::shared_ptr< Entry > &root, const QCString &tagLine)
static void findIncludedUsingDirectives()
Definition doxygen.cpp:2409
static void countMembers()
Definition doxygen.cpp:8955
static void organizeSubGroups(const Entry *root)
Definition doxygen.cpp:484
void searchInputFiles()
static void findFriends()
Definition doxygen.cpp:4190
static void findEnums(const Entry *root)
Definition doxygen.cpp:7475
static void addListReferences()
Definition doxygen.cpp:5444
static void exitDoxygen() noexcept
static void addMembersToIndex()
Definition doxygen.cpp:8093
static void findMainPage(Entry *root)
Definition doxygen.cpp:9657
static void findUsingDirectives(const Entry *root)
Definition doxygen.cpp:1851
static void addSourceReferences()
Definition doxygen.cpp:8728
static void buildExampleList(Entry *root)
Definition doxygen.cpp:9874
static void inheritDocumentation()
Definition doxygen.cpp:9141
static void flushUnresolvedRelations()
Definition doxygen.cpp:9385
static QCString g_commentFileName
Definition doxygen.cpp:192
static void findDocumentedEnumValues()
Definition doxygen.cpp:8085
static void findTagLessClasses()
Definition doxygen.cpp:1647
static void generateDiskNames()
static void addToIndices()
Definition doxygen.cpp:8135
static void computeClassRelations()
Definition doxygen.cpp:5316
static void buildFunctionList(const Entry *root)
Definition doxygen.cpp:3881
static void checkPageRelations()
Definition doxygen.cpp:9769
static void findModuleDocumentation(const Entry *root)
Definition doxygen.cpp:1266
static void findEnumDocumentation(const Entry *root)
Definition doxygen.cpp:7973
static void computePageRelations(Entry *root)
Definition doxygen.cpp:9739
static QCString createOutputDirectory(const QCString &baseDirName, const QCString &formatDirName, const char *defaultDirName)
static StringSet g_usingDeclarations
Definition doxygen.cpp:189
static void buildDictionaryList(const Entry *root)
Definition doxygen.cpp:3472
static void buildClassDocList(const Entry *root)
Definition doxygen.cpp:1137
static void buildPageList(Entry *root)
Definition doxygen.cpp:9630
static void computeVerifiedDotPath()
static bool g_singleComment
Definition doxygen.cpp:193
static void findSectionsInDocumentation()
Definition doxygen.cpp:9277
static void mergeCategories()
Definition doxygen.cpp:8450
static void buildFileList(const Entry *root)
Definition doxygen.cpp:496
static void buildClassList(const Entry *root)
Definition doxygen.cpp:1127
static void findUsedTemplateInstances()
Definition doxygen.cpp:5280
static void computeTooltipTexts()
Definition doxygen.cpp:8895
static void parseFilesSingleThreading(const std::shared_ptr< Entry > &root)
parse the list of input files
static void buildCompleteMemberLists()
Definition doxygen.cpp:8472
static void combineUsingRelations()
Definition doxygen.cpp:9176
static void checkMarkdownMainfile()
static std::unordered_map< std::string, std::vector< ClassDefMutable * > > g_usingClassMap
Definition doxygen.cpp:2157
static void buildConceptDocList(const Entry *root)
Definition doxygen.cpp:1286
static void parseFilesMultiThreading(const std::shared_ptr< Entry > &root)
parse the list of input files
static void transferFunctionReferences()
Definition doxygen.cpp:4320
static void buildDefineList()
Definition doxygen.cpp:8807
static void buildInterfaceAndServiceList(const Entry *root)
Definition doxygen.cpp:3585
static void computeMemberRelations()
Definition doxygen.cpp:8415
static void buildListOfUsingDecls(const Entry *root)
Definition doxygen.cpp:1993
static std::multimap< std::string, const Entry * > g_classEntries
Definition doxygen.cpp:186
void printLayout()
Definition layout.cpp:1820
#define warn_uncond(fmt,...)
Definition message.h:122
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
const char * qPrint(const char *s)
Definition qcstring.h:672
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:5937
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
Definition util.cpp:1414
int getPrefixIndex(const QCString &name)
Definition util.cpp:3676

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 11419 of file doxygen.cpp.

11420{
11421 QCString versionString = getFullVersion();
11422
11423 // helper that calls \a func to write to file \a fileName via a TextStream
11424 auto writeFile = [](const char *fileName,std::function<void(TextStream&)> func) -> bool
11425 {
11426 std::ofstream f;
11427 if (openOutputFile(fileName,f))
11428 {
11429 TextStream t(&f);
11430 func(t);
11431 return true;
11432 }
11433 return false;
11434 };
11435
11436
11437 /**************************************************************************
11438 * Handle arguments *
11439 **************************************************************************/
11440
11441 int optInd=1;
11442 QCString configName;
11443 QCString traceName;
11444 bool genConfig=false;
11445 bool shortList=false;
11446 bool traceTiming=false;
11448 bool updateConfig=false;
11449 bool quiet = false;
11450 while (optInd<argc && argv[optInd][0]=='-' &&
11451 (isalpha(argv[optInd][1]) || argv[optInd][1]=='?' ||
11452 argv[optInd][1]=='-')
11453 )
11454 {
11455 switch(argv[optInd][1])
11456 {
11457 case 'g':
11458 {
11459 genConfig=TRUE;
11460 }
11461 break;
11462 case 'l':
11463 {
11464 QCString layoutName;
11465 if (optInd+1>=argc)
11466 {
11467 layoutName="DoxygenLayout.xml";
11468 }
11469 else
11470 {
11471 layoutName=argv[optInd+1];
11472 }
11473 writeDefaultLayoutFile(layoutName);
11475 exit(0);
11476 }
11477 break;
11478 case 'c':
11479 if (optInd+1>=argc) // no file name given
11480 {
11481 err("option \"-c\" is missing the file name to read\n");
11482 devUsage();
11484 exit(1);
11485 }
11486 else
11487 {
11488 g_commentFileName=argv[optInd+1];
11489 optInd++;
11490 }
11491 g_singleComment=true;
11492 quiet=true;
11493 break;
11494 case 'd':
11495 {
11496 QCString debugLabel=getArg(argc,argv,optInd);
11497 if (debugLabel.isEmpty())
11498 {
11499 devUsage();
11501 exit(0);
11502 }
11503 int retVal = Debug::setFlagStr(debugLabel);
11504 if (!retVal)
11505 {
11506 err("option \"-d\" has unknown debug specifier: \"{}\".\n",debugLabel);
11507 devUsage();
11509 exit(1);
11510 }
11511 }
11512 break;
11513 case 't':
11514 {
11515#if ENABLE_TRACING
11516 if (!strcmp(argv[optInd]+1,"t_time"))
11517 {
11518 traceTiming = true;
11519 }
11520 else if (!strcmp(argv[optInd]+1,"t"))
11521 {
11522 traceTiming = false;
11523 }
11524 else
11525 {
11526 err("option should be \"-t\" or \"-t_time\", found: \"{}\".\n",argv[optInd]);
11528 exit(1);
11529 }
11530 if (optInd+1>=argc || argv[optInd+1][0] == '-') // no file name given
11531 {
11532 traceName="stdout";
11533 }
11534 else
11535 {
11536 traceName=argv[optInd+1];
11537 optInd++;
11538 }
11539#else
11540 err("support for option \"-t\" has not been compiled in (use a debug build or a release build with tracing enabled).\n");
11542 exit(1);
11543#endif
11544 }
11545 break;
11546 case 'x':
11547 if (!strcmp(argv[optInd]+1,"x_noenv")) diffList=Config::CompareMode::CompressedNoEnv;
11548 else if (!strcmp(argv[optInd]+1,"x")) diffList=Config::CompareMode::Compressed;
11549 else
11550 {
11551 err("option should be \"-x\" or \"-x_noenv\", found: \"{}\".\n",argv[optInd]);
11553 exit(1);
11554 }
11555 break;
11556 case 's':
11557 shortList=TRUE;
11558 break;
11559 case 'u':
11560 updateConfig=TRUE;
11561 break;
11562 case 'e':
11563 {
11564 QCString formatName=getArg(argc,argv,optInd);
11565 if (formatName.isEmpty())
11566 {
11567 err("option \"-e\" is missing format specifier rtf.\n");
11569 exit(1);
11570 }
11571 if (qstricmp(formatName.data(),"rtf")==0)
11572 {
11573 if (optInd+1>=argc)
11574 {
11575 err("option \"-e rtf\" is missing an extensions file name\n");
11577 exit(1);
11578 }
11579 writeFile(argv[optInd+1],RTFGenerator::writeExtensionsFile);
11581 exit(0);
11582 }
11583 err("option \"-e\" has invalid format specifier.\n");
11585 exit(1);
11586 }
11587 break;
11588 case 'f':
11589 {
11590 QCString listName=getArg(argc,argv,optInd);
11591 if (listName.isEmpty())
11592 {
11593 err("option \"-f\" is missing list specifier.\n");
11595 exit(1);
11596 }
11597 if (qstricmp(listName.data(),"emoji")==0)
11598 {
11599 if (optInd+1>=argc)
11600 {
11601 err("option \"-f emoji\" is missing an output file name\n");
11603 exit(1);
11604 }
11605 writeFile(argv[optInd+1],[](TextStream &t) { EmojiEntityMapper::instance().writeEmojiFile(t); });
11607 exit(0);
11608 }
11609 err("option \"-f\" has invalid list specifier.\n");
11611 exit(1);
11612 }
11613 break;
11614 case 'w':
11615 {
11616 QCString formatName=getArg(argc,argv,optInd);
11617 if (formatName.isEmpty())
11618 {
11619 err("option \"-w\" is missing format specifier rtf, html or latex\n");
11621 exit(1);
11622 }
11623 if (qstricmp(formatName.data(),"rtf")==0)
11624 {
11625 if (optInd+1>=argc)
11626 {
11627 err("option \"-w rtf\" is missing a style sheet file name\n");
11629 exit(1);
11630 }
11631 if (!writeFile(argv[optInd+1],RTFGenerator::writeStyleSheetFile))
11632 {
11633 err("error opening RTF style sheet file {}!\n",argv[optInd+1]);
11635 exit(1);
11636 }
11638 exit(0);
11639 }
11640 else if (qstricmp(formatName.data(),"html")==0)
11641 {
11642 Config::init();
11643 if (optInd+4<argc || FileInfo("Doxyfile").exists() || FileInfo("doxyfile").exists())
11644 // explicit config file mentioned or default found on disk
11645 {
11646 QCString df = optInd+4<argc ? argv[optInd+4] : (FileInfo("Doxyfile").exists() ? QCString("Doxyfile") : QCString("doxyfile"));
11647 if (!Config::parse(df)) // parse the config file
11648 {
11649 err("error opening or reading configuration file {}!\n",argv[optInd+4]);
11651 exit(1);
11652 }
11653 }
11654 if (optInd+3>=argc)
11655 {
11656 err("option \"-w html\" does not have enough arguments\n");
11658 exit(1);
11659 }
11663 setTranslator(Config_getEnum(OUTPUT_LANGUAGE));
11664 writeFile(argv[optInd+1],[&](TextStream &t) { HtmlGenerator::writeHeaderFile(t,argv[optInd+3]); });
11665 writeFile(argv[optInd+2],HtmlGenerator::writeFooterFile);
11666 writeFile(argv[optInd+3],HtmlGenerator::writeStyleSheetFile);
11668 exit(0);
11669 }
11670 else if (qstricmp(formatName.data(),"latex")==0)
11671 {
11672 Config::init();
11673 if (optInd+4<argc || FileInfo("Doxyfile").exists() || FileInfo("doxyfile").exists())
11674 {
11675 QCString df = optInd+4<argc ? argv[optInd+4] : (FileInfo("Doxyfile").exists() ? QCString("Doxyfile") : QCString("doxyfile"));
11676 if (!Config::parse(df))
11677 {
11678 err("error opening or reading configuration file {}!\n",argv[optInd+4]);
11680 exit(1);
11681 }
11682 }
11683 if (optInd+3>=argc)
11684 {
11685 err("option \"-w latex\" does not have enough arguments\n");
11687 exit(1);
11688 }
11692 setTranslator(Config_getEnum(OUTPUT_LANGUAGE));
11693 writeFile(argv[optInd+1],LatexGenerator::writeHeaderFile);
11694 writeFile(argv[optInd+2],LatexGenerator::writeFooterFile);
11695 writeFile(argv[optInd+3],LatexGenerator::writeStyleSheetFile);
11697 exit(0);
11698 }
11699 else
11700 {
11701 err("Illegal format specifier \"{}\": should be one of rtf, html or latex\n",formatName);
11703 exit(1);
11704 }
11705 }
11706 break;
11707 case 'm':
11709 break;
11710 case 'v':
11711 version(false);
11713 exit(0);
11714 break;
11715 case 'V':
11716 version(true);
11718 exit(0);
11719 break;
11720 case '-':
11721 if (qstrcmp(&argv[optInd][2],"help")==0)
11722 {
11723 usage(argv[0],versionString);
11724 exit(0);
11725 }
11726 else if (qstrcmp(&argv[optInd][2],"version")==0)
11727 {
11728 version(false);
11730 exit(0);
11731 }
11732 else if ((qstrcmp(&argv[optInd][2],"Version")==0) ||
11733 (qstrcmp(&argv[optInd][2],"VERSION")==0))
11734 {
11735 version(true);
11737 exit(0);
11738 }
11739 else
11740 {
11741 err("Unknown option \"-{}\"\n",&argv[optInd][1]);
11742 usage(argv[0],versionString);
11743 exit(1);
11744 }
11745 break;
11746 case 'b':
11747 setvbuf(stdout,nullptr,_IONBF,0);
11748 break;
11749 case 'q':
11750 quiet = true;
11751 break;
11752 case 'h':
11753 case '?':
11754 usage(argv[0],versionString);
11755 exit(0);
11756 break;
11757 default:
11758 err("Unknown option \"-{:c}\"\n",argv[optInd][1]);
11759 usage(argv[0],versionString);
11760 exit(1);
11761 }
11762 optInd++;
11763 }
11764
11765 /**************************************************************************
11766 * Parse or generate the config file *
11767 **************************************************************************/
11768
11769 initTracing(traceName.data(),traceTiming);
11770 TRACE("Doxygen version used: {}",getFullVersion());
11771 Config::init();
11772
11773 FileInfo configFileInfo1("Doxyfile"),configFileInfo2("doxyfile");
11774 if (optInd>=argc)
11775 {
11776 if (configFileInfo1.exists())
11777 {
11778 configName="Doxyfile";
11779 }
11780 else if (configFileInfo2.exists())
11781 {
11782 configName="doxyfile";
11783 }
11784 else if (genConfig)
11785 {
11786 configName="Doxyfile";
11787 }
11788 else
11789 {
11790 err("Doxyfile not found and no input file specified!\n");
11791 usage(argv[0],versionString);
11792 exit(1);
11793 }
11794 }
11795 else
11796 {
11797 FileInfo fi(argv[optInd]);
11798 if (fi.exists() || qstrcmp(argv[optInd],"-")==0 || genConfig)
11799 {
11800 configName=argv[optInd];
11801 }
11802 else
11803 {
11804 err("configuration file {} not found!\n",argv[optInd]);
11805 usage(argv[0],versionString);
11806 exit(1);
11807 }
11808 }
11809
11810 if (genConfig)
11811 {
11812 generateConfigFile(configName,shortList);
11814 exit(0);
11815 }
11816
11817 if (!Config::parse(configName,updateConfig,diffList))
11818 {
11819 err("could not open or read configuration file {}!\n",configName);
11821 exit(1);
11822 }
11823
11824 if (diffList!=Config::CompareMode::Full)
11825 {
11827 compareDoxyfile(diffList);
11829 exit(0);
11830 }
11831
11832 if (updateConfig)
11833 {
11835 generateConfigFile(configName,shortList,TRUE);
11837 exit(0);
11838 }
11839
11840 /* Perlmod wants to know the path to the config file.*/
11841 FileInfo configFileInfo(configName.str());
11842 setPerlModDoxyfile(configFileInfo.absFilePath());
11843
11844 /* handle -q option */
11845 if (quiet) Config_updateBool(QUIET,TRUE);
11846}
static bool setFlagStr(const QCString &label)
Definition debug.cpp:103
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:1732
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:6720

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(), 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 11069 of file doxygen.cpp.

11081{
11082 //printf("killSet count=%d\n",killSet ? (int)killSet->size() : -1);
11083 // strip trailing slashes
11084 if (s.isEmpty()) return;
11085
11086 g_pathsVisited.clear();
11087
11088 FileInfo fi(s.str());
11089 //printf("readFileOrDirectory(%s)\n",s);
11090 {
11091 if (exclSet==nullptr || exclSet->find(fi.absFilePath())==exclSet->end())
11092 {
11093 if (Config_getBool(EXCLUDE_SYMLINKS) && fi.isSymLink())
11094 {
11095 }
11096 else if (!fi.exists() || !fi.isReadable())
11097 {
11098 if (errorIfNotExist)
11099 {
11100 warn_uncond("source '{}' is not a readable file or directory... skipping.\n",s);
11101 }
11102 }
11103 else if (fi.isFile())
11104 {
11105 std::string dirPath = fi.dirPath(true);
11106 std::string filePath = fi.absFilePath();
11107 if (paths && !dirPath.empty())
11108 {
11109 paths->insert(dirPath);
11110 }
11111 //printf("killSet.find(%s)=%d\n",qPrint(fi.absFilePath()),killSet.find(fi.absFilePath())!=killSet.end());
11112 if (killSet==nullptr || killSet->find(filePath)==killSet->end())
11113 {
11114 std::string name=fi.fileName();
11115 if (fnMap)
11116 {
11117 auto fd = createFileDef(QCString(dirPath+"/"),QCString(name));
11118 if (!name.empty())
11119 {
11120 FileName *fn = fnMap->add(QCString(name),QCString(filePath));
11121 fn->push_back(std::move(fd));
11122 }
11123 }
11124 if (resultList || resultSet)
11125 {
11126 if (resultList) resultList->push_back(filePath);
11127 if (resultSet) resultSet->insert(filePath);
11128 }
11129
11130 if (killSet) killSet->insert(fi.absFilePath());
11131 }
11132 }
11133 else if (fi.isDir()) // readable dir
11134 {
11135 readDir(&fi,fnMap,exclSet,patList,
11136 exclPatList,resultList,resultSet,errorIfNotExist,
11137 recursive,killSet,paths);
11138 }
11139 }
11140 }
11141}
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(), readDir(), QCString::str(), and warn_uncond.

Referenced by searchInputFiles().