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

11765{
11766 AUTO_TRACE();
11767 Doxygen::globalNamespaceDef = createNamespaceDef("<globalScope>",1,1,"<globalScope>");
11777
11778 setTranslator(Config_getEnum(OUTPUT_LANGUAGE));
11779
11780 /* Set the global html file extension. */
11781 Doxygen::htmlFileExtension = Config_getString(HTML_FILE_EXTENSION);
11782
11783
11785 Config_getBool(CALLER_GRAPH) ||
11786 Config_getBool(REFERENCES_RELATION) ||
11787 Config_getBool(REFERENCED_BY_RELATION);
11788
11789 /**************************************************************************
11790 * Add custom extension mappings
11791 **************************************************************************/
11792
11793 const StringVector &extMaps = Config_getList(EXTENSION_MAPPING);
11794 for (const auto &mapping : extMaps)
11795 {
11796 QCString mapStr = mapping.c_str();
11797 int i=mapStr.find('=');
11798 if (i==-1)
11799 {
11800 continue;
11801 }
11802 else
11803 {
11804 QCString ext = mapStr.left(i).stripWhiteSpace().lower();
11805 QCString language = mapStr.mid(i+1).stripWhiteSpace().lower();
11806 if (ext.isEmpty() || language.isEmpty())
11807 {
11808 continue;
11809 }
11810
11811 if (!updateLanguageMapping(ext,language))
11812 {
11813 err("Failed to map file extension '%s' to unsupported language '%s'.\n"
11814 "Check the EXTENSION_MAPPING setting in the config file.\n",
11815 qPrint(ext),qPrint(language));
11816 }
11817 else
11818 {
11819 msg("Adding custom extension mapping: '%s' will be treated as language '%s'\n",
11820 qPrint(ext),qPrint(language));
11821 }
11822 }
11823 }
11824 // create input file exncodings
11825
11826 // check INPUT_ENCODING
11827 void *cd = portable_iconv_open("UTF-8",Config_getString(INPUT_ENCODING).data());
11828 if (cd==reinterpret_cast<void *>(-1))
11829 {
11830 term("unsupported character conversion: '%s'->'%s': %s\n"
11831 "Check the 'INPUT_ENCODING' setting in the config file!\n",
11832 qPrint(Config_getString(INPUT_ENCODING)),qPrint("UTF-8"),strerror(errno));
11833 }
11834 else
11835 {
11837 }
11838
11839 // check and split INPUT_FILE_ENCODING
11840 const StringVector &fileEncod = Config_getList(INPUT_FILE_ENCODING);
11841 for (const auto &mapping : fileEncod)
11842 {
11843 QCString mapStr = mapping.c_str();
11844 int i=mapStr.find('=');
11845 if (i==-1)
11846 {
11847 continue;
11848 }
11849 else
11850 {
11851 QCString pattern = mapStr.left(i).stripWhiteSpace().lower();
11852 QCString encoding = mapStr.mid(i+1).stripWhiteSpace().lower();
11853 if (pattern.isEmpty() || encoding.isEmpty())
11854 {
11855 continue;
11856 }
11857 cd = portable_iconv_open("UTF-8",encoding.data());
11858 if (cd==reinterpret_cast<void *>(-1))
11859 {
11860 term("unsupported character conversion: '%s'->'%s': %s\n"
11861 "Check the 'INPUT_FILE_ENCODING' setting in the config file!\n",
11862 qPrint(encoding),qPrint("UTF-8"),strerror(errno));
11863 }
11864 else
11865 {
11867 }
11868
11869 Doxygen::inputFileEncodingList.emplace_back(pattern, encoding);
11870 }
11871 }
11872
11873 // add predefined macro name to a dictionary
11874 const StringVector &expandAsDefinedList =Config_getList(EXPAND_AS_DEFINED);
11875 for (const auto &s : expandAsDefinedList)
11876 {
11877 Doxygen::expandAsDefinedSet.insert(s.c_str());
11878 }
11879
11880 // read aliases and store them in a dictionary
11881 readAliases();
11882
11883 // store number of spaces in a tab into Doxygen::spaces
11884 int tabSize = Config_getInt(TAB_SIZE);
11885 Doxygen::spaces.resize(tabSize);
11886 for (int sp=0; sp<tabSize; sp++) Doxygen::spaces.at(sp)=' ';
11887 Doxygen::spaces.at(tabSize)='\0';
11888}
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:661
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 11753 of file doxygen.cpp.

11754{
11755 AUTO_TRACE();
11756
11761}
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 11295 of file doxygen.cpp.

11296{
11300
11301 delete Doxygen::indexList;
11310 Doxygen::mainPage.reset();
11314 Doxygen::globalScope = nullptr;
11316 delete theTranslator;
11317 delete g_outputList;
11318
11323 delete Doxygen::dirLinkedMap;
11324 delete Doxygen::symbolMap;
11325}
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:180
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(), readConfiguration(), and stopDoxygen().

◆ generateOutput()

void generateOutput ( )

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

Definition at line 12889 of file doxygen.cpp.

12890{
12891 AUTO_TRACE();
12892 /**************************************************************************
12893 * Initialize output generators *
12894 **************************************************************************/
12895
12896 /// add extra languages for which we can only produce syntax highlighted code
12898
12899 //// dump all symbols
12900 if (g_dumpSymbolMap)
12901 {
12902 dumpSymbolMap();
12903 exit(0);
12904 }
12905
12906 bool generateHtml = Config_getBool(GENERATE_HTML);
12907 bool generateLatex = Config_getBool(GENERATE_LATEX);
12908 bool generateMan = Config_getBool(GENERATE_MAN);
12909 bool generateRtf = Config_getBool(GENERATE_RTF);
12910 bool generateDocbook = Config_getBool(GENERATE_DOCBOOK);
12911
12912
12914 if (generateHtml)
12915 {
12919 }
12920 if (generateLatex)
12921 {
12924 }
12925 if (generateDocbook)
12926 {
12929 }
12930 if (generateMan)
12931 {
12932 g_outputList->add<ManGenerator>();
12934 }
12935 if (generateRtf)
12936 {
12937 g_outputList->add<RTFGenerator>();
12939 }
12940 if (Config_getBool(USE_HTAGS))
12941 {
12943 QCString htmldir = Config_getString(HTML_OUTPUT);
12944 if (!Htags::execute(htmldir))
12945 err("USE_HTAGS is YES but htags(1) failed. \n");
12946 else if (!Htags::loadFilemap(htmldir))
12947 err("htags(1) ended normally but failed to load the filemap. \n");
12948 }
12949
12950 /**************************************************************************
12951 * Generate documentation *
12952 **************************************************************************/
12953
12954 g_s.begin("Generating style sheet...\n");
12955 //printf("writing style info\n");
12956 g_outputList->writeStyleInfo(0); // write first part
12957 g_s.end();
12958
12959 bool searchEngine = Config_getBool(SEARCHENGINE);
12960 bool serverBasedSearch = Config_getBool(SERVER_BASED_SEARCH);
12961
12962 g_s.begin("Generating search indices...\n");
12963 if (searchEngine && !serverBasedSearch && generateHtml)
12964 {
12966 }
12967
12968 // generate search indices (need to do this before writing other HTML
12969 // pages as these contain a drop down menu with options depending on
12970 // what categories we find in this function.
12971 if (generateHtml && searchEngine)
12972 {
12973 QCString searchDirName = Config_getString(HTML_OUTPUT)+"/search";
12974 Dir searchDir(searchDirName.str());
12975 if (!searchDir.exists() && !searchDir.mkdir(searchDirName.str()))
12976 {
12977 term("Could not create search results directory '%s' $PWD='%s'\n",
12978 qPrint(searchDirName),Dir::currentDirPath().c_str());
12979 }
12980 HtmlGenerator::writeSearchData(searchDirName);
12981 if (!serverBasedSearch) // client side search index
12982 {
12984 }
12985 }
12986 g_s.end();
12987
12988 // copy static stuff
12989 if (generateHtml)
12990 {
12993 copyLogo(Config_getString(HTML_OUTPUT));
12994 copyIcon(Config_getString(HTML_OUTPUT));
12995 copyExtraFiles(Config_getList(HTML_EXTRA_FILES),"HTML_EXTRA_FILES",Config_getString(HTML_OUTPUT));
12996 }
12997 if (generateLatex)
12998 {
13000 copyLogo(Config_getString(LATEX_OUTPUT));
13001 copyIcon(Config_getString(LATEX_OUTPUT));
13002 copyExtraFiles(Config_getList(LATEX_EXTRA_FILES),"LATEX_EXTRA_FILES",Config_getString(LATEX_OUTPUT));
13003 }
13004 if (generateDocbook)
13005 {
13006 copyLogo(Config_getString(DOCBOOK_OUTPUT));
13007 copyIcon(Config_getString(DOCBOOK_OUTPUT));
13008 }
13009 if (generateRtf)
13010 {
13011 copyLogo(Config_getString(RTF_OUTPUT));
13012 copyIcon(Config_getString(RTF_OUTPUT));
13013 copyExtraFiles(Config_getList(RTF_EXTRA_FILES),"RTF_EXTRA_FILES",Config_getString(RTF_OUTPUT));
13014 }
13015
13017 if (fm.hasFormulas() && generateHtml
13018 && !Config_getBool(USE_MATHJAX))
13019 {
13020 g_s.begin("Generating images for formulas in HTML...\n");
13021 fm.generateImages(Config_getString(HTML_OUTPUT), Config_getEnum(HTML_FORMULA_FORMAT)==HTML_FORMULA_FORMAT_t::svg ?
13023 g_s.end();
13024 }
13025 if (fm.hasFormulas() && generateRtf)
13026 {
13027 g_s.begin("Generating images for formulas in RTF...\n");
13029 g_s.end();
13030 }
13031
13032 if (fm.hasFormulas() && generateDocbook)
13033 {
13034 g_s.begin("Generating images for formulas in Docbook...\n");
13036 g_s.end();
13037 }
13038
13039 g_s.begin("Generating example documentation...\n");
13041 g_s.end();
13042
13043 g_s.begin("Generating file sources...\n");
13045 g_s.end();
13046
13047 g_s.begin("Generating file documentation...\n");
13049 g_s.end();
13050
13051 g_s.begin("Generating page documentation...\n");
13053 g_s.end();
13054
13055 g_s.begin("Generating group documentation...\n");
13057 g_s.end();
13058
13059 g_s.begin("Generating class documentation...\n");
13061 g_s.end();
13062
13063 g_s.begin("Generating concept documentation...\n");
13065 g_s.end();
13066
13067 g_s.begin("Generating module documentation...\n");
13069 g_s.end();
13070
13071 g_s.begin("Generating namespace documentation...\n");
13073 g_s.end();
13074
13075 if (Config_getBool(GENERATE_LEGEND))
13076 {
13077 g_s.begin("Generating graph info page...\n");
13079 g_s.end();
13080 }
13081
13082 g_s.begin("Generating directory documentation...\n");
13084 g_s.end();
13085
13086 if (g_outputList->size()>0)
13087 {
13089 }
13090
13091 g_s.begin("finalizing index lists...\n");
13092 Doxygen::indexList->finalize();
13093 g_s.end();
13094
13095 g_s.begin("writing tag file...\n");
13096 writeTagFile();
13097 g_s.end();
13098
13099 if (Config_getBool(GENERATE_XML))
13100 {
13101 g_s.begin("Generating XML output...\n");
13103 generateXML();
13105 g_s.end();
13106 }
13107 if (Config_getBool(GENERATE_SQLITE3))
13108 {
13109 g_s.begin("Generating SQLITE3 output...\n");
13111 g_s.end();
13112 }
13113
13114 if (Config_getBool(GENERATE_AUTOGEN_DEF))
13115 {
13116 g_s.begin("Generating AutoGen DEF output...\n");
13117 generateDEF();
13118 g_s.end();
13119 }
13120 if (Config_getBool(GENERATE_PERLMOD))
13121 {
13122 g_s.begin("Generating Perl module output...\n");
13124 g_s.end();
13125 }
13126 if (generateHtml && searchEngine && serverBasedSearch)
13127 {
13128 g_s.begin("Generating search index\n");
13129 if (Doxygen::searchIndex.kind()==SearchIndexIntf::Internal) // write own search index
13130 {
13132 Doxygen::searchIndex.write(Config_getString(HTML_OUTPUT)+"/search/search.idx");
13133 }
13134 else // write data for external search index
13135 {
13137 QCString searchDataFile = Config_getString(SEARCHDATA_FILE);
13138 if (searchDataFile.isEmpty())
13139 {
13140 searchDataFile="searchdata.xml";
13141 }
13142 if (!Portable::isAbsolutePath(searchDataFile.data()))
13143 {
13144 searchDataFile.prepend(Config_getString(OUTPUT_DIRECTORY)+"/");
13145 }
13146 Doxygen::searchIndex.write(searchDataFile);
13147 }
13148 g_s.end();
13149 }
13150
13151 if (generateRtf)
13152 {
13153 g_s.begin("Combining RTF output...\n");
13154 if (!RTFGenerator::preProcessFileInplace(Config_getString(RTF_OUTPUT),"refman.rtf"))
13155 {
13156 err("An error occurred during post-processing the RTF files!\n");
13157 }
13158 g_s.end();
13159 }
13160
13161 g_s.begin("Running plantuml with JAVA...\n");
13163 g_s.end();
13164
13165 if (Config_getBool(HAVE_DOT))
13166 {
13167 g_s.begin("Running dot...\n");
13169 g_s.end();
13170 }
13171
13172 if (generateHtml &&
13173 Config_getBool(GENERATE_HTMLHELP) &&
13174 !Config_getString(HHC_LOCATION).isEmpty())
13175 {
13176 g_s.begin("Running html help compiler...\n");
13178 g_s.end();
13179 }
13180
13181 if ( generateHtml &&
13182 Config_getBool(GENERATE_QHP) &&
13183 !Config_getString(QHG_LOCATION).isEmpty())
13184 {
13185 g_s.begin("Running qhelpgenerator...\n");
13187 g_s.end();
13188 }
13189
13190 g_outputList->cleanup();
13191
13192 msg("type lookup cache used %zu/%zu hits=%" PRIu64 " misses=%" PRIu64 "\n",
13194 Doxygen::typeLookupCache->capacity(),
13196 Doxygen::typeLookupCache->misses());
13197 msg("symbol lookup cache used %zu/%zu hits=%" PRIu64 " misses=%" PRIu64 "\n",
13199 Doxygen::symbolLookupCache->capacity(),
13201 Doxygen::symbolLookupCache->misses());
13202 int typeCacheParam = computeIdealCacheParam(static_cast<size_t>(Doxygen::typeLookupCache->misses()*2/3)); // part of the cache is flushed, hence the 2/3 correction factor
13203 int symbolCacheParam = computeIdealCacheParam(static_cast<size_t>(Doxygen::symbolLookupCache->misses()));
13204 int cacheParam = std::max(typeCacheParam,symbolCacheParam);
13205 if (cacheParam>Config_getInt(LOOKUP_CACHE_SIZE))
13206 {
13207 msg("Note: based on cache misses the ideal setting for LOOKUP_CACHE_SIZE is %d at the cost of higher memory usage.\n",cacheParam);
13208 }
13209
13211 {
13212
13213 std::size_t numThreads = static_cast<std::size_t>(Config_getInt(NUM_PROC_THREADS));
13214 if (numThreads<1) numThreads=1;
13215 msg("Total elapsed time: %.6f seconds\n(of which an average of %.6f seconds per thread waiting for external tools to finish)\n",
13216 (static_cast<double>(Debug::elapsedTime())),
13217 Portable::getSysElapsedTime()/static_cast<double>(numThreads)
13218 );
13219 g_s.print();
13220
13222 msg("finished...\n");
13224 }
13225 else
13226 {
13227 msg("finished...\n");
13228 }
13229
13230
13231 /**************************************************************************
13232 * Start cleaning up *
13233 **************************************************************************/
13234
13236
13238 Dir thisDir;
13239 thisDir.remove(Doxygen::filterDBFileName.str());
13241 exitTracing();
13243 delete Doxygen::clangUsrMap;
13245
13246 //dumpDocNodeSizes();
13247}
@ 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:526
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:9909
static void generateExampleDocs()
Definition doxygen.cpp:9864
static void dumpSymbolMap()
static void generateFileDocs()
Definition doxygen.cpp:8526
static void copyIcon(const QCString &outputOption)
static void generatePageDocs()
Definition doxygen.cpp:9716
static void generateFileSources()
Definition doxygen.cpp:8360
static void copyLogo(const QCString &outputOption)
static void generateClassDocs()
Definition doxygen.cpp:8945
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:183
static bool g_successfulRun
Definition doxygen.cpp:182
static void generateNamespaceDocs()
static void writeTagFile()
void cleanUpDoxygen()
static void generateConceptDocs()
Definition doxygen.cpp:8971
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:2175

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

11227{
11228 initResources();
11229 QCString lang = Portable::getenv("LC_ALL");
11230 if (!lang.isEmpty()) Portable::setenv("LANG",lang);
11231 std::setlocale(LC_ALL,"");
11232 std::setlocale(LC_CTYPE,"C"); // to get isspace(0xA0)==0, needed for UTF-8
11233 std::setlocale(LC_NUMERIC,"C");
11234
11236
11260
11261 // register any additional parsers here...
11262
11264
11265#if USE_LIBCLANG
11267#endif
11276 Doxygen::pageLinkedMap = new PageLinkedMap; // all doc pages
11277 Doxygen::exampleLinkedMap = new PageLinkedMap; // all examples
11278 //Doxygen::tagDestinationDict.setAutoDelete(TRUE);
11280
11281 // initialization of these globals depends on
11282 // configuration switches so we need to postpone these
11283 Doxygen::globalScope = nullptr;
11292
11293}
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 12251 of file doxygen.cpp.

12252{
12253 AUTO_TRACE();
12254 std::atexit(exitDoxygen);
12255
12256 Portable::correctPath(Config_getList(EXTERNAL_TOOL_PATH));
12257
12258#if USE_LIBCLANG
12259 Doxygen::clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING);
12260#endif
12261
12262 // we would like to show the versionString earlier, but we first have to handle the configuration file
12263 // to know the value of the QUIET setting.
12264 QCString versionString = getFullVersion();
12265 msg("Doxygen version used: %s\n",qPrint(versionString));
12266
12268
12269 /**************************************************************************
12270 * Make sure the output directory exists
12271 **************************************************************************/
12272 QCString outputDirectory = Config_getString(OUTPUT_DIRECTORY);
12273 if (outputDirectory.isEmpty())
12274 {
12275 outputDirectory = Config_updateString(OUTPUT_DIRECTORY,Dir::currentDirPath().c_str());
12276 }
12277 else
12278 {
12279 Dir dir(outputDirectory.str());
12280 if (!dir.exists())
12281 {
12282 dir.setPath(Dir::currentDirPath());
12283 if (!dir.mkdir(outputDirectory.str()))
12284 {
12285 term("tag OUTPUT_DIRECTORY: Output directory '%s' does not "
12286 "exist and cannot be created\n",qPrint(outputDirectory));
12287 }
12288 else
12289 {
12290 msg("Notice: Output directory '%s' does not exist. "
12291 "I have created it for you.\n", qPrint(outputDirectory));
12292 }
12293 dir.setPath(outputDirectory.str());
12294 }
12295 outputDirectory = Config_updateString(OUTPUT_DIRECTORY,dir.absPath().c_str());
12296 }
12297 AUTO_TRACE_ADD("outputDirectory={}",outputDirectory);
12298
12299 /**************************************************************************
12300 * Initialize global lists and dictionaries
12301 **************************************************************************/
12302
12303 // also scale lookup cache with SYMBOL_CACHE_SIZE
12304 int cacheSize = Config_getInt(LOOKUP_CACHE_SIZE);
12305 if (cacheSize<0) cacheSize=0;
12306 if (cacheSize>9) cacheSize=9;
12307 uint32_t lookupSize = 65536 << cacheSize;
12310
12311#ifdef HAS_SIGNALS
12312 signal(SIGINT, stopDoxygen);
12313#endif
12314
12315 uint32_t pid = Portable::pid();
12316 Doxygen::filterDBFileName.sprintf("doxygen_filterdb_%d.tmp",pid);
12317 Doxygen::filterDBFileName.prepend(outputDirectory+"/");
12318
12319 /**************************************************************************
12320 * Check/create output directories *
12321 **************************************************************************/
12322
12323 QCString htmlOutput;
12324 bool generateHtml = Config_getBool(GENERATE_HTML);
12325 if (generateHtml)
12326 {
12327 htmlOutput = createOutputDirectory(outputDirectory,Config_getString(HTML_OUTPUT),"/html");
12328 Config_updateString(HTML_OUTPUT,htmlOutput);
12329
12330 QCString sitemapUrl = Config_getString(SITEMAP_URL);
12331 bool generateSitemap = !sitemapUrl.isEmpty();
12332 if (generateSitemap && !sitemapUrl.endsWith("/"))
12333 {
12334 Config_updateString(SITEMAP_URL,sitemapUrl+"/");
12335 }
12336
12337 // add HTML indexers that are enabled
12338 bool generateHtmlHelp = Config_getBool(GENERATE_HTMLHELP);
12339 bool generateEclipseHelp = Config_getBool(GENERATE_ECLIPSEHELP);
12340 bool generateQhp = Config_getBool(GENERATE_QHP);
12341 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
12342 bool generateDocSet = Config_getBool(GENERATE_DOCSET);
12343 if (generateEclipseHelp) Doxygen::indexList->addIndex<EclipseHelp>();
12344 if (generateHtmlHelp) Doxygen::indexList->addIndex<HtmlHelp>();
12345 if (generateQhp) Doxygen::indexList->addIndex<Qhp>();
12346 if (generateSitemap) Doxygen::indexList->addIndex<Sitemap>();
12347 if (generateTreeView) Doxygen::indexList->addIndex<FTVHelp>(TRUE);
12348 if (generateDocSet) Doxygen::indexList->addIndex<DocSets>();
12349 Doxygen::indexList->addIndex<Crawlmap>();
12350 Doxygen::indexList->initialize();
12351 }
12352
12353 QCString docbookOutput;
12354 bool generateDocbook = Config_getBool(GENERATE_DOCBOOK);
12355 if (generateDocbook)
12356 {
12357 docbookOutput = createOutputDirectory(outputDirectory,Config_getString(DOCBOOK_OUTPUT),"/docbook");
12358 Config_updateString(DOCBOOK_OUTPUT,docbookOutput);
12359 }
12360
12361 QCString xmlOutput;
12362 bool generateXml = Config_getBool(GENERATE_XML);
12363 if (generateXml)
12364 {
12365 xmlOutput = createOutputDirectory(outputDirectory,Config_getString(XML_OUTPUT),"/xml");
12366 Config_updateString(XML_OUTPUT,xmlOutput);
12367 }
12368
12369 QCString latexOutput;
12370 bool generateLatex = Config_getBool(GENERATE_LATEX);
12371 if (generateLatex)
12372 {
12373 latexOutput = createOutputDirectory(outputDirectory,Config_getString(LATEX_OUTPUT), "/latex");
12374 Config_updateString(LATEX_OUTPUT,latexOutput);
12375 }
12376
12377 QCString rtfOutput;
12378 bool generateRtf = Config_getBool(GENERATE_RTF);
12379 if (generateRtf)
12380 {
12381 rtfOutput = createOutputDirectory(outputDirectory,Config_getString(RTF_OUTPUT),"/rtf");
12382 Config_updateString(RTF_OUTPUT,rtfOutput);
12383 }
12384
12385 QCString manOutput;
12386 bool generateMan = Config_getBool(GENERATE_MAN);
12387 if (generateMan)
12388 {
12389 manOutput = createOutputDirectory(outputDirectory,Config_getString(MAN_OUTPUT),"/man");
12390 Config_updateString(MAN_OUTPUT,manOutput);
12391 }
12392
12393 QCString sqlOutput;
12394 bool generateSql = Config_getBool(GENERATE_SQLITE3);
12395 if (generateSql)
12396 {
12397 sqlOutput = createOutputDirectory(outputDirectory,Config_getString(SQLITE3_OUTPUT),"/sqlite3");
12398 Config_updateString(SQLITE3_OUTPUT,sqlOutput);
12399 }
12400
12401 if (Config_getBool(HAVE_DOT))
12402 {
12403 QCString curFontPath = Config_getString(DOT_FONTPATH);
12404 if (curFontPath.isEmpty())
12405 {
12406 Portable::getenv("DOTFONTPATH");
12407 QCString newFontPath = ".";
12408 if (!curFontPath.isEmpty())
12409 {
12410 newFontPath+=Portable::pathListSeparator();
12411 newFontPath+=curFontPath;
12412 }
12413 Portable::setenv("DOTFONTPATH",qPrint(newFontPath));
12414 }
12415 else
12416 {
12417 Portable::setenv("DOTFONTPATH",qPrint(curFontPath));
12418 }
12419 }
12420
12421
12422
12423 /**************************************************************************
12424 * Handle layout file *
12425 **************************************************************************/
12426
12428 QCString layoutFileName = Config_getString(LAYOUT_FILE);
12429 bool defaultLayoutUsed = FALSE;
12430 if (layoutFileName.isEmpty())
12431 {
12432 layoutFileName = Config_updateString(LAYOUT_FILE,"DoxygenLayout.xml");
12433 defaultLayoutUsed = TRUE;
12434 }
12435 AUTO_TRACE_ADD("defaultLayoutUsed={}, layoutFileName={}",defaultLayoutUsed,layoutFileName);
12436
12437 FileInfo fi(layoutFileName.str());
12438 if (fi.exists())
12439 {
12440 msg("Parsing layout file %s...\n",qPrint(layoutFileName));
12441 LayoutDocManager::instance().parse(layoutFileName);
12442 }
12443 else if (!defaultLayoutUsed)
12444 {
12445 warn_uncond("failed to open layout file '%s' for reading! Using default settings.\n",qPrint(layoutFileName));
12446 }
12447 printLayout();
12448
12449 /**************************************************************************
12450 * Read and preprocess input *
12451 **************************************************************************/
12452
12453 // prevent search in the output directories
12454 StringVector exclPatterns = Config_getList(EXCLUDE_PATTERNS);
12455 if (generateHtml) exclPatterns.push_back(htmlOutput.str());
12456 if (generateDocbook) exclPatterns.push_back(docbookOutput.str());
12457 if (generateXml) exclPatterns.push_back(xmlOutput.str());
12458 if (generateLatex) exclPatterns.push_back(latexOutput.str());
12459 if (generateRtf) exclPatterns.push_back(rtfOutput.str());
12460 if (generateMan) exclPatterns.push_back(manOutput.str());
12461 Config_updateList(EXCLUDE_PATTERNS,exclPatterns);
12462
12464
12466
12467 // Notice: the order of the function calls below is very important!
12468
12469 if (Config_getBool(GENERATE_HTML) && !Config_getBool(USE_MATHJAX))
12470 {
12472 }
12473 if (Config_getBool(GENERATE_RTF))
12474 {
12476 }
12477 if (Config_getBool(GENERATE_DOCBOOK))
12478 {
12480 }
12481
12483
12484 /**************************************************************************
12485 * Handle Tag Files *
12486 **************************************************************************/
12487
12488 std::shared_ptr<Entry> root = std::make_shared<Entry>();
12489 msg("Reading and parsing tag files\n");
12490
12491 const StringVector &tagFileList = Config_getList(TAGFILES);
12492 for (const auto &s : tagFileList)
12493 {
12494 readTagFile(root,s.c_str());
12495 }
12496
12497 /**************************************************************************
12498 * Parse source files *
12499 **************************************************************************/
12500
12501 addSTLSupport(root);
12502
12503 g_s.begin("Parsing files\n");
12504 if (Config_getInt(NUM_PROC_THREADS)==1)
12505 {
12507 }
12508 else
12509 {
12511 }
12512 g_s.end();
12513
12514 /**************************************************************************
12515 * Gather information *
12516 **************************************************************************/
12517
12518 g_s.begin("Building macro definition list...\n");
12520 g_s.end();
12521
12522 g_s.begin("Building group list...\n");
12523 buildGroupList(root.get());
12524 organizeSubGroups(root.get());
12525 g_s.end();
12526
12527 g_s.begin("Building directory list...\n");
12529 findDirDocumentation(root.get());
12530 g_s.end();
12531
12532 g_s.begin("Building namespace list...\n");
12533 buildNamespaceList(root.get());
12534 findUsingDirectives(root.get());
12535 g_s.end();
12536
12537 g_s.begin("Building file list...\n");
12538 buildFileList(root.get());
12539 g_s.end();
12540
12541 g_s.begin("Building class list...\n");
12542 buildClassList(root.get());
12543 g_s.end();
12544
12545 g_s.begin("Building concept list...\n");
12546 buildConceptList(root.get());
12547 g_s.end();
12548
12549 // build list of using declarations here (global list)
12550 buildListOfUsingDecls(root.get());
12551 g_s.end();
12552
12553 g_s.begin("Computing nesting relations for classes...\n");
12555 g_s.end();
12556 // 1.8.2-20121111: no longer add nested classes to the group as well
12557 //distributeClassGroupRelations();
12558
12559 // calling buildClassList may result in cached relations that
12560 // become invalid after resolveClassNestingRelations(), that's why
12561 // we need to clear the cache here
12562 Doxygen::typeLookupCache->clear();
12563 // we don't need the list of using declaration anymore
12564 g_usingDeclarations.clear();
12565
12566 g_s.begin("Associating documentation with classes...\n");
12567 buildClassDocList(root.get());
12568 g_s.end();
12569
12570 g_s.begin("Associating documentation with concepts...\n");
12571 buildConceptDocList(root.get());
12573 g_s.end();
12574
12575 g_s.begin("Associating documentation with modules...\n");
12576 findModuleDocumentation(root.get());
12577 g_s.end();
12578
12579 g_s.begin("Building example list...\n");
12580 buildExampleList(root.get());
12581 g_s.end();
12582
12583 g_s.begin("Searching for enumerations...\n");
12584 findEnums(root.get());
12585 g_s.end();
12586
12587 // Since buildVarList calls isVarWithConstructor
12588 // and this calls getResolvedClass we need to process
12589 // typedefs first so the relations between classes via typedefs
12590 // are properly resolved. See bug 536385 for an example.
12591 g_s.begin("Searching for documented typedefs...\n");
12592 buildTypedefList(root.get());
12593 g_s.end();
12594
12595 if (Config_getBool(OPTIMIZE_OUTPUT_SLICE))
12596 {
12597 g_s.begin("Searching for documented sequences...\n");
12598 buildSequenceList(root.get());
12599 g_s.end();
12600
12601 g_s.begin("Searching for documented dictionaries...\n");
12602 buildDictionaryList(root.get());
12603 g_s.end();
12604 }
12605
12606 g_s.begin("Searching for members imported via using declarations...\n");
12607 // this should be after buildTypedefList in order to properly import
12608 // used typedefs
12609 findUsingDeclarations(root.get(),TRUE); // do for python packages first
12610 findUsingDeclarations(root.get(),FALSE); // then the rest
12611 g_s.end();
12612
12613 g_s.begin("Searching for included using directives...\n");
12615 g_s.end();
12616
12617 g_s.begin("Searching for documented variables...\n");
12618 buildVarList(root.get());
12619 g_s.end();
12620
12621 g_s.begin("Building interface member list...\n");
12622 buildInterfaceAndServiceList(root.get()); // UNO IDL
12623
12624 g_s.begin("Building member list...\n"); // using class info only !
12625 buildFunctionList(root.get());
12626 g_s.end();
12627
12628 g_s.begin("Searching for friends...\n");
12629 findFriends();
12630 g_s.end();
12631
12632 g_s.begin("Searching for documented defines...\n");
12633 findDefineDocumentation(root.get());
12634 g_s.end();
12635
12636 g_s.begin("Computing class inheritance relations...\n");
12637 findClassEntries(root.get());
12639 g_s.end();
12640
12641 g_s.begin("Computing class usage relations...\n");
12643 g_s.end();
12644
12645 if (Config_getBool(INLINE_SIMPLE_STRUCTS))
12646 {
12647 g_s.begin("Searching for tag less structs...\n");
12649 g_s.end();
12650 }
12651
12652 g_s.begin("Flushing cached template relations that have become invalid...\n");
12654 g_s.end();
12655
12656 g_s.begin("Warn for undocumented namespaces...\n");
12658 g_s.end();
12659
12660 g_s.begin("Computing class relations...\n");
12663 if (Config_getBool(OPTIMIZE_OUTPUT_VHDL))
12664 {
12666 }
12668 g_classEntries.clear();
12669 g_s.end();
12670
12671 g_s.begin("Add enum values to enums...\n");
12672 addEnumValuesToEnums(root.get());
12673 findEnumDocumentation(root.get());
12674 g_s.end();
12675
12676 g_s.begin("Searching for member function documentation...\n");
12677 findObjCMethodDefinitions(root.get());
12678 findMemberDocumentation(root.get()); // may introduce new members !
12679 findUsingDeclImports(root.get()); // may introduce new members !
12683 g_s.end();
12684
12685 // moved to after finding and copying documentation,
12686 // as this introduces new members see bug 722654
12687 g_s.begin("Creating members for template instances...\n");
12689 g_s.end();
12690
12691 g_s.begin("Building page list...\n");
12692 buildPageList(root.get());
12693 g_s.end();
12694
12695 g_s.begin("Search for main page...\n");
12696 findMainPage(root.get());
12697 findMainPageTagFiles(root.get());
12698 g_s.end();
12699
12700 g_s.begin("Computing page relations...\n");
12701 computePageRelations(root.get());
12703 g_s.end();
12704
12705 g_s.begin("Determining the scope of groups...\n");
12706 findGroupScope(root.get());
12707 g_s.end();
12708
12709 g_s.begin("Computing module relations...\n");
12710 auto &mm = ModuleManager::instance();
12711 mm.resolvePartitions();
12712 mm.resolveImports();
12713 mm.collectExportedSymbols();
12714 g_s.end();
12715
12716 auto memberNameComp = [](const MemberNameLinkedMap::Ptr &n1,const MemberNameLinkedMap::Ptr &n2)
12717 {
12718 return qstricmp_sort(n1->memberName().data()+getPrefixIndex(n1->memberName()),
12719 n2->memberName().data()+getPrefixIndex(n2->memberName())
12720 )<0;
12721 };
12722
12723 auto classComp = [](const ClassLinkedMap::Ptr &c1,const ClassLinkedMap::Ptr &c2)
12724 {
12725 if (Config_getBool(SORT_BY_SCOPE_NAME))
12726 {
12727 return qstricmp_sort(c1->name(), c2->name())<0;
12728 }
12729 else
12730 {
12731 int i = qstricmp_sort(c1->className(), c2->className());
12732 return i==0 ? qstricmp_sort(c1->name(), c2->name())<0 : i<0;
12733 }
12734 };
12735
12736 auto namespaceComp = [](const NamespaceLinkedMap::Ptr &n1,const NamespaceLinkedMap::Ptr &n2)
12737 {
12738 return qstricmp_sort(n1->name(),n2->name())<0;
12739 };
12740
12741 auto conceptComp = [](const ConceptLinkedMap::Ptr &c1,const ConceptLinkedMap::Ptr &c2)
12742 {
12743 return qstricmp_sort(c1->name(),c2->name())<0;
12744 };
12745
12746 g_s.begin("Sorting lists...\n");
12747 std::stable_sort(Doxygen::memberNameLinkedMap->begin(),
12749 memberNameComp);
12750 std::stable_sort(Doxygen::functionNameLinkedMap->begin(),
12752 memberNameComp);
12753 std::stable_sort(Doxygen::hiddenClassLinkedMap->begin(),
12755 classComp);
12756 std::stable_sort(Doxygen::classLinkedMap->begin(),
12758 classComp);
12759 std::stable_sort(Doxygen::conceptLinkedMap->begin(),
12761 conceptComp);
12762 std::stable_sort(Doxygen::namespaceLinkedMap->begin(),
12764 namespaceComp);
12765 g_s.end();
12766
12767 g_s.begin("Determining which enums are documented\n");
12769 g_s.end();
12770
12771 g_s.begin("Computing member relations...\n");
12774 g_s.end();
12775
12776 g_s.begin("Building full member lists recursively...\n");
12778 g_s.end();
12779
12780 g_s.begin("Adding members to member groups.\n");
12782 g_s.end();
12783
12784 if (Config_getBool(DISTRIBUTE_GROUP_DOC))
12785 {
12786 g_s.begin("Distributing member group documentation.\n");
12788 g_s.end();
12789 }
12790
12791 g_s.begin("Computing member references...\n");
12793 g_s.end();
12794
12795 if (Config_getBool(INHERIT_DOCS))
12796 {
12797 g_s.begin("Inheriting documentation...\n");
12799 g_s.end();
12800 }
12801
12802
12803 // compute the shortest possible names of all files
12804 // without losing the uniqueness of the file names.
12805 g_s.begin("Generating disk names...\n");
12807 g_s.end();
12808
12809 g_s.begin("Adding source references...\n");
12811 g_s.end();
12812
12813 g_s.begin("Adding xrefitems...\n");
12816 g_s.end();
12817
12818 g_s.begin("Sorting member lists...\n");
12820 g_s.end();
12821
12822 g_s.begin("Setting anonymous enum type...\n");
12824 g_s.end();
12825
12826 g_s.begin("Computing dependencies between directories...\n");
12828 g_s.end();
12829
12830 g_s.begin("Generating citations page...\n");
12832 g_s.end();
12833
12834 g_s.begin("Counting members...\n");
12835 countMembers();
12836 g_s.end();
12837
12838 g_s.begin("Counting data structures...\n");
12840 g_s.end();
12841
12842 g_s.begin("Resolving user defined references...\n");
12844 g_s.end();
12845
12846 g_s.begin("Finding anchors and sections in the documentation...\n");
12848 g_s.end();
12849
12850 g_s.begin("Transferring function references...\n");
12852 g_s.end();
12853
12854 g_s.begin("Combining using relations...\n");
12856 g_s.end();
12857
12859 g_s.begin("Adding members to index pages...\n");
12861 addToIndices();
12862 g_s.end();
12863
12864 g_s.begin("Correcting members for VHDL...\n");
12866 g_s.end();
12867
12868 g_s.begin("Computing tooltip texts...\n");
12870 g_s.end();
12871
12872 if (Config_getBool(SORT_GROUP_NAMES))
12873 {
12874 std::stable_sort(Doxygen::groupLinkedMap->begin(),
12876 [](const auto &g1,const auto &g2)
12877 { return g1->groupTitle() < g2->groupTitle(); });
12878
12879 for (const auto &gd : *Doxygen::groupLinkedMap)
12880 {
12881 gd->sortSubGroups();
12882 }
12883 }
12884
12885 printNavTree(root.get(),0);
12887}
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
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:504
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:5113
void printNavTree(Entry *root, int indent)
Definition doxygen.cpp:9766
static void buildGroupList(const Entry *root)
Definition doxygen.cpp:412
static void findUsingDeclarations(const Entry *root, bool filterPythonPackages)
Definition doxygen.cpp:1978
static void flushCachedTemplateRelations()
Definition doxygen.cpp:9182
static void computeTemplateClassRelations()
Definition doxygen.cpp:5209
void printSectionsTree()
Definition doxygen.cpp:9847
static void generateXRefPages()
Definition doxygen.cpp:5381
static void findUsingDeclImports(const Entry *root)
Definition doxygen.cpp:2082
static void findDirDocumentation(const Entry *root)
Definition doxygen.cpp:9426
static void warnUndocumentedNamespaces()
Definition doxygen.cpp:5160
static void buildConceptList(const Entry *root)
Definition doxygen.cpp:1248
static void resolveClassNestingRelations()
Definition doxygen.cpp:1303
static void findClassEntries(const Entry *root)
Definition doxygen.cpp:5083
static void vhdlCorrectMemberProperties()
Definition doxygen.cpp:8164
static void stopDoxygen(int)
static void computeMemberReferences()
Definition doxygen.cpp:5278
static void transferRelatedFunctionDocumentation()
Definition doxygen.cpp:4195
static void addMembersToMemberGroup()
Definition doxygen.cpp:9052
static void findMainPageTagFiles(Entry *root)
Definition doxygen.cpp:9586
static void distributeConceptGroups()
Definition doxygen.cpp:1270
static void transferFunctionDocumentation()
Definition doxygen.cpp:4114
static void setAnonymousEnumType()
Definition doxygen.cpp:8799
static void sortMemberLists()
Definition doxygen.cpp:8704
static void createTemplateInstanceMembers()
Definition doxygen.cpp:8289
void transferStaticInstanceInitializers()
Definition doxygen.cpp:4244
static void findObjCMethodDefinitions(const Entry *root)
Definition doxygen.cpp:7322
static void findGroupScope(const Entry *root)
Definition doxygen.cpp:427
static void findDefineDocumentation(Entry *root)
Definition doxygen.cpp:9333
static void findMemberDocumentation(const Entry *root)
Definition doxygen.cpp:7292
static void distributeMemberGroupDocumentation()
Definition doxygen.cpp:9090
static void addEnumValuesToEnums(const Entry *root)
Definition doxygen.cpp:7521
static void resolveUserReferences()
Definition doxygen.cpp:9648
static void buildNamespaceList(const Entry *root)
Definition doxygen.cpp:1643
static void readTagFile(const std::shared_ptr< Entry > &root, const QCString &tagLine)
static void findIncludedUsingDirectives()
Definition doxygen.cpp:2364
static void countMembers()
Definition doxygen.cpp:8813
static void organizeSubGroups(const Entry *root)
Definition doxygen.cpp:471
void searchInputFiles()
static void findEnums(const Entry *root)
Definition doxygen.cpp:7350
static void addListReferences()
Definition doxygen.cpp:5312
static void exitDoxygen() noexcept
static void addMembersToIndex()
Definition doxygen.cpp:7954
static void findMainPage(Entry *root)
Definition doxygen.cpp:9516
static void findUsingDirectives(const Entry *root)
Definition doxygen.cpp:1823
static void addSourceReferences()
Definition doxygen.cpp:8586
static void buildExampleList(Entry *root)
Definition doxygen.cpp:9733
static void inheritDocumentation()
Definition doxygen.cpp:8992
static void flushUnresolvedRelations()
Definition doxygen.cpp:9236
static void findDocumentedEnumValues()
Definition doxygen.cpp:7946
static void findTagLessClasses()
Definition doxygen.cpp:1619
static void generateDiskNames()
static void addToIndices()
Definition doxygen.cpp:7996
static void computeClassRelations()
Definition doxygen.cpp:5180
static void checkPageRelations()
Definition doxygen.cpp:9628
static void findModuleDocumentation(const Entry *root)
Definition doxygen.cpp:1238
static void findEnumDocumentation(const Entry *root)
Definition doxygen.cpp:7831
static void computePageRelations(Entry *root)
Definition doxygen.cpp:9598
static QCString createOutputDirectory(const QCString &baseDirName, const QCString &formatDirName, const char *defaultDirName)
static StringSet g_usingDeclarations
Definition doxygen.cpp:181
static void buildClassDocList(const Entry *root)
Definition doxygen.cpp:1109
static void buildPageList(Entry *root)
Definition doxygen.cpp:9489
static void computeVerifiedDotPath()
static void findSectionsInDocumentation()
Definition doxygen.cpp:9128
static void mergeCategories()
Definition doxygen.cpp:8308
void printLayout()
Definition doxygen.cpp:9804
static void buildFileList(const Entry *root)
Definition doxygen.cpp:483
static void buildClassList(const Entry *root)
Definition doxygen.cpp:1099
static void findUsedTemplateInstances()
Definition doxygen.cpp:5144
static void computeTooltipTexts()
Definition doxygen.cpp:8753
static void parseFilesSingleThreading(const std::shared_ptr< Entry > &root)
parse the list of input files
static void buildCompleteMemberLists()
Definition doxygen.cpp:8330
static void combineUsingRelations()
Definition doxygen.cpp:9027
static void checkMarkdownMainfile()
static void buildConceptDocList(const Entry *root)
Definition doxygen.cpp:1258
static void parseFilesMultiThreading(const std::shared_ptr< Entry > &root)
parse the list of input files
static void transferFunctionReferences()
Definition doxygen.cpp:4147
static void buildDefineList()
Definition doxygen.cpp:8665
static void computeMemberRelations()
Definition doxygen.cpp:8273
static void buildListOfUsingDecls(const Entry *root)
Definition doxygen.cpp:1965
static std::multimap< std::string, const Entry * > g_classEntries
Definition doxygen.cpp:178
#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 addSTLSupport(std::shared_ptr< Entry > &root)
Add stub entries for the most used classes in the standard template library.
int getPrefixIndex(const QCString &name)
Definition util.cpp:3590

References Dir::absPath(), addEnumValuesToEnums(), addListReferences(), addMembersToIndex(), addMembersToMemberGroup(), addSourceReferences(), addSTLSupport(), addToIndices(), AUTO_TRACE, AUTO_TRACE_ADD, begin(), buildClassDocList(), buildClassList(), buildCompleteMemberLists(), buildConceptDocList(), buildConceptList(), buildDefineList(), buildDirectories(), buildExampleList(), buildFileList(), buildGroupList(), buildListOfUsingDecls(), buildNamespaceList(), buildPageList(), checkMarkdownMainfile(), checkPageRelations(), FormulaManager::checkRepositories(), Doxygen::clangAssistedParsing, Doxygen::classLinkedMap, 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, Doxygen::filterDBFileName, findClassEntries(), findDefineDocumentation(), findDirDocumentation(), findDocumentedEnumValues(), findEnumDocumentation(), findEnums(), findGroupScope(), findIncludedUsingDirectives(), findInheritedTemplateInstances(), findMainPage(), findMainPageTagFiles(), findMemberDocumentation(), findModuleDocumentation(), findObjCMethodDefinitions(), findSectionsInDocumentation(), findTagLessClasses(), findUsedTemplateInstances(), findUsingDeclarations(), findUsingDeclImports(), findUsingDirectives(), flushCachedTemplateRelations(), flushUnresolvedRelations(), Doxygen::functionNameLinkedMap, g_classEntries, g_s, g_usingDeclarations, generateDiskNames(), 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(), Doxygen::memberNameLinkedMap, mergeCategories(), Dir::mkdir(), msg(), Doxygen::namespaceLinkedMap, organizeSubGroups(), LayoutDocManager::parse(), parseFilesMultiThreading(), parseFilesSingleThreading(), Portable::pathListSeparator(), Portable::pid(), printLayout(), printNavTree(), printSectionsTree(), qPrint(), qstricmp_sort(), readTagFile(), resolveClassNestingRelations(), resolveUserReferences(), searchInputFiles(), setAnonymousEnumType(), Portable::setenv(), Dir::setPath(), sortMemberLists(), GroupDef::sortSubGroups(), 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 11339 of file doxygen.cpp.

11340{
11341 QCString versionString = getFullVersion();
11342
11343 // helper that calls \a func to write to file \a fileName via a TextStream
11344 auto writeFile = [](const char *fileName,std::function<void(TextStream&)> func) -> bool
11345 {
11346 std::ofstream f;
11347 if (openOutputFile(fileName,f))
11348 {
11349 TextStream t(&f);
11350 func(t);
11351 return true;
11352 }
11353 return false;
11354 };
11355
11356
11357 /**************************************************************************
11358 * Handle arguments *
11359 **************************************************************************/
11360
11361 int optInd=1;
11362 QCString configName;
11363 QCString traceName;
11364 bool genConfig=false;
11365 bool shortList=false;
11366 bool traceTiming=false;
11368 bool updateConfig=false;
11369 bool quiet = false;
11370 while (optInd<argc && argv[optInd][0]=='-' &&
11371 (isalpha(argv[optInd][1]) || argv[optInd][1]=='?' ||
11372 argv[optInd][1]=='-')
11373 )
11374 {
11375 switch(argv[optInd][1])
11376 {
11377 case 'g':
11378 {
11379 genConfig=TRUE;
11380 }
11381 break;
11382 case 'l':
11383 {
11384 QCString layoutName;
11385 if (optInd+1>=argc)
11386 {
11387 layoutName="DoxygenLayout.xml";
11388 }
11389 else
11390 {
11391 layoutName=argv[optInd+1];
11392 }
11393 writeDefaultLayoutFile(layoutName);
11395 exit(0);
11396 }
11397 break;
11398 case 'd':
11399 {
11400 QCString debugLabel=getArg(argc,argv,optInd);
11401 if (debugLabel.isEmpty())
11402 {
11403 devUsage();
11405 exit(0);
11406 }
11407 int retVal = Debug::setFlagStr(debugLabel);
11408 if (!retVal)
11409 {
11410 err("option \"-d\" has unknown debug specifier: \"%s\".\n",qPrint(debugLabel));
11411 devUsage();
11413 exit(1);
11414 }
11415 }
11416 break;
11417 case 't':
11418 {
11419#if ENABLE_TRACING
11420 if (!strcmp(argv[optInd]+1,"t_time"))
11421 {
11422 traceTiming = true;
11423 }
11424 else if (!strcmp(argv[optInd]+1,"t"))
11425 {
11426 traceTiming = false;
11427 }
11428 else
11429 {
11430 err("option should be \"-t\" or \"-t_time\", found: \"%s\".\n",argv[optInd]);
11432 exit(1);
11433 }
11434 if (optInd+1>=argc || argv[optInd+1][0] == '-') // no file name given
11435 {
11436 traceName="stdout";
11437 }
11438 else
11439 {
11440 traceName=argv[optInd+1];
11441 optInd++;
11442 }
11443#else
11444 err("support for option \"-t\" has not been compiled in (use a debug build or a release build with tracing enabled).\n");
11446 exit(1);
11447#endif
11448 }
11449 break;
11450 case 'x':
11451 if (!strcmp(argv[optInd]+1,"x_noenv")) diffList=Config::CompareMode::CompressedNoEnv;
11452 else if (!strcmp(argv[optInd]+1,"x")) diffList=Config::CompareMode::Compressed;
11453 else
11454 {
11455 err("option should be \"-x\" or \"-x_noenv\", found: \"%s\".\n",argv[optInd]);
11457 exit(1);
11458 }
11459 break;
11460 case 's':
11461 shortList=TRUE;
11462 break;
11463 case 'u':
11464 updateConfig=TRUE;
11465 break;
11466 case 'e':
11467 {
11468 QCString formatName=getArg(argc,argv,optInd);
11469 if (formatName.isEmpty())
11470 {
11471 err("option \"-e\" is missing format specifier rtf.\n");
11473 exit(1);
11474 }
11475 if (qstricmp(formatName.data(),"rtf")==0)
11476 {
11477 if (optInd+1>=argc)
11478 {
11479 err("option \"-e rtf\" is missing an extensions file name\n");
11481 exit(1);
11482 }
11483 writeFile(argv[optInd+1],RTFGenerator::writeExtensionsFile);
11485 exit(0);
11486 }
11487 err("option \"-e\" has invalid format specifier.\n");
11489 exit(1);
11490 }
11491 break;
11492 case 'f':
11493 {
11494 QCString listName=getArg(argc,argv,optInd);
11495 if (listName.isEmpty())
11496 {
11497 err("option \"-f\" is missing list specifier.\n");
11499 exit(1);
11500 }
11501 if (qstricmp(listName.data(),"emoji")==0)
11502 {
11503 if (optInd+1>=argc)
11504 {
11505 err("option \"-f emoji\" is missing an output file name\n");
11507 exit(1);
11508 }
11509 writeFile(argv[optInd+1],[](TextStream &t) { EmojiEntityMapper::instance().writeEmojiFile(t); });
11511 exit(0);
11512 }
11513 err("option \"-f\" has invalid list specifier.\n");
11515 exit(1);
11516 }
11517 break;
11518 case 'w':
11519 {
11520 QCString formatName=getArg(argc,argv,optInd);
11521 if (formatName.isEmpty())
11522 {
11523 err("option \"-w\" is missing format specifier rtf, html or latex\n");
11525 exit(1);
11526 }
11527 if (qstricmp(formatName.data(),"rtf")==0)
11528 {
11529 if (optInd+1>=argc)
11530 {
11531 err("option \"-w rtf\" is missing a style sheet file name\n");
11533 exit(1);
11534 }
11535 if (!writeFile(argv[optInd+1],RTFGenerator::writeStyleSheetFile))
11536 {
11537 err("error opening RTF style sheet file %s!\n",argv[optInd+1]);
11539 exit(1);
11540 }
11542 exit(0);
11543 }
11544 else if (qstricmp(formatName.data(),"html")==0)
11545 {
11546 Config::init();
11547 if (optInd+4<argc || FileInfo("Doxyfile").exists() || FileInfo("doxyfile").exists())
11548 // explicit config file mentioned or default found on disk
11549 {
11550 QCString df = optInd+4<argc ? argv[optInd+4] : (FileInfo("Doxyfile").exists() ? QCString("Doxyfile") : QCString("doxyfile"));
11551 if (!Config::parse(df)) // parse the config file
11552 {
11553 err("error opening or reading configuration file %s!\n",argv[optInd+4]);
11555 exit(1);
11556 }
11557 }
11558 if (optInd+3>=argc)
11559 {
11560 err("option \"-w html\" does not have enough arguments\n");
11562 exit(1);
11563 }
11567 setTranslator(Config_getEnum(OUTPUT_LANGUAGE));
11568 writeFile(argv[optInd+1],[&](TextStream &t) { HtmlGenerator::writeHeaderFile(t,argv[optInd+3]); });
11569 writeFile(argv[optInd+2],HtmlGenerator::writeFooterFile);
11570 writeFile(argv[optInd+3],HtmlGenerator::writeStyleSheetFile);
11572 exit(0);
11573 }
11574 else if (qstricmp(formatName.data(),"latex")==0)
11575 {
11576 Config::init();
11577 if (optInd+4<argc || FileInfo("Doxyfile").exists() || FileInfo("doxyfile").exists())
11578 {
11579 QCString df = optInd+4<argc ? argv[optInd+4] : (FileInfo("Doxyfile").exists() ? QCString("Doxyfile") : QCString("doxyfile"));
11580 if (!Config::parse(df))
11581 {
11582 err("error opening or reading configuration file %s!\n",argv[optInd+4]);
11584 exit(1);
11585 }
11586 }
11587 if (optInd+3>=argc)
11588 {
11589 err("option \"-w latex\" does not have enough arguments\n");
11591 exit(1);
11592 }
11596 setTranslator(Config_getEnum(OUTPUT_LANGUAGE));
11597 writeFile(argv[optInd+1],LatexGenerator::writeHeaderFile);
11598 writeFile(argv[optInd+2],LatexGenerator::writeFooterFile);
11599 writeFile(argv[optInd+3],LatexGenerator::writeStyleSheetFile);
11601 exit(0);
11602 }
11603 else
11604 {
11605 err("Illegal format specifier \"%s\": should be one of rtf, html or latex\n",qPrint(formatName));
11607 exit(1);
11608 }
11609 }
11610 break;
11611 case 'm':
11613 break;
11614 case 'v':
11615 version(false);
11617 exit(0);
11618 break;
11619 case 'V':
11620 version(true);
11622 exit(0);
11623 break;
11624 case '-':
11625 if (qstrcmp(&argv[optInd][2],"help")==0)
11626 {
11627 usage(argv[0],versionString);
11628 exit(0);
11629 }
11630 else if (qstrcmp(&argv[optInd][2],"version")==0)
11631 {
11632 version(false);
11634 exit(0);
11635 }
11636 else if ((qstrcmp(&argv[optInd][2],"Version")==0) ||
11637 (qstrcmp(&argv[optInd][2],"VERSION")==0))
11638 {
11639 version(true);
11641 exit(0);
11642 }
11643 else
11644 {
11645 err("Unknown option \"-%s\"\n",&argv[optInd][1]);
11646 usage(argv[0],versionString);
11647 exit(1);
11648 }
11649 break;
11650 case 'b':
11651 setvbuf(stdout,nullptr,_IONBF,0);
11652 break;
11653 case 'q':
11654 quiet = true;
11655 break;
11656 case 'h':
11657 case '?':
11658 usage(argv[0],versionString);
11659 exit(0);
11660 break;
11661 default:
11662 err("Unknown option \"-%c\"\n",argv[optInd][1]);
11663 usage(argv[0],versionString);
11664 exit(1);
11665 }
11666 optInd++;
11667 }
11668
11669 /**************************************************************************
11670 * Parse or generate the config file *
11671 **************************************************************************/
11672
11673 initTracing(traceName.data(),traceTiming);
11674 TRACE("Doxygen version used: {}",getFullVersion());
11675 Config::init();
11676
11677 FileInfo configFileInfo1("Doxyfile"),configFileInfo2("doxyfile");
11678 if (optInd>=argc)
11679 {
11680 if (configFileInfo1.exists())
11681 {
11682 configName="Doxyfile";
11683 }
11684 else if (configFileInfo2.exists())
11685 {
11686 configName="doxyfile";
11687 }
11688 else if (genConfig)
11689 {
11690 configName="Doxyfile";
11691 }
11692 else
11693 {
11694 err("Doxyfile not found and no input file specified!\n");
11695 usage(argv[0],versionString);
11696 exit(1);
11697 }
11698 }
11699 else
11700 {
11701 FileInfo fi(argv[optInd]);
11702 if (fi.exists() || qstrcmp(argv[optInd],"-")==0 || genConfig)
11703 {
11704 configName=argv[optInd];
11705 }
11706 else
11707 {
11708 err("configuration file %s not found!\n",argv[optInd]);
11709 usage(argv[0],versionString);
11710 exit(1);
11711 }
11712 }
11713
11714 if (genConfig)
11715 {
11716 generateConfigFile(configName,shortList);
11718 exit(0);
11719 }
11720
11721 if (!Config::parse(configName,updateConfig,diffList))
11722 {
11723 err("could not open or read configuration file %s!\n",qPrint(configName));
11725 exit(1);
11726 }
11727
11728 if (diffList!=Config::CompareMode::Full)
11729 {
11731 compareDoxyfile(diffList);
11733 exit(0);
11734 }
11735
11736 if (updateConfig)
11737 {
11739 generateConfigFile(configName,shortList,TRUE);
11741 exit(0);
11742 }
11743
11744 /* Perlmod wants to know the path to the config file.*/
11745 FileInfo configFileInfo(configName.str());
11746 setPerlModDoxyfile(configFileInfo.absFilePath());
11747
11748 /* handle -q option */
11749 if (quiet) Config_updateBool(QUIET,TRUE);
11750}
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:6623

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_dumpSymbolMap, 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 10990 of file doxygen.cpp.

11002{
11003 //printf("killSet count=%d\n",killSet ? (int)killSet->size() : -1);
11004 // strip trailing slashes
11005 if (s.isEmpty()) return;
11006
11007 g_pathsVisited.clear();
11008
11009 FileInfo fi(s.str());
11010 //printf("readFileOrDirectory(%s)\n",s);
11011 {
11012 if (exclSet==nullptr || exclSet->find(fi.absFilePath())==exclSet->end())
11013 {
11014 if (Config_getBool(EXCLUDE_SYMLINKS) && fi.isSymLink())
11015 {
11016 }
11017 else if (!fi.exists() || !fi.isReadable())
11018 {
11019 if (errorIfNotExist)
11020 {
11021 warn_uncond("source '%s' is not a readable file or directory... skipping.\n",qPrint(s));
11022 }
11023 }
11024 else if (fi.isFile())
11025 {
11026 std::string dirPath = fi.dirPath(true);
11027 std::string filePath = fi.absFilePath();
11028 if (paths && !dirPath.empty())
11029 {
11030 paths->insert(dirPath);
11031 }
11032 //printf("killSet.find(%s)=%d\n",qPrint(fi.absFilePath()),killSet.find(fi.absFilePath())!=killSet.end());
11033 if (killSet==nullptr || killSet->find(filePath)==killSet->end())
11034 {
11035 std::string name=fi.fileName();
11036 if (fnMap)
11037 {
11038 auto fd = createFileDef(QCString(dirPath+"/"),QCString(name));
11039 if (!name.empty())
11040 {
11041 FileName *fn = fnMap->add(QCString(name),QCString(filePath));
11042 fn->push_back(std::move(fd));
11043 }
11044 }
11045 if (resultList || resultSet)
11046 {
11047 if (resultList) resultList->push_back(filePath);
11048 if (resultSet) resultSet->insert(filePath);
11049 }
11050
11051 if (killSet) killSet->insert(fi.absFilePath());
11052 }
11053 }
11054 else if (fi.isDir()) // readable dir
11055 {
11056 readDir(&fi,fnMap,exclSet,patList,
11057 exclPatList,resultList,resultSet,errorIfNotExist,
11058 recursive,killSet,paths);
11059 }
11060 }
11061 }
11062}
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:265

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().