56#define XML_DB(x) do {} while(0)
84 const char *s = str.
data();
98 int spacesToNextTabStop = tabSize - (col%tabSize);
99 while (spacesToNextTabStop--)
101 if (col>=stripIndentAmount) t <<
"<sp/>";
107 if (col>=stripIndentAmount) t <<
"<sp/>";
110 case '<': t <<
"<"; col++;
break;
111 case '>': t <<
">"; col++;
break;
112 case '&': t <<
"&"; col++;
break;
113 case '\'': t <<
"'"; col++;
break;
114 case '"': t <<
"""; col++;
break;
115 case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
116 case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
117 case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
118 case 27:
case 28:
case 29:
case 30:
case 31:
120 t <<
"<sp value=\"" << int(c) <<
"\"/>";
131 t <<
"<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n";
132 t <<
"<doxygen xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
133 t <<
"xsi:noNamespaceSchemaLocation=\"compound.xsd\" ";
134 t <<
"version=\"" << getDoxygenVersion() <<
"\" ";
142 QCString fileName=outputDirectory+
"/combine.xslt";
146 err(
"Cannot open file {} for writing!\n",fileName);
151 "<!-- XSLT script to combine the generated output into a single file. \n"
152 " If you have xsltproc you could use:\n"
153 " xsltproc combine.xslt index.xml >all.xml\n"
155 "<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">\n"
156 " <xsl:output method=\"xml\" version=\"1.0\" indent=\"no\" standalone=\"yes\" />\n"
157 " <xsl:template match=\"/\">\n"
158 " <doxygen version=\"{doxygenindex/@version}\" xml:lang=\"{doxygenindex/@xml:lang}\">\n"
159 " <!-- Load all doxygen generated xml files -->\n"
160 " <xsl:for-each select=\"doxygenindex/compound\">\n"
161 " <xsl:copy-of select=\"document( concat( @refid, '.xml' ) )/doxygen/*\" />\n"
165 "</xsl:stylesheet>\n";
172 t <<
"<ref refid=\"" << compoundId;
173 if (!anchorId.
isEmpty()) t <<
"_1" << anchorId;
174 t <<
"\" kindref=\"";
175 if (!anchorId.
isEmpty()) t <<
"member";
else t <<
"compound";
177 if (!extRef.
isEmpty()) t <<
" external=\"" << extRef <<
"\"";
195 const QCString &anchor,std::string_view text
216 *
m_t <<
"<highlight class=\"normal\">";
248 XML_DB((
"(writeCodeLink)\n"));
251 *
m_t <<
"<highlight class=\"normal\">";
263 XML_DB((
"(writeToolTip)\n"));
270 XML_DB((
"(startCodeLine)\n"));
280 *
m_t <<
" refkind=\"member\"";
284 *
m_t <<
" refkind=\"compound\"";
300 XML_DB((
"(endCodeLine)\n"));
303 *
m_t <<
"</highlight>";
308 *
m_t <<
"</codeline>\n";
319 XML_DB((
"(startFontClass)\n"));
322 *
m_t <<
"</highlight>";
325 *
m_t <<
"<highlight class=\"" << colorClass <<
"\">";
332 XML_DB((
"(endFontClass)\n"));
333 *
m_t <<
"</highlight>";
340 XML_DB((
"(writeCodeAnchor)\n"));
344 const QCString &anchorId,
int l,
bool)
347 XML_DB((
"(writeLineNumber)\n"));
362 XML_DB((
"(startCodeFragment)\n"));
363 *
m_t <<
" <programlisting>\n";
368 XML_DB((
"(endCodeFragment)\n"));
369 *
m_t <<
" </programlisting>\n";
381 indentStr.
fill(
' ',indent);
386 t << indentStr <<
"<templateparamlist>\n";
389 t << indentStr <<
" <param>\n";
390 if (!a.type.isEmpty())
392 t << indentStr <<
" <type>";
396 if (!a.name.isEmpty())
398 t << indentStr <<
" <declname>" <<
convertToXML(a.name) <<
"</declname>\n";
399 t << indentStr <<
" <defname>" <<
convertToXML(a.name) <<
"</defname>\n";
401 if (!a.defval.isEmpty())
403 t << indentStr <<
" <defval>";
407 if (!a.typeConstraint.isEmpty())
409 t << indentStr <<
" <typeconstraint>";
411 t <<
"</typeconstraint>\n";
413 if (a.hasTemplateDocumentation())
415 t << indentStr <<
" <briefdescription>\n";
416 t << indentStr <<
" ";
425 t << indentStr <<
" </briefdescription>\n";
427 t << indentStr <<
" </param>\n";
429 t << indentStr <<
"</templateparamlist>\n";
467 auto astImpl =
dynamic_cast<const DocNodeAST*
>(ast.get());
476 std::visit(visitor,astImpl->root);
485 intf->resetCodeParserState();
489 intf->parseCode(xmlList,
508 t <<
" <" << tagName <<
" refid=\"";
519 t <<
">" <<
convertToXML(name) <<
"</" << tagName <<
">\n";
534 else if (typeStr==
"virtual") typeStr=
"";
566 int len =
static_cast<int>(strlen(keyword));
567 int searchEnd =
static_cast<int>(str.
size());
568 while (searchStart<searchEnd)
570 int index = str.
find(keyword, searchStart);
575 int end = index + len;
578 if ((index>0 && str[index-1]!=
' ') ||
579 (
end!=searchEnd && str[
end] !=
' ')
586 if (needSpace && index>0)
588 str.
remove(index-1, len+1);
589 searchEnd -= (len+1);
591 else if (needSpace &&
end<searchEnd)
594 searchEnd -= (len+1);
610 int i = argsStr.
find(
"noexcept(");
613 int bracketCount = 1;
616 bool insideString =
false;
617 bool insideChar =
false;
619 while (!found && p<argsStr.
length())
621 char c = argsStr[p++];
624 if (c==
'"' && pc!=
'\\') insideString=
false;
628 if (c==
'\'' && pc!=
'\\') insideChar=
false;
634 case '(': bracketCount++;
break;
635 case ')': bracketCount--; found = bracketCount==0;
break;
636 case '"': insideString =
true;
break;
637 case '\'': insideChar =
true;
break;
642 expr = argsStr.
mid(i+9,p-i-10);
655 t <<
prefix <<
" <" << tagName <<
">\n";
656 for (
const auto &ref : refs)
661 t <<
prefix <<
" </" << tagName <<
">\n";
667 writeRefsForType(satisfiesRefs,
"satisfies");
668 writeRefsForType(verifiesRefs,
"verifies");
738 argsStr +=
" override";
750 argsStr +=
"=default";
754 argsStr +=
"=delete";
756 i=defStr.
find(
"auto ");
759 defStr=defStr.
left(i)+typeStr+defStr.
mid(i+4);
766 <<
"_1" << md->
anchor() <<
"\" kind=\"" << memType <<
"\"><name>"
771 t <<
" <member refid=\""
773 <<
"_1" << md->
anchor() <<
"\" kind=\"" << memType <<
"\"><name>"
779 t <<
" <memberdef kind=\"";
780 t << memType <<
"\" id=\"";
791 if (md->
isStatic()) t <<
"yes";
else t <<
"no";
796 t <<
" nodiscard=\"yes\"";
801 t <<
" constexpr=\"yes\"";
806 t <<
" consteval=\"yes\"";
811 t <<
" constinit=\"yes\"";
816 t <<
" extern=\"yes\"";
827 if (md->
isExplicit()) t <<
"yes";
else t <<
"no";
831 if (md->
isInline()) t <<
"yes";
else t <<
"no";
843 t <<
" final=\"yes\"";
848 t <<
" sealed=\"yes\"";
858 t <<
" optional=\"yes\"";
863 t <<
" required=\"yes\"";
868 t <<
" noexcept=\"yes\"";
873 t <<
" noexceptexpression=\"" <<
convertToXML(noExceptExpr) <<
"\"";
878 t <<
" volatile=\"yes\"";
888 if (md->
isStrong()) t <<
"yes";
else t <<
"no";
899 if (md->
isMutable()) t <<
"yes";
else t <<
"no";
904 t <<
" thread_local=\"yes\"";
909 t <<
" initonly=\"yes\"";
913 t <<
" attribute=\"yes\"";
917 t <<
" property=\"yes\"";
921 t <<
" readonly=\"yes\"";
925 t <<
" bound=\"yes\"";
929 t <<
" removable=\"yes\"";
933 t <<
" constrained=\"yes\"";
937 t <<
" transient=\"yes\"";
941 t <<
" maybevoid=\"yes\"";
945 t <<
" maybedefault=\"yes\"";
949 t <<
" maybeambiguous=\"yes\"";
955 if (md->
isReadable()) t <<
"yes";
else t <<
"no";
959 if (md->
isWritable()) t <<
"yes";
else t <<
"no";
963 if (md->
isGettable()) t <<
"yes";
else t <<
"no";
966 t <<
" privategettable=\"";
970 t <<
" protectedgettable=\"";
975 if (md->
isSettable()) t <<
"yes";
else t <<
"no";
978 t <<
" privatesettable=\"";
982 t <<
" protectedsettable=\"";
990 else if (md->
isCopy()) t <<
"copy";
991 else if (md->
isRetain()) t <<
"retain";
992 else if (md->
isStrong()) t <<
"strong";
993 else if (md->
isWeak()) t <<
"weak";
1000 if (md->
isAddable()) t <<
"yes";
else t <<
"no";
1004 if (md->
isRemovable()) t <<
"yes";
else t <<
"no";
1008 if (md->
isRaisable()) t <<
"yes";
else t <<
"no";
1026 t <<
" <definition>" <<
convertToXML(defStr) <<
"</definition>\n";
1027 t <<
" <argsstring>" <<
convertToXML(argsStr) <<
"</argsstring>\n";
1038 t <<
" <name>" <<
convertToXML(nameStr) <<
"</name>\n";
1039 if (nameStr!=qualifiedNameStr)
1041 t <<
" <qualifiedname>" <<
convertToXML(qualifiedNameStr) <<
"</qualifiedname>\n";
1055 if (bitfield.
at(0)==
':') bitfield=bitfield.
mid(1);
1056 t <<
" <bitfield>" <<
convertToXML(bitfield) <<
"</bitfield>\n";
1062 t <<
" <reimplements refid=\""
1068 t <<
" <reimplementedby refid=\""
1070 <<
convertToXML(rbmd->name()) <<
"</reimplementedby>\n";
1075 t <<
" <qualifier>" <<
convertToXML(qmd) <<
"</qualifier>\n";
1090 bool isFortran = md->
getLanguage()==SrcLangExt::Fortran;
1093 auto defIt = defAl.
begin();
1098 if (defIt!=defAl.
end())
1104 if (!a.attrib.isEmpty())
1106 t <<
" <attributes>";
1108 t <<
"</attributes>\n";
1110 if (isFortran && defArg && !defArg->
type.
isEmpty())
1116 else if (!a.type.isEmpty())
1122 if (!a.name.isEmpty())
1126 t <<
"</declname>\n";
1132 t <<
"</defname>\n";
1134 if (!a.array.isEmpty())
1140 if (!a.defval.isEmpty())
1148 t <<
" <briefdescription>";
1151 t <<
"</briefdescription>\n";
1163 t <<
" <param></param>\n";
1169 t <<
" <param><defname>" << a.type <<
"</defname></param>\n";
1175 t <<
" <requiresclause>";
1177 t <<
" </requiresclause>\n";
1182 t <<
" <initializer>";
1184 t <<
"</initializer>\n";
1189 t <<
" <exceptions>";
1191 t <<
"</exceptions>\n";
1200 <<
"_1" << emd->anchor() <<
"\" kind=\"enumvalue\"><name>"
1204 << emd->anchor() <<
"\" prot=\"" <<
to_string_lower(emd->protection());
1209 if (!emd->initializer().isEmpty())
1211 t <<
" <initializer>";
1213 t <<
"</initializer>\n";
1215 t <<
" <briefdescription>\n";
1216 writeXMLDocBlock(t,emd->briefFile(),emd->briefLine(),emd->getOuterScope(),emd,emd->briefDescription());
1217 t <<
" </briefdescription>\n";
1218 t <<
" <detaileddescription>\n";
1219 writeXMLDocBlock(t,emd->docFile(),emd->docLine(),emd->getOuterScope(),emd,emd->documentation());
1220 t <<
" </detaileddescription>\n";
1221 t <<
" </enumvalue>\n";
1224 t <<
" <briefdescription>\n";
1226 t <<
" </briefdescription>\n";
1227 t <<
" <detaileddescription>\n";
1229 t <<
" </detaileddescription>\n";
1230 t <<
" <inbodydescription>\n";
1232 t <<
" </inbodydescription>\n";
1235 t <<
" <location file=\""
1260 for (
const auto &refmd : refList)
1265 for (
const auto &refmd : refByList)
1270 t <<
" </memberdef>\n";
1286 if (ml==
nullptr)
return;
1288 for (
const auto &md : *ml)
1296 if (count==0)
return;
1298 t <<
" <sectiondef kind=\"" << kind <<
"\">\n";
1299 if (!header.isEmpty())
1301 t <<
" <header>" <<
convertToXML(header) <<
"</header>\n";
1303 if (!documentation.isEmpty())
1305 t <<
" <description>";
1307 t <<
"</description>\n";
1309 for (
const auto &md : *ml)
1316 t <<
" </sectiondef>\n";
1321 t <<
" <listofallmembers>\n";
1324 for (
auto &mi : *mni)
1334 if (!mi->ambiguityResolutionScope().isEmpty())
1336 t <<
" ambiguityscope=\"" <<
convertToXML(mi->ambiguityResolutionScope()) <<
"\"";
1343 t <<
" </listofallmembers>\n";
1348 for (
const auto &cd : cl)
1350 if (!cd->isHidden() && !cd->isAnonymous())
1354 t <<
"\">" <<
convertToXML(cd->name()) <<
"</innerclass>\n";
1361 for (
const auto &cd : cl)
1363 if (!cd->isHidden())
1365 t <<
" <innerconcept refid=\"" << cd->getOutputFileBase()
1366 <<
"\">" <<
convertToXML(cd->name()) <<
"</innerconcept>\n";
1373 for (
const auto &mod : ml)
1375 if (!mod->isHidden())
1377 t <<
" <innermodule refid=\"" << mod->getOutputFileBase()
1378 <<
"\">" <<
convertToXML(mod->name()) <<
"</innermodule>\n";
1385 for (
const auto &nd : nl)
1387 if (!nd->isHidden() && !nd->isAnonymous())
1389 t <<
" <innernamespace refid=\"" << nd->getOutputFileBase()
1390 <<
"\"" << (nd->isInline() ?
" inline=\"yes\"" :
"")
1391 <<
">" <<
convertToXML(nd->name()) <<
"</innernamespace>\n";
1398 if (exportMap.empty())
return;
1399 t <<
" <exports>\n";
1400 for (
const auto &[moduleName,importInfoList] : exportMap)
1402 for (
const auto &importInfo : importInfoList)
1411 t << importInfo.importName;
1415 t <<
" </exports>\n";
1420 for (
const auto &fd : fl)
1422 t <<
" <innerfile refid=\"" << fd->getOutputFileBase()
1423 <<
"\">" <<
convertToXML(fd->name()) <<
"</innerfile>\n";
1429 for (
const auto &pd : pl)
1431 t <<
" <innerpage refid=\"" << pd->getOutputFileBase();
1432 if (pd->getGroupDef())
1434 t <<
"_" << pd->name();
1436 t <<
"\">" <<
convertToXML(pd->title()) <<
"</innerpage>\n";
1442 for (
const auto &sgd : gl)
1444 t <<
" <innergroup refid=\"" << sgd->getOutputFileBase()
1446 <<
"</innergroup>\n";
1454 for(
const auto subdir : *dl)
1456 t <<
" <innerdir refid=\"" << subdir->getOutputFileBase()
1457 <<
"\">" <<
convertToXML(subdir->displayName()) <<
"</innerdir>\n";
1477 t <<
"</includes>\n";
1506 msg(
"Generating XML output for class {}\n",cd->
name());
1517 err(
"Cannot open file {} for writing!\n",fileName);
1523 t <<
" <compounddef id=\""
1528 if (cd->
isFinal()) t <<
"\" final=\"yes";
1529 if (cd->
isSealed()) t <<
"\" sealed=\"yes";
1530 if (cd->
isAbstract()) t <<
"\" abstract=\"yes";
1532 t <<
" <compoundname>";
1535 t <<
"</compoundname>\n";
1538 t <<
" <basecompoundref ";
1539 if (bcd.classDef->isLinkable())
1543 if (bcd.prot == Protection::Package)
ASSERT(0);
1549 if (!bcd.templSpecifiers.isEmpty())
1553 bcd.classDef->name(),bcd.templSpecifiers)
1560 t <<
"</basecompoundref>\n";
1564 if (bcd.prot == Protection::Package)
ASSERT(0);
1565 t <<
" <derivedcompoundref refid=\""
1571 t <<
"\">" <<
convertToXML(bcd.classDef->displayName())
1572 <<
"</derivedcompoundref>\n";
1583 mg->documentation());
1599 t <<
" <requiresclause>";
1601 t <<
" </requiresclause>\n";
1606 t <<
" <qualifier>" <<
convertToXML(qcd) <<
"</qualifier>\n";
1609 t <<
" <briefdescription>\n";
1611 t <<
" </briefdescription>\n";
1612 t <<
" <detaileddescription>\n";
1614 t <<
" </detaileddescription>\n";
1618 t <<
" <inheritancegraph>\n";
1620 t <<
" </inheritancegraph>\n";
1625 t <<
" <collaborationgraph>\n";
1627 t <<
" </collaborationgraph>\n";
1630 t <<
" <location file=\""
1646 t <<
" </compounddef>\n";
1647 t <<
"</doxygen>\n";
1649 ti <<
" </compound>\n";
1657 <<
"\" kind=\"concept\"" <<
"><name>"
1667 err(
"Cannot open file {} for writing!\n",fileName);
1673 <<
"\" kind=\"concept\">\n";
1674 t <<
" <compoundname>";
1677 t <<
"</compoundname>\n";
1680 t <<
" <initializer>";
1682 t <<
"</initializer>\n";
1684 intf->resetCodeParserState();
1687 t <<
" <conceptparts>\n";
1693 t <<
" <docpart line=\"" << part.lineNr <<
"\" col=\"" << part.colNr <<
"\">\n";
1695 t <<
" </docpart>\n";
1698 t <<
" <codepart line=\"" << part.lineNr <<
"\">";
1700 intf->parseCode(xmlList,
1708 t <<
"</codepart>\n";
1712 t <<
" </conceptparts>\n";
1713 t <<
" <briefdescription>\n";
1715 t <<
" </briefdescription>\n";
1716 t <<
" <detaileddescription>\n";
1718 t <<
" </detaileddescription>\n";
1720 t <<
" <location file=\""
1724 t <<
" </compounddef>\n";
1725 t <<
"</doxygen>\n";
1727 ti <<
" </compound>\n";
1734 <<
"\" kind=\"module\"" <<
"><name>"
1742 err(
"Cannot open file {} for writing!\n",fileName);
1748 <<
"\" kind=\"module\">\n";
1749 t <<
" <compoundname>";
1751 t <<
"</compoundname>\n";
1765 mg->documentation());
1767 t <<
" <briefdescription>\n";
1769 t <<
" </briefdescription>\n";
1770 t <<
" <detaileddescription>\n";
1772 t <<
" </detaileddescription>\n";
1775 t <<
" <location file=\""
1779 t <<
" </compounddef>\n";
1780 t <<
"</doxygen>\n";
1782 ti <<
" </compound>\n";
1800 <<
"\" kind=\"namespace\"" <<
"><name>"
1808 err(
"Cannot open file {} for writing!\n",fileName);
1815 <<
"\" kind=\"namespace\" "
1816 << (nd->
isInline()?
"inline=\"yes\" ":
"")
1819 t <<
" <compoundname>";
1822 t <<
"</compoundname>\n";
1831 mg->documentation());
1842 t <<
" <briefdescription>\n";
1844 t <<
" </briefdescription>\n";
1845 t <<
" <detaileddescription>\n";
1847 t <<
" </detaileddescription>\n";
1849 t <<
" <location file=\""
1853 t <<
" </compounddef>\n";
1854 t <<
"</doxygen>\n";
1856 ti <<
" </compound>\n";
1886 err(
"Cannot open file {} for writing!\n",fileName);
1893 <<
"\" kind=\"file\" language=\""
1895 t <<
" <compoundname>";
1897 t <<
"</compoundname>\n";
1902 if (inc.fileDef && !inc.fileDef->isReference())
1904 t <<
" refid=\"" << inc.fileDef->getOutputFileBase() <<
"\"";
1908 t <<
"</includes>\n";
1913 t <<
" <includedby";
1914 if (inc.fileDef && !inc.fileDef->isReference())
1916 t <<
" refid=\"" << inc.fileDef->getOutputFileBase() <<
"\"";
1920 t <<
"</includedby>\n";
1926 t <<
" <incdepgraph>\n";
1928 t <<
" </incdepgraph>\n";
1934 t <<
" <invincdepgraph>\n";
1936 t <<
" </invincdepgraph>\n";
1946 mg->documentation());
1957 t <<
" <briefdescription>\n";
1959 t <<
" </briefdescription>\n";
1960 t <<
" <detaileddescription>\n";
1962 t <<
" </detaileddescription>\n";
1969 t <<
" </compounddef>\n";
1970 t <<
"</doxygen>\n";
1972 ti <<
" </compound>\n";
1999 err(
"Cannot open file {} for writing!\n",fileName);
2005 t <<
" <compounddef id=\""
2021 mg->documentation());
2032 t <<
" <briefdescription>\n";
2034 t <<
" </briefdescription>\n";
2035 t <<
" <detaileddescription>\n";
2037 t <<
" </detaileddescription>\n";
2039 t <<
" </compounddef>\n";
2040 t <<
"</doxygen>\n";
2042 ti <<
" </compound>\n";
2057 err(
"Cannot open file {} for writing!\n",fileName);
2063 t <<
" <compounddef id=\""
2070 t <<
" <briefdescription>\n";
2072 t <<
" </briefdescription>\n";
2073 t <<
" <detaileddescription>\n";
2075 t <<
" </detaileddescription>\n";
2078 t <<
" </compounddef>\n";
2079 t <<
"</doxygen>\n";
2081 ti <<
" </compound>\n";
2086 ti <<
" <compound refid=\"requirements\" kind=\"requirements\"><name>" <<
convertToXML(pd->
name()) <<
"</name>\n";
2088 QCString fileName = outputDirectory+
"/requirements.xml";
2092 err(
"Cannot open file {} for writing!\n",fileName);
2097 auto writeDefsForReq = [&t](
const std::vector<const Definition *> &defs,
const char *tagName)
2099 for (
const auto &def : defs)
2101 t <<
" <" << tagName <<
" refid=\"";
2102 t << def->getOutputFileBase();
2105 t <<
"_1" << def->anchor();
2109 t <<
"</" << tagName<<
">\n";
2114 t <<
" <compounddef id=\"requirements\" kind=\"requirements\">\n";
2116 t <<
" <requirementslist>\n";
2118 for (
const auto &req : reqs)
2120 t <<
" <requirement refid=\"" << req->id();
2121 if (
auto tagFile = req->getTagFile(); !tagFile.isEmpty())
2128 writeDefsForReq(req->satisfiedBy(),
"satisfiedby");
2129 writeDefsForReq(req->verifiedBy(),
"verifiedby");
2130 t <<
" </requirement>\n";
2132 t <<
" </requirementslist>\n";
2133 t <<
" </compounddef>\n";
2134 t <<
"</doxygen>\n";
2136 ti <<
" </compound>\n";
2146 const char *kindName = isExample ?
"example" :
"page";
2155 if (pageName==
"index")
2157 pageName=
"indexpage";
2159 else if (pageName==
"requirements")
2165 ti <<
" <compound refid=\"" << pageName
2170 QCString fileName=outputDirectory+
"/"+pageName+
".xml";
2174 err(
"Cannot open file {} for writing!\n",fileName);
2180 t <<
" <compounddef id=\"" << pageName;
2181 t <<
"\" kind=\"" << kindName <<
"\">\n";
2183 <<
"</compoundname>\n";
2214 auto writeIndent = [&]() {
for (
int i=0;i<4+indent*2;i++) t <<
" "; };
2215 auto incIndent = [&](
const char *text) {
writeIndent(); t << text <<
"\n"; indent++; };
2216 auto decIndent = [&](
const char *text) { indent--;
writeIndent(); t << text <<
"\n"; };
2217 incIndent(
"<tableofcontents>");
2222 if (si->type().isSection())
2225 int nextLevel = si->type().level();
2226 if (nextLevel>level)
2228 for (
int l=level;l<nextLevel;l++)
2230 if (l < maxLevel) incIndent(
"<tableofcontents>");
2233 else if (nextLevel<level)
2235 for (
int l=level;l>nextLevel;l--)
2237 if (l <= maxLevel && inLi[l]) decIndent(
"</tocsect>");
2239 if (l <= maxLevel) decIndent(
"</tableofcontents>");
2242 if (nextLevel <= maxLevel)
2244 if (inLi[nextLevel])
2246 decIndent(
"</tocsect>");
2248 else if (level>nextLevel)
2250 decIndent(
"</tableofcontents>");
2251 incIndent(
"<tableofcontents>");
2255 if (titleDoc.
isEmpty()) titleDoc = label;
2256 incIndent(
"<tocsect>");
2257 writeIndent(); t <<
"<name>" << titleDoc <<
"</name>\n";
2259 if (!si->title().isEmpty())
2265 inLi[nextLevel]=
true;
2270 while (level>1 && level <= maxLevel)
2272 if (inLi[level]) decIndent(
"</tocsect>");
2274 decIndent(
"</tableofcontents>");
2277 if (level <= maxLevel && inLi[level]) decIndent(
"</tocsect>");
2279 decIndent(
"</tableofcontents>");
2281 t <<
" <briefdescription>\n";
2283 t <<
" </briefdescription>\n";
2284 t <<
" <detaileddescription>\n";
2295 t <<
" </detaileddescription>\n";
2300 t <<
" </compounddef>\n";
2301 t <<
"</doxygen>\n";
2303 ti <<
" </compound>\n";
2309 ti <<
" <compound refid=\"" << pageName <<
"\" kind=\"requirement\"><name>" <<
convertToXML(req->
id()) <<
"</name>\n";
2312 QCString fileName = outputDirectory+
"/"+pageName+
".xml";
2316 err(
"Cannot open file {} for writing!\n",fileName);
2321 t <<
" <compounddef id=\"" << pageName <<
"\" kind=\"requirement\">\n";
2322 t <<
" <compoundname>" <<
convertToXML(req->
id()) <<
"</compoundname>\n";
2324 t <<
" <detaileddescription>\n";
2326 t <<
" </detaileddescription>\n";
2328 t <<
" </compounddef>\n";
2329 t <<
"</doxygen>\n";
2331 ti <<
" </compound>\n";
2346 Dir xmlDir(outputDirectory.
str());
2352 QCString fileName=outputDirectory+
"/compound.xsd";
2356 err(
"Cannot open file {} for writing!\n",fileName);
2364 const char *startLine = compound_xsd.
data();
2368 const char *endLine = startLine+1;
2369 while (*endLine && *(endLine-1)!=
'\n') endLine++;
2370 int len=
static_cast<int>(endLine-startLine);
2374 if (s.
find(
"<!-- Automatically insert here the HTML entities -->")!=-1)
2380 t.
write(startLine,len);
2388 fileName=outputDirectory+
"/doxyfile.xsd";
2392 err(
"Cannot open file {} for writing!\n",fileName);
2400 const char *startLine = doxyfile_xsd.
data();
2404 const char *endLine = startLine+1;
2405 while (*endLine && *(endLine-1)!=
'\n') endLine++;
2406 int len=
static_cast<int>(endLine-startLine);
2410 if (s.
find(
"<!-- Automatically insert here the configuration settings -->")!=-1)
2416 t.
write(startLine,len);
2424 fileName=outputDirectory+
"/Doxyfile.xml";
2428 err(
"Cannot open file {} for writing\n",fileName);
2438 fileName=outputDirectory+
"/index.xml";
2442 err(
"Cannot open file {} for writing!\n",fileName);
2450 t <<
"<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n";
2451 t <<
"<doxygenindex xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
2452 t <<
"xsi:noNamespaceSchemaLocation=\"index.xsd\" ";
2453 t <<
"version=\"" << getDoxygenVersion() <<
"\" ";
2463 msg(
"Generating XML output for concept {}\n",cd->displayName());
2468 msg(
"Generating XML output for namespace {}\n",nd->displayName());
2473 for (
const auto &fd : *fn)
2475 msg(
"Generating XML output for file {}\n",fd->name());
2481 msg(
"Generating XML output for group {}\n",gd->name());
2486 msg(
"Generating XML output for page {}\n",pd->name());
2491 if (req->getTagFile().isEmpty())
2493 msg(
"Generating XML output for requirement {}\n", req->id());
2499 msg(
"Generate XML output for dir {}\n",dd->name());
2504 msg(
"Generating XML output for module {}\n",mod->name());
2509 msg(
"Generating XML output for example {}\n",pd->name());
2514 msg(
"Generating XML output for the main page\n");
2519 t <<
"</doxygenindex>\n";
This class represents an function or template argument list.
RefQualifierType refQualifier() const
bool hasParameters() const
bool constSpecifier() const
bool volatileSpecifier() const
A abstract class representing of a compound symbol.
virtual bool isAbstract() const =0
Returns TRUE if there is at least one pure virtual member in this class.
virtual bool isFinal() const =0
Returns TRUE if this class is marked as final.
virtual const ArgumentList & templateArguments() const =0
Returns the template arguments of this class.
virtual QCString compoundTypeString() const =0
Returns the type of compound as a string.
virtual const MemberLists & getMemberLists() const =0
Returns the list containing the list of members sorted per type.
virtual const BaseClassList & baseClasses() const =0
Returns the list of base classes from which this class directly inherits.
virtual bool isSealed() const =0
Returns TRUE if this class is marked as sealed.
virtual StringVector getQualifiers() const =0
virtual Protection protection() const =0
Return the protection level (Public,Protected,Private) in which this compound was found.
virtual const MemberNameInfoLinkedMap & memberNameInfoLinkedMap() const =0
Returns a dictionary of all members.
virtual bool isImplicitTemplateInstance() const =0
virtual const MemberGroupList & getMemberGroups() const =0
Returns the member groups defined for this class.
virtual ClassLinkedRefMap getClasses() const =0
returns the classes nested into this class
virtual FileDef * getFileDef() const =0
Returns the namespace this compound is in, or 0 if it has a global scope.
virtual const IncludeInfo * includeInfo() const =0
virtual QCString requiresClause() const =0
virtual const BaseClassList & subClasses() const =0
Returns the list of sub classes that directly derive from this class.
virtual QCString initializer() const =0
virtual ArgumentList getTemplateParameterList() const =0
virtual const IncludeInfo * includeInfo() const =0
virtual Parts conceptParts() const =0
virtual const FileDef * getFileDef() const =0
The common base class of all entity definitions found in the sources.
virtual QCString docFile() const =0
virtual int getEndBodyLine() const =0
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
virtual int docLine() const =0
virtual QCString getDefFileName() const =0
virtual int getDefLine() const =0
virtual DefType definitionType() const =0
virtual const SectionRefs & getSectionRefs() const =0
returns the section dictionary, only of importance for pagedef
virtual QCString anchor() const =0
virtual int inbodyLine() const =0
virtual const FileDef * getBodyDef() const =0
virtual int briefLine() const =0
virtual bool isLinkableInProject() const =0
virtual QCString briefDescription(bool abbreviate=FALSE) const =0
virtual bool isAnonymous() const =0
virtual const RequirementRefs & requirementReferences() const =0
virtual bool isHidden() const =0
virtual QCString documentation() const =0
virtual QCString qualifiedName() const =0
virtual QCString displayName(bool includeScope=TRUE) const =0
virtual bool isArtificial() const =0
virtual QCString briefFile() const =0
virtual QCString getOutputFileBase() const =0
virtual Definition * getOuterScope() const =0
virtual const MemberVector & getReferencedByMembers() const =0
virtual int getStartBodyLine() const =0
virtual QCString getDefFileExtension() const =0
virtual int getDefColumn() const =0
virtual bool isReference() const =0
virtual const MemberVector & getReferencesMembers() const =0
virtual QCString inbodyDocumentation() const =0
virtual const QCString & name() const =0
A model of a directory symbol.
virtual const DirList & subDirs() const =0
virtual const FileList & getFiles() const =0
Class representing a directory in the file system.
Class representing the abstract syntax tree of a documentation block.
Representation of a class inheritance or dependency graph.
void writeXML(TextStream &t)
Representation of an include dependency graph.
void writeXML(TextStream &t)
static NamespaceLinkedMap * namespaceLinkedMap
static ConceptLinkedMap * conceptLinkedMap
static std::unique_ptr< PageDef > mainPage
static FileNameLinkedMap * inputNameLinkedMap
static ParserManager * parserManager
static ClassLinkedMap * classLinkedMap
static PageLinkedMap * exampleLinkedMap
static PageLinkedMap * pageLinkedMap
static DirLinkedMap * dirLinkedMap
static GroupLinkedMap * groupLinkedMap
A model of a file symbol.
virtual const NamespaceLinkedRefMap & getNamespaces() const =0
virtual const MemberGroupList & getMemberGroups() const =0
virtual QCString absFilePath() const =0
virtual const ClassLinkedRefMap & getClasses() const =0
virtual const IncludeInfoList & includeFileList() const =0
virtual const MemberLists & getMemberLists() const =0
virtual const QCString & docName() const =0
virtual const ConceptLinkedRefMap & getConcepts() const =0
virtual const IncludeInfoList & includedByFileList() const =0
A model of a group of symbols.
virtual const GroupList & getSubGroups() const =0
virtual QCString groupTitle() const =0
virtual const FileList & getFiles() const =0
virtual const MemberLists & getMemberLists() const =0
virtual const MemberGroupList & getMemberGroups() const =0
virtual const ConceptLinkedRefMap & getConcepts() const =0
virtual const PageLinkedRefMap & getPages() const =0
virtual const NamespaceLinkedRefMap & getNamespaces() const =0
virtual const ClassLinkedRefMap & getClasses() const =0
virtual const ModuleLinkedRefMap & getModules() const =0
void writeXMLSchema(TextStream &t)
static HtmlEntityMapper & instance()
Returns the one and only instance of the HTML entity mapper.
const T * find(const std::string &key) const
constexpr bool isXmlEnabled() const noexcept
constexpr int xmlLevel() const noexcept
A model of a class/file/namespace member symbol.
virtual QCString typeString() const =0
virtual bool isConstExpr() const =0
virtual bool isConstEval() const =0
virtual bool isInitonly() const =0
virtual bool isNoExcept() const =0
virtual QCString requiresClause() const =0
virtual bool isAssign() const =0
virtual bool isExplicit() const =0
virtual bool isNew() const =0
virtual bool isMaybeVoid() const =0
virtual bool isSealed() const =0
virtual QCString definition() const =0
virtual QCString enumBaseType() const =0
virtual bool isConstInit() const =0
virtual QCString excpString() const =0
virtual const ClassDef * getClassDef() const =0
virtual const ArgumentList & templateArguments() const =0
virtual GroupDef * getGroupDef()=0
virtual bool isSettable() const =0
virtual bool isRetain() const =0
virtual bool isAddable() const =0
virtual const MemberVector & enumFieldList() const =0
virtual const FileDef * getFileDef() const =0
virtual bool isInline() const =0
virtual const ArgumentList & argumentList() const =0
virtual bool isWritable() const =0
virtual bool isMaybeAmbiguous() const =0
virtual bool isPrivateGettable() const =0
virtual const MemberVector & reimplementedBy() const =0
virtual bool isRequired() const =0
virtual bool isAttribute() const =0
virtual bool isExternal() const =0
virtual bool isCopy() const =0
virtual QCString getScopeString() const =0
virtual int getDeclLine() const =0
virtual bool isTypeAlias() const =0
virtual int getDeclColumn() const =0
virtual bool isStatic() const =0
virtual const MemberDef * reimplements() const =0
virtual bool isMaybeDefault() const =0
virtual QCString getWriteAccessor() const =0
virtual bool isPrivateSettable() const =0
virtual StringVector getQualifiers() const =0
virtual QCString bitfieldString() const =0
virtual bool isRaisable() const =0
virtual bool isRemovable() const =0
virtual bool isConstrained() const =0
virtual bool isReadonly() const =0
virtual bool isBound() const =0
virtual bool isThreadLocal() const =0
virtual const NamespaceDef * getNamespaceDef() const =0
virtual QCString getDeclFileName() const =0
virtual bool isProtectedSettable() const =0
virtual bool isProtectedGettable() const =0
virtual bool hasOneLineInitializer() const =0
virtual bool isTransient() const =0
virtual bool hasMultiLineInitializer() const =0
virtual Protection protection() const =0
virtual bool isOptional() const =0
virtual QCString getReadAccessor() const =0
virtual bool isGettable() const =0
virtual MemberType memberType() const =0
virtual bool isReadable() const =0
virtual bool isWeak() const =0
virtual bool isNoDiscard() const =0
virtual bool isStrong() const =0
virtual QCString argsString() const =0
virtual Specifier virtualness(int count=0) const =0
virtual bool isUNOProperty() const =0
virtual bool isFinal() const =0
virtual const ArgumentList & declArgumentList() const =0
virtual bool isMutable() const =0
virtual bool isFriendClass() const =0
virtual const QCString & initializer() const =0
A list of MemberDef objects as shown in documentation sections.
MemberListType listType() const
constexpr const char * toXML() const noexcept
constexpr bool isDeclaration() const noexcept
constexpr bool isDetailed() const noexcept
virtual const MemberGroupList & getMemberGroups() const =0
virtual bool isPrimaryInterface() const =0
virtual const MemberLists & getMemberLists() const =0
virtual FileList getUsedFiles() const =0
virtual const ImportInfoMap & getExports() const =0
virtual const ConceptLinkedRefMap & getConcepts() const =0
virtual const ClassLinkedRefMap & getClasses() const =0
static ModuleManager & instance()
ModuleDef * getPrimaryInterface(const QCString &moduleName) const
An abstract interface of a namespace symbol.
virtual ConceptLinkedRefMap getConcepts() const =0
virtual const MemberLists & getMemberLists() const =0
virtual NamespaceLinkedRefMap getNamespaces() const =0
virtual bool isInline() const =0
virtual ClassLinkedRefMap getClasses() const =0
virtual const MemberGroupList & getMemberGroups() const =0
Class representing a list of different code generators.
void add(OutputCodeIntfPtr &&p)
void endCodeFragment(const QCString &style)
void startCodeFragment(const QCString &style)
A model of a page symbol.
virtual const PageLinkedRefMap & getSubPages() const =0
virtual LocalToc localToc() const =0
virtual QCString title() const =0
virtual const GroupDef * getGroupDef() const =0
This is an alternative implementation of QCString.
int find(char c, int index=0, bool cs=TRUE) const
QCString & prepend(const char *s)
size_t length() const
Returns the length of the string, not counting the 0-terminator.
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
char & at(size_t i)
Returns a reference to the character at index i.
bool isEmpty() const
Returns TRUE iff the string is empty.
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
QCString & remove(size_t index, size_t len)
QCString fill(char c, int len=-1)
Fills a string with a predefined character.
const std::string & str() const
size_t size() const
Returns the length of the string, not counting the 0-terminator.
int findRev(char c, int index=-1, bool cs=TRUE) const
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
QCString left(size_t len) const
bool stripPrefix(const QCString &prefix)
virtual QCString title() const =0
virtual QCString id() const =0
virtual QCString doc() const =0
virtual int line() const =0
virtual QCString file() const =0
static RequirementManager & instance()
RequirementIntfList requirements() const
static ResourceMgr & instance()
Returns the one and only instance of this class.
bool copyResource(const QCString &name, const QCString &targetDir) const
Copies a registered resource to a given target directory.
QCString getAsString(const QCString &name) const
Gets the resource data as a C string.
class that provide information about a section.
static SectionManager & instance()
returns a reference to the singleton
class that represents a list of constant references to sections.
Abstract interface for a hyperlinked text fragment.
Implements TextGeneratorIntf for an XML stream.
TextGeneratorXMLImpl(TextStream &t)
void writeString(std::string_view s, bool) const override
void writeLink(const QCString &extRef, const QCString &file, const QCString &anchor, std::string_view text) const override
void writeBreak(int) const override
Text streaming class that buffers data.
void write(const char *buf, size_t len)
Adds a array of character to the stream.
void writeTooltip(const QCString &, const DocLinkInfo &, const QCString &, const QCString &, const SourceLinkInfo &, const SourceLinkInfo &) override
void setStripIndentAmount(size_t amount) override
void codify(const QCString &text) override
Generator for producing XML formatted source code.
void endCodeLine() override
size_t m_stripIndentAmount
void writeCodeLink(CodeSymbolType type, const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name, const QCString &tooltip) override
void startCodeLine(int) override
void startSpecialComment() override
bool m_normalHLNeedStartTag
void endSpecialComment() override
void stripCodeComments(bool b) override
void startFontClass(const QCString &colorClass) override
void writeLineNumber(const QCString &extRef, const QCString &compId, const QCString &anchorId, int l, bool writeLineAnchor) override
void endCodeFragment(const QCString &) override
XMLCodeGenerator(TextStream *t)
void endFontClass() override
void writeCodeAnchor(const QCString &) override
void startCodeFragment(const QCString &) override
Concrete visitor implementation for XML output.
#define Config_getInt(name)
#define Config_getBool(name)
#define Config_getString(name)
std::vector< bool > BoolVector
DirIterator end(const DirIterator &) noexcept
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf, const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &input, const DocOptions &options)
IDocParserPtr createDocParser()
factory function to create a parser
constexpr uint32_t IncludeKind_LocalMask
Translator * theTranslator
std::unordered_map< std::string, ImportInfoList > ImportInfoMap
void writeXMLDoxyfile(TextStream &t)
void writeXSDDoxyfile(TextStream &t)
std::ofstream openOutputStream(const QCString &name, bool append=false)
Portable versions of functions that are platform dependent.
const char * qPrint(const char *s)
static void writeIndent(TextStream &t, int indent)
void splitRequirementRefs(const RequirementRefs &inputReqRefs, RequirementRefs &satisfiesRefs, RequirementRefs &verifiesRefs)
std::vector< RequirementRef > RequirementRefs
List of requirement references.
This class contains the information about the argument of a function or template.
bool hasDocumentation(bool allowEmptyName=false) const
Options to configure the code parser.
Class representing the data associated with a #include statement.
LinkifyTextOptions & setScope(const Definition *scope)
LinkifyTextOptions & setSelf(const Definition *self)
LinkifyTextOptions & setFileScope(const FileDef *fileScope)
static constexpr const char * to_string_lower(Protection prot) noexcept
const char * writeUTF8Char(TextStream &t, const char *s)
Writes the UTF8 character pointed to by s to stream t and returns a pointer to the next character.
Various UTF8 related helper functions.
size_t updateColumnCount(const char *s, size_t col)
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
QCString insertTemplateSpecifierInScope(const QCString &scope, const QCString &templ)
void clearSubDirs(const Dir &d)
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
QCString filterTitle(const QCString &title)
void createSubDirs(const Dir &d)
static QCString stripFromPath(const QCString &p, const StringVector &l)
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)
QCString convertToXML(const QCString &s, bool keepEntities)
QCString langToString(SrcLangExt lang)
Returns a string representation of lang.
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
void linkifyText(const TextGeneratorIntf &out, const QCString &text, const LinkifyTextOptions &options)
QCString convertCharEntitiesToUTF8(const QCString &str)
A bunch of utility functions.
static QCString classOutputFileBase(const ClassDef *cd)
QCString xmlRequirementId(const QCString &reqId)
static void generateXMLForGroup(const GroupDef *gd, TextStream &ti)
static void writeInnerConcepts(const ConceptLinkedRefMap &cl, TextStream &t)
static void writeInnerGroups(const GroupList &gl, TextStream &t)
static void writeXMLDocBlock(TextStream &t, const QCString &fileName, int lineNr, const Definition *scope, const MemberDef *md, const QCString &text)
static void writeInnerDirs(const DirList *dl, TextStream &t)
static void writeListOfAllMembers(const ClassDef *cd, TextStream &t)
static void generateXMLForClass(const ClassDef *cd, TextStream &ti)
static void writeMemberReference(TextStream &t, const Definition *def, const MemberDef *rmd, const QCString &tagName)
static void generateXMLForFile(FileDef *fd, TextStream &ti)
static QCString memberOutputFileBase(const MemberDef *md)
static void writeMemberTemplateLists(const MemberDef *md, TextStream &t)
void writeXMLCodeBlock(TextStream &t, FileDef *fd)
static void writeTemplateList(const ClassDef *cd, TextStream &t)
void generateXMLForRequirements(PageDef *pd, TextStream &ti)
static bool stripKeyword(QCString &str, const char *keyword, bool needSpace)
static bool memberVisible(const Definition *d, const MemberDef *md)
static void writeIncludeInfo(const IncludeInfo *ii, TextStream &t)
static void stripQualifiers(QCString &typeStr)
static void writeInnerPages(const PageLinkedRefMap &pl, TextStream &t)
static void generateXMLForNamespace(const NamespaceDef *nd, TextStream &ti)
static void generateXMLForRequirement(const RequirementIntf *req, TextStream &ti)
static void writeXMLHeader(TextStream &t)
static void writeInnerModules(const ModuleLinkedRefMap &ml, TextStream &t)
static void generateXMLForModule(const ModuleDef *mod, TextStream &ti)
static void generateXMLForConcept(const ConceptDef *cd, TextStream &ti)
static void writeExports(const ImportInfoMap &exportMap, TextStream &t)
static void writeInnerFiles(const FileList &fl, TextStream &t)
static void generateXMLForMember(const MemberDef *md, TextStream &ti, TextStream &t, const Definition *def)
static void writeRequirementRefs(const Definition *d, TextStream &t, const char *prefix="")
void writeXMLCodeString(bool hide, TextStream &t, const QCString &str, size_t &col, size_t stripIndentAmount)
void writeXMLLink(TextStream &t, const QCString &extRef, const QCString &compoundId, const QCString &anchorId, const QCString &text, const QCString &tooltip)
static void writeTemplateArgumentList(TextStream &t, const ArgumentList &al, const Definition *scope, const FileDef *fileScope, int indent)
void writeXMLString(TextStream &t, const QCString &s)
static void generateXMLSection(const Definition *d, TextStream &ti, TextStream &t, const MemberList *ml, const QCString &kind, const QCString &header=QCString(), const QCString &documentation=QCString())
static void writeInnerClasses(const ClassLinkedRefMap &cl, TextStream &t)
static void writeInnerNamespaces(const NamespaceLinkedRefMap &nl, TextStream &t)
static void generateXMLForDir(DirDef *dd, TextStream &ti)
static void generateXMLForPage(PageDef *pd, TextStream &ti, bool isExample)
static QCString extractNoExcept(QCString &argsStr)
static void writeCombineScript()