From 2f21b0d9ff6d81cdcde1d0730974652a5cc68523 Mon Sep 17 00:00:00 2001 From: Anton Sergunov Date: Wed, 7 Dec 2016 13:24:25 +0600 Subject: [PATCH] Let the DoxygenParser find xml files produced by Doxygen 1.8.7 Make the parser to search for both locations: * The old one BestClassEver.xml, _1_1BestClassEver.xml * The new one _best_class_ever.xml, _1_1_best_class_ever.xml Signed-off-by: Anton Sergunov --- ApiExtractor/doxygenparser.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ApiExtractor/doxygenparser.cpp b/ApiExtractor/doxygenparser.cpp index b18c0993..7dedcd45 100644 --- a/ApiExtractor/doxygenparser.cpp +++ b/ApiExtractor/doxygenparser.cpp @@ -64,6 +64,17 @@ void DoxygenParser::fillDocumentation(AbstractMetaClass* metaClass) doxyFileSuffix += metaClass->name(); doxyFileSuffix += ".xml"; + // if capital chars are disabled + QString lowerCaseDoxyFileSuffix; + for(QString::const_iterator i = doxyFileSuffix.begin(); i != doxyFileSuffix.end(); ++i) { + if(i->isUpper()) { + lowerCaseDoxyFileSuffix.append('_'); + lowerCaseDoxyFileSuffix.append(i->toLower()); + } else { + lowerCaseDoxyFileSuffix.append(*i); + } + } + const char* prefixes[] = { "class", "struct", "namespace" }; const int numPrefixes = sizeof(prefixes) / sizeof(const char*); bool isProperty = false; @@ -73,6 +84,11 @@ void DoxygenParser::fillDocumentation(AbstractMetaClass* metaClass) doxyFilePath = documentationDataDirectory() + "/" + prefixes[i] + doxyFileSuffix; if (QFile::exists(doxyFilePath)) break; + + doxyFilePath = documentationDataDirectory() + "/" + prefixes[i] + lowerCaseDoxyFileSuffix; + if (QFile::exists(doxyFilePath)) + break; + doxyFilePath.clear(); } @@ -80,7 +96,7 @@ void DoxygenParser::fillDocumentation(AbstractMetaClass* metaClass) ReportHandler::warning("Can't find doxygen file for class " + metaClass->name() + ", tried: " + documentationDataDirectory() + "/{struct|class|namespace}" - + doxyFileSuffix); + + "{" + doxyFileSuffix + "|" + lowerCaseDoxyFileSuffix + "}"); return; } QXmlQuery xquery;