Doxygen
Loading...
Searching...
No Matches
xmlgen.cpp
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2015 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 */
15
16#include <stdlib.h>
17
18#include "textstream.h"
19#include "xmlgen.h"
20#include "doxygen.h"
21#include "message.h"
22#include "config.h"
23#include "classlist.h"
24#include "util.h"
25#include "defargs.h"
26#include "outputgen.h"
27#include "outputlist.h"
28#include "dot.h"
29#include "dotclassgraph.h"
30#include "dotincldepgraph.h"
31#include "pagedef.h"
32#include "filename.h"
33#include "version.h"
34#include "xmldocvisitor.h"
35#include "docparser.h"
36#include "language.h"
37#include "parserintf.h"
38#include "arguments.h"
39#include "memberlist.h"
40#include "groupdef.h"
41#include "memberdef.h"
42#include "namespacedef.h"
43#include "membername.h"
44#include "membergroup.h"
45#include "dirdef.h"
46#include "section.h"
47#include "htmlentity.h"
48#include "resourcemgr.h"
49#include "dir.h"
50#include "utf8.h"
51#include "portable.h"
52#include "outputlist.h"
53#include "moduledef.h"
54#include "requirement.h"
55
56// no debug info
57#define XML_DB(x) do {} while(0)
58// debug to stdout
59//#define XML_DB(x) printf x
60// debug inside output
61//#define XML_DB(x) QCString __t;__t.sprintf x;m_t << __t
62
63static void writeXMLDocBlock(TextStream &t,
64 const QCString &fileName,
65 int lineNr,
66 const Definition *scope,
67 const MemberDef * md,
68 const QCString &text);
69//------------------
70
71inline void writeXMLString(TextStream &t,const QCString &s)
72{
73 t << convertToXML(s);
74}
75
77{
78 return convertNameToFile("requirement_"+reqId,false,true);
79}
80
81inline void writeXMLCodeString(bool hide,TextStream &t,const QCString &str, size_t &col, size_t stripIndentAmount)
82{
83 if (str.isEmpty()) return;
84 const int tabSize = Config_getInt(TAB_SIZE);
85 const char *s = str.data();
86 char c=0;
87 if (hide) // only update column count
88 {
89 col=updateColumnCount(s,col);
90 }
91 else // actually output content and keep track of m_col
92 {
93 while ((c=*s++))
94 {
95 switch(c)
96 {
97 case '\t':
98 {
99 int spacesToNextTabStop = tabSize - (col%tabSize);
100 while (spacesToNextTabStop--)
101 {
102 if (col>=stripIndentAmount) t << "<sp/>";
103 col++;
104 }
105 break;
106 }
107 case ' ':
108 if (col>=stripIndentAmount) t << "<sp/>";
109 col++;
110 break;
111 case '<': t << "&lt;"; col++; break;
112 case '>': t << "&gt;"; col++; break;
113 case '&': t << "&amp;"; col++; break;
114 case '\'': t << "&apos;"; col++; break;
115 case '"': t << "&quot;"; col++; break;
116 case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
117 case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18:
118 case 19: case 20: case 21: case 22: case 23: case 24: case 25: case 26:
119 case 27: case 28: case 29: case 30: case 31:
120 // encode invalid XML characters (see http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char)
121 t << "<sp value=\"" << int(c) << "\"/>";
122 break;
123 default: s=writeUTF8Char(t,s-1); col++; break;
124 }
125 }
126 }
127}
128
129
131{
132 t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n";
133 t << "<doxygen xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
134 t << "xsi:noNamespaceSchemaLocation=\"compound.xsd\" ";
135 t << "version=\"" << getDoxygenVersion() << "\" ";
136 t << "xml:lang=\"" << theTranslator->trISOLang() << "\"";
137 t << ">\n";
138}
139
141{
142 QCString outputDirectory = Config_getString(XML_OUTPUT);
143 QCString fileName=outputDirectory+"/combine.xslt";
144 std::ofstream t = Portable::openOutputStream(fileName);
145 if (!t.is_open())
146 {
147 err("Cannot open file {} for writing!\n",fileName);
148 return;
149 }
150
151 t <<
152 "<!-- XSLT script to combine the generated output into a single file. \n"
153 " If you have xsltproc you could use:\n"
154 " xsltproc combine.xslt index.xml >all.xml\n"
155 "-->\n"
156 "<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">\n"
157 " <xsl:output method=\"xml\" version=\"1.0\" indent=\"no\" standalone=\"yes\" />\n"
158 " <xsl:template match=\"/\">\n"
159 " <doxygen version=\"{doxygenindex/@version}\" xml:lang=\"{doxygenindex/@xml:lang}\">\n"
160 " <!-- Load all doxygen generated xml files -->\n"
161 " <xsl:for-each select=\"doxygenindex/compound\">\n"
162 " <xsl:copy-of select=\"document( concat( @refid, '.xml' ) )/doxygen/*\" />\n"
163 " </xsl:for-each>\n"
164 " </doxygen>\n"
165 " </xsl:template>\n"
166 "</xsl:stylesheet>\n";
167
168}
169
170void writeXMLLink(TextStream &t,const QCString &extRef,const QCString &compoundId,
171 const QCString &anchorId,const QCString &text,const QCString &tooltip)
172{
173 t << "<ref refid=\"" << compoundId;
174 if (!anchorId.isEmpty()) t << "_1" << anchorId;
175 t << "\" kindref=\"";
176 if (!anchorId.isEmpty()) t << "member"; else t << "compound";
177 t << "\"";
178 if (!extRef.isEmpty()) t << " external=\"" << extRef << "\"";
179 if (!tooltip.isEmpty()) t << " tooltip=\"" << convertToXML(tooltip) << "\"";
180 t << ">";
181 writeXMLString(t,text);
182 t << "</ref>";
183}
184
185/** Implements TextGeneratorIntf for an XML stream. */
187{
188 public:
190 void writeString(std::string_view s,bool /*keepSpaces*/) const override
191 {
193 }
194 void writeBreak(int) const override {}
195 void writeLink(const QCString &extRef,const QCString &file,
196 const QCString &anchor,std::string_view text
197 ) const override
198 {
199 writeXMLLink(m_t,extRef,file,anchor,text,QCString());
200 }
201 private:
203};
204
205//-------------------------------------------------------------------------------------------
206
210
211/** Generator for producing XML formatted source code. */
213{
214 XML_DB(("(codify \"%s\")\n",qPrint(text)));
216 {
217 *m_t << "<highlight class=\"normal\">";
219 }
221}
222
227
229{
230 m_hide = false;
231}
232
237
239{
240 m_stripIndentAmount = amount;
241}
242
244 const QCString &ref,const QCString &file,
245 const QCString &anchor,const QCString &name,
246 const QCString &tooltip)
247{
248 if (m_hide) return;
249 XML_DB(("(writeCodeLink)\n"));
251 {
252 *m_t << "<highlight class=\"normal\">";
254 }
255 writeXMLLink(*m_t,ref,file,anchor,name,tooltip);
256 m_col+=name.length();
257}
258
260 const QCString &, const SourceLinkInfo &, const SourceLinkInfo &
261 )
262{
263 if (m_hide) return;
264 XML_DB(("(writeToolTip)\n"));
265}
266
268{
269 m_col=0;
270 if (m_hide) return;
271 XML_DB(("(startCodeLine)\n"));
272 *m_t << "<codeline";
273 if (m_lineNumber!=-1)
274 {
275 *m_t << " lineno=\"" << m_lineNumber << "\"";
276 if (!m_refId.isEmpty())
277 {
278 *m_t << " refid=\"" << m_refId << "\"";
279 if (m_isMemberRef)
280 {
281 *m_t << " refkind=\"member\"";
282 }
283 else
284 {
285 *m_t << " refkind=\"compound\"";
286 }
287 }
288 if (!m_external.isEmpty())
289 {
290 *m_t << " external=\"" << m_external << "\"";
291 }
292 }
293 *m_t << ">";
295 m_col=0;
296}
297
299{
300 if (m_hide) return;
301 XML_DB(("(endCodeLine)\n"));
303 {
304 *m_t << "</highlight>";
306 }
308 {
309 *m_t << "</codeline>\n";
310 }
311 m_lineNumber = -1;
312 m_refId.clear();
313 m_external.clear();
315}
316
318{
319 if (m_hide) return;
320 XML_DB(("(startFontClass)\n"));
322 {
323 *m_t << "</highlight>";
325 }
326 *m_t << "<highlight class=\"" << colorClass << "\">"; // non DocBook
328}
329
331{
332 if (m_hide) return;
333 XML_DB(("(endFontClass)\n"));
334 *m_t << "</highlight>"; // non DocBook
336}
337
339{
340 if (m_hide) return;
341 XML_DB(("(writeCodeAnchor)\n"));
342}
343
344void XMLCodeGenerator::writeLineNumber(const QCString &extRef,const QCString &compId,
345 const QCString &anchorId,int l,bool)
346{
347 if (m_hide) return;
348 XML_DB(("(writeLineNumber)\n"));
349 // we remember the information provided here to use it
350 // at the <codeline> start tag.
351 m_lineNumber = l;
352 if (!compId.isEmpty())
353 {
354 m_refId=compId;
355 if (!anchorId.isEmpty()) m_refId+=QCString("_1")+anchorId;
356 m_isMemberRef = anchorId!=nullptr;
357 if (!extRef.isEmpty()) m_external=extRef;
358 }
359}
360
362{
363 XML_DB(("(startCodeFragment)\n"));
364 *m_t << " <programlisting>\n";
365}
366
368{
369 XML_DB(("(endCodeFragment)\n"));
370 *m_t << " </programlisting>\n";
371}
372
373//-------------------------------------------------------------------------------------------
374
376 const ArgumentList &al,
377 const Definition *scope,
378 const FileDef *fileScope,
379 int indent)
380{
381 QCString indentStr;
382 indentStr.fill(' ',indent);
383 if (al.hasParameters())
384 {
385 t << indentStr << "<templateparamlist>\n";
386 for (const Argument &a : al)
387 {
388 t << indentStr << " <param>\n";
389 if (!a.type.isEmpty())
390 {
391 t << indentStr << " <type>";
392 linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,nullptr,a.type);
393 t << "</type>\n";
394 }
395 if (!a.name.isEmpty())
396 {
397 t << indentStr << " <declname>" << convertToXML(a.name) << "</declname>\n";
398 t << indentStr << " <defname>" << convertToXML(a.name) << "</defname>\n";
399 }
400 if (!a.defval.isEmpty())
401 {
402 t << indentStr << " <defval>";
403 linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,nullptr,a.defval);
404 t << "</defval>\n";
405 }
406 if (!a.typeConstraint.isEmpty())
407 {
408 t << indentStr << " <typeconstraint>";
409 linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,nullptr,a.typeConstraint);
410 t << "</typeconstraint>\n";
411 }
412 if (a.hasTemplateDocumentation())
413 {
414 t << indentStr << " <briefdescription>\n";
415 t << indentStr << " ";
416 if (scope)
417 {
418 writeXMLDocBlock(t,scope->briefFile(),scope->briefLine(),scope,nullptr,a.docs);
419 }
420 else
421 {
422 writeXMLDocBlock(t,fileScope->briefFile(),fileScope->briefLine(),fileScope,nullptr,a.docs);
423 }
424 t << indentStr << " </briefdescription>\n";
425 }
426 t << indentStr << " </param>\n";
427 }
428 t << indentStr << "</templateparamlist>\n";
429 }
430}
431
436
437static void writeTemplateList(const ClassDef *cd,TextStream &t)
438{
440}
441
442static void writeTemplateList(const ConceptDef *cd,TextStream &t)
443{
445}
446
448 const QCString &fileName,
449 int lineNr,
450 const Definition *scope,
451 const MemberDef * md,
452 const QCString &text)
453{
454 QCString stext = text.stripWhiteSpace();
455 if (stext.isEmpty()) return;
456 // convert the documentation string into an abstract syntax tree
457 auto parser { createDocParser() };
458 auto ast { validatingParseDoc(*parser.get(),
459 fileName,
460 lineNr,
461 scope,
462 md,
463 text,
464 DocOptions())
465 };
466 auto astImpl = dynamic_cast<const DocNodeAST*>(ast.get());
467 if (astImpl)
468 {
469 // create a code generator
470 OutputCodeList xmlCodeList;
471 xmlCodeList.add<XMLCodeGenerator>(&t);
472 // create a parse tree visitor for XML
473 XmlDocVisitor visitor(t,xmlCodeList,scope?scope->getDefFileExtension():QCString(""));
474 // visit all nodes
475 std::visit(visitor,astImpl->root);
476 // clean up
477 }
478}
479
481{
482 auto intf=Doxygen::parserManager->getCodeParser(fd->getDefFileExtension());
484 intf->resetCodeParserState();
485 OutputCodeList xmlList;
486 xmlList.add<XMLCodeGenerator>(&t);
487 xmlList.startCodeFragment("DoxyCode");
488 intf->parseCode(xmlList, // codeOutList
489 QCString(), // scopeName
491 Config_getBool(FILTER_SOURCE_FILES)),
492 langExt, // lang
493 Config_getBool(STRIP_CODE_COMMENTS),
494 CodeParserOptions().setFileDef(fd)
495 );
496 xmlList.endCodeFragment("DoxyCode");
497}
498
499static void writeMemberReference(TextStream &t,const Definition *def,const MemberDef *rmd,const QCString &tagName)
500{
501 QCString scope = rmd->getScopeString();
502 QCString name = rmd->name();
503 if (!scope.isEmpty() && scope!=def->name())
504 {
506 }
507 t << " <" << tagName << " refid=\"";
508 t << rmd->getOutputFileBase() << "_1" << rmd->anchor() << "\"";
509 if (rmd->getStartBodyLine()!=-1 && rmd->getBodyDef())
510 {
511 t << " compoundref=\"" << rmd->getBodyDef()->getOutputFileBase() << "\"";
512 t << " startline=\"" << rmd->getStartBodyLine() << "\"";
513 if (rmd->getEndBodyLine()!=-1)
514 {
515 t << " endline=\"" << rmd->getEndBodyLine() << "\"";
516 }
517 }
518 t << ">" << convertToXML(name) << "</" << tagName << ">\n";
519
520}
521
522static void stripQualifiers(QCString &typeStr)
523{
524 bool done=false;
525 typeStr.stripPrefix("friend ");
526 while (!done)
527 {
528 if (typeStr.stripPrefix("static ")) {}
529 else if (typeStr.stripPrefix("constexpr ")) {}
530 else if (typeStr.stripPrefix("consteval ")) {}
531 else if (typeStr.stripPrefix("constinit ")) {}
532 else if (typeStr.stripPrefix("virtual ")) {}
533 else if (typeStr=="virtual") typeStr="";
534 else done=TRUE;
535 }
536}
537
539{
540 //bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES);
541 //if (inlineGroupedClasses && cd->partOfGroups()!=0)
542 return cd->getOutputFileBase();
543 //else
544 // return cd->getOutputFileBase();
545}
546
548{
549 //bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES);
550 //if (inlineGroupedClasses && md->getClassDef() && md->getClassDef()->partOfGroups()!=0)
551 // return md->getClassDef()->getXmlOutputFileBase();
552 //else
553 // return md->getOutputFileBase();
554 return md->getOutputFileBase();
555}
556
557// Removes a keyword from a given string
558// @param str string from which to strip the keyword
559// @param needSpace true if spacing is required around the keyword
560// @return true if the keyword was removed, false otherwise
561static bool stripKeyword(QCString& str, const char *keyword, bool needSpace)
562{
563 bool found = false;
564 int searchStart = 0;
565 int len = static_cast<int>(strlen(keyword));
566 int searchEnd = static_cast<int>(str.size());
567 while (searchStart<searchEnd)
568 {
569 int index = str.find(keyword, searchStart);
570 if (index==-1)
571 {
572 break; // no more occurrences found
573 }
574 int end = index + len;
575 if (needSpace)
576 {
577 if ((index>0 && str[index-1]!=' ') || // at the start of the string or preceded by a space, or
578 (end!=searchEnd && str[end] !=' ') // at the end of the string or followed by a space.
579 )
580 {
581 searchStart = end;
582 continue; // no a standalone word
583 }
584 }
585 if (needSpace && index>0) // strip with space before keyword
586 {
587 str.remove(index-1, len+1);
588 searchEnd -= (len+1);
589 }
590 else if (needSpace && end<searchEnd) // strip with space after string starting with keyword
591 {
592 str.remove(index, len+1);
593 searchEnd -= (len+1);
594 }
595 else // strip just keyword
596 {
597 str.remove(index, len);
598 searchEnd -= len;
599 }
600 found = true;
601 }
602 return found;
603}
604
606{
607 QCString expr;
608 //printf("extractNoExcept(%s)\n",qPrint(argsStr));
609 int i = argsStr.find("noexcept(");
610 if (i!=-1)
611 {
612 int bracketCount = 1;
613 size_t p = i+9;
614 bool found = false;
615 bool insideString = false;
616 bool insideChar = false;
617 char pc = 0;
618 while (!found && p<argsStr.length())
619 {
620 char c = argsStr[p++];
621 if (insideString)
622 {
623 if (c=='"' && pc!='\\') insideString=false;
624 }
625 else if (insideChar)
626 {
627 if (c=='\'' && pc!='\\') insideChar=false;
628 }
629 else
630 {
631 switch (c)
632 {
633 case '(': bracketCount++; break;
634 case ')': bracketCount--; found = bracketCount==0; break;
635 case '"': insideString = true; break;
636 case '\'': insideChar = true; break;
637 }
638 }
639 pc = c;
640 }
641 expr = argsStr.mid(i+9,p-i-10);
642 argsStr = (argsStr.left(i) + argsStr.mid(p)).stripWhiteSpace();
643 }
644 //printf("extractNoExcept -> argsStr='%s', expr='%s'\n",qPrint(argsStr),qPrint(expr));
645 return expr;
646}
647
648static void writeRequirementRefs(const Definition *d,TextStream &t,const char *prefix="")
649{
650 auto writeRefsForType = [&t,&prefix](const RequirementRefs &refs,const char *tagName)
651 {
652 if (!refs.empty())
653 {
654 t << prefix << " <" << tagName << ">\n";
655 for (const auto &ref : refs)
656 {
657 t << prefix << " <requirement refid=\"" << xmlRequirementId(ref.reqId()) << "\">"
658 << convertToXML(ref.title()) << "</requirement>\n";
659 }
660 t << prefix << " </" << tagName << ">\n";
661 }
662 };
663 RequirementRefs satisfiesRefs;
664 RequirementRefs verifiesRefs;
665 splitRequirementRefs(d->requirementReferences(),satisfiesRefs,verifiesRefs);
666 writeRefsForType(satisfiesRefs,"satisfies");
667 writeRefsForType(verifiesRefs,"verifies");
668}
669
670
671static void generateXMLForMember(const MemberDef *md,TextStream &ti,TextStream &t,const Definition *def)
672{
673
674 // + declaration/definition arg lists
675 // + reimplements
676 // + reimplementedBy
677 // + exceptions
678 // + const/volatile specifiers
679 // - examples
680 // + source definition
681 // + source references
682 // + source referenced by
683 // - body code
684 // + template arguments
685 // (templateArguments(), definitionTemplateParameterLists())
686 // - call graph
687
688 // enum values are written as part of the enum
689 if (md->memberType()==MemberType::EnumValue) return;
690 if (md->isHidden()) return;
691
692 // group members are only visible in their group
693 bool groupMember = md->getGroupDef() && def->definitionType()!=Definition::TypeGroup;
694
695 QCString memType;
696 bool isFunc=FALSE;
697 switch (md->memberType())
698 {
699 case MemberType::Define: memType="define"; break;
700 case MemberType::Function: memType="function"; isFunc=TRUE; break;
701 case MemberType::Variable: memType="variable"; break;
702 case MemberType::Typedef: memType="typedef"; break;
703 case MemberType::Enumeration: memType="enum"; break;
704 case MemberType::EnumValue: ASSERT(0); break;
705 case MemberType::Signal: memType="signal"; isFunc=TRUE; break;
706 case MemberType::Slot: memType="slot"; isFunc=TRUE; break;
707 case MemberType::Friend: memType="friend"; isFunc=TRUE; break;
708 case MemberType::DCOP: memType="dcop"; isFunc=TRUE; break;
709 case MemberType::Property: memType="property"; break;
710 case MemberType::Event: memType="event"; break;
711 case MemberType::Interface: memType="interface"; break;
712 case MemberType::Service: memType="service"; break;
713 case MemberType::Sequence: memType="sequence"; break;
714 case MemberType::Dictionary: memType="dictionary"; break;
715 }
716
717 QCString nameStr = md->name();
718 QCString typeStr = md->typeString();
719 QCString argsStr = md->argsString();
720 QCString defStr = md->definition();
721 defStr.stripPrefix("constexpr ");
722 defStr.stripPrefix("consteval ");
723 defStr.stripPrefix("constinit ");
724 stripQualifiers(typeStr);
725 if (typeStr=="auto")
726 {
727 int i=argsStr.findRev("->");
728 if (i!=-1) // move trailing return type into type and strip it from argsStr
729 {
730 typeStr=argsStr.mid(i+2).stripWhiteSpace();
731 argsStr=argsStr.left(i).stripWhiteSpace();
732 if (stripKeyword(typeStr, "override", true))
733 {
734 argsStr += " override";
735 }
736 if (stripKeyword(typeStr, "final", true))
737 {
738 argsStr += " final";
739 }
740 if (stripKeyword(typeStr, "=0", false))
741 {
742 argsStr += "=0";
743 }
744 if (stripKeyword(typeStr, "=default", false))
745 {
746 argsStr += "=default";
747 }
748 if (stripKeyword(typeStr, "=delete", false))
749 {
750 argsStr += "=delete";
751 }
752 i=defStr.find("auto ");
753 if (i!=-1)
754 {
755 defStr=defStr.left(i)+typeStr+defStr.mid(i+4);
756 }
757 }
758 }
759 QCString noExceptExpr = extractNoExcept(argsStr);
760
761 ti << " <member refid=\"" << memberOutputFileBase(md)
762 << "_1" << md->anchor() << "\" kind=\"" << memType << "\"><name>"
763 << convertToXML(nameStr) << "</name></member>\n";
764
765 if (groupMember)
766 {
767 t << " <member refid=\""
769 << "_1" << md->anchor() << "\" kind=\"" << memType << "\"><name>"
770 << convertToXML(nameStr) << "</name></member>\n";
771 return;
772 }
773 else
774 {
775 t << " <memberdef kind=\"";
776 t << memType << "\" id=\"";
777 t << memberOutputFileBase(md);
778 t << "_1" // encoded ':' character (see util.cpp:convertNameToFile)
779 << md->anchor();
780 }
781 //enum { define_t,variable_t,typedef_t,enum_t,function_t } xmlType = function_t;
782
783 t << "\" prot=\"" << to_string_lower(md->protection());
784 t << "\"";
785
786 t << " static=\"";
787 if (md->isStatic()) t << "yes"; else t << "no";
788 t << "\"";
789
790 if (md->isNoDiscard())
791 {
792 t << " nodiscard=\"yes\"";
793 }
794
795 if (md->isConstExpr())
796 {
797 t << " constexpr=\"yes\"";
798 }
799
800 if (md->isConstEval())
801 {
802 t << " consteval=\"yes\"";
803 }
804
805 if (md->isConstInit())
806 {
807 t << " constinit=\"yes\"";
808 }
809
810 if (md->isExternal())
811 {
812 t << " extern=\"yes\"";
813 }
814
815 if (isFunc)
816 {
817 const ArgumentList &al = md->argumentList();
818 t << " const=\"";
819 if (al.constSpecifier()) t << "yes"; else t << "no";
820 t << "\"";
821
822 t << " explicit=\"";
823 if (md->isExplicit()) t << "yes"; else t << "no";
824 t << "\"";
825
826 t << " inline=\"";
827 if (md->isInline()) t << "yes"; else t << "no";
828 t << "\"";
829
831 {
832 t << " refqual=\"";
833 if (al.refQualifier()==RefQualifierType::LValue) t << "lvalue"; else t << "rvalue";
834 t << "\"";
835 }
836
837 if (md->isFinal())
838 {
839 t << " final=\"yes\"";
840 }
841
842 if (md->isSealed())
843 {
844 t << " sealed=\"yes\"";
845 }
846
847 if (md->isNew())
848 {
849 t << " new=\"yes\"";
850 }
851
852 if (md->isOptional())
853 {
854 t << " optional=\"yes\"";
855 }
856
857 if (md->isRequired())
858 {
859 t << " required=\"yes\"";
860 }
861
862 if (md->isNoExcept())
863 {
864 t << " noexcept=\"yes\"";
865 }
866
867 if (!noExceptExpr.isEmpty())
868 {
869 t << " noexceptexpression=\"" << convertToXML(noExceptExpr) << "\"";
870 }
871
872 if (al.volatileSpecifier())
873 {
874 t << " volatile=\"yes\"";
875 }
876
877 t << " virt=\"" << to_string_lower(md->virtualness());
878 t << "\"";
879 }
880
882 {
883 t << " strong=\"";
884 if (md->isStrong()) t << "yes"; else t << "no";
885 t << "\"";
886 }
887
888 if (md->memberType() == MemberType::Variable)
889 {
890 //ArgumentList *al = md->argumentList();
891 //t << " volatile=\"";
892 //if (al && al->volatileSpecifier) t << "yes"; else t << "no";
893
894 t << " mutable=\"";
895 if (md->isMutable()) t << "yes"; else t << "no";
896 t << "\"";
897
898 if (md->isThreadLocal())
899 {
900 t << " thread_local=\"yes\"";
901 }
902
903 if (md->isInitonly())
904 {
905 t << " initonly=\"yes\"";
906 }
907 if (md->isAttribute())
908 {
909 t << " attribute=\"yes\"";
910 }
911 if (md->isUNOProperty())
912 {
913 t << " property=\"yes\"";
914 }
915 if (md->isReadonly())
916 {
917 t << " readonly=\"yes\"";
918 }
919 if (md->isBound())
920 {
921 t << " bound=\"yes\"";
922 }
923 if (md->isRemovable())
924 {
925 t << " removable=\"yes\"";
926 }
927 if (md->isConstrained())
928 {
929 t << " constrained=\"yes\"";
930 }
931 if (md->isTransient())
932 {
933 t << " transient=\"yes\"";
934 }
935 if (md->isMaybeVoid())
936 {
937 t << " maybevoid=\"yes\"";
938 }
939 if (md->isMaybeDefault())
940 {
941 t << " maybedefault=\"yes\"";
942 }
943 if (md->isMaybeAmbiguous())
944 {
945 t << " maybeambiguous=\"yes\"";
946 }
947 }
948 else if (md->memberType() == MemberType::Property)
949 {
950 t << " readable=\"";
951 if (md->isReadable()) t << "yes"; else t << "no";
952 t << "\"";
953
954 t << " writable=\"";
955 if (md->isWritable()) t << "yes"; else t << "no";
956 t << "\"";
957
958 t << " gettable=\"";
959 if (md->isGettable()) t << "yes"; else t << "no";
960 t << "\"";
961
962 t << " privategettable=\"";
963 if (md->isPrivateGettable()) t << "yes"; else t << "no";
964 t << "\"";
965
966 t << " protectedgettable=\"";
967 if (md->isProtectedGettable()) t << "yes"; else t << "no";
968 t << "\"";
969
970 t << " settable=\"";
971 if (md->isSettable()) t << "yes"; else t << "no";
972 t << "\"";
973
974 t << " privatesettable=\"";
975 if (md->isPrivateSettable()) t << "yes"; else t << "no";
976 t << "\"";
977
978 t << " protectedsettable=\"";
979 if (md->isProtectedSettable()) t << "yes"; else t << "no";
980 t << "\"";
981
982 if (md->isAssign() || md->isCopy() || md->isRetain() || md->isStrong() || md->isWeak())
983 {
984 t << " accessor=\"";
985 if (md->isAssign()) t << "assign";
986 else if (md->isCopy()) t << "copy";
987 else if (md->isRetain()) t << "retain";
988 else if (md->isStrong()) t << "strong";
989 else if (md->isWeak()) t << "weak";
990 t << "\"";
991 }
992 }
993 else if (md->memberType() == MemberType::Event)
994 {
995 t << " add=\"";
996 if (md->isAddable()) t << "yes"; else t << "no";
997 t << "\"";
998
999 t << " remove=\"";
1000 if (md->isRemovable()) t << "yes"; else t << "no";
1001 t << "\"";
1002
1003 t << " raise=\"";
1004 if (md->isRaisable()) t << "yes"; else t << "no";
1005 t << "\"";
1006 }
1007
1008 t << ">\n";
1009
1010 if (md->memberType()!=MemberType::Define &&
1012 )
1013 {
1015 t << " <type>";
1016 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,typeStr);
1017 t << "</type>\n";
1018 if (md->isTypeAlias())
1019 {
1020 defStr+=" = "+md->initializer();
1021 }
1022 t << " <definition>" << convertToXML(defStr) << "</definition>\n";
1023 t << " <argsstring>" << convertToXML(argsStr) << "</argsstring>\n";
1024 }
1025
1027 {
1028 t << " <type>";
1030 t << "</type>\n";
1031 }
1032
1033 QCString qualifiedNameStr = md->qualifiedName();
1034 t << " <name>" << convertToXML(nameStr) << "</name>\n";
1035 if (nameStr!=qualifiedNameStr)
1036 {
1037 t << " <qualifiedname>" << convertToXML(qualifiedNameStr) << "</qualifiedname>\n";
1038 }
1039
1040 if (md->memberType() == MemberType::Property)
1041 {
1042 if (md->isReadable())
1043 t << " <read>" << convertToXML(md->getReadAccessor()) << "</read>\n";
1044 if (md->isWritable())
1045 t << " <write>" << convertToXML(md->getWriteAccessor()) << "</write>\n";
1046 }
1047
1049 {
1050 QCString bitfield = md->bitfieldString();
1051 if (bitfield.at(0)==':') bitfield=bitfield.mid(1);
1052 t << " <bitfield>" << convertToXML(bitfield) << "</bitfield>\n";
1053 }
1054
1055 const MemberDef *rmd = md->reimplements();
1056 if (rmd)
1057 {
1058 t << " <reimplements refid=\""
1059 << memberOutputFileBase(rmd) << "_1" << rmd->anchor() << "\">"
1060 << convertToXML(rmd->name()) << "</reimplements>\n";
1061 }
1062 for (const auto &rbmd : md->reimplementedBy())
1063 {
1064 t << " <reimplementedby refid=\""
1065 << memberOutputFileBase(rbmd) << "_1" << rbmd->anchor() << "\">"
1066 << convertToXML(rbmd->name()) << "</reimplementedby>\n";
1067 }
1068
1069 for (const auto &qmd : md->getQualifiers())
1070 {
1071 t << " <qualifier>" << convertToXML(qmd) << "</qualifier>\n";
1072 }
1073
1074 if (md->isFriendClass()) // for friend classes we show a link to the class as a "parameter"
1075 {
1076 t << " <param>\n";
1077 t << " <type>";
1078 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,nameStr);
1079 t << "</type>\n";
1080 t << " </param>\n";
1081 }
1082 else if (isFunc) //function
1083 {
1084 const ArgumentList &declAl = md->declArgumentList();
1085 const ArgumentList &defAl = md->argumentList();
1086 bool isFortran = md->getLanguage()==SrcLangExt::Fortran;
1087 if (declAl.hasParameters())
1088 {
1089 auto defIt = defAl.begin();
1090 for (const Argument &a : declAl)
1091 {
1092 //const Argument *defArg = defAli.current();
1093 const Argument *defArg = nullptr;
1094 if (defIt!=defAl.end())
1095 {
1096 defArg = &(*defIt);
1097 ++defIt;
1098 }
1099 t << " <param>\n";
1100 if (!a.attrib.isEmpty())
1101 {
1102 t << " <attributes>";
1103 writeXMLString(t,a.attrib);
1104 t << "</attributes>\n";
1105 }
1106 if (isFortran && defArg && !defArg->type.isEmpty())
1107 {
1108 t << " <type>";
1109 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,defArg->type);
1110 t << "</type>\n";
1111 }
1112 else if (!a.type.isEmpty())
1113 {
1114 t << " <type>";
1115 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,a.type);
1116 t << "</type>\n";
1117 }
1118 if (!a.name.isEmpty())
1119 {
1120 t << " <declname>";
1121 writeXMLString(t,a.name);
1122 t << "</declname>\n";
1123 }
1124 if (defArg && !defArg->name.isEmpty() && defArg->name!=a.name)
1125 {
1126 t << " <defname>";
1127 writeXMLString(t,defArg->name);
1128 t << "</defname>\n";
1129 }
1130 if (!a.array.isEmpty())
1131 {
1132 t << " <array>";
1133 writeXMLString(t,a.array);
1134 t << "</array>\n";
1135 }
1136 if (!a.defval.isEmpty())
1137 {
1138 t << " <defval>";
1139 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,a.defval);
1140 t << "</defval>\n";
1141 }
1142 if (defArg && defArg->hasDocumentation())
1143 {
1144 t << " <briefdescription>";
1146 md->getOuterScope(),md,defArg->docs);
1147 t << "</briefdescription>\n";
1148 }
1149 t << " </param>\n";
1150 }
1151 }
1152 }
1153 else if (md->memberType()==MemberType::Define &&
1154 !md->argsString().isEmpty()) // define
1155 {
1156 if (md->argumentList().empty()) // special case for "foo()" to
1157 // distinguish it from "foo".
1158 {
1159 t << " <param></param>\n";
1160 }
1161 else
1162 {
1163 for (const Argument &a : md->argumentList())
1164 {
1165 t << " <param><defname>" << a.type << "</defname></param>\n";
1166 }
1167 }
1168 }
1169 if (!md->requiresClause().isEmpty())
1170 {
1171 t << " <requiresclause>";
1173 t << " </requiresclause>\n";
1174 }
1175
1176 if (!md->isTypeAlias() && (md->hasOneLineInitializer() || md->hasMultiLineInitializer()))
1177 {
1178 t << " <initializer>";
1180 t << "</initializer>\n";
1181 }
1182
1183 if (!md->excpString().isEmpty())
1184 {
1185 t << " <exceptions>";
1187 t << "</exceptions>\n";
1188 }
1189 writeRequirementRefs(md,t," ");
1190
1191 if (md->memberType()==MemberType::Enumeration) // enum
1192 {
1193 for (const auto &emd : md->enumFieldList())
1194 {
1195 ti << " <member refid=\"" << memberOutputFileBase(md)
1196 << "_1" << emd->anchor() << "\" kind=\"enumvalue\"><name>"
1197 << convertToXML(emd->name()) << "</name></member>\n";
1198
1199 t << " <enumvalue id=\"" << memberOutputFileBase(md) << "_1"
1200 << emd->anchor() << "\" prot=\"" << to_string_lower(emd->protection());
1201 t << "\">\n";
1202 t << " <name>";
1203 writeXMLString(t,emd->name());
1204 t << "</name>\n";
1205 if (!emd->initializer().isEmpty())
1206 {
1207 t << " <initializer>";
1208 writeXMLString(t,emd->initializer());
1209 t << "</initializer>\n";
1210 }
1211 t << " <briefdescription>\n";
1212 writeXMLDocBlock(t,emd->briefFile(),emd->briefLine(),emd->getOuterScope(),emd,emd->briefDescription());
1213 t << " </briefdescription>\n";
1214 t << " <detaileddescription>\n";
1215 writeXMLDocBlock(t,emd->docFile(),emd->docLine(),emd->getOuterScope(),emd,emd->documentation());
1216 t << " </detaileddescription>\n";
1217 t << " </enumvalue>\n";
1218 }
1219 }
1220 t << " <briefdescription>\n";
1222 t << " </briefdescription>\n";
1223 t << " <detaileddescription>\n";
1224 writeXMLDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation());
1225 t << " </detaileddescription>\n";
1226 t << " <inbodydescription>\n";
1228 t << " </inbodydescription>\n";
1229 if (md->getDefLine()!=-1)
1230 {
1231 t << " <location file=\""
1232 << convertToXML(stripFromPath(md->getDefFileName())) << "\" line=\""
1233 << md->getDefLine() << "\" column=\""
1234 << md->getDefColumn() << "\"" ;
1235 if (md->getStartBodyLine()!=-1)
1236 {
1237 const FileDef *bodyDef = md->getBodyDef();
1238 if (bodyDef)
1239 {
1240 t << " bodyfile=\"" << convertToXML(stripFromPath(bodyDef->absFilePath())) << "\"";
1241 }
1242 t << " bodystart=\"" << md->getStartBodyLine() << "\" bodyend=\""
1243 << md->getEndBodyLine() << "\"";
1244 }
1245 if (md->getDeclLine()!=-1)
1246 {
1247 t << " declfile=\"" << convertToXML(stripFromPath(md->getDeclFileName())) << "\" declline=\""
1248 << md->getDeclLine() << "\" declcolumn=\""
1249 << md->getDeclColumn() << "\"";
1250 }
1251 t << "/>\n";
1252 }
1253
1254 //printf("md->getReferencesMembers()=%p\n",md->getReferencesMembers());
1255 auto refList = md->getReferencesMembers();
1256 for (const auto &refmd : refList)
1257 {
1258 writeMemberReference(t,def,refmd,"references");
1259 }
1260 auto refByList = md->getReferencedByMembers();
1261 for (const auto &refmd : refByList)
1262 {
1263 writeMemberReference(t,def,refmd,"referencedby");
1264 }
1265
1266 t << " </memberdef>\n";
1267}
1268
1269// namespace members are also inserted in the file scope, but
1270// to prevent this duplication in the XML output, we optionally filter those here.
1271static bool memberVisible(const Definition *d,const MemberDef *md)
1272{
1273 return Config_getBool(XML_NS_MEMB_FILE_SCOPE) ||
1275 md->getNamespaceDef()==nullptr;
1276}
1277
1279 const MemberList *ml,const QCString &kind,const QCString &header=QCString(),
1280 const QCString &documentation=QCString())
1281{
1282 if (ml==nullptr) return;
1283 int count=0;
1284 for (const auto &md : *ml)
1285 {
1286 if (memberVisible(d,md) && (md->memberType()!=MemberType::EnumValue) &&
1287 !md->isHidden())
1288 {
1289 count++;
1290 }
1291 }
1292 if (count==0) return; // empty list
1293
1294 t << " <sectiondef kind=\"" << kind << "\">\n";
1295 if (!header.isEmpty())
1296 {
1297 t << " <header>" << convertToXML(header) << "</header>\n";
1298 }
1299 if (!documentation.isEmpty())
1300 {
1301 t << " <description>";
1302 writeXMLDocBlock(t,d->docFile(),d->docLine(),d,nullptr,documentation);
1303 t << "</description>\n";
1304 }
1305 for (const auto &md : *ml)
1306 {
1307 if (memberVisible(d,md))
1308 {
1309 generateXMLForMember(md,ti,t,d);
1310 }
1311 }
1312 t << " </sectiondef>\n";
1313}
1314
1316{
1317 t << " <listofallmembers>\n";
1318 for (auto &mni : cd->memberNameInfoLinkedMap())
1319 {
1320 for (auto &mi : *mni)
1321 {
1322 const MemberDef *md=mi->memberDef();
1323 if (!md->isAnonymous())
1324 {
1325 Protection prot = mi->prot();
1326 Specifier virt=md->virtualness();
1327 t << " <member refid=\"" << memberOutputFileBase(md) << "_1" <<
1328 md->anchor() << "\" prot=\"" << to_string_lower(prot);
1329 t << "\" virt=\"" << to_string_lower(virt) << "\"";
1330 if (!mi->ambiguityResolutionScope().isEmpty())
1331 {
1332 t << " ambiguityscope=\"" << convertToXML(mi->ambiguityResolutionScope()) << "\"";
1333 }
1334 t << "><scope>" << convertToXML(cd->name()) << "</scope><name>" <<
1335 convertToXML(md->name()) << "</name></member>\n";
1336 }
1337 }
1338 }
1339 t << " </listofallmembers>\n";
1340}
1341
1343{
1344 for (const auto &cd : cl)
1345 {
1346 if (!cd->isHidden() && !cd->isAnonymous())
1347 {
1348 t << " <innerclass refid=\"" << classOutputFileBase(cd)
1349 << "\" prot=\"" << to_string_lower(cd->protection());
1350 t << "\">" << convertToXML(cd->name()) << "</innerclass>\n";
1351 }
1352 }
1353}
1354
1356{
1357 for (const auto &cd : cl)
1358 {
1359 if (!cd->isHidden())
1360 {
1361 t << " <innerconcept refid=\"" << cd->getOutputFileBase()
1362 << "\">" << convertToXML(cd->name()) << "</innerconcept>\n";
1363 }
1364 }
1365}
1366
1368{
1369 for (const auto &mod : ml)
1370 {
1371 if (!mod->isHidden())
1372 {
1373 t << " <innermodule refid=\"" << mod->getOutputFileBase()
1374 << "\">" << convertToXML(mod->name()) << "</innermodule>\n";
1375 }
1376 }
1377}
1378
1380{
1381 for (const auto &nd : nl)
1382 {
1383 if (!nd->isHidden() && !nd->isAnonymous())
1384 {
1385 t << " <innernamespace refid=\"" << nd->getOutputFileBase()
1386 << "\"" << (nd->isInline() ? " inline=\"yes\"" : "")
1387 << ">" << convertToXML(nd->name()) << "</innernamespace>\n";
1388 }
1389 }
1390}
1391
1392static void writeExports(const ImportInfoMap &exportMap,TextStream &t)
1393{
1394 if (exportMap.empty()) return;
1395 t << " <exports>\n";
1396 for (const auto &[moduleName,importInfoList] : exportMap)
1397 {
1398 for (const auto &importInfo : importInfoList)
1399 {
1400 t << " <export";
1401 ModuleDef *mod = ModuleManager::instance().getPrimaryInterface(importInfo.importName);
1402 if (mod && mod->isLinkableInProject())
1403 {
1404 t << " refid=\"" << mod->getOutputFileBase() << "\"";
1405 }
1406 t << ">";
1407 t << importInfo.importName;
1408 t << "</export>\n";
1409 }
1410 }
1411 t << " </exports>\n";
1412}
1413
1414static void writeInnerFiles(const FileList &fl,TextStream &t)
1415{
1416 for (const auto &fd : fl)
1417 {
1418 t << " <innerfile refid=\"" << fd->getOutputFileBase()
1419 << "\">" << convertToXML(fd->name()) << "</innerfile>\n";
1420 }
1421}
1422
1424{
1425 for (const auto &pd : pl)
1426 {
1427 t << " <innerpage refid=\"" << pd->getOutputFileBase();
1428 if (pd->getGroupDef())
1429 {
1430 t << "_" << pd->name();
1431 }
1432 t << "\">" << convertToXML(pd->title()) << "</innerpage>\n";
1433 }
1434}
1435
1436static void writeInnerGroups(const GroupList &gl,TextStream &t)
1437{
1438 for (const auto &sgd : gl)
1439 {
1440 t << " <innergroup refid=\"" << sgd->getOutputFileBase()
1441 << "\">" << convertToXML(sgd->groupTitle())
1442 << "</innergroup>\n";
1443 }
1444}
1445
1446static void writeInnerDirs(const DirList *dl,TextStream &t)
1447{
1448 if (dl)
1449 {
1450 for(const auto subdir : *dl)
1451 {
1452 t << " <innerdir refid=\"" << subdir->getOutputFileBase()
1453 << "\">" << convertToXML(subdir->displayName()) << "</innerdir>\n";
1454 }
1455 }
1456}
1457
1458static void writeIncludeInfo(const IncludeInfo *ii,TextStream &t)
1459{
1460 if (ii)
1461 {
1462 QCString nm = ii->includeName;
1463 if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName();
1464 if (!nm.isEmpty())
1465 {
1466 t << " <includes";
1467 if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references
1468 {
1469 t << " refid=\"" << ii->fileDef->getOutputFileBase() << "\"";
1470 }
1471 t << " local=\"" << ((ii->kind & IncludeKind_LocalMask) ? "yes" : "no") << "\">";
1472 t << nm;
1473 t << "</includes>\n";
1474 }
1475 }
1476}
1477
1478static void generateXMLForClass(const ClassDef *cd,TextStream &ti)
1479{
1480 // + brief description
1481 // + detailed description
1482 // + template argument list(s)
1483 // - include file
1484 // + member groups
1485 // + inheritance diagram
1486 // + list of direct super classes
1487 // + list of direct sub classes
1488 // + list of inner classes
1489 // + collaboration diagram
1490 // + list of all members
1491 // + user defined member sections
1492 // + standard member sections
1493 // + detailed member documentation
1494 // - examples using the class
1495
1496 if (cd->isReference()) return; // skip external references.
1497 if (cd->isHidden()) return; // skip hidden classes.
1498 if (cd->isAnonymous()) return; // skip anonymous compounds.
1499 if (cd->isImplicitTemplateInstance()) return; // skip generated template instances.
1500 if (cd->isArtificial()) return; // skip artificially created classes
1501
1502 msg("Generating XML output for class {}\n",cd->name());
1503
1504 ti << " <compound refid=\"" << classOutputFileBase(cd)
1505 << "\" kind=\"" << cd->compoundTypeString()
1506 << "\"><name>" << convertToXML(cd->name()) << "</name>\n";
1507
1508 QCString outputDirectory = Config_getString(XML_OUTPUT);
1509 QCString fileName=outputDirectory+"/"+ classOutputFileBase(cd)+".xml";
1510 std::ofstream f = Portable::openOutputStream(fileName);
1511 if (!f.is_open())
1512 {
1513 err("Cannot open file {} for writing!\n",fileName);
1514 return;
1515 }
1516 TextStream t(&f);
1517
1518 writeXMLHeader(t);
1519 t << " <compounddef id=\""
1520 << classOutputFileBase(cd) << "\" kind=\""
1521 << cd->compoundTypeString() << "\" language=\""
1522 << langToString(cd->getLanguage()) << "\" prot=\"";
1523 t << to_string_lower(cd->protection());
1524 if (cd->isFinal()) t << "\" final=\"yes";
1525 if (cd->isSealed()) t << "\" sealed=\"yes";
1526 if (cd->isAbstract()) t << "\" abstract=\"yes";
1527 t << "\">\n";
1528 t << " <compoundname>";
1529 QCString nameStr = cd->name();
1530 writeXMLString(t,nameStr);
1531 t << "</compoundname>\n";
1532 for (const auto &bcd : cd->baseClasses())
1533 {
1534 t << " <basecompoundref ";
1535 if (bcd.classDef->isLinkable())
1536 {
1537 t << "refid=\"" << classOutputFileBase(bcd.classDef) << "\" ";
1538 }
1539 if (bcd.prot == Protection::Package) ASSERT(0);
1540 t << "prot=\"";
1541 t << to_string_lower(bcd.prot);
1542 t << "\" virt=\"";
1543 t << to_string_lower(bcd.virt);
1544 t << "\">";
1545 if (!bcd.templSpecifiers.isEmpty())
1546 {
1547 t << convertToXML(
1549 bcd.classDef->name(),bcd.templSpecifiers)
1550 );
1551 }
1552 else
1553 {
1554 t << convertToXML(bcd.classDef->displayName());
1555 }
1556 t << "</basecompoundref>\n";
1557 }
1558 for (const auto &bcd : cd->subClasses())
1559 {
1560 if (bcd.prot == Protection::Package) ASSERT(0);
1561 t << " <derivedcompoundref refid=\""
1562 << classOutputFileBase(bcd.classDef)
1563 << "\" prot=\"";
1564 t << to_string_lower(bcd.prot);
1565 t << "\" virt=\"";
1566 t << to_string_lower(bcd.virt);
1567 t << "\">" << convertToXML(bcd.classDef->displayName())
1568 << "</derivedcompoundref>\n";
1569 }
1570
1572
1574
1575 writeTemplateList(cd,t);
1576 for (const auto &mg : cd->getMemberGroups())
1577 {
1578 generateXMLSection(cd,ti,t,&mg->members(),"user-defined",mg->header(),
1579 mg->documentation());
1580 }
1581
1582 for (const auto &ml : cd->getMemberLists())
1583 {
1584 if (!ml->listType().isDetailed())
1585 {
1586 generateXMLSection(cd,ti,t,ml.get(),ml->listType().toXML());
1587 }
1588 }
1589
1590 if (!cd->requiresClause().isEmpty())
1591 {
1592 t << " <requiresclause>";
1593 linkifyText(TextGeneratorXMLImpl(t),cd,cd->getFileDef(),nullptr,cd->requiresClause());
1594 t << " </requiresclause>\n";
1595 }
1596
1597 for (const auto &qcd : cd->getQualifiers())
1598 {
1599 t << " <qualifier>" << convertToXML(qcd) << "</qualifier>\n";
1600 }
1601
1602 t << " <briefdescription>\n";
1603 writeXMLDocBlock(t,cd->briefFile(),cd->briefLine(),cd,nullptr,cd->briefDescription());
1604 t << " </briefdescription>\n";
1605 t << " <detaileddescription>\n";
1606 writeXMLDocBlock(t,cd->docFile(),cd->docLine(),cd,nullptr,cd->documentation());
1607 t << " </detaileddescription>\n";
1608 DotClassGraph inheritanceGraph(cd,GraphType::Inheritance);
1609 if (!inheritanceGraph.isTrivial())
1610 {
1611 t << " <inheritancegraph>\n";
1612 inheritanceGraph.writeXML(t);
1613 t << " </inheritancegraph>\n";
1614 }
1615 DotClassGraph collaborationGraph(cd,GraphType::Collaboration);
1616 if (!collaborationGraph.isTrivial())
1617 {
1618 t << " <collaborationgraph>\n";
1619 collaborationGraph.writeXML(t);
1620 t << " </collaborationgraph>\n";
1621 }
1623 t << " <location file=\""
1624 << convertToXML(stripFromPath(cd->getDefFileName())) << "\" line=\""
1625 << cd->getDefLine() << "\"" << " column=\""
1626 << cd->getDefColumn() << "\"" ;
1627 if (cd->getStartBodyLine()!=-1)
1628 {
1629 const FileDef *bodyDef = cd->getBodyDef();
1630 if (bodyDef)
1631 {
1632 t << " bodyfile=\"" << convertToXML(stripFromPath(bodyDef->absFilePath())) << "\"";
1633 }
1634 t << " bodystart=\"" << cd->getStartBodyLine() << "\" bodyend=\""
1635 << cd->getEndBodyLine() << "\"";
1636 }
1637 t << "/>\n";
1639 t << " </compounddef>\n";
1640 t << "</doxygen>\n";
1641
1642 ti << " </compound>\n";
1643}
1644
1646{
1647 if (cd->isReference() || cd->isHidden()) return; // skip external references.
1648
1649 ti << " <compound refid=\"" << cd->getOutputFileBase()
1650 << "\" kind=\"concept\"" << "><name>"
1651 << convertToXML(cd->name()) << "</name>\n";
1652
1653 QCString outputDirectory = Config_getString(XML_OUTPUT);
1654 QCString fileName=outputDirectory+"/"+cd->getOutputFileBase()+".xml";
1655 std::ofstream f = Portable::openOutputStream(fileName);
1656 if (!f.is_open())
1657 {
1658 err("Cannot open file {} for writing!\n",fileName);
1659 return;
1660 }
1661 TextStream t(&f);
1662 writeXMLHeader(t);
1663 t << " <compounddef id=\"" << cd->getOutputFileBase()
1664 << "\" kind=\"concept\">\n";
1665 t << " <compoundname>";
1666 QCString nameStr = cd->name();
1667 writeXMLString(t,nameStr);
1668 t << "</compoundname>\n";
1670 writeTemplateList(cd,t);
1671 t << " <initializer>";
1672 linkifyText(TextGeneratorXMLImpl(t),cd,cd->getFileDef(),nullptr,cd->initializer());
1673 t << "</initializer>\n";
1674 auto intf=Doxygen::parserManager->getCodeParser(".cpp");
1675 intf->resetCodeParserState();
1676 OutputCodeList xmlList;
1677 xmlList.add<XMLCodeGenerator>(&t);
1678 t << " <conceptparts>\n";
1679 for (const auto &part : cd->conceptParts())
1680 {
1681 switch (part.type)
1682 {
1684 t << " <docpart line=\"" << part.lineNr << "\" col=\"" << part.colNr << "\">\n";
1685 writeXMLDocBlock(t,cd->getDefFileName(),part.lineNr,cd,nullptr,part.content);
1686 t << " </docpart>\n";
1687 break;
1689 t << " <codepart line=\"" << part.lineNr << "\">";
1690 xmlList.startCodeFragment("DoxyCode");
1691 intf->parseCode(xmlList, // codeOutList
1692 nameStr, // scopeName
1693 part.content, // code
1694 SrcLangExt::Cpp, // lang
1695 false, // stripCodeComments
1697 );
1698 xmlList.endCodeFragment("DoxyCode");
1699 t << "</codepart>\n";
1700 break;
1701 }
1702 }
1703 t << " </conceptparts>\n";
1704 t << " <briefdescription>\n";
1705 writeXMLDocBlock(t,cd->briefFile(),cd->briefLine(),cd,nullptr,cd->briefDescription());
1706 t << " </briefdescription>\n";
1707 t << " <detaileddescription>\n";
1708 writeXMLDocBlock(t,cd->docFile(),cd->docLine(),cd,nullptr,cd->documentation());
1709 t << " </detaileddescription>\n";
1711 t << " <location file=\""
1712 << convertToXML(stripFromPath(cd->getDefFileName())) << "\" line=\""
1713 << cd->getDefLine() << "\"" << " column=\""
1714 << cd->getDefColumn() << "\"/>\n" ;
1715 t << " </compounddef>\n";
1716 t << "</doxygen>\n";
1717
1718 ti << " </compound>\n";
1719}
1720
1721static void generateXMLForModule(const ModuleDef *mod,TextStream &ti)
1722{
1723 if (mod->isReference() || mod->isHidden() || !mod->isPrimaryInterface()) return;
1724 ti << " <compound refid=\"" << mod->getOutputFileBase()
1725 << "\" kind=\"module\"" << "><name>"
1726 << convertToXML(mod->name()) << "</name>\n";
1727
1728 QCString outputDirectory = Config_getString(XML_OUTPUT);
1729 QCString fileName=outputDirectory+"/"+mod->getOutputFileBase()+".xml";
1730 std::ofstream f = Portable::openOutputStream(fileName);
1731 if (!f.is_open())
1732 {
1733 err("Cannot open file {} for writing!\n",fileName);
1734 return;
1735 }
1736 TextStream t(&f);
1737 writeXMLHeader(t);
1738 t << " <compounddef id=\"" << mod->getOutputFileBase()
1739 << "\" kind=\"module\">\n";
1740 t << " <compoundname>";
1741 writeXMLString(t,mod->name());
1742 t << "</compoundname>\n";
1743 writeInnerFiles(mod->getUsedFiles(),t);
1744 writeInnerClasses(mod->getClasses(),t);
1746 for (const auto &ml : mod->getMemberLists())
1747 {
1748 if (ml->listType().isDeclaration())
1749 {
1750 generateXMLSection(mod,ti,t,ml.get(),ml->listType().toXML());
1751 }
1752 }
1753 for (const auto &mg : mod->getMemberGroups())
1754 {
1755 generateXMLSection(mod,ti,t,&mg->members(),"user-defined",mg->header(),
1756 mg->documentation());
1757 }
1758 t << " <briefdescription>\n";
1759 writeXMLDocBlock(t,mod->briefFile(),mod->briefLine(),mod,nullptr,mod->briefDescription());
1760 t << " </briefdescription>\n";
1761 t << " <detaileddescription>\n";
1762 writeXMLDocBlock(t,mod->docFile(),mod->docLine(),mod,nullptr,mod->documentation());
1763 t << " </detaileddescription>\n";
1764 writeExports(mod->getExports(),t);
1765 writeRequirementRefs(mod,t);
1766 t << " <location file=\""
1767 << convertToXML(stripFromPath(mod->getDefFileName())) << "\" line=\""
1768 << mod->getDefLine() << "\"" << " column=\""
1769 << mod->getDefColumn() << "\"/>\n" ;
1770 t << " </compounddef>\n";
1771 t << "</doxygen>\n";
1772
1773 ti << " </compound>\n";
1774
1775}
1776
1778{
1779 // + contained class definitions
1780 // + contained namespace definitions
1781 // + member groups
1782 // + normal members
1783 // + brief desc
1784 // + detailed desc
1785 // + location
1786 // - files containing (parts of) the namespace definition
1787
1788 if (nd->isReference() || nd->isHidden()) return; // skip external references
1789
1790 ti << " <compound refid=\"" << nd->getOutputFileBase()
1791 << "\" kind=\"namespace\"" << "><name>"
1792 << convertToXML(nd->name()) << "</name>\n";
1793
1794 QCString outputDirectory = Config_getString(XML_OUTPUT);
1795 QCString fileName=outputDirectory+"/"+nd->getOutputFileBase()+".xml";
1796 std::ofstream f = Portable::openOutputStream(fileName);
1797 if (!f.is_open())
1798 {
1799 err("Cannot open file {} for writing!\n",fileName);
1800 return;
1801 }
1802 TextStream t(&f);
1803
1804 writeXMLHeader(t);
1805 t << " <compounddef id=\"" << nd->getOutputFileBase()
1806 << "\" kind=\"namespace\" "
1807 << (nd->isInline()?"inline=\"yes\" ":"")
1808 << "language=\""
1809 << langToString(nd->getLanguage()) << "\">\n";
1810 t << " <compoundname>";
1811 QCString nameStr = nd->name();
1812 writeXMLString(t,nameStr);
1813 t << "</compoundname>\n";
1814
1818
1819 for (const auto &mg : nd->getMemberGroups())
1820 {
1821 generateXMLSection(nd,ti,t,&mg->members(),"user-defined",mg->header(),
1822 mg->documentation());
1823 }
1824
1825 for (const auto &ml : nd->getMemberLists())
1826 {
1827 if (ml->listType().isDeclaration())
1828 {
1829 generateXMLSection(nd,ti,t,ml.get(),ml->listType().toXML());
1830 }
1831 }
1832
1833 t << " <briefdescription>\n";
1834 writeXMLDocBlock(t,nd->briefFile(),nd->briefLine(),nd,nullptr,nd->briefDescription());
1835 t << " </briefdescription>\n";
1836 t << " <detaileddescription>\n";
1837 writeXMLDocBlock(t,nd->docFile(),nd->docLine(),nd,nullptr,nd->documentation());
1838 t << " </detaileddescription>\n";
1840 t << " <location file=\""
1841 << convertToXML(stripFromPath(nd->getDefFileName())) << "\" line=\""
1842 << nd->getDefLine() << "\"" << " column=\""
1843 << nd->getDefColumn() << "\"/>\n" ;
1844 t << " </compounddef>\n";
1845 t << "</doxygen>\n";
1846
1847 ti << " </compound>\n";
1848}
1849
1851{
1852 // + includes files
1853 // + includedby files
1854 // + include graph
1855 // + included by graph
1856 // + contained class definitions
1857 // + contained namespace definitions
1858 // + member groups
1859 // + normal members
1860 // + brief desc
1861 // + detailed desc
1862 // + source code
1863 // + location
1864 // - number of lines
1865
1866 if (fd->isReference()) return; // skip external references
1867
1868 ti << " <compound refid=\"" << fd->getOutputFileBase()
1869 << "\" kind=\"file\"><name>" << convertToXML(fd->name())
1870 << "</name>\n";
1871
1872 QCString outputDirectory = Config_getString(XML_OUTPUT);
1873 QCString fileName=outputDirectory+"/"+fd->getOutputFileBase()+".xml";
1874 std::ofstream f = Portable::openOutputStream(fileName);
1875 if (!f.is_open())
1876 {
1877 err("Cannot open file {} for writing!\n",fileName);
1878 return;
1879 }
1880 TextStream t(&f);
1881
1882 writeXMLHeader(t);
1883 t << " <compounddef id=\"" << fd->getOutputFileBase()
1884 << "\" kind=\"file\" language=\""
1885 << langToString(fd->getLanguage()) << "\">\n";
1886 t << " <compoundname>";
1887 writeXMLString(t,fd->name());
1888 t << "</compoundname>\n";
1889
1890 for (const auto &inc : fd->includeFileList())
1891 {
1892 t << " <includes";
1893 if (inc.fileDef && !inc.fileDef->isReference()) // TODO: support external references
1894 {
1895 t << " refid=\"" << inc.fileDef->getOutputFileBase() << "\"";
1896 }
1897 t << " local=\"" << ((inc.kind & IncludeKind_LocalMask) ? "yes" : "no") << "\">";
1898 t << convertToXML(inc.includeName);
1899 t << "</includes>\n";
1900 }
1901
1902 for (const auto &inc : fd->includedByFileList())
1903 {
1904 t << " <includedby";
1905 if (inc.fileDef && !inc.fileDef->isReference()) // TODO: support external references
1906 {
1907 t << " refid=\"" << inc.fileDef->getOutputFileBase() << "\"";
1908 }
1909 t << " local=\"" << ((inc.kind &IncludeKind_LocalMask) ? "yes" : "no") << "\">";
1910 t << convertToXML(inc.includeName);
1911 t << "</includedby>\n";
1912 }
1913
1914 DotInclDepGraph incDepGraph(fd,FALSE);
1915 if (!incDepGraph.isTrivial())
1916 {
1917 t << " <incdepgraph>\n";
1918 incDepGraph.writeXML(t);
1919 t << " </incdepgraph>\n";
1920 }
1921
1922 DotInclDepGraph invIncDepGraph(fd,TRUE);
1923 if (!invIncDepGraph.isTrivial())
1924 {
1925 t << " <invincdepgraph>\n";
1926 invIncDepGraph.writeXML(t);
1927 t << " </invincdepgraph>\n";
1928 }
1929
1933
1934 for (const auto &mg : fd->getMemberGroups())
1935 {
1936 generateXMLSection(fd,ti,t,&mg->members(),"user-defined",mg->header(),
1937 mg->documentation());
1938 }
1939
1940 for (const auto &ml : fd->getMemberLists())
1941 {
1942 if (ml->listType().isDeclaration())
1943 {
1944 generateXMLSection(fd,ti,t,ml.get(),ml->listType().toXML());
1945 }
1946 }
1947
1948 t << " <briefdescription>\n";
1949 writeXMLDocBlock(t,fd->briefFile(),fd->briefLine(),fd,nullptr,fd->briefDescription());
1950 t << " </briefdescription>\n";
1951 t << " <detaileddescription>\n";
1952 writeXMLDocBlock(t,fd->docFile(),fd->docLine(),fd,nullptr,fd->documentation());
1953 t << " </detaileddescription>\n";
1954 if (Config_getBool(XML_PROGRAMLISTING))
1955 {
1956 writeXMLCodeBlock(t,fd);
1957 }
1959 t << " <location file=\"" << convertToXML(stripFromPath(fd->getDefFileName())) << "\"/>\n";
1960 t << " </compounddef>\n";
1961 t << "</doxygen>\n";
1962
1963 ti << " </compound>\n";
1964}
1965
1966static void generateXMLForGroup(const GroupDef *gd,TextStream &ti)
1967{
1968 // + members
1969 // + member groups
1970 // + files
1971 // + classes
1972 // + namespaces
1973 // - packages
1974 // + pages
1975 // + child groups
1976 // - examples
1977 // + brief description
1978 // + detailed description
1979
1980 if (gd->isReference()) return; // skip external references
1981
1982 ti << " <compound refid=\"" << gd->getOutputFileBase()
1983 << "\" kind=\"group\"><name>" << convertToXML(gd->name()) << "</name>\n";
1984
1985 QCString outputDirectory = Config_getString(XML_OUTPUT);
1986 QCString fileName=outputDirectory+"/"+gd->getOutputFileBase()+".xml";
1987 std::ofstream f = Portable::openOutputStream(fileName);
1988 if (!f.is_open())
1989 {
1990 err("Cannot open file {} for writing!\n",fileName);
1991 return;
1992 }
1993 TextStream t(&f);
1994
1995 writeXMLHeader(t);
1996 t << " <compounddef id=\""
1997 << gd->getOutputFileBase() << "\" kind=\"group\">\n";
1998 t << " <compoundname>" << convertToXML(gd->name()) << "</compoundname>\n";
1999 t << " <title>" << convertToXML(gd->groupTitle()) << "</title>\n";
2000
2002 writeInnerFiles(gd->getFiles(),t);
2006 writeInnerPages(gd->getPages(),t);
2008
2009 for (const auto &mg : gd->getMemberGroups())
2010 {
2011 generateXMLSection(gd,ti,t,&mg->members(),"user-defined",mg->header(),
2012 mg->documentation());
2013 }
2014
2015 for (const auto &ml : gd->getMemberLists())
2016 {
2017 if (ml->listType().isDeclaration())
2018 {
2019 generateXMLSection(gd,ti,t,ml.get(),ml->listType().toXML());
2020 }
2021 }
2022
2023 t << " <briefdescription>\n";
2024 writeXMLDocBlock(t,gd->briefFile(),gd->briefLine(),gd,nullptr,gd->briefDescription());
2025 t << " </briefdescription>\n";
2026 t << " <detaileddescription>\n";
2027 writeXMLDocBlock(t,gd->docFile(),gd->docLine(),gd,nullptr,gd->documentation());
2028 t << " </detaileddescription>\n";
2030 t << " </compounddef>\n";
2031 t << "</doxygen>\n";
2032
2033 ti << " </compound>\n";
2034}
2035
2037{
2038 if (dd->isReference()) return; // skip external references
2039 ti << " <compound refid=\"" << dd->getOutputFileBase()
2040 << "\" kind=\"dir\"><name>" << convertToXML(dd->displayName())
2041 << "</name>\n";
2042
2043 QCString outputDirectory = Config_getString(XML_OUTPUT);
2044 QCString fileName=outputDirectory+"/"+dd->getOutputFileBase()+".xml";
2045 std::ofstream f = Portable::openOutputStream(fileName);
2046 if (!f.is_open())
2047 {
2048 err("Cannot open file {} for writing!\n",fileName);
2049 return;
2050 }
2051 TextStream t(&f);
2052
2053 writeXMLHeader(t);
2054 t << " <compounddef id=\""
2055 << dd->getOutputFileBase() << "\" kind=\"dir\">\n";
2056 t << " <compoundname>" << convertToXML(dd->displayName()) << "</compoundname>\n";
2057
2058 writeInnerDirs(&dd->subDirs(),t);
2059 writeInnerFiles(dd->getFiles(),t);
2060
2061 t << " <briefdescription>\n";
2062 writeXMLDocBlock(t,dd->briefFile(),dd->briefLine(),dd,nullptr,dd->briefDescription());
2063 t << " </briefdescription>\n";
2064 t << " <detaileddescription>\n";
2065 writeXMLDocBlock(t,dd->docFile(),dd->docLine(),dd,nullptr,dd->documentation());
2066 t << " </detaileddescription>\n";
2068 t << " <location file=\"" << convertToXML(stripFromPath(dd->name())) << "\"/>\n";
2069 t << " </compounddef>\n";
2070 t << "</doxygen>\n";
2071
2072 ti << " </compound>\n";
2073}
2074
2075static void generateXMLForPage(PageDef *pd,TextStream &ti,bool isExample)
2076{
2077 // + name
2078 // + title
2079 // + documentation
2080 // + location
2081
2082 const char *kindName = isExample ? "example" : "page";
2083
2084 if (pd->isReference()) return;
2085
2086 QCString pageName = pd->getOutputFileBase();
2087 if (pd->getGroupDef())
2088 {
2089 pageName+=QCString("_")+pd->name();
2090 }
2091 if (pageName=="index")
2092 {
2093 pageName="indexpage"; // to prevent overwriting the generated index page.
2094 }
2095 else if (pageName=="requirements")
2096 {
2097 return; // requirements are listed separately
2098 }
2099
2100 ti << " <compound refid=\"" << pageName
2101 << "\" kind=\"" << kindName << "\"><name>" << convertToXML(pd->name())
2102 << "</name>\n";
2103
2104 QCString outputDirectory = Config_getString(XML_OUTPUT);
2105 QCString fileName=outputDirectory+"/"+pageName+".xml";
2106 std::ofstream f = Portable::openOutputStream(fileName);
2107 if (!f.is_open())
2108 {
2109 err("Cannot open file {} for writing!\n",fileName);
2110 return;
2111 }
2112 TextStream t(&f);
2113
2114 writeXMLHeader(t);
2115 t << " <compounddef id=\"" << pageName;
2116 t << "\" kind=\"" << kindName << "\">\n";
2117 t << " <compoundname>" << convertToXML(pd->name())
2118 << "</compoundname>\n";
2119
2120 if (pd==Doxygen::mainPage.get()) // main page is special
2121 {
2122 QCString title;
2123 if (mainPageHasTitle())
2124 {
2126 }
2127 else
2128 {
2129 title = Config_getString(PROJECT_NAME);
2130 }
2131 t << " <title>" << convertToXML(convertCharEntitiesToUTF8(title))
2132 << "</title>\n";
2133 }
2134 else
2135 {
2136 const SectionInfo *si = SectionManager::instance().find(pd->name());
2137 if (si)
2138 {
2139 t << " <title>" << convertToXML(filterTitle(convertCharEntitiesToUTF8(si->title())))
2140 << "</title>\n";
2141 }
2142 }
2144 const SectionRefs &sectionRefs = pd->getSectionRefs();
2145 if (pd->localToc().isXmlEnabled() && !sectionRefs.empty())
2146 {
2147 int level=1;
2148 int indent=0;
2149 auto writeIndent = [&]() { for (int i=0;i<4+indent*2;i++) t << " "; };
2150 auto incIndent = [&](const char *text) { writeIndent(); t << text << "\n"; indent++; };
2151 auto decIndent = [&](const char *text) { indent--; writeIndent(); t << text << "\n"; };
2152 incIndent("<tableofcontents>");
2153 int maxLevel = pd->localToc().xmlLevel();
2154 BoolVector inLi(maxLevel+1,false);
2155 for (const SectionInfo *si : sectionRefs)
2156 {
2157 if (si->type().isSection())
2158 {
2159 //printf(" level=%d title=%s\n",level,qPrint(si->title));
2160 int nextLevel = si->type().level();
2161 if (nextLevel>level)
2162 {
2163 for (int l=level;l<nextLevel;l++)
2164 {
2165 if (l < maxLevel) incIndent("<tableofcontents>");
2166 }
2167 }
2168 else if (nextLevel<level)
2169 {
2170 for (int l=level;l>nextLevel;l--)
2171 {
2172 if (l <= maxLevel && inLi[l]) decIndent("</tocsect>");
2173 inLi[l]=false;
2174 if (l <= maxLevel) decIndent("</tableofcontents>");
2175 }
2176 }
2177 if (nextLevel <= maxLevel)
2178 {
2179 if (inLi[nextLevel])
2180 {
2181 decIndent("</tocsect>");
2182 }
2183 else if (level>nextLevel)
2184 {
2185 decIndent("</tableofcontents>");
2186 incIndent("<tableofcontents>");
2187 }
2188 QCString titleDoc = convertToXML(si->title());
2189 QCString label = convertToXML(si->label());
2190 if (titleDoc.isEmpty()) titleDoc = label;
2191 incIndent("<tocsect>");
2192 writeIndent(); t << "<name>" << titleDoc << "</name>\n"; // kept for backwards compatibility
2193 writeIndent(); t << "<docs>";
2194 if (!si->title().isEmpty())
2195 {
2196 writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,nullptr,si->title());
2197 }
2198 t << "</docs>\n";
2199 writeIndent(); t << "<reference>" << convertToXML(pageName) << "_1" << label << "</reference>\n";
2200 inLi[nextLevel]=true;
2201 level = nextLevel;
2202 }
2203 }
2204 }
2205 while (level>1 && level <= maxLevel)
2206 {
2207 if (inLi[level]) decIndent("</tocsect>");
2208 inLi[level]=false;
2209 decIndent("</tableofcontents>");
2210 level--;
2211 }
2212 if (level <= maxLevel && inLi[level]) decIndent("</tocsect>");
2213 inLi[level]=false;
2214 decIndent("</tableofcontents>");
2215 }
2216 t << " <briefdescription>\n";
2217 writeXMLDocBlock(t,pd->briefFile(),pd->briefLine(),pd,nullptr,pd->briefDescription());
2218 t << " </briefdescription>\n";
2219 t << " <detaileddescription>\n";
2220 if (isExample)
2221 {
2222 writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,nullptr,
2223 pd->documentation()+"\n\\include "+pd->name());
2224 }
2225 else
2226 {
2227 writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,nullptr,
2228 pd->documentation());
2229 }
2230 t << " </detaileddescription>\n";
2232
2233 t << " <location file=\"" << convertToXML(stripFromPath(pd->getDefFileName())) << "\"/>\n";
2234
2235 t << " </compounddef>\n";
2236 t << "</doxygen>\n";
2237
2238 ti << " </compound>\n";
2239}
2240
2242{
2243 QCString pageName = xmlRequirementId(req->id());
2244 ti << " <compound refid=\"" << pageName << "\" kind=\"requirement\"><name>" << convertToXML(req->id()) << "</name>\n";
2245
2246 QCString outputDirectory = Config_getString(XML_OUTPUT);
2247 QCString fileName = outputDirectory+"/"+pageName+".xml";
2248 std::ofstream f = Portable::openOutputStream(fileName);
2249 if (!f.is_open())
2250 {
2251 err("Cannot open file {} for writing!\n",fileName);
2252 return;
2253 }
2254 TextStream t(&f);
2255 writeXMLHeader(t);
2256 t << " <compounddef id=\"" << pageName << "\" kind=\"requirement\">\n";
2257 t << " <compoundname>" << convertToXML(req->id()) << "</compoundname>\n";
2258 t << " <title>" << convertToXML(filterTitle(convertCharEntitiesToUTF8(req->title()))) << "</title>\n";
2259 t << " <detaileddescription>\n";
2260 writeXMLDocBlock(t,req->file(),req->line(),RequirementManager::instance().requirementsPage(),nullptr,req->doc());
2261 t << " </detaileddescription>\n";
2262 t << " <location file=\"" << convertToXML(stripFromPath(req->file())) << "\" line=\"" << req->line() << "\"/>\n" ;
2263 t << " </compounddef>\n";
2264 t << "</doxygen>\n";
2265
2266 ti << " </compound>\n";
2267}
2268
2269
2271{
2272 // + classes
2273 // + concepts
2274 // + namespaces
2275 // + files
2276 // + groups
2277 // + related pages
2278 // - examples
2279
2280 QCString outputDirectory = Config_getString(XML_OUTPUT);
2281 Dir xmlDir(outputDirectory.str());
2282 createSubDirs(xmlDir);
2283
2284 ResourceMgr::instance().copyResource("xml.xsd",outputDirectory);
2285 ResourceMgr::instance().copyResource("index.xsd",outputDirectory);
2286
2287 QCString fileName=outputDirectory+"/compound.xsd";
2288 std::ofstream f = Portable::openOutputStream(fileName);
2289 if (!f.is_open())
2290 {
2291 err("Cannot open file {} for writing!\n",fileName);
2292 return;
2293 }
2294 {
2295 TextStream t(&f);
2296
2297 // write compound.xsd, but replace special marker with the entities
2298 QCString compound_xsd = ResourceMgr::instance().getAsString("compound.xsd");
2299 const char *startLine = compound_xsd.data();
2300 while (*startLine)
2301 {
2302 // find end of the line
2303 const char *endLine = startLine+1;
2304 while (*endLine && *(endLine-1)!='\n') endLine++; // skip to end of the line including \n
2305 int len=static_cast<int>(endLine-startLine);
2306 if (len>0)
2307 {
2308 QCString s(startLine,len);
2309 if (s.find("<!-- Automatically insert here the HTML entities -->")!=-1)
2310 {
2312 }
2313 else
2314 {
2315 t.write(startLine,len);
2316 }
2317 }
2318 startLine=endLine;
2319 }
2320 }
2321 f.close();
2322
2323 fileName=outputDirectory+"/doxyfile.xsd";
2324 f = Portable::openOutputStream(fileName);
2325 if (!f.is_open())
2326 {
2327 err("Cannot open file {} for writing!\n",fileName);
2328 return;
2329 }
2330 {
2331 TextStream t(&f);
2332
2333 // write doxyfile.xsd, but replace special marker with the entities
2334 QCString doxyfile_xsd = ResourceMgr::instance().getAsString("doxyfile.xsd");
2335 const char *startLine = doxyfile_xsd.data();
2336 while (*startLine)
2337 {
2338 // find end of the line
2339 const char *endLine = startLine+1;
2340 while (*endLine && *(endLine-1)!='\n') endLine++; // skip to end of the line including \n
2341 int len=static_cast<int>(endLine-startLine);
2342 if (len>0)
2343 {
2344 QCString s(startLine,len);
2345 if (s.find("<!-- Automatically insert here the configuration settings -->")!=-1)
2346 {
2348 }
2349 else
2350 {
2351 t.write(startLine,len);
2352 }
2353 }
2354 startLine=endLine;
2355 }
2356 }
2357 f.close();
2358
2359 fileName=outputDirectory+"/Doxyfile.xml";
2360 f = Portable::openOutputStream(fileName);
2361 if (!f.is_open())
2362 {
2363 err("Cannot open file {} for writing\n",fileName);
2364 return;
2365 }
2366 else
2367 {
2368 TextStream t(&f);
2370 }
2371 f.close();
2372
2373 fileName=outputDirectory+"/index.xml";
2374 f = Portable::openOutputStream(fileName);
2375 if (!f.is_open())
2376 {
2377 err("Cannot open file {} for writing!\n",fileName);
2378 return;
2379 }
2380 else
2381 {
2382 TextStream t(&f);
2383
2384 // write index header
2385 t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n";
2386 t << "<doxygenindex xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
2387 t << "xsi:noNamespaceSchemaLocation=\"index.xsd\" ";
2388 t << "version=\"" << getDoxygenVersion() << "\" ";
2389 t << "xml:lang=\"" << theTranslator->trISOLang() << "\"";
2390 t << ">\n";
2391
2392 for (const auto &cd : *Doxygen::classLinkedMap)
2393 {
2394 generateXMLForClass(cd.get(),t);
2395 }
2396 for (const auto &cd : *Doxygen::conceptLinkedMap)
2397 {
2398 msg("Generating XML output for concept {}\n",cd->displayName());
2399 generateXMLForConcept(cd.get(),t);
2400 }
2401 for (const auto &nd : *Doxygen::namespaceLinkedMap)
2402 {
2403 msg("Generating XML output for namespace {}\n",nd->displayName());
2404 generateXMLForNamespace(nd.get(),t);
2405 }
2406 for (const auto &fn : *Doxygen::inputNameLinkedMap)
2407 {
2408 for (const auto &fd : *fn)
2409 {
2410 msg("Generating XML output for file {}\n",fd->name());
2411 generateXMLForFile(fd.get(),t);
2412 }
2413 }
2414 for (const auto &gd : *Doxygen::groupLinkedMap)
2415 {
2416 msg("Generating XML output for group {}\n",gd->name());
2417 generateXMLForGroup(gd.get(),t);
2418 }
2419 for (const auto &pd : *Doxygen::pageLinkedMap)
2420 {
2421 msg("Generating XML output for page {}\n",pd->name());
2422 generateXMLForPage(pd.get(),t,FALSE);
2423 }
2424 for (const auto &req : RequirementManager::instance().requirements())
2425 {
2426 if (req->getTagFile().isEmpty())
2427 {
2428 msg("Generating XML output for requirement {}\n", req->id());
2430 }
2431 }
2432 for (const auto &dd : *Doxygen::dirLinkedMap)
2433 {
2434 msg("Generate XML output for dir {}\n",dd->name());
2435 generateXMLForDir(dd.get(),t);
2436 }
2437 for (const auto &mod : ModuleManager::instance().modules())
2438 {
2439 msg("Generating XML output for module {}\n",mod->name());
2440 generateXMLForModule(mod.get(),t);
2441 }
2442 for (const auto &pd : *Doxygen::exampleLinkedMap)
2443 {
2444 msg("Generating XML output for example {}\n",pd->name());
2445 generateXMLForPage(pd.get(),t,TRUE);
2446 }
2448 {
2449 msg("Generating XML output for the main page\n");
2451 }
2452
2453 //t << " </compoundlist>\n";
2454 t << "</doxygenindex>\n";
2455 }
2456
2458 clearSubDirs(xmlDir);
2459}
2460
2461
constexpr auto prefix
Definition anchor.cpp:44
This class represents an function or template argument list.
Definition arguments.h:65
RefQualifierType refQualifier() const
Definition arguments.h:116
iterator end()
Definition arguments.h:94
bool hasParameters() const
Definition arguments.h:76
bool constSpecifier() const
Definition arguments.h:111
bool empty() const
Definition arguments.h:99
iterator begin()
Definition arguments.h:93
bool volatileSpecifier() const
Definition arguments.h:112
A abstract class representing of a compound symbol.
Definition classdef.h:104
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.
Definition definition.h:77
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.
Definition dirdef.h:110
virtual const DirList & subDirs() const =0
virtual const FileList & getFiles() const =0
Class representing a directory in the file system.
Definition dir.h:75
A list of directories.
Definition dirdef.h:180
Class representing the abstract syntax tree of a documentation block.
Definition docnode.h:1464
Representation of a class inheritance or dependency graph.
void writeXML(TextStream &t)
bool isTrivial() const
Representation of an include dependency graph.
void writeXML(TextStream &t)
bool isTrivial() const
static NamespaceLinkedMap * namespaceLinkedMap
Definition doxygen.h:114
static ConceptLinkedMap * conceptLinkedMap
Definition doxygen.h:97
static std::unique_ptr< PageDef > mainPage
Definition doxygen.h:100
static FileNameLinkedMap * inputNameLinkedMap
Definition doxygen.h:104
static ParserManager * parserManager
Definition doxygen.h:130
static ClassLinkedMap * classLinkedMap
Definition doxygen.h:95
static PageLinkedMap * exampleLinkedMap
Definition doxygen.h:98
static PageLinkedMap * pageLinkedMap
Definition doxygen.h:99
static DirLinkedMap * dirLinkedMap
Definition doxygen.h:128
static GroupLinkedMap * groupLinkedMap
Definition doxygen.h:113
A model of a file symbol.
Definition filedef.h:99
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.
Definition groupdef.h:52
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
Definition linkedmap.h:47
constexpr bool isXmlEnabled() const noexcept
Definition types.h:616
constexpr int xmlLevel() const noexcept
Definition types.h:621
A model of a class/file/namespace member symbol.
Definition memberdef.h:48
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.
Definition memberlist.h:125
MemberListType listType() const
Definition memberlist.h:130
constexpr const char * toXML() const noexcept
Definition types.h:414
constexpr bool isDeclaration() const noexcept
Definition types.h:384
constexpr bool isDetailed() const noexcept
Definition types.h:383
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.
Definition outputlist.h:165
void add(OutputCodeIntfPtr &&p)
Definition outputlist.h:195
void endCodeFragment(const QCString &style)
Definition outputlist.h:282
void startCodeFragment(const QCString &style)
Definition outputlist.h:279
A model of a page symbol.
Definition pagedef.h:26
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.
Definition qcstring.h:101
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
QCString & prepend(const char *s)
Definition qcstring.h:422
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:166
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:241
char & at(size_t i)
Returns a reference to the character at index i.
Definition qcstring.h:593
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:163
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:260
QCString & remove(size_t index, size_t len)
Definition qcstring.h:442
QCString fill(char c, int len=-1)
Fills a string with a predefined character.
Definition qcstring.h:193
const std::string & str() const
Definition qcstring.h:552
size_t size() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:169
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:96
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:172
QCString left(size_t len) const
Definition qcstring.h:229
bool stripPrefix(const QCString &prefix)
Definition qcstring.h:213
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()
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.
Definition section.h:58
QCString title() const
Definition section.h:70
static SectionManager & instance()
returns a reference to the singleton
Definition section.h:179
class that represents a list of constant references to sections.
Definition section.h:103
bool empty() const
Definition section.h:125
Abstract interface for a hyperlinked text fragment.
Definition util.h:63
Implements TextGeneratorIntf for an XML stream.
Definition xmlgen.cpp:187
TextGeneratorXMLImpl(TextStream &t)
Definition xmlgen.cpp:189
void writeString(std::string_view s, bool) const override
Definition xmlgen.cpp:190
void writeLink(const QCString &extRef, const QCString &file, const QCString &anchor, std::string_view text) const override
Definition xmlgen.cpp:195
TextStream & m_t
Definition xmlgen.cpp:202
void writeBreak(int) const override
Definition xmlgen.cpp:194
Text streaming class that buffers data.
Definition textstream.h:36
void write(const char *buf, size_t len)
Adds a array of character to the stream.
Definition textstream.h:188
void writeTooltip(const QCString &, const DocLinkInfo &, const QCString &, const QCString &, const SourceLinkInfo &, const SourceLinkInfo &) override
Definition xmlgen.cpp:259
bool m_insideSpecialHL
Definition xmlgen.h:62
void setStripIndentAmount(size_t amount) override
Definition xmlgen.cpp:238
void codify(const QCString &text) override
Generator for producing XML formatted source code.
Definition xmlgen.cpp:212
void endCodeLine() override
Definition xmlgen.cpp:298
size_t m_stripIndentAmount
Definition xmlgen.h:65
void writeCodeLink(CodeSymbolType type, const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name, const QCString &tooltip) override
Definition xmlgen.cpp:243
void startCodeLine(int) override
Definition xmlgen.cpp:267
void startSpecialComment() override
Definition xmlgen.cpp:233
bool m_normalHLNeedStartTag
Definition xmlgen.h:61
void endSpecialComment() override
Definition xmlgen.cpp:228
bool m_insideCodeLine
Definition xmlgen.h:60
void stripCodeComments(bool b) override
Definition xmlgen.cpp:223
void startFontClass(const QCString &colorClass) override
Definition xmlgen.cpp:317
bool m_stripCodeComments
Definition xmlgen.h:63
QCString m_refId
Definition xmlgen.h:54
void writeLineNumber(const QCString &extRef, const QCString &compId, const QCString &anchorId, int l, bool writeLineAnchor) override
Definition xmlgen.cpp:344
size_t m_col
Definition xmlgen.h:58
QCString m_external
Definition xmlgen.h:55
TextStream * m_t
Definition xmlgen.h:53
void endCodeFragment(const QCString &) override
Definition xmlgen.cpp:367
XMLCodeGenerator(TextStream *t)
Definition xmlgen.cpp:207
void endFontClass() override
Definition xmlgen.cpp:330
void writeCodeAnchor(const QCString &) override
Definition xmlgen.cpp:338
bool m_isMemberRef
Definition xmlgen.h:57
void startCodeFragment(const QCString &) override
Definition xmlgen.cpp:361
Concrete visitor implementation for XML output.
#define Config_getInt(name)
Definition config.h:34
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
std::vector< bool > BoolVector
Definition containers.h:36
DirIterator end(const DirIterator &) noexcept
Definition dir.cpp:175
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
Definition docparser.cpp:55
@ Collaboration
Definition dotgraph.h:31
@ Inheritance
Definition dotgraph.h:31
constexpr uint32_t IncludeKind_LocalMask
Definition filedef.h:63
Translator * theTranslator
Definition language.cpp:71
#define msg(fmt,...)
Definition message.h:94
#define err(fmt,...)
Definition message.h:127
std::unordered_map< std::string, ImportInfoList > ImportInfoMap
Definition moduledef.h:61
void writeXMLDoxyfile(TextStream &t)
void writeXSDDoxyfile(TextStream &t)
std::ofstream openOutputStream(const QCString &name, bool append=false)
Definition portable.cpp:649
Portable versions of functions that are platform dependent.
const char * qPrint(const char *s)
Definition qcstring.h:687
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
#define ASSERT(x)
Definition qcstring.h:39
static void writeIndent(TextStream &t, int indent)
Definition qhp.cpp:37
void splitRequirementRefs(const RequirementRefs &inputReqRefs, RequirementRefs &satisfiesRefs, RequirementRefs &verifiesRefs)
std::vector< RequirementRef > RequirementRefs
List of requirement references.
Definition requirement.h:56
This class contains the information about the argument of a function or template.
Definition arguments.h:27
QCString type
Definition arguments.h:42
QCString name
Definition arguments.h:44
QCString docs
Definition arguments.h:47
bool hasDocumentation() const
Definition arguments.h:31
Options to configure the code parser.
Definition parserintf.h:78
Class representing the data associated with a #include statement.
Definition filedef.h:75
QCString includeName
Definition filedef.h:80
IncludeKind kind
Definition filedef.h:81
const FileDef * fileDef
Definition filedef.h:79
CodeSymbolType
Definition types.h:481
@ Enumeration
Definition types.h:557
@ EnumValue
Definition types.h:558
@ Dictionary
Definition types.h:568
@ Interface
Definition types.h:565
@ Sequence
Definition types.h:567
@ Variable
Definition types.h:555
@ Property
Definition types.h:563
@ Typedef
Definition types.h:556
@ Function
Definition types.h:554
@ Service
Definition types.h:566
Protection
Definition types.h:32
SrcLangExt
Definition types.h:207
Specifier
Definition types.h:80
static constexpr const char * to_string_lower(Protection prot) noexcept
Definition types.h:50
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.
Definition utf8.cpp:197
Various UTF8 related helper functions.
size_t updateColumnCount(const char *s, size_t col)
Definition util.cpp:6880
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5191
bool mainPageHasTitle()
Definition util.cpp:6284
QCString insertTemplateSpecifierInScope(const QCString &scope, const QCString &templ)
Definition util.cpp:3727
void clearSubDirs(const Dir &d)
Definition util.cpp:3648
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
Definition util.cpp:1471
QCString filterTitle(const QCString &title)
Definition util.cpp:5610
void createSubDirs(const Dir &d)
Definition util.cpp:3621
static QCString stripFromPath(const QCString &p, const StringVector &l)
Definition util.cpp:299
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)
Definition util.cpp:3485
QCString convertToXML(const QCString &s, bool keepEntities)
Definition util.cpp:3893
QCString langToString(SrcLangExt lang)
Returns a string representation of lang.
Definition util.cpp:5891
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
Definition util.cpp:5897
void linkifyText(const TextGeneratorIntf &out, const Definition *scope, const FileDef *fileScope, const Definition *self, const QCString &text, bool autoBreak, bool external, bool keepSpaces, int indentLevel)
Definition util.cpp:894
QCString convertCharEntitiesToUTF8(const QCString &str)
Definition util.cpp:4028
A bunch of utility functions.
static QCString classOutputFileBase(const ClassDef *cd)
Definition xmlgen.cpp:538
QCString xmlRequirementId(const QCString &reqId)
Definition xmlgen.cpp:76
static void generateXMLForGroup(const GroupDef *gd, TextStream &ti)
Definition xmlgen.cpp:1966
void generateXML()
Definition xmlgen.cpp:2270
static void writeInnerConcepts(const ConceptLinkedRefMap &cl, TextStream &t)
Definition xmlgen.cpp:1355
static void writeInnerGroups(const GroupList &gl, TextStream &t)
Definition xmlgen.cpp:1436
static void writeXMLDocBlock(TextStream &t, const QCString &fileName, int lineNr, const Definition *scope, const MemberDef *md, const QCString &text)
Definition xmlgen.cpp:447
static void writeInnerDirs(const DirList *dl, TextStream &t)
Definition xmlgen.cpp:1446
static void writeListOfAllMembers(const ClassDef *cd, TextStream &t)
Definition xmlgen.cpp:1315
#define XML_DB(x)
Definition xmlgen.cpp:57
static void generateXMLForClass(const ClassDef *cd, TextStream &ti)
Definition xmlgen.cpp:1478
static void writeMemberReference(TextStream &t, const Definition *def, const MemberDef *rmd, const QCString &tagName)
Definition xmlgen.cpp:499
static void generateXMLForFile(FileDef *fd, TextStream &ti)
Definition xmlgen.cpp:1850
static QCString memberOutputFileBase(const MemberDef *md)
Definition xmlgen.cpp:547
static void writeMemberTemplateLists(const MemberDef *md, TextStream &t)
Definition xmlgen.cpp:432
void writeXMLCodeBlock(TextStream &t, FileDef *fd)
Definition xmlgen.cpp:480
static void writeTemplateList(const ClassDef *cd, TextStream &t)
Definition xmlgen.cpp:437
static bool stripKeyword(QCString &str, const char *keyword, bool needSpace)
Definition xmlgen.cpp:561
static bool memberVisible(const Definition *d, const MemberDef *md)
Definition xmlgen.cpp:1271
static void writeIncludeInfo(const IncludeInfo *ii, TextStream &t)
Definition xmlgen.cpp:1458
static void stripQualifiers(QCString &typeStr)
Definition xmlgen.cpp:522
static void writeInnerPages(const PageLinkedRefMap &pl, TextStream &t)
Definition xmlgen.cpp:1423
static void generateXMLForNamespace(const NamespaceDef *nd, TextStream &ti)
Definition xmlgen.cpp:1777
static void generateXMLForRequirement(const RequirementIntf *req, TextStream &ti)
Definition xmlgen.cpp:2241
static void writeXMLHeader(TextStream &t)
Definition xmlgen.cpp:130
static void writeInnerModules(const ModuleLinkedRefMap &ml, TextStream &t)
Definition xmlgen.cpp:1367
static void generateXMLForModule(const ModuleDef *mod, TextStream &ti)
Definition xmlgen.cpp:1721
static void generateXMLForConcept(const ConceptDef *cd, TextStream &ti)
Definition xmlgen.cpp:1645
static void writeExports(const ImportInfoMap &exportMap, TextStream &t)
Definition xmlgen.cpp:1392
static void writeInnerFiles(const FileList &fl, TextStream &t)
Definition xmlgen.cpp:1414
static void generateXMLForMember(const MemberDef *md, TextStream &ti, TextStream &t, const Definition *def)
Definition xmlgen.cpp:671
static void writeRequirementRefs(const Definition *d, TextStream &t, const char *prefix="")
Definition xmlgen.cpp:648
void writeXMLCodeString(bool hide, TextStream &t, const QCString &str, size_t &col, size_t stripIndentAmount)
Definition xmlgen.cpp:81
void writeXMLLink(TextStream &t, const QCString &extRef, const QCString &compoundId, const QCString &anchorId, const QCString &text, const QCString &tooltip)
Definition xmlgen.cpp:170
static void writeTemplateArgumentList(TextStream &t, const ArgumentList &al, const Definition *scope, const FileDef *fileScope, int indent)
Definition xmlgen.cpp:375
void writeXMLString(TextStream &t, const QCString &s)
Definition xmlgen.cpp:71
static void generateXMLSection(const Definition *d, TextStream &ti, TextStream &t, const MemberList *ml, const QCString &kind, const QCString &header=QCString(), const QCString &documentation=QCString())
Definition xmlgen.cpp:1278
static void writeInnerClasses(const ClassLinkedRefMap &cl, TextStream &t)
Definition xmlgen.cpp:1342
static void writeInnerNamespaces(const NamespaceLinkedRefMap &nl, TextStream &t)
Definition xmlgen.cpp:1379
static void generateXMLForDir(DirDef *dd, TextStream &ti)
Definition xmlgen.cpp:2036
static void generateXMLForPage(PageDef *pd, TextStream &ti, bool isExample)
Definition xmlgen.cpp:2075
static QCString extractNoExcept(QCString &argsStr)
Definition xmlgen.cpp:605
static void writeCombineScript()
Definition xmlgen.cpp:140