diff options
-rw-r--r-- | src/clangparser.cpp | 11 | ||||
-rw-r--r-- | src/doxygen.cpp | 17 | ||||
-rw-r--r-- | src/doxygen.h | 16 |
3 files changed, 19 insertions, 25 deletions
diff --git a/src/clangparser.cpp b/src/clangparser.cpp index c7639ea..0754888 100644 --- a/src/clangparser.cpp +++ b/src/clangparser.cpp @@ -169,7 +169,6 @@ void ClangParser::start(const char *fileName,QStrList &filesInTranslationUnit) p->index = clang_createIndex(0, 0); p->curLine = 1; p->curToken = 0; - QDictIterator<void> di(Doxygen::inputPaths); int argc=0; std::string error; // load a clang compilation database (https://clang.llvm.org/docs/JSONCompilationDatabase.html) @@ -197,7 +196,11 @@ void ClangParser::start(const char *fileName,QStrList &filesInTranslationUnit) } } } - char **argv = (char**)malloc(sizeof(char*)*(4+Doxygen::inputPaths.count()+includePath.count()+clangOptions.count()+clang_option_len)); + char **argv = (char**)malloc(sizeof(char*)* + (4+Doxygen::inputPaths.size()+ + includePath.count()+ + clangOptions.count()+ + clang_option_len)); if (!command.empty() ) { std::vector<std::string> options = command[command.size()-1].CommandLine; @@ -212,9 +215,9 @@ void ClangParser::start(const char *fileName,QStrList &filesInTranslationUnit) else { // add include paths for input files - for (di.toFirst();di.current();++di,++argc) + for (const std::string &path : Doxygen::inputPaths) { - QCString inc = QCString("-I")+di.currentKey(); + QCString inc = QCString("-I")+path.data(); argv[argc]=qstrdup(inc.data()); //printf("argv[%d]=%s\n",argc,argv[argc]); } diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 8ea7647..dde0f1d 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -127,7 +127,7 @@ GroupSDict *Doxygen::groupSDict = 0; PageSDict *Doxygen::pageSDict = 0; PageSDict *Doxygen::exampleSDict = 0; StringDict Doxygen::aliasDict(257); // aliases -QDict<void> Doxygen::inputPaths(1009); +std::set<std::string> Doxygen::inputPaths; FileNameLinkedMap *Doxygen::includeNameLinkedMap = 0; // include names FileNameLinkedMap *Doxygen::exampleNameLinkedMap = 0; // examples FileNameLinkedMap *Doxygen::imageNameLinkedMap = 0; // images @@ -9248,7 +9248,7 @@ static QDict<void> g_pathsVisited(1009); // The directory is read iff the recursiveFlag is set. // The contents of all files is append to the input string -int readDir(QFileInfo *fi, +static int readDir(QFileInfo *fi, FileNameLinkedMap *fnMap, StringDict *exclDict, QStrList *patList, @@ -9258,13 +9258,13 @@ int readDir(QFileInfo *fi, bool errorIfNotExist, bool recursive, std::unordered_set<std::string> *killSet, - QDict<void> *paths + std::set<std::string> *paths ) { QCString dirName = fi->absFilePath().utf8(); - if (paths && paths->find(dirName)==0) + if (paths && !dirName.isEmpty()) { - paths->insert(dirName,(void*)0x8); + paths->insert(dirName.data()); } if (fi->isSymLink()) { @@ -9359,7 +9359,7 @@ int readFileOrDirectory(const char *s, bool recursive, bool errorIfNotExist, std::unordered_set<std::string> *killSet, - QDict<void> *paths + std::set<std::string> *paths ) { //printf("killSet count=%d\n",killSet ? (int)killSet->size() : -1); @@ -9388,9 +9388,9 @@ int readFileOrDirectory(const char *s, { QCString dirPath = fi.dirPath(TRUE).utf8(); QCString filePath = fi.absFilePath().utf8(); - if (paths && paths->find(dirPath)) + if (paths && !dirPath.isEmpty()) { - paths->insert(dirPath,(void*)0x8); + paths->insert(dirPath.data()); } //printf("killSet.find(%s)=%d\n",fi.absFilePath().data(),killSet.find(fi.absFilePath())!=killSet.end()); if (killSet==0 || killSet->find(filePath.data())==killSet->end()) @@ -10594,6 +10594,7 @@ void searchInputFiles() g_s.begin("Searching INPUT for files to process...\n"); killSet.clear(); + Doxygen::inputPaths.clear(); QStrList &inputList=Config_getList(INPUT); g_inputFiles.setAutoDelete(TRUE); s=inputList.first(); diff --git a/src/doxygen.h b/src/doxygen.h index 74a9f71..8e1354a 100644 --- a/src/doxygen.h +++ b/src/doxygen.h @@ -22,6 +22,7 @@ #include <qdict.h> #include <qintdict.h> +#include <set> #include <unordered_set> #include "ftextstream.h" @@ -100,7 +101,7 @@ class Doxygen static bool insideMainPage; static FileNameLinkedMap *includeNameLinkedMap; static FileNameLinkedMap *exampleNameLinkedMap; - static QDict<void> inputPaths; + static std::set<std::string> inputPaths; static FileNameLinkedMap *inputNameLinkedMap; static FileNameLinkedMap *imageNameLinkedMap; static FileNameLinkedMap *dotFileNameLinkedMap; @@ -163,19 +164,8 @@ int readFileOrDirectory(const char *s, bool recursive, bool errorIfNotExist=TRUE, std::unordered_set<std::string> *killSet = 0, - QDict<void> *paths = 0 + std::set<std::string> *paths = 0 ); -int readDir(QFileInfo *fi, - FileNameLinkedMap *fnDict, - StringDict *exclDict, - QStrList *patList, - QStrList *exclPatList, - StringList *resultList, - StringDict *resultDict, - bool errorIfNotExist, - bool recursive, - std::unordered_set<std::string> *killSet - ); void copyAndFilterFile(const char *fileName,BufStr &dest); #endif |