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,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(("(startCodeFragment)\n"));
358 *m_t << " <programlisting>\n";
359}
360
362{
363 XML_DB(("(endCodeFragment)\n"));
364 *m_t << " </programlisting>\n";
365}
366
367//-------------------------------------------------------------------------------------------
368
370 const ArgumentList &al,
371 const Definition *scope,
372 const FileDef *fileScope,
373 int indent)
374{
375 QCString indentStr;
376 indentStr.fill(' ',indent);
377 if (al.hasParameters())
378 {
379 t << indentStr << "<templateparamlist>\n";
380 for (const Argument &a : al)
381 {
382 t << indentStr << " <param>\n";
383 if (!a.type.isEmpty())
384 {
385 t << indentStr << " <type>";
386 linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,nullptr,a.type);
387 t << "</type>\n";
388 }
389 if (!a.name.isEmpty())
390 {
391 t << indentStr << " <declname>" << convertToXML(a.name) << "</declname>\n";
392 t << indentStr << " <defname>" << convertToXML(a.name) << "</defname>\n";
393 }
394 if (!a.defval.isEmpty())
395 {
396 t << indentStr << " <defval>";
397 linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,nullptr,a.defval);
398 t << "</defval>\n";
399 }
400 if (!a.typeConstraint.isEmpty())
401 {
402 t << indentStr << " <typeconstraint>";
403 linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,nullptr,a.typeConstraint);
404 t << "</typeconstraint>\n";
405 }
406 if (a.hasTemplateDocumentation())
407 {
408 t << indentStr << " <briefdescription>\n";
409 t << indentStr << " ";
410 if (scope)
411 {
412 writeXMLDocBlock(t,scope->briefFile(),scope->briefLine(),scope,nullptr,a.docs);
413 }
414 else
415 {
416 writeXMLDocBlock(t,fileScope->briefFile(),fileScope->briefLine(),fileScope,nullptr,a.docs);
417 }
418 t << indentStr << " </briefdescription>\n";
419 }
420 t << indentStr << " </param>\n";
421 }
422 t << indentStr << "</templateparamlist>\n";
423 }
424}
425
430
431static void writeTemplateList(const ClassDef *cd,TextStream &t)
432{
434}
435
436static void writeTemplateList(const ConceptDef *cd,TextStream &t)
437{
439}
440
442 const QCString &fileName,
443 int lineNr,
444 const Definition *scope,
445 const MemberDef * md,
446 const QCString &text)
447{
448 QCString stext = text.stripWhiteSpace();
449 if (stext.isEmpty()) return;
450 // convert the documentation string into an abstract syntax tree
451 auto parser { createDocParser() };
452 auto ast { validatingParseDoc(*parser.get(),
453 fileName,
454 lineNr,
455 scope,
456 md,
457 text,
458 DocOptions())
459 };
460 auto astImpl = dynamic_cast<const DocNodeAST*>(ast.get());
461 if (astImpl)
462 {
463 // create a code generator
464 OutputCodeList xmlCodeList;
465 xmlCodeList.add<XMLCodeGenerator>(&t);
466 // create a parse tree visitor for XML
467 XmlDocVisitor visitor(t,xmlCodeList,scope?scope->getDefFileExtension():QCString(""));
468 // visit all nodes
469 std::visit(visitor,astImpl->root);
470 // clean up
471 }
472}
473
475{
476 auto intf=Doxygen::parserManager->getCodeParser(fd->getDefFileExtension());
478 intf->resetCodeParserState();
479 OutputCodeList xmlList;
480 xmlList.add<XMLCodeGenerator>(&t);
481 xmlList.startCodeFragment("DoxyCode");
482 intf->parseCode(xmlList, // codeOutList
483 QCString(), // scopeName
485 Config_getBool(FILTER_SOURCE_FILES)),
486 langExt, // lang
487 Config_getBool(STRIP_CODE_COMMENTS),
488 CodeParserOptions().setFileDef(fd)
489 );
490 xmlList.endCodeFragment("DoxyCode");
491}
492
493static void writeMemberReference(TextStream &t,const Definition *def,const MemberDef *rmd,const QCString &tagName)
494{
495 QCString scope = rmd->getScopeString();
496 QCString name = rmd->name();
497 if (!scope.isEmpty() && scope!=def->name())
498 {
500 }
501 t << " <" << tagName << " refid=\"";
502 t << rmd->getOutputFileBase() << "_1" << rmd->anchor() << "\"";
503 if (rmd->getStartBodyLine()!=-1 && rmd->getBodyDef())
504 {
505 t << " compoundref=\"" << rmd->getBodyDef()->getOutputFileBase() << "\"";
506 t << " startline=\"" << rmd->getStartBodyLine() << "\"";
507 if (rmd->getEndBodyLine()!=-1)
508 {
509 t << " endline=\"" << rmd->getEndBodyLine() << "\"";
510 }
511 }
512 t << ">" << convertToXML(name) << "</" << tagName << ">\n";
513
514}
515
516// removes anonymous markers like '@1' from s.
517// examples '@3::A' -> '::A', 'A::@2::B' -> 'A::B', '@A' -> '@A'
519{
520 auto isDigit = [](char c) { return c>='0' && c<='9'; };
521 int len = static_cast<int>(s.length());
522 int i=0,j=0;
523 if (len>0)
524 {
525 while (i<len)
526 {
527 if (i<len-1 && s[i]=='@' && isDigit(s[i+1])) // found pattern '@\d+'
528 {
529 if (j>=2 && i>=2 && s[i-2]==':' && s[i-1]==':') j-=2; // found pattern '::@\d+'
530 i+=2; // skip over @ and first digit
531 while (i<len && isDigit(s[i])) i++; // skip additional digits
532 }
533 else // copy characters
534 {
535 s[j++]=s[i++];
536 }
537 }
538 // resize resulting string
539 s.resize(j);
540 }
541}
542
543static void stripQualifiers(QCString &typeStr)
544{
545 bool done=false;
546 typeStr.stripPrefix("friend ");
547 while (!done)
548 {
549 if (typeStr.stripPrefix("static ")) {}
550 else if (typeStr.stripPrefix("constexpr ")) {}
551 else if (typeStr.stripPrefix("consteval ")) {}
552 else if (typeStr.stripPrefix("constinit ")) {}
553 else if (typeStr.stripPrefix("virtual ")) {}
554 else if (typeStr=="virtual") typeStr="";
555 else done=TRUE;
556 }
557}
558
560{
561 //bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES);
562 //if (inlineGroupedClasses && cd->partOfGroups()!=0)
563 return cd->getOutputFileBase();
564 //else
565 // return cd->getOutputFileBase();
566}
567
569{
570 //bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES);
571 //if (inlineGroupedClasses && md->getClassDef() && md->getClassDef()->partOfGroups()!=0)
572 // return md->getClassDef()->getXmlOutputFileBase();
573 //else
574 // return md->getOutputFileBase();
575 return md->getOutputFileBase();
576}
577
578// Removes a keyword from a given string
579// @param str string from which to strip the keyword
580// @param needSpace true if spacing is required around the keyword
581// @return true if the keyword was removed, false otherwise
582static bool stripKeyword(QCString& str, const char *keyword, bool needSpace)
583{
584 bool found = false;
585 int searchStart = 0;
586 int len = static_cast<int>(strlen(keyword));
587 int searchEnd = static_cast<int>(str.size());
588 while (searchStart<searchEnd)
589 {
590 int index = str.find(keyword, searchStart);
591 if (index==-1)
592 {
593 break; // no more occurrences found
594 }
595 int end = index + len;
596 if (needSpace)
597 {
598 if ((index>0 && str[index-1]!=' ') || // at the start of the string or preceded by a space, or
599 (end!=searchEnd && str[end] !=' ') // at the end of the string or followed by a space.
600 )
601 {
602 searchStart = end;
603 continue; // no a standalone word
604 }
605 }
606 if (needSpace && index>0) // strip with space before keyword
607 {
608 str.remove(index-1, len+1);
609 searchEnd -= (len+1);
610 }
611 else if (needSpace && end<searchEnd) // strip with space after string starting with keyword
612 {
613 str.remove(index, len+1);
614 searchEnd -= (len+1);
615 }
616 else // strip just keyword
617 {
618 str.remove(index, len);
619 searchEnd -= len;
620 }
621 found = true;
622 }
623 return found;
624}
625
627{
628 QCString expr;
629 //printf("extractNoExcept(%s)\n",qPrint(argsStr));
630 int i = argsStr.find("noexcept(");
631 if (i!=-1)
632 {
633 int bracketCount = 1;
634 size_t p = i+9;
635 bool found = false;
636 bool insideString = false;
637 bool insideChar = false;
638 char pc = 0;
639 while (!found && p<argsStr.length())
640 {
641 char c = argsStr[p++];
642 if (insideString)
643 {
644 if (c=='"' && pc!='\\') insideString=false;
645 }
646 else if (insideChar)
647 {
648 if (c=='\'' && pc!='\\') insideChar=false;
649 }
650 else
651 {
652 switch (c)
653 {
654 case '(': bracketCount++; break;
655 case ')': bracketCount--; found = bracketCount==0; break;
656 case '"': insideString = true; break;
657 case '\'': insideChar = true; break;
658 }
659 }
660 pc = c;
661 }
662 expr = argsStr.mid(i+9,p-i-10);
663 argsStr = (argsStr.left(i) + argsStr.mid(p)).stripWhiteSpace();
664 }
665 //printf("extractNoExcept -> argsStr='%s', expr='%s'\n",qPrint(argsStr),qPrint(expr));
666 return expr;
667}
668
669
670static void generateXMLForMember(const MemberDef *md,TextStream &ti,TextStream &t,const Definition *def)
671{
672
673 // + declaration/definition arg lists
674 // + reimplements
675 // + reimplementedBy
676 // + exceptions
677 // + const/volatile specifiers
678 // - examples
679 // + source definition
680 // + source references
681 // + source referenced by
682 // - body code
683 // + template arguments
684 // (templateArguments(), definitionTemplateParameterLists())
685 // - call graph
686
687 // enum values are written as part of the enum
688 if (md->memberType()==MemberType::EnumValue) return;
689 if (md->isHidden()) return;
690
691 // group members are only visible in their group
692 bool groupMember = md->getGroupDef() && def->definitionType()!=Definition::TypeGroup;
693
694 QCString memType;
695 bool isFunc=FALSE;
696 switch (md->memberType())
697 {
698 case MemberType::Define: memType="define"; break;
699 case MemberType::Function: memType="function"; isFunc=TRUE; break;
700 case MemberType::Variable: memType="variable"; break;
701 case MemberType::Typedef: memType="typedef"; break;
702 case MemberType::Enumeration: memType="enum"; break;
703 case MemberType::EnumValue: ASSERT(0); break;
704 case MemberType::Signal: memType="signal"; isFunc=TRUE; break;
705 case MemberType::Slot: memType="slot"; isFunc=TRUE; break;
706 case MemberType::Friend: memType="friend"; isFunc=TRUE; break;
707 case MemberType::DCOP: memType="dcop"; isFunc=TRUE; break;
708 case MemberType::Property: memType="property"; break;
709 case MemberType::Event: memType="event"; break;
710 case MemberType::Interface: memType="interface"; break;
711 case MemberType::Service: memType="service"; break;
712 case MemberType::Sequence: memType="sequence"; break;
713 case MemberType::Dictionary: memType="dictionary"; break;
714 }
715
716 QCString nameStr = md->name();
717 QCString typeStr = md->typeString();
718 QCString argsStr = md->argsString();
719 QCString defStr = md->definition();
720 defStr.stripPrefix("constexpr ");
721 defStr.stripPrefix("consteval ");
722 defStr.stripPrefix("constinit ");
723 stripAnonymousMarkers(typeStr);
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 stripAnonymousMarkers(nameStr);
762 ti << " <member refid=\"" << memberOutputFileBase(md)
763 << "_1" << md->anchor() << "\" kind=\"" << memType << "\"><name>"
764 << convertToXML(nameStr) << "</name></member>\n";
765
766 if (groupMember)
767 {
768 t << " <member refid=\""
770 << "_1" << md->anchor() << "\" kind=\"" << memType << "\"><name>"
771 << convertToXML(nameStr) << "</name></member>\n";
772 return;
773 }
774 else
775 {
776 t << " <memberdef kind=\"";
777 t << memType << "\" id=\"";
778 t << memberOutputFileBase(md);
779 t << "_1" // encoded ':' character (see util.cpp:convertNameToFile)
780 << md->anchor();
781 }
782 //enum { define_t,variable_t,typedef_t,enum_t,function_t } xmlType = function_t;
783
784 t << "\" prot=\"" << to_string_lower(md->protection());
785 t << "\"";
786
787 t << " static=\"";
788 if (md->isStatic()) t << "yes"; else t << "no";
789 t << "\"";
790
791 if (md->isNoDiscard())
792 {
793 t << " nodiscard=\"yes\"";
794 }
795
796 if (md->isConstExpr())
797 {
798 t << " constexpr=\"yes\"";
799 }
800
801 if (md->isConstEval())
802 {
803 t << " consteval=\"yes\"";
804 }
805
806 if (md->isConstInit())
807 {
808 t << " constinit=\"yes\"";
809 }
810
811 if (md->isExternal())
812 {
813 t << " extern=\"yes\"";
814 }
815
816 if (isFunc)
817 {
818 const ArgumentList &al = md->argumentList();
819 t << " const=\"";
820 if (al.constSpecifier()) t << "yes"; else t << "no";
821 t << "\"";
822
823 t << " explicit=\"";
824 if (md->isExplicit()) t << "yes"; else t << "no";
825 t << "\"";
826
827 t << " inline=\"";
828 if (md->isInline()) t << "yes"; else t << "no";
829 t << "\"";
830
832 {
833 t << " refqual=\"";
834 if (al.refQualifier()==RefQualifierType::LValue) t << "lvalue"; else t << "rvalue";
835 t << "\"";
836 }
837
838 if (md->isFinal())
839 {
840 t << " final=\"yes\"";
841 }
842
843 if (md->isSealed())
844 {
845 t << " sealed=\"yes\"";
846 }
847
848 if (md->isNew())
849 {
850 t << " new=\"yes\"";
851 }
852
853 if (md->isOptional())
854 {
855 t << " optional=\"yes\"";
856 }
857
858 if (md->isRequired())
859 {
860 t << " required=\"yes\"";
861 }
862
863 if (md->isNoExcept())
864 {
865 t << " noexcept=\"yes\"";
866 }
867
868 if (!noExceptExpr.isEmpty())
869 {
870 t << " noexceptexpression=\"" << convertToXML(noExceptExpr) << "\"";
871 }
872
873 if (al.volatileSpecifier())
874 {
875 t << " volatile=\"yes\"";
876 }
877
878 t << " virt=\"" << to_string_lower(md->virtualness());
879 t << "\"";
880 }
881
883 {
884 t << " strong=\"";
885 if (md->isStrong()) t << "yes"; else t << "no";
886 t << "\"";
887 }
888
889 if (md->memberType() == MemberType::Variable)
890 {
891 //ArgumentList *al = md->argumentList();
892 //t << " volatile=\"";
893 //if (al && al->volatileSpecifier) t << "yes"; else t << "no";
894
895 t << " mutable=\"";
896 if (md->isMutable()) t << "yes"; else t << "no";
897 t << "\"";
898
899 if (md->isThreadLocal())
900 {
901 t << " thread_local=\"yes\"";
902 }
903
904 if (md->isInitonly())
905 {
906 t << " initonly=\"yes\"";
907 }
908 if (md->isAttribute())
909 {
910 t << " attribute=\"yes\"";
911 }
912 if (md->isUNOProperty())
913 {
914 t << " property=\"yes\"";
915 }
916 if (md->isReadonly())
917 {
918 t << " readonly=\"yes\"";
919 }
920 if (md->isBound())
921 {
922 t << " bound=\"yes\"";
923 }
924 if (md->isRemovable())
925 {
926 t << " removable=\"yes\"";
927 }
928 if (md->isConstrained())
929 {
930 t << " constrained=\"yes\"";
931 }
932 if (md->isTransient())
933 {
934 t << " transient=\"yes\"";
935 }
936 if (md->isMaybeVoid())
937 {
938 t << " maybevoid=\"yes\"";
939 }
940 if (md->isMaybeDefault())
941 {
942 t << " maybedefault=\"yes\"";
943 }
944 if (md->isMaybeAmbiguous())
945 {
946 t << " maybeambiguous=\"yes\"";
947 }
948 }
949 else if (md->memberType() == MemberType::Property)
950 {
951 t << " readable=\"";
952 if (md->isReadable()) t << "yes"; else t << "no";
953 t << "\"";
954
955 t << " writable=\"";
956 if (md->isWritable()) t << "yes"; else t << "no";
957 t << "\"";
958
959 t << " gettable=\"";
960 if (md->isGettable()) t << "yes"; else t << "no";
961 t << "\"";
962
963 t << " privategettable=\"";
964 if (md->isPrivateGettable()) t << "yes"; else t << "no";
965 t << "\"";
966
967 t << " protectedgettable=\"";
968 if (md->isProtectedGettable()) t << "yes"; else t << "no";
969 t << "\"";
970
971 t << " settable=\"";
972 if (md->isSettable()) t << "yes"; else t << "no";
973 t << "\"";
974
975 t << " privatesettable=\"";
976 if (md->isPrivateSettable()) t << "yes"; else t << "no";
977 t << "\"";
978
979 t << " protectedsettable=\"";
980 if (md->isProtectedSettable()) t << "yes"; else t << "no";
981 t << "\"";
982
983 if (md->isAssign() || md->isCopy() || md->isRetain() || md->isStrong() || md->isWeak())
984 {
985 t << " accessor=\"";
986 if (md->isAssign()) t << "assign";
987 else if (md->isCopy()) t << "copy";
988 else if (md->isRetain()) t << "retain";
989 else if (md->isStrong()) t << "strong";
990 else if (md->isWeak()) t << "weak";
991 t << "\"";
992 }
993 }
994 else if (md->memberType() == MemberType::Event)
995 {
996 t << " add=\"";
997 if (md->isAddable()) t << "yes"; else t << "no";
998 t << "\"";
999
1000 t << " remove=\"";
1001 if (md->isRemovable()) t << "yes"; else t << "no";
1002 t << "\"";
1003
1004 t << " raise=\"";
1005 if (md->isRaisable()) t << "yes"; else t << "no";
1006 t << "\"";
1007 }
1008
1009 t << ">\n";
1010
1011 if (md->memberType()!=MemberType::Define &&
1013 )
1014 {
1016 t << " <type>";
1017 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,typeStr);
1018 t << "</type>\n";
1019 if (md->isTypeAlias())
1020 {
1021 defStr+=" = "+md->initializer();
1022 }
1023 stripAnonymousMarkers(defStr);
1024 t << " <definition>" << convertToXML(defStr) << "</definition>\n";
1025 t << " <argsstring>" << convertToXML(argsStr) << "</argsstring>\n";
1026 }
1027
1029 {
1030 t << " <type>";
1032 t << "</type>\n";
1033 }
1034
1035 QCString qualifiedNameStr = md->qualifiedName();
1036 stripAnonymousMarkers(qualifiedNameStr);
1037 t << " <name>" << convertToXML(nameStr) << "</name>\n";
1038 if (nameStr!=qualifiedNameStr)
1039 {
1040 t << " <qualifiedname>" << convertToXML(qualifiedNameStr) << "</qualifiedname>\n";
1041 }
1042
1043 if (md->memberType() == MemberType::Property)
1044 {
1045 if (md->isReadable())
1046 t << " <read>" << convertToXML(md->getReadAccessor()) << "</read>\n";
1047 if (md->isWritable())
1048 t << " <write>" << convertToXML(md->getWriteAccessor()) << "</write>\n";
1049 }
1050
1052 {
1053 QCString bitfield = md->bitfieldString();
1054 if (bitfield.at(0)==':') bitfield=bitfield.mid(1);
1055 t << " <bitfield>" << convertToXML(bitfield) << "</bitfield>\n";
1056 }
1057
1058 const MemberDef *rmd = md->reimplements();
1059 if (rmd)
1060 {
1061 t << " <reimplements refid=\""
1062 << memberOutputFileBase(rmd) << "_1" << rmd->anchor() << "\">"
1063 << convertToXML(rmd->name()) << "</reimplements>\n";
1064 }
1065 for (const auto &rbmd : md->reimplementedBy())
1066 {
1067 t << " <reimplementedby refid=\""
1068 << memberOutputFileBase(rbmd) << "_1" << rbmd->anchor() << "\">"
1069 << convertToXML(rbmd->name()) << "</reimplementedby>\n";
1070 }
1071
1072 for (const auto &qmd : md->getQualifiers())
1073 {
1074 t << " <qualifier>" << convertToXML(qmd) << "</qualifier>\n";
1075 }
1076
1077 if (md->isFriendClass()) // for friend classes we show a link to the class as a "parameter"
1078 {
1079 t << " <param>\n";
1080 t << " <type>";
1081 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,nameStr);
1082 t << "</type>\n";
1083 t << " </param>\n";
1084 }
1085 else if (isFunc) //function
1086 {
1087 const ArgumentList &declAl = md->declArgumentList();
1088 const ArgumentList &defAl = md->argumentList();
1089 bool isFortran = md->getLanguage()==SrcLangExt::Fortran;
1090 if (declAl.hasParameters())
1091 {
1092 auto defIt = defAl.begin();
1093 for (const Argument &a : declAl)
1094 {
1095 //const Argument *defArg = defAli.current();
1096 const Argument *defArg = nullptr;
1097 if (defIt!=defAl.end())
1098 {
1099 defArg = &(*defIt);
1100 ++defIt;
1101 }
1102 t << " <param>\n";
1103 if (!a.attrib.isEmpty())
1104 {
1105 t << " <attributes>";
1106 writeXMLString(t,a.attrib);
1107 t << "</attributes>\n";
1108 }
1109 if (isFortran && defArg && !defArg->type.isEmpty())
1110 {
1111 t << " <type>";
1112 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,defArg->type);
1113 t << "</type>\n";
1114 }
1115 else if (!a.type.isEmpty())
1116 {
1117 t << " <type>";
1118 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,a.type);
1119 t << "</type>\n";
1120 }
1121 if (!a.name.isEmpty())
1122 {
1123 t << " <declname>";
1124 writeXMLString(t,a.name);
1125 t << "</declname>\n";
1126 }
1127 if (defArg && !defArg->name.isEmpty() && defArg->name!=a.name)
1128 {
1129 t << " <defname>";
1130 writeXMLString(t,defArg->name);
1131 t << "</defname>\n";
1132 }
1133 if (!a.array.isEmpty())
1134 {
1135 t << " <array>";
1136 writeXMLString(t,a.array);
1137 t << "</array>\n";
1138 }
1139 if (!a.defval.isEmpty())
1140 {
1141 t << " <defval>";
1142 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,a.defval);
1143 t << "</defval>\n";
1144 }
1145 if (defArg && defArg->hasDocumentation())
1146 {
1147 t << " <briefdescription>";
1149 md->getOuterScope(),md,defArg->docs);
1150 t << "</briefdescription>\n";
1151 }
1152 t << " </param>\n";
1153 }
1154 }
1155 }
1156 else if (md->memberType()==MemberType::Define &&
1157 !md->argsString().isEmpty()) // define
1158 {
1159 if (md->argumentList().empty()) // special case for "foo()" to
1160 // distinguish it from "foo".
1161 {
1162 t << " <param></param>\n";
1163 }
1164 else
1165 {
1166 for (const Argument &a : md->argumentList())
1167 {
1168 t << " <param><defname>" << a.type << "</defname></param>\n";
1169 }
1170 }
1171 }
1172 if (!md->requiresClause().isEmpty())
1173 {
1174 t << " <requiresclause>";
1176 t << " </requiresclause>\n";
1177 }
1178
1179 if (!md->isTypeAlias() && (md->hasOneLineInitializer() || md->hasMultiLineInitializer()))
1180 {
1181 t << " <initializer>";
1183 t << "</initializer>\n";
1184 }
1185
1186 if (!md->excpString().isEmpty())
1187 {
1188 t << " <exceptions>";
1190 t << "</exceptions>\n";
1191 }
1192
1193 if (md->memberType()==MemberType::Enumeration) // enum
1194 {
1195 for (const auto &emd : md->enumFieldList())
1196 {
1197 ti << " <member refid=\"" << memberOutputFileBase(md)
1198 << "_1" << emd->anchor() << "\" kind=\"enumvalue\"><name>"
1199 << convertToXML(emd->name()) << "</name></member>\n";
1200
1201 t << " <enumvalue id=\"" << memberOutputFileBase(md) << "_1"
1202 << emd->anchor() << "\" prot=\"" << to_string_lower(emd->protection());
1203 t << "\">\n";
1204 t << " <name>";
1205 writeXMLString(t,emd->name());
1206 t << "</name>\n";
1207 if (!emd->initializer().isEmpty())
1208 {
1209 t << " <initializer>";
1210 writeXMLString(t,emd->initializer());
1211 t << "</initializer>\n";
1212 }
1213 t << " <briefdescription>\n";
1214 writeXMLDocBlock(t,emd->briefFile(),emd->briefLine(),emd->getOuterScope(),emd,emd->briefDescription());
1215 t << " </briefdescription>\n";
1216 t << " <detaileddescription>\n";
1217 writeXMLDocBlock(t,emd->docFile(),emd->docLine(),emd->getOuterScope(),emd,emd->documentation());
1218 t << " </detaileddescription>\n";
1219 t << " </enumvalue>\n";
1220 }
1221 }
1222 t << " <briefdescription>\n";
1224 t << " </briefdescription>\n";
1225 t << " <detaileddescription>\n";
1226 writeXMLDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation());
1227 t << " </detaileddescription>\n";
1228 t << " <inbodydescription>\n";
1230 t << " </inbodydescription>\n";
1231 if (md->getDefLine()!=-1)
1232 {
1233 t << " <location file=\""
1234 << convertToXML(stripFromPath(md->getDefFileName())) << "\" line=\""
1235 << md->getDefLine() << "\" column=\""
1236 << md->getDefColumn() << "\"" ;
1237 if (md->getStartBodyLine()!=-1)
1238 {
1239 const FileDef *bodyDef = md->getBodyDef();
1240 if (bodyDef)
1241 {
1242 t << " bodyfile=\"" << convertToXML(stripFromPath(bodyDef->absFilePath())) << "\"";
1243 }
1244 t << " bodystart=\"" << md->getStartBodyLine() << "\" bodyend=\""
1245 << md->getEndBodyLine() << "\"";
1246 }
1247 if (md->getDeclLine()!=-1)
1248 {
1249 t << " declfile=\"" << convertToXML(stripFromPath(md->getDeclFileName())) << "\" declline=\""
1250 << md->getDeclLine() << "\" declcolumn=\""
1251 << md->getDeclColumn() << "\"";
1252 }
1253 t << "/>\n";
1254 }
1255
1256 //printf("md->getReferencesMembers()=%p\n",md->getReferencesMembers());
1257 auto refList = md->getReferencesMembers();
1258 for (const auto &refmd : refList)
1259 {
1260 writeMemberReference(t,def,refmd,"references");
1261 }
1262 auto refByList = md->getReferencedByMembers();
1263 for (const auto &refmd : refByList)
1264 {
1265 writeMemberReference(t,def,refmd,"referencedby");
1266 }
1267
1268 t << " </memberdef>\n";
1269}
1270
1271// namespace members are also inserted in the file scope, but
1272// to prevent this duplication in the XML output, we optionally filter those here.
1273static bool memberVisible(const Definition *d,const MemberDef *md)
1274{
1275 return Config_getBool(XML_NS_MEMB_FILE_SCOPE) ||
1277 md->getNamespaceDef()==nullptr;
1278}
1279
1281 const MemberList *ml,const QCString &kind,const QCString &header=QCString(),
1282 const QCString &documentation=QCString())
1283{
1284 if (ml==nullptr) return;
1285 int count=0;
1286 for (const auto &md : *ml)
1287 {
1288 if (memberVisible(d,md) && (md->memberType()!=MemberType::EnumValue) &&
1289 !md->isHidden())
1290 {
1291 count++;
1292 }
1293 }
1294 if (count==0) return; // empty list
1295
1296 t << " <sectiondef kind=\"" << kind << "\">\n";
1297 if (!header.isEmpty())
1298 {
1299 t << " <header>" << convertToXML(header) << "</header>\n";
1300 }
1301 if (!documentation.isEmpty())
1302 {
1303 t << " <description>";
1304 writeXMLDocBlock(t,d->docFile(),d->docLine(),d,nullptr,documentation);
1305 t << "</description>\n";
1306 }
1307 for (const auto &md : *ml)
1308 {
1309 if (memberVisible(d,md))
1310 {
1311 generateXMLForMember(md,ti,t,d);
1312 }
1313 }
1314 t << " </sectiondef>\n";
1315}
1316
1318{
1319 t << " <listofallmembers>\n";
1320 for (auto &mni : cd->memberNameInfoLinkedMap())
1321 {
1322 for (auto &mi : *mni)
1323 {
1324 const MemberDef *md=mi->memberDef();
1325 if (!md->isAnonymous())
1326 {
1327 Protection prot = mi->prot();
1328 Specifier virt=md->virtualness();
1329 t << " <member refid=\"" << memberOutputFileBase(md) << "_1" <<
1330 md->anchor() << "\" prot=\"" << to_string_lower(prot);
1331 t << "\" virt=\"" << to_string_lower(virt) << "\"";
1332 if (!mi->ambiguityResolutionScope().isEmpty())
1333 {
1334 t << " ambiguityscope=\"" << convertToXML(mi->ambiguityResolutionScope()) << "\"";
1335 }
1336 t << "><scope>" << convertToXML(cd->name()) << "</scope><name>" <<
1337 convertToXML(md->name()) << "</name></member>\n";
1338 }
1339 }
1340 }
1341 t << " </listofallmembers>\n";
1342}
1343
1345{
1346 for (const auto &cd : cl)
1347 {
1348 if (!cd->isHidden() && !cd->isAnonymous())
1349 {
1350 t << " <innerclass refid=\"" << classOutputFileBase(cd)
1351 << "\" prot=\"" << to_string_lower(cd->protection());
1352 t << "\">" << convertToXML(cd->name()) << "</innerclass>\n";
1353 }
1354 }
1355}
1356
1358{
1359 for (const auto &cd : cl)
1360 {
1361 if (!cd->isHidden())
1362 {
1363 t << " <innerconcept refid=\"" << cd->getOutputFileBase()
1364 << "\">" << convertToXML(cd->name()) << "</innerconcept>\n";
1365 }
1366 }
1367}
1368
1370{
1371 for (const auto &mod : ml)
1372 {
1373 if (!mod->isHidden())
1374 {
1375 t << " <innermodule refid=\"" << mod->getOutputFileBase()
1376 << "\">" << convertToXML(mod->name()) << "</innermodule>\n";
1377 }
1378 }
1379}
1380
1382{
1383 for (const auto &nd : nl)
1384 {
1385 if (!nd->isHidden() && !nd->isAnonymous())
1386 {
1387 t << " <innernamespace refid=\"" << nd->getOutputFileBase()
1388 << "\"" << (nd->isInline() ? " inline=\"yes\"" : "")
1389 << ">" << convertToXML(nd->name()) << "</innernamespace>\n";
1390 }
1391 }
1392}
1393
1394static void writeExports(const ImportInfoMap &exportMap,TextStream &t)
1395{
1396 if (exportMap.empty()) return;
1397 t << " <exports>\n";
1398 for (const auto &[moduleName,importInfoList] : exportMap)
1399 {
1400 for (const auto &importInfo : importInfoList)
1401 {
1402 t << " <export";
1403 ModuleDef *mod = ModuleManager::instance().getPrimaryInterface(importInfo.importName);
1404 if (mod && mod->isLinkableInProject())
1405 {
1406 t << " refid=\"" << mod->getOutputFileBase() << "\"";
1407 }
1408 t << ">";
1409 t << importInfo.importName;
1410 t << "</export>\n";
1411 }
1412 }
1413 t << " </exports>\n";
1414}
1415
1416static void writeInnerFiles(const FileList &fl,TextStream &t)
1417{
1418 for (const auto &fd : fl)
1419 {
1420 t << " <innerfile refid=\"" << fd->getOutputFileBase()
1421 << "\">" << convertToXML(fd->name()) << "</innerfile>\n";
1422 }
1423}
1424
1426{
1427 for (const auto &pd : pl)
1428 {
1429 t << " <innerpage refid=\"" << pd->getOutputFileBase();
1430 if (pd->getGroupDef())
1431 {
1432 t << "_" << pd->name();
1433 }
1434 t << "\">" << convertToXML(pd->title()) << "</innerpage>\n";
1435 }
1436}
1437
1438static void writeInnerGroups(const GroupList &gl,TextStream &t)
1439{
1440 for (const auto &sgd : gl)
1441 {
1442 t << " <innergroup refid=\"" << sgd->getOutputFileBase()
1443 << "\">" << convertToXML(sgd->groupTitle())
1444 << "</innergroup>\n";
1445 }
1446}
1447
1448static void writeInnerDirs(const DirList *dl,TextStream &t)
1449{
1450 if (dl)
1451 {
1452 for(const auto subdir : *dl)
1453 {
1454 t << " <innerdir refid=\"" << subdir->getOutputFileBase()
1455 << "\">" << convertToXML(subdir->displayName()) << "</innerdir>\n";
1456 }
1457 }
1458}
1459
1460static void writeIncludeInfo(const IncludeInfo *ii,TextStream &t)
1461{
1462 if (ii)
1463 {
1464 QCString nm = ii->includeName;
1465 if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName();
1466 if (!nm.isEmpty())
1467 {
1468 t << " <includes";
1469 if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references
1470 {
1471 t << " refid=\"" << ii->fileDef->getOutputFileBase() << "\"";
1472 }
1473 t << " local=\"" << ((ii->kind & IncludeKind_LocalMask) ? "yes" : "no") << "\">";
1474 t << nm;
1475 t << "</includes>\n";
1476 }
1477 }
1478}
1479
1480static void generateXMLForClass(const ClassDef *cd,TextStream &ti)
1481{
1482 // + brief description
1483 // + detailed description
1484 // + template argument list(s)
1485 // - include file
1486 // + member groups
1487 // + inheritance diagram
1488 // + list of direct super classes
1489 // + list of direct sub classes
1490 // + list of inner classes
1491 // + collaboration diagram
1492 // + list of all members
1493 // + user defined member sections
1494 // + standard member sections
1495 // + detailed member documentation
1496 // - examples using the class
1497
1498 if (cd->isReference()) return; // skip external references.
1499 if (cd->isHidden()) return; // skip hidden classes.
1500 if (cd->isAnonymous()) return; // skip anonymous compounds.
1501 if (cd->isImplicitTemplateInstance()) return; // skip generated template instances.
1502 if (cd->isArtificial()) return; // skip artificially created classes
1503
1504 msg("Generating XML output for class {}\n",cd->name());
1505
1506 ti << " <compound refid=\"" << classOutputFileBase(cd)
1507 << "\" kind=\"" << cd->compoundTypeString()
1508 << "\"><name>" << convertToXML(cd->name()) << "</name>\n";
1509
1510 QCString outputDirectory = Config_getString(XML_OUTPUT);
1511 QCString fileName=outputDirectory+"/"+ classOutputFileBase(cd)+".xml";
1512 std::ofstream f = Portable::openOutputStream(fileName);
1513 if (!f.is_open())
1514 {
1515 err("Cannot open file {} for writing!\n",fileName);
1516 return;
1517 }
1518 TextStream t(&f);
1519
1520 writeXMLHeader(t);
1521 t << " <compounddef id=\""
1522 << classOutputFileBase(cd) << "\" kind=\""
1523 << cd->compoundTypeString() << "\" language=\""
1524 << langToString(cd->getLanguage()) << "\" prot=\"";
1525 t << to_string_lower(cd->protection());
1526 if (cd->isFinal()) t << "\" final=\"yes";
1527 if (cd->isSealed()) t << "\" sealed=\"yes";
1528 if (cd->isAbstract()) t << "\" abstract=\"yes";
1529 t << "\">\n";
1530 t << " <compoundname>";
1531 QCString nameStr = cd->name();
1532 stripAnonymousMarkers(nameStr);
1533 writeXMLString(t,nameStr);
1534 t << "</compoundname>\n";
1535 for (const auto &bcd : cd->baseClasses())
1536 {
1537 t << " <basecompoundref ";
1538 if (bcd.classDef->isLinkable())
1539 {
1540 t << "refid=\"" << classOutputFileBase(bcd.classDef) << "\" ";
1541 }
1542 if (bcd.prot == Protection::Package) ASSERT(0);
1543 t << "prot=\"";
1544 t << to_string_lower(bcd.prot);
1545 t << "\" virt=\"";
1546 t << to_string_lower(bcd.virt);
1547 t << "\">";
1548 if (!bcd.templSpecifiers.isEmpty())
1549 {
1550 t << convertToXML(
1552 bcd.classDef->name(),bcd.templSpecifiers)
1553 );
1554 }
1555 else
1556 {
1557 t << convertToXML(bcd.classDef->displayName());
1558 }
1559 t << "</basecompoundref>\n";
1560 }
1561 for (const auto &bcd : cd->subClasses())
1562 {
1563 if (bcd.prot == Protection::Package) ASSERT(0);
1564 t << " <derivedcompoundref refid=\""
1565 << classOutputFileBase(bcd.classDef)
1566 << "\" prot=\"";
1567 t << to_string_lower(bcd.prot);
1568 t << "\" virt=\"";
1569 t << to_string_lower(bcd.virt);
1570 t << "\">" << convertToXML(bcd.classDef->displayName())
1571 << "</derivedcompoundref>\n";
1572 }
1573
1575
1577
1578 writeTemplateList(cd,t);
1579 for (const auto &mg : cd->getMemberGroups())
1580 {
1581 generateXMLSection(cd,ti,t,&mg->members(),"user-defined",mg->header(),
1582 mg->documentation());
1583 }
1584
1585 for (const auto &ml : cd->getMemberLists())
1586 {
1587 if (!ml->listType().isDetailed())
1588 {
1589 generateXMLSection(cd,ti,t,ml.get(),ml->listType().toXML());
1590 }
1591 }
1592
1593 if (!cd->requiresClause().isEmpty())
1594 {
1595 t << " <requiresclause>";
1596 linkifyText(TextGeneratorXMLImpl(t),cd,cd->getFileDef(),nullptr,cd->requiresClause());
1597 t << " </requiresclause>\n";
1598 }
1599
1600 for (const auto &qcd : cd->getQualifiers())
1601 {
1602 t << " <qualifier>" << convertToXML(qcd) << "</qualifier>\n";
1603 }
1604
1605 t << " <briefdescription>\n";
1606 writeXMLDocBlock(t,cd->briefFile(),cd->briefLine(),cd,nullptr,cd->briefDescription());
1607 t << " </briefdescription>\n";
1608 t << " <detaileddescription>\n";
1609 writeXMLDocBlock(t,cd->docFile(),cd->docLine(),cd,nullptr,cd->documentation());
1610 t << " </detaileddescription>\n";
1611 DotClassGraph inheritanceGraph(cd,GraphType::Inheritance);
1612 if (!inheritanceGraph.isTrivial())
1613 {
1614 t << " <inheritancegraph>\n";
1615 inheritanceGraph.writeXML(t);
1616 t << " </inheritancegraph>\n";
1617 }
1618 DotClassGraph collaborationGraph(cd,GraphType::Collaboration);
1619 if (!collaborationGraph.isTrivial())
1620 {
1621 t << " <collaborationgraph>\n";
1622 collaborationGraph.writeXML(t);
1623 t << " </collaborationgraph>\n";
1624 }
1625 t << " <location file=\""
1626 << convertToXML(stripFromPath(cd->getDefFileName())) << "\" line=\""
1627 << cd->getDefLine() << "\"" << " column=\""
1628 << cd->getDefColumn() << "\"" ;
1629 if (cd->getStartBodyLine()!=-1)
1630 {
1631 const FileDef *bodyDef = cd->getBodyDef();
1632 if (bodyDef)
1633 {
1634 t << " bodyfile=\"" << convertToXML(stripFromPath(bodyDef->absFilePath())) << "\"";
1635 }
1636 t << " bodystart=\"" << cd->getStartBodyLine() << "\" bodyend=\""
1637 << cd->getEndBodyLine() << "\"";
1638 }
1639 t << "/>\n";
1641 t << " </compounddef>\n";
1642 t << "</doxygen>\n";
1643
1644 ti << " </compound>\n";
1645}
1646
1648{
1649 if (cd->isReference() || cd->isHidden()) return; // skip external references.
1650
1651 ti << " <compound refid=\"" << cd->getOutputFileBase()
1652 << "\" kind=\"concept\"" << "><name>"
1653 << convertToXML(cd->name()) << "</name>\n";
1654
1655 QCString outputDirectory = Config_getString(XML_OUTPUT);
1656 QCString fileName=outputDirectory+"/"+cd->getOutputFileBase()+".xml";
1657 std::ofstream f = Portable::openOutputStream(fileName);
1658 if (!f.is_open())
1659 {
1660 err("Cannot open file {} for writing!\n",fileName);
1661 return;
1662 }
1663 TextStream t(&f);
1664 writeXMLHeader(t);
1665 t << " <compounddef id=\"" << cd->getOutputFileBase()
1666 << "\" kind=\"concept\">\n";
1667 t << " <compoundname>";
1668 QCString nameStr = cd->name();
1669 stripAnonymousMarkers(nameStr);
1670 writeXMLString(t,nameStr);
1671 t << "</compoundname>\n";
1673 writeTemplateList(cd,t);
1674 t << " <initializer>";
1675 linkifyText(TextGeneratorXMLImpl(t),cd,cd->getFileDef(),nullptr,cd->initializer());
1676 t << " </initializer>\n";
1677 t << " <briefdescription>\n";
1678 writeXMLDocBlock(t,cd->briefFile(),cd->briefLine(),cd,nullptr,cd->briefDescription());
1679 t << " </briefdescription>\n";
1680 t << " <detaileddescription>\n";
1681 writeXMLDocBlock(t,cd->docFile(),cd->docLine(),cd,nullptr,cd->documentation());
1682 t << " </detaileddescription>\n";
1683 t << " <location file=\""
1684 << convertToXML(stripFromPath(cd->getDefFileName())) << "\" line=\""
1685 << cd->getDefLine() << "\"" << " column=\""
1686 << cd->getDefColumn() << "\"/>\n" ;
1687 t << " </compounddef>\n";
1688 t << "</doxygen>\n";
1689
1690 ti << " </compound>\n";
1691}
1692
1693static void generateXMLForModule(const ModuleDef *mod,TextStream &ti)
1694{
1695 if (mod->isReference() || mod->isHidden() || !mod->isPrimaryInterface()) return;
1696 ti << " <compound refid=\"" << mod->getOutputFileBase()
1697 << "\" kind=\"module\"" << "><name>"
1698 << convertToXML(mod->name()) << "</name>\n";
1699
1700 QCString outputDirectory = Config_getString(XML_OUTPUT);
1701 QCString fileName=outputDirectory+"/"+mod->getOutputFileBase()+".xml";
1702 std::ofstream f = Portable::openOutputStream(fileName);
1703 if (!f.is_open())
1704 {
1705 err("Cannot open file {} for writing!\n",fileName);
1706 return;
1707 }
1708 TextStream t(&f);
1709 writeXMLHeader(t);
1710 t << " <compounddef id=\"" << mod->getOutputFileBase()
1711 << "\" kind=\"module\">\n";
1712 t << " <compoundname>";
1713 writeXMLString(t,mod->name());
1714 t << "</compoundname>\n";
1715 writeInnerFiles(mod->getUsedFiles(),t);
1716 writeInnerClasses(mod->getClasses(),t);
1718 for (const auto &ml : mod->getMemberLists())
1719 {
1720 if (ml->listType().isDeclaration())
1721 {
1722 generateXMLSection(mod,ti,t,ml.get(),ml->listType().toXML());
1723 }
1724 }
1725 for (const auto &mg : mod->getMemberGroups())
1726 {
1727 generateXMLSection(mod,ti,t,&mg->members(),"user-defined",mg->header(),
1728 mg->documentation());
1729 }
1730 t << " <briefdescription>\n";
1731 writeXMLDocBlock(t,mod->briefFile(),mod->briefLine(),mod,nullptr,mod->briefDescription());
1732 t << " </briefdescription>\n";
1733 t << " <detaileddescription>\n";
1734 writeXMLDocBlock(t,mod->docFile(),mod->docLine(),mod,nullptr,mod->documentation());
1735 t << " </detaileddescription>\n";
1736 writeExports(mod->getExports(),t);
1737 t << " <location file=\""
1738 << convertToXML(stripFromPath(mod->getDefFileName())) << "\" line=\""
1739 << mod->getDefLine() << "\"" << " column=\""
1740 << mod->getDefColumn() << "\"/>\n" ;
1741 t << " </compounddef>\n";
1742 t << "</doxygen>\n";
1743
1744 ti << " </compound>\n";
1745
1746}
1747
1749{
1750 // + contained class definitions
1751 // + contained namespace definitions
1752 // + member groups
1753 // + normal members
1754 // + brief desc
1755 // + detailed desc
1756 // + location
1757 // - files containing (parts of) the namespace definition
1758
1759 if (nd->isReference() || nd->isHidden()) return; // skip external references
1760
1761 ti << " <compound refid=\"" << nd->getOutputFileBase()
1762 << "\" kind=\"namespace\"" << "><name>"
1763 << convertToXML(nd->name()) << "</name>\n";
1764
1765 QCString outputDirectory = Config_getString(XML_OUTPUT);
1766 QCString fileName=outputDirectory+"/"+nd->getOutputFileBase()+".xml";
1767 std::ofstream f = Portable::openOutputStream(fileName);
1768 if (!f.is_open())
1769 {
1770 err("Cannot open file {} for writing!\n",fileName);
1771 return;
1772 }
1773 TextStream t(&f);
1774
1775 writeXMLHeader(t);
1776 t << " <compounddef id=\"" << nd->getOutputFileBase()
1777 << "\" kind=\"namespace\" "
1778 << (nd->isInline()?"inline=\"yes\" ":"")
1779 << "language=\""
1780 << langToString(nd->getLanguage()) << "\">\n";
1781 t << " <compoundname>";
1782 QCString nameStr = nd->name();
1783 stripAnonymousMarkers(nameStr);
1784 writeXMLString(t,nameStr);
1785 t << "</compoundname>\n";
1786
1790
1791 for (const auto &mg : nd->getMemberGroups())
1792 {
1793 generateXMLSection(nd,ti,t,&mg->members(),"user-defined",mg->header(),
1794 mg->documentation());
1795 }
1796
1797 for (const auto &ml : nd->getMemberLists())
1798 {
1799 if (ml->listType().isDeclaration())
1800 {
1801 generateXMLSection(nd,ti,t,ml.get(),ml->listType().toXML());
1802 }
1803 }
1804
1805 t << " <briefdescription>\n";
1806 writeXMLDocBlock(t,nd->briefFile(),nd->briefLine(),nd,nullptr,nd->briefDescription());
1807 t << " </briefdescription>\n";
1808 t << " <detaileddescription>\n";
1809 writeXMLDocBlock(t,nd->docFile(),nd->docLine(),nd,nullptr,nd->documentation());
1810 t << " </detaileddescription>\n";
1811 t << " <location file=\""
1812 << convertToXML(stripFromPath(nd->getDefFileName())) << "\" line=\""
1813 << nd->getDefLine() << "\"" << " column=\""
1814 << nd->getDefColumn() << "\"/>\n" ;
1815 t << " </compounddef>\n";
1816 t << "</doxygen>\n";
1817
1818 ti << " </compound>\n";
1819}
1820
1822{
1823 // + includes files
1824 // + includedby files
1825 // + include graph
1826 // + included by graph
1827 // + contained class definitions
1828 // + contained namespace definitions
1829 // + member groups
1830 // + normal members
1831 // + brief desc
1832 // + detailed desc
1833 // + source code
1834 // + location
1835 // - number of lines
1836
1837 if (fd->isReference()) return; // skip external references
1838
1839 ti << " <compound refid=\"" << fd->getOutputFileBase()
1840 << "\" kind=\"file\"><name>" << convertToXML(fd->name())
1841 << "</name>\n";
1842
1843 QCString outputDirectory = Config_getString(XML_OUTPUT);
1844 QCString fileName=outputDirectory+"/"+fd->getOutputFileBase()+".xml";
1845 std::ofstream f = Portable::openOutputStream(fileName);
1846 if (!f.is_open())
1847 {
1848 err("Cannot open file {} for writing!\n",fileName);
1849 return;
1850 }
1851 TextStream t(&f);
1852
1853 writeXMLHeader(t);
1854 t << " <compounddef id=\"" << fd->getOutputFileBase()
1855 << "\" kind=\"file\" language=\""
1856 << langToString(fd->getLanguage()) << "\">\n";
1857 t << " <compoundname>";
1858 writeXMLString(t,fd->name());
1859 t << "</compoundname>\n";
1860
1861 for (const auto &inc : fd->includeFileList())
1862 {
1863 t << " <includes";
1864 if (inc.fileDef && !inc.fileDef->isReference()) // TODO: support external references
1865 {
1866 t << " refid=\"" << inc.fileDef->getOutputFileBase() << "\"";
1867 }
1868 t << " local=\"" << ((inc.kind & IncludeKind_LocalMask) ? "yes" : "no") << "\">";
1869 t << convertToXML(inc.includeName);
1870 t << "</includes>\n";
1871 }
1872
1873 for (const auto &inc : fd->includedByFileList())
1874 {
1875 t << " <includedby";
1876 if (inc.fileDef && !inc.fileDef->isReference()) // TODO: support external references
1877 {
1878 t << " refid=\"" << inc.fileDef->getOutputFileBase() << "\"";
1879 }
1880 t << " local=\"" << ((inc.kind &IncludeKind_LocalMask) ? "yes" : "no") << "\">";
1881 t << convertToXML(inc.includeName);
1882 t << "</includedby>\n";
1883 }
1884
1885 DotInclDepGraph incDepGraph(fd,FALSE);
1886 if (!incDepGraph.isTrivial())
1887 {
1888 t << " <incdepgraph>\n";
1889 incDepGraph.writeXML(t);
1890 t << " </incdepgraph>\n";
1891 }
1892
1893 DotInclDepGraph invIncDepGraph(fd,TRUE);
1894 if (!invIncDepGraph.isTrivial())
1895 {
1896 t << " <invincdepgraph>\n";
1897 invIncDepGraph.writeXML(t);
1898 t << " </invincdepgraph>\n";
1899 }
1900
1904
1905 for (const auto &mg : fd->getMemberGroups())
1906 {
1907 generateXMLSection(fd,ti,t,&mg->members(),"user-defined",mg->header(),
1908 mg->documentation());
1909 }
1910
1911 for (const auto &ml : fd->getMemberLists())
1912 {
1913 if (ml->listType().isDeclaration())
1914 {
1915 generateXMLSection(fd,ti,t,ml.get(),ml->listType().toXML());
1916 }
1917 }
1918
1919 t << " <briefdescription>\n";
1920 writeXMLDocBlock(t,fd->briefFile(),fd->briefLine(),fd,nullptr,fd->briefDescription());
1921 t << " </briefdescription>\n";
1922 t << " <detaileddescription>\n";
1923 writeXMLDocBlock(t,fd->docFile(),fd->docLine(),fd,nullptr,fd->documentation());
1924 t << " </detaileddescription>\n";
1925 if (Config_getBool(XML_PROGRAMLISTING))
1926 {
1927 writeXMLCodeBlock(t,fd);
1928 }
1929 t << " <location file=\"" << convertToXML(stripFromPath(fd->getDefFileName())) << "\"/>\n";
1930 t << " </compounddef>\n";
1931 t << "</doxygen>\n";
1932
1933 ti << " </compound>\n";
1934}
1935
1936static void generateXMLForGroup(const GroupDef *gd,TextStream &ti)
1937{
1938 // + members
1939 // + member groups
1940 // + files
1941 // + classes
1942 // + namespaces
1943 // - packages
1944 // + pages
1945 // + child groups
1946 // - examples
1947 // + brief description
1948 // + detailed description
1949
1950 if (gd->isReference()) return; // skip external references
1951
1952 ti << " <compound refid=\"" << gd->getOutputFileBase()
1953 << "\" kind=\"group\"><name>" << convertToXML(gd->name()) << "</name>\n";
1954
1955 QCString outputDirectory = Config_getString(XML_OUTPUT);
1956 QCString fileName=outputDirectory+"/"+gd->getOutputFileBase()+".xml";
1957 std::ofstream f = Portable::openOutputStream(fileName);
1958 if (!f.is_open())
1959 {
1960 err("Cannot open file {} for writing!\n",fileName);
1961 return;
1962 }
1963 TextStream t(&f);
1964
1965 writeXMLHeader(t);
1966 t << " <compounddef id=\""
1967 << gd->getOutputFileBase() << "\" kind=\"group\">\n";
1968 t << " <compoundname>" << convertToXML(gd->name()) << "</compoundname>\n";
1969 t << " <title>" << convertToXML(gd->groupTitle()) << "</title>\n";
1970
1972 writeInnerFiles(gd->getFiles(),t);
1976 writeInnerPages(gd->getPages(),t);
1978
1979 for (const auto &mg : gd->getMemberGroups())
1980 {
1981 generateXMLSection(gd,ti,t,&mg->members(),"user-defined",mg->header(),
1982 mg->documentation());
1983 }
1984
1985 for (const auto &ml : gd->getMemberLists())
1986 {
1987 if (ml->listType().isDeclaration())
1988 {
1989 generateXMLSection(gd,ti,t,ml.get(),ml->listType().toXML());
1990 }
1991 }
1992
1993 t << " <briefdescription>\n";
1994 writeXMLDocBlock(t,gd->briefFile(),gd->briefLine(),gd,nullptr,gd->briefDescription());
1995 t << " </briefdescription>\n";
1996 t << " <detaileddescription>\n";
1997 writeXMLDocBlock(t,gd->docFile(),gd->docLine(),gd,nullptr,gd->documentation());
1998 t << " </detaileddescription>\n";
1999 t << " </compounddef>\n";
2000 t << "</doxygen>\n";
2001
2002 ti << " </compound>\n";
2003}
2004
2006{
2007 if (dd->isReference()) return; // skip external references
2008 ti << " <compound refid=\"" << dd->getOutputFileBase()
2009 << "\" kind=\"dir\"><name>" << convertToXML(dd->displayName())
2010 << "</name>\n";
2011
2012 QCString outputDirectory = Config_getString(XML_OUTPUT);
2013 QCString fileName=outputDirectory+"/"+dd->getOutputFileBase()+".xml";
2014 std::ofstream f = Portable::openOutputStream(fileName);
2015 if (!f.is_open())
2016 {
2017 err("Cannot open file {} for writing!\n",fileName);
2018 return;
2019 }
2020 TextStream t(&f);
2021
2022 writeXMLHeader(t);
2023 t << " <compounddef id=\""
2024 << dd->getOutputFileBase() << "\" kind=\"dir\">\n";
2025 t << " <compoundname>" << convertToXML(dd->displayName()) << "</compoundname>\n";
2026
2027 writeInnerDirs(&dd->subDirs(),t);
2028 writeInnerFiles(dd->getFiles(),t);
2029
2030 t << " <briefdescription>\n";
2031 writeXMLDocBlock(t,dd->briefFile(),dd->briefLine(),dd,nullptr,dd->briefDescription());
2032 t << " </briefdescription>\n";
2033 t << " <detaileddescription>\n";
2034 writeXMLDocBlock(t,dd->docFile(),dd->docLine(),dd,nullptr,dd->documentation());
2035 t << " </detaileddescription>\n";
2036 t << " <location file=\"" << convertToXML(stripFromPath(dd->name())) << "\"/>\n";
2037 t << " </compounddef>\n";
2038 t << "</doxygen>\n";
2039
2040 ti << " </compound>\n";
2041}
2042
2043static void generateXMLForPage(PageDef *pd,TextStream &ti,bool isExample)
2044{
2045 // + name
2046 // + title
2047 // + documentation
2048 // + location
2049
2050 const char *kindName = isExample ? "example" : "page";
2051
2052 if (pd->isReference()) return;
2053
2054 QCString pageName = pd->getOutputFileBase();
2055 if (pd->getGroupDef())
2056 {
2057 pageName+=QCString("_")+pd->name();
2058 }
2059 if (pageName=="index") pageName="indexpage"; // to prevent overwriting the generated index page.
2060
2061 ti << " <compound refid=\"" << pageName
2062 << "\" kind=\"" << kindName << "\"><name>" << convertToXML(pd->name())
2063 << "</name>\n";
2064
2065 QCString outputDirectory = Config_getString(XML_OUTPUT);
2066 QCString fileName=outputDirectory+"/"+pageName+".xml";
2067 std::ofstream f = Portable::openOutputStream(fileName);
2068 if (!f.is_open())
2069 {
2070 err("Cannot open file {} for writing!\n",fileName);
2071 return;
2072 }
2073 TextStream t(&f);
2074
2075 writeXMLHeader(t);
2076 t << " <compounddef id=\"" << pageName;
2077 t << "\" kind=\"" << kindName << "\">\n";
2078 t << " <compoundname>" << convertToXML(pd->name())
2079 << "</compoundname>\n";
2080
2081 if (pd==Doxygen::mainPage.get()) // main page is special
2082 {
2083 QCString title;
2084 if (mainPageHasTitle())
2085 {
2087 }
2088 else
2089 {
2090 title = Config_getString(PROJECT_NAME);
2091 }
2092 t << " <title>" << convertToXML(convertCharEntitiesToUTF8(title))
2093 << "</title>\n";
2094 }
2095 else
2096 {
2097 const SectionInfo *si = SectionManager::instance().find(pd->name());
2098 if (si)
2099 {
2100 t << " <title>" << convertToXML(filterTitle(convertCharEntitiesToUTF8(si->title())))
2101 << "</title>\n";
2102 }
2103 }
2105 const SectionRefs &sectionRefs = pd->getSectionRefs();
2106 if (pd->localToc().isXmlEnabled() && !sectionRefs.empty())
2107 {
2108 int level=1;
2109 int indent=0;
2110 auto writeIndent = [&]() { for (int i=0;i<4+indent*2;i++) t << " "; };
2111 auto incIndent = [&](const char *text) { writeIndent(); t << text << "\n"; indent++; };
2112 auto decIndent = [&](const char *text) { indent--; writeIndent(); t << text << "\n"; };
2113 incIndent("<tableofcontents>");
2114 int maxLevel = pd->localToc().xmlLevel();
2115 BoolVector inLi(maxLevel+1,false);
2116 for (const SectionInfo *si : sectionRefs)
2117 {
2118 if (si->type().isSection())
2119 {
2120 //printf(" level=%d title=%s\n",level,qPrint(si->title));
2121 int nextLevel = si->type().level();
2122 if (nextLevel>level)
2123 {
2124 for (int l=level;l<nextLevel;l++)
2125 {
2126 if (l < maxLevel) incIndent("<tableofcontents>");
2127 }
2128 }
2129 else if (nextLevel<level)
2130 {
2131 for (int l=level;l>nextLevel;l--)
2132 {
2133 if (l <= maxLevel && inLi[l]) decIndent("</tocsect>");
2134 inLi[l]=false;
2135 if (l <= maxLevel) decIndent("</tableofcontents>");
2136 }
2137 }
2138 if (nextLevel <= maxLevel)
2139 {
2140 if (inLi[nextLevel])
2141 {
2142 decIndent("</tocsect>");
2143 }
2144 else if (level>nextLevel)
2145 {
2146 decIndent("</tableofcontents>");
2147 incIndent("<tableofcontents>");
2148 }
2149 QCString titleDoc = convertToXML(si->title());
2150 QCString label = convertToXML(si->label());
2151 if (titleDoc.isEmpty()) titleDoc = label;
2152 incIndent("<tocsect>");
2153 writeIndent(); t << "<name>" << titleDoc << "</name>\n"; // kept for backwards compatibility
2154 writeIndent(); t << "<docs>";
2155 if (!si->title().isEmpty())
2156 {
2157 writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,nullptr,si->title());
2158 }
2159 t << "</docs>\n";
2160 writeIndent(); t << "<reference>" << convertToXML(pageName) << "_1" << label << "</reference>\n";
2161 inLi[nextLevel]=true;
2162 level = nextLevel;
2163 }
2164 }
2165 }
2166 while (level>1 && level <= maxLevel)
2167 {
2168 if (inLi[level]) decIndent("</tocsect>");
2169 inLi[level]=false;
2170 decIndent("</tableofcontents>");
2171 level--;
2172 }
2173 if (level <= maxLevel && inLi[level]) decIndent("</tocsect>");
2174 inLi[level]=false;
2175 decIndent("</tableofcontents>");
2176 }
2177 t << " <briefdescription>\n";
2178 writeXMLDocBlock(t,pd->briefFile(),pd->briefLine(),pd,nullptr,pd->briefDescription());
2179 t << " </briefdescription>\n";
2180 t << " <detaileddescription>\n";
2181 if (isExample)
2182 {
2183 writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,nullptr,
2184 pd->documentation()+"\n\\include "+pd->name());
2185 }
2186 else
2187 {
2188 writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,nullptr,
2189 pd->documentation());
2190 }
2191 t << " </detaileddescription>\n";
2192
2193 t << " <location file=\"" << convertToXML(stripFromPath(pd->getDefFileName())) << "\"/>\n";
2194
2195 t << " </compounddef>\n";
2196 t << "</doxygen>\n";
2197
2198 ti << " </compound>\n";
2199}
2200
2202{
2203 // + classes
2204 // + concepts
2205 // + namespaces
2206 // + files
2207 // + groups
2208 // + related pages
2209 // - examples
2210
2211 QCString outputDirectory = Config_getString(XML_OUTPUT);
2212 Dir xmlDir(outputDirectory.str());
2213 createSubDirs(xmlDir);
2214
2215 ResourceMgr::instance().copyResource("xml.xsd",outputDirectory);
2216 ResourceMgr::instance().copyResource("index.xsd",outputDirectory);
2217
2218 QCString fileName=outputDirectory+"/compound.xsd";
2219 std::ofstream f = Portable::openOutputStream(fileName);
2220 if (!f.is_open())
2221 {
2222 err("Cannot open file {} for writing!\n",fileName);
2223 return;
2224 }
2225 {
2226 TextStream t(&f);
2227
2228 // write compound.xsd, but replace special marker with the entities
2229 QCString compound_xsd = ResourceMgr::instance().getAsString("compound.xsd");
2230 const char *startLine = compound_xsd.data();
2231 while (*startLine)
2232 {
2233 // find end of the line
2234 const char *endLine = startLine+1;
2235 while (*endLine && *(endLine-1)!='\n') endLine++; // skip to end of the line including \n
2236 int len=static_cast<int>(endLine-startLine);
2237 if (len>0)
2238 {
2239 QCString s(startLine,len);
2240 if (s.find("<!-- Automatically insert here the HTML entities -->")!=-1)
2241 {
2243 }
2244 else
2245 {
2246 t.write(startLine,len);
2247 }
2248 }
2249 startLine=endLine;
2250 }
2251 }
2252 f.close();
2253
2254 fileName=outputDirectory+"/doxyfile.xsd";
2255 f = Portable::openOutputStream(fileName);
2256 if (!f.is_open())
2257 {
2258 err("Cannot open file {} for writing!\n",fileName);
2259 return;
2260 }
2261 {
2262 TextStream t(&f);
2263
2264 // write doxyfile.xsd, but replace special marker with the entities
2265 QCString doxyfile_xsd = ResourceMgr::instance().getAsString("doxyfile.xsd");
2266 const char *startLine = doxyfile_xsd.data();
2267 while (*startLine)
2268 {
2269 // find end of the line
2270 const char *endLine = startLine+1;
2271 while (*endLine && *(endLine-1)!='\n') endLine++; // skip to end of the line including \n
2272 int len=static_cast<int>(endLine-startLine);
2273 if (len>0)
2274 {
2275 QCString s(startLine,len);
2276 if (s.find("<!-- Automatically insert here the configuration settings -->")!=-1)
2277 {
2279 }
2280 else
2281 {
2282 t.write(startLine,len);
2283 }
2284 }
2285 startLine=endLine;
2286 }
2287 }
2288 f.close();
2289
2290 fileName=outputDirectory+"/Doxyfile.xml";
2291 f = Portable::openOutputStream(fileName);
2292 if (!f.is_open())
2293 {
2294 err("Cannot open file {} for writing\n",fileName);
2295 return;
2296 }
2297 else
2298 {
2299 TextStream t(&f);
2301 }
2302 f.close();
2303
2304 fileName=outputDirectory+"/index.xml";
2305 f = Portable::openOutputStream(fileName);
2306 if (!f.is_open())
2307 {
2308 err("Cannot open file {} for writing!\n",fileName);
2309 return;
2310 }
2311 else
2312 {
2313 TextStream t(&f);
2314
2315 // write index header
2316 t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n";
2317 t << "<doxygenindex xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
2318 t << "xsi:noNamespaceSchemaLocation=\"index.xsd\" ";
2319 t << "version=\"" << getDoxygenVersion() << "\" ";
2320 t << "xml:lang=\"" << theTranslator->trISOLang() << "\"";
2321 t << ">\n";
2322
2323 for (const auto &cd : *Doxygen::classLinkedMap)
2324 {
2325 generateXMLForClass(cd.get(),t);
2326 }
2327 for (const auto &cd : *Doxygen::conceptLinkedMap)
2328 {
2329 msg("Generating XML output for concept {}\n",cd->displayName());
2330 generateXMLForConcept(cd.get(),t);
2331 }
2332 for (const auto &nd : *Doxygen::namespaceLinkedMap)
2333 {
2334 msg("Generating XML output for namespace {}\n",nd->displayName());
2335 generateXMLForNamespace(nd.get(),t);
2336 }
2337 for (const auto &fn : *Doxygen::inputNameLinkedMap)
2338 {
2339 for (const auto &fd : *fn)
2340 {
2341 msg("Generating XML output for file {}\n",fd->name());
2342 generateXMLForFile(fd.get(),t);
2343 }
2344 }
2345 for (const auto &gd : *Doxygen::groupLinkedMap)
2346 {
2347 msg("Generating XML output for group {}\n",gd->name());
2348 generateXMLForGroup(gd.get(),t);
2349 }
2350 for (const auto &pd : *Doxygen::pageLinkedMap)
2351 {
2352 msg("Generating XML output for page {}\n",pd->name());
2353 generateXMLForPage(pd.get(),t,FALSE);
2354 }
2355 for (const auto &dd : *Doxygen::dirLinkedMap)
2356 {
2357 msg("Generate XML output for dir {}\n",dd->name());
2358 generateXMLForDir(dd.get(),t);
2359 }
2360 for (const auto &mod : ModuleManager::instance().modules())
2361 {
2362 msg("Generating XML output for module {}\n",mod->name());
2363 generateXMLForModule(mod.get(),t);
2364 }
2365 for (const auto &pd : *Doxygen::exampleLinkedMap)
2366 {
2367 msg("Generating XML output for example {}\n",pd->name());
2368 generateXMLForPage(pd.get(),t,TRUE);
2369 }
2371 {
2372 msg("Generating XML output for the main page\n");
2374 }
2375
2376 //t << " </compoundlist>\n";
2377 t << "</doxygenindex>\n";
2378 }
2379
2381 clearSubDirs(xmlDir);
2382}
2383
2384
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:178
Class representing the abstract syntax tree of a documentation block.
Definition docnode.h:1466
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
void resize(size_t newlen)
Definition qcstring.h:180
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
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:178
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:63
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:188
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:62
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:65
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:61
void endSpecialComment() override
Definition xmlgen.cpp:222
bool m_insideCodeLine
Definition xmlgen.h:60
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: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:338
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:361
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:57
void startCodeFragment(const QCString &) override
Definition xmlgen.cpp:355
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
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:6830
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5147
bool mainPageHasTitle()
Definition util.cpp:6234
QCString insertTemplateSpecifierInScope(const QCString &scope, const QCString &templ)
Definition util.cpp:3688
void clearSubDirs(const Dir &d)
Definition util.cpp:3609
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
Definition util.cpp:1438
QCString filterTitle(const QCString &title)
Definition util.cpp:5566
void createSubDirs(const Dir &d)
Definition util.cpp:3582
static QCString stripFromPath(const QCString &p, const StringVector &l)
Definition util.cpp:299
QCString convertToXML(const QCString &s, bool keepEntities)
Definition util.cpp:3854
QCString langToString(SrcLangExt lang)
Returns a string representation of lang.
Definition util.cpp:5843
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
Definition util.cpp:5849
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:3989
A bunch of utility functions.
static QCString classOutputFileBase(const ClassDef *cd)
Definition xmlgen.cpp:559
static void generateXMLForGroup(const GroupDef *gd, TextStream &ti)
Definition xmlgen.cpp:1936
void generateXML()
Definition xmlgen.cpp:2201
static void writeInnerConcepts(const ConceptLinkedRefMap &cl, TextStream &t)
Definition xmlgen.cpp:1357
static void writeInnerGroups(const GroupList &gl, TextStream &t)
Definition xmlgen.cpp:1438
static void writeXMLDocBlock(TextStream &t, const QCString &fileName, int lineNr, const Definition *scope, const MemberDef *md, const QCString &text)
Definition xmlgen.cpp:441
static void writeInnerDirs(const DirList *dl, TextStream &t)
Definition xmlgen.cpp:1448
static void writeListOfAllMembers(const ClassDef *cd, TextStream &t)
Definition xmlgen.cpp:1317
static void stripAnonymousMarkers(QCString &s)
Definition xmlgen.cpp:518
#define XML_DB(x)
Definition xmlgen.cpp:56
static void generateXMLForClass(const ClassDef *cd, TextStream &ti)
Definition xmlgen.cpp:1480
static void writeMemberReference(TextStream &t, const Definition *def, const MemberDef *rmd, const QCString &tagName)
Definition xmlgen.cpp:493
static void generateXMLForFile(FileDef *fd, TextStream &ti)
Definition xmlgen.cpp:1821
static QCString memberOutputFileBase(const MemberDef *md)
Definition xmlgen.cpp:568
static void writeMemberTemplateLists(const MemberDef *md, TextStream &t)
Definition xmlgen.cpp:426
void writeXMLCodeBlock(TextStream &t, FileDef *fd)
Definition xmlgen.cpp:474
static void writeTemplateList(const ClassDef *cd, TextStream &t)
Definition xmlgen.cpp:431
static bool stripKeyword(QCString &str, const char *keyword, bool needSpace)
Definition xmlgen.cpp:582
static bool memberVisible(const Definition *d, const MemberDef *md)
Definition xmlgen.cpp:1273
static void writeIncludeInfo(const IncludeInfo *ii, TextStream &t)
Definition xmlgen.cpp:1460
static void stripQualifiers(QCString &typeStr)
Definition xmlgen.cpp:543
static void writeInnerPages(const PageLinkedRefMap &pl, TextStream &t)
Definition xmlgen.cpp:1425
static void generateXMLForNamespace(const NamespaceDef *nd, TextStream &ti)
Definition xmlgen.cpp:1748
static void writeXMLHeader(TextStream &t)
Definition xmlgen.cpp:124
static void writeInnerModules(const ModuleLinkedRefMap &ml, TextStream &t)
Definition xmlgen.cpp:1369
static void generateXMLForModule(const ModuleDef *mod, TextStream &ti)
Definition xmlgen.cpp:1693
static void generateXMLForConcept(const ConceptDef *cd, TextStream &ti)
Definition xmlgen.cpp:1647
static void writeExports(const ImportInfoMap &exportMap, TextStream &t)
Definition xmlgen.cpp:1394
static void writeInnerFiles(const FileList &fl, TextStream &t)
Definition xmlgen.cpp:1416
static void generateXMLForMember(const MemberDef *md, TextStream &ti, TextStream &t, const Definition *def)
Definition xmlgen.cpp:670
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:369
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:1280
static void writeInnerClasses(const ClassLinkedRefMap &cl, TextStream &t)
Definition xmlgen.cpp:1344
static void writeInnerNamespaces(const NamespaceLinkedRefMap &nl, TextStream &t)
Definition xmlgen.cpp:1381
static void generateXMLForDir(DirDef *dd, TextStream &ti)
Definition xmlgen.cpp:2005
static void generateXMLForPage(PageDef *pd, TextStream &ti, bool isExample)
Definition xmlgen.cpp:2043
static QCString extractNoExcept(QCString &argsStr)
Definition xmlgen.cpp:626
static void writeCombineScript()
Definition xmlgen.cpp:134