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