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) };
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
586// Removes a keyword from a given string
587// @param str string from which to strip the keyword
588// @param needSpace true if spacing is required around the keyword
589// @return true if the keyword was removed, false otherwise
590static bool stripKeyword(QCString& str, const char *keyword, bool needSpace)
591{
592 bool found = false;
593 int searchStart = 0;
594 int len = static_cast<int>(strlen(keyword));
595 int searchEnd = static_cast<int>(str.size());
596 while (searchStart<searchEnd)
597 {
598 int index = str.find(keyword, searchStart);
599 if (index==-1)
600 {
601 break; // no more occurrences found
602 }
603 int end = index + len;
604 if (needSpace)
605 {
606 if ((index>0 && str[index-1]!=' ') || // at the start of the string or preceded by a space, or
607 (end!=searchEnd && str[end] !=' ') // at the end of the string or followed by a space.
608 )
609 {
610 searchStart = end;
611 continue; // no a standalone word
612 }
613 }
614 if (needSpace && index>0) // strip with space before keyword
615 {
616 str.remove(index-1, len+1);
617 searchEnd -= (len+1);
618 }
619 else if (needSpace && end<searchEnd) // strip with space after string starting with keyword
620 {
621 str.remove(index, len+1);
622 searchEnd -= (len+1);
623 }
624 else // strip just keyword
625 {
626 str.remove(index, len);
627 searchEnd -= len;
628 }
629 found = true;
630 }
631 return found;
632}
633
635{
636 QCString expr;
637 //printf("extractNoExcept(%s)\n",qPrint(argsStr));
638 int i = argsStr.find("noexcept(");
639 if (i!=-1)
640 {
641 int bracketCount = 1;
642 size_t p = i+9;
643 bool found = false;
644 bool insideString = false;
645 bool insideChar = false;
646 char pc = 0;
647 while (!found && p<argsStr.length())
648 {
649 char c = argsStr[p++];
650 if (insideString)
651 {
652 if (c=='"' && pc!='\\') insideString=false;
653 }
654 else if (insideChar)
655 {
656 if (c=='\'' && pc!='\\') insideChar=false;
657 }
658 else
659 {
660 switch (c)
661 {
662 case '(': bracketCount++; break;
663 case ')': bracketCount--; found = bracketCount==0; break;
664 case '"': insideString = true; break;
665 case '\'': insideChar = true; break;
666 }
667 }
668 pc = c;
669 }
670 expr = argsStr.mid(i+9,p-i-10);
671 argsStr = (argsStr.left(i) + argsStr.mid(p)).stripWhiteSpace();
672 }
673 //printf("extractNoExcept -> argsStr='%s', expr='%s'\n",qPrint(argsStr),qPrint(expr));
674 return expr;
675}
676
677
678static void generateXMLForMember(const MemberDef *md,TextStream &ti,TextStream &t,const Definition *def)
679{
680
681 // + declaration/definition arg lists
682 // + reimplements
683 // + reimplementedBy
684 // + exceptions
685 // + const/volatile specifiers
686 // - examples
687 // + source definition
688 // + source references
689 // + source referenced by
690 // - body code
691 // + template arguments
692 // (templateArguments(), definitionTemplateParameterLists())
693 // - call graph
694
695 // enum values are written as part of the enum
696 if (md->memberType()==MemberType::EnumValue) return;
697 if (md->isHidden()) return;
698
699 // group members are only visible in their group
700 bool groupMember = md->getGroupDef() && def->definitionType()!=Definition::TypeGroup;
701
702 QCString memType;
703 bool isFunc=FALSE;
704 switch (md->memberType())
705 {
706 case MemberType::Define: memType="define"; break;
707 case MemberType::Function: memType="function"; isFunc=TRUE; break;
708 case MemberType::Variable: memType="variable"; break;
709 case MemberType::Typedef: memType="typedef"; break;
710 case MemberType::Enumeration: memType="enum"; break;
711 case MemberType::EnumValue: ASSERT(0); break;
712 case MemberType::Signal: memType="signal"; isFunc=TRUE; break;
713 case MemberType::Slot: memType="slot"; isFunc=TRUE; break;
714 case MemberType::Friend: memType="friend"; isFunc=TRUE; break;
715 case MemberType::DCOP: memType="dcop"; isFunc=TRUE; break;
716 case MemberType::Property: memType="property"; break;
717 case MemberType::Event: memType="event"; break;
718 case MemberType::Interface: memType="interface"; break;
719 case MemberType::Service: memType="service"; break;
720 case MemberType::Sequence: memType="sequence"; break;
721 case MemberType::Dictionary: memType="dictionary"; break;
722 }
723
724 QCString nameStr = md->name();
725 QCString typeStr = md->typeString();
726 QCString argsStr = md->argsString();
727 QCString defStr = md->definition();
728 defStr.stripPrefix("constexpr ");
729 defStr.stripPrefix("consteval ");
730 defStr.stripPrefix("constinit ");
731 stripAnonymousMarkers(typeStr);
732 stripQualifiers(typeStr);
733 if (typeStr=="auto")
734 {
735 int i=argsStr.findRev("->");
736 if (i!=-1) // move trailing return type into type and strip it from argsStr
737 {
738 typeStr=argsStr.mid(i+2).stripWhiteSpace();
739 argsStr=argsStr.left(i).stripWhiteSpace();
740 if (stripKeyword(typeStr, "override", true))
741 {
742 argsStr += " override";
743 }
744 if (stripKeyword(typeStr, "final", true))
745 {
746 argsStr += " final";
747 }
748 if (stripKeyword(typeStr, "=0", false))
749 {
750 argsStr += "=0";
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->isInitonly())
900 {
901 t << " initonly=\"yes\"";
902 }
903 if (md->isAttribute())
904 {
905 t << " attribute=\"yes\"";
906 }
907 if (md->isUNOProperty())
908 {
909 t << " property=\"yes\"";
910 }
911 if (md->isReadonly())
912 {
913 t << " readonly=\"yes\"";
914 }
915 if (md->isBound())
916 {
917 t << " bound=\"yes\"";
918 }
919 if (md->isRemovable())
920 {
921 t << " removable=\"yes\"";
922 }
923 if (md->isConstrained())
924 {
925 t << " constrained=\"yes\"";
926 }
927 if (md->isTransient())
928 {
929 t << " transient=\"yes\"";
930 }
931 if (md->isMaybeVoid())
932 {
933 t << " maybevoid=\"yes\"";
934 }
935 if (md->isMaybeDefault())
936 {
937 t << " maybedefault=\"yes\"";
938 }
939 if (md->isMaybeAmbiguous())
940 {
941 t << " maybeambiguous=\"yes\"";
942 }
943 }
944 else if (md->memberType() == MemberType::Property)
945 {
946 t << " readable=\"";
947 if (md->isReadable()) t << "yes"; else t << "no";
948 t << "\"";
949
950 t << " writable=\"";
951 if (md->isWritable()) t << "yes"; else t << "no";
952 t << "\"";
953
954 t << " gettable=\"";
955 if (md->isGettable()) t << "yes"; else t << "no";
956 t << "\"";
957
958 t << " privategettable=\"";
959 if (md->isPrivateGettable()) t << "yes"; else t << "no";
960 t << "\"";
961
962 t << " protectedgettable=\"";
963 if (md->isProtectedGettable()) t << "yes"; else t << "no";
964 t << "\"";
965
966 t << " settable=\"";
967 if (md->isSettable()) t << "yes"; else t << "no";
968 t << "\"";
969
970 t << " privatesettable=\"";
971 if (md->isPrivateSettable()) t << "yes"; else t << "no";
972 t << "\"";
973
974 t << " protectedsettable=\"";
975 if (md->isProtectedSettable()) t << "yes"; else t << "no";
976 t << "\"";
977
978 if (md->isAssign() || md->isCopy() || md->isRetain() || md->isStrong() || md->isWeak())
979 {
980 t << " accessor=\"";
981 if (md->isAssign()) t << "assign";
982 else if (md->isCopy()) t << "copy";
983 else if (md->isRetain()) t << "retain";
984 else if (md->isStrong()) t << "strong";
985 else if (md->isWeak()) t << "weak";
986 t << "\"";
987 }
988 }
989 else if (md->memberType() == MemberType::Event)
990 {
991 t << " add=\"";
992 if (md->isAddable()) t << "yes"; else t << "no";
993 t << "\"";
994
995 t << " remove=\"";
996 if (md->isRemovable()) t << "yes"; else t << "no";
997 t << "\"";
998
999 t << " raise=\"";
1000 if (md->isRaisable()) t << "yes"; else t << "no";
1001 t << "\"";
1002 }
1003
1004 t << ">\n";
1005
1006 if (md->memberType()!=MemberType::Define &&
1008 )
1009 {
1011 t << " <type>";
1012 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,typeStr);
1013 t << "</type>\n";
1014 if (md->isTypeAlias())
1015 {
1016 defStr+=" = "+md->initializer();
1017 }
1018 stripAnonymousMarkers(defStr);
1019 t << " <definition>" << convertToXML(defStr) << "</definition>\n";
1020 t << " <argsstring>" << convertToXML(argsStr) << "</argsstring>\n";
1021 }
1022
1024 {
1025 t << " <type>";
1027 t << "</type>\n";
1028 }
1029
1030 QCString qualifiedNameStr = md->qualifiedName();
1031 stripAnonymousMarkers(qualifiedNameStr);
1032 t << " <name>" << convertToXML(nameStr) << "</name>\n";
1033 if (nameStr!=qualifiedNameStr)
1034 {
1035 t << " <qualifiedname>" << convertToXML(qualifiedNameStr) << "</qualifiedname>\n";
1036 }
1037
1038 if (md->memberType() == MemberType::Property)
1039 {
1040 if (md->isReadable())
1041 t << " <read>" << convertToXML(md->getReadAccessor()) << "</read>\n";
1042 if (md->isWritable())
1043 t << " <write>" << convertToXML(md->getWriteAccessor()) << "</write>\n";
1044 }
1045
1047 {
1048 QCString bitfield = md->bitfieldString();
1049 if (bitfield.at(0)==':') bitfield=bitfield.mid(1);
1050 t << " <bitfield>" << convertToXML(bitfield) << "</bitfield>\n";
1051 }
1052
1053 const MemberDef *rmd = md->reimplements();
1054 if (rmd)
1055 {
1056 t << " <reimplements refid=\""
1057 << memberOutputFileBase(rmd) << "_1" << rmd->anchor() << "\">"
1058 << convertToXML(rmd->name()) << "</reimplements>\n";
1059 }
1060 for (const auto &rbmd : md->reimplementedBy())
1061 {
1062 t << " <reimplementedby refid=\""
1063 << memberOutputFileBase(rbmd) << "_1" << rbmd->anchor() << "\">"
1064 << convertToXML(rbmd->name()) << "</reimplementedby>\n";
1065 }
1066
1067 for (const auto &qmd : md->getQualifiers())
1068 {
1069 t << " <qualifier>" << convertToXML(qmd.c_str()) << "</qualifier>\n";
1070 }
1071
1072 if (md->isFriendClass()) // for friend classes we show a link to the class as a "parameter"
1073 {
1074 t << " <param>\n";
1075 t << " <type>";
1076 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,nameStr);
1077 t << "</type>\n";
1078 t << " </param>\n";
1079 }
1080 else if (isFunc) //function
1081 {
1082 const ArgumentList &declAl = md->declArgumentList();
1083 const ArgumentList &defAl = md->argumentList();
1084 bool isFortran = md->getLanguage()==SrcLangExt::Fortran;
1085 if (declAl.hasParameters())
1086 {
1087 auto defIt = defAl.begin();
1088 for (const Argument &a : declAl)
1089 {
1090 //const Argument *defArg = defAli.current();
1091 const Argument *defArg = nullptr;
1092 if (defIt!=defAl.end())
1093 {
1094 defArg = &(*defIt);
1095 ++defIt;
1096 }
1097 t << " <param>\n";
1098 if (!a.attrib.isEmpty())
1099 {
1100 t << " <attributes>";
1101 writeXMLString(t,a.attrib);
1102 t << "</attributes>\n";
1103 }
1104 if (isFortran && defArg && !defArg->type.isEmpty())
1105 {
1106 t << " <type>";
1107 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,defArg->type);
1108 t << "</type>\n";
1109 }
1110 else if (!a.type.isEmpty())
1111 {
1112 t << " <type>";
1113 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,a.type);
1114 t << "</type>\n";
1115 }
1116 if (!a.name.isEmpty())
1117 {
1118 t << " <declname>";
1119 writeXMLString(t,a.name);
1120 t << "</declname>\n";
1121 }
1122 if (defArg && !defArg->name.isEmpty() && defArg->name!=a.name)
1123 {
1124 t << " <defname>";
1125 writeXMLString(t,defArg->name);
1126 t << "</defname>\n";
1127 }
1128 if (!a.array.isEmpty())
1129 {
1130 t << " <array>";
1131 writeXMLString(t,a.array);
1132 t << "</array>\n";
1133 }
1134 if (!a.defval.isEmpty())
1135 {
1136 t << " <defval>";
1137 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,a.defval);
1138 t << "</defval>\n";
1139 }
1140 if (defArg && defArg->hasDocumentation())
1141 {
1142 t << " <briefdescription>";
1144 md->getOuterScope(),md,defArg->docs);
1145 t << "</briefdescription>\n";
1146 }
1147 t << " </param>\n";
1148 }
1149 }
1150 }
1151 else if (md->memberType()==MemberType::Define &&
1152 !md->argsString().isEmpty()) // define
1153 {
1154 if (md->argumentList().empty()) // special case for "foo()" to
1155 // distinguish it from "foo".
1156 {
1157 t << " <param></param>\n";
1158 }
1159 else
1160 {
1161 for (const Argument &a : md->argumentList())
1162 {
1163 t << " <param><defname>" << a.type << "</defname></param>\n";
1164 }
1165 }
1166 }
1167 if (!md->requiresClause().isEmpty())
1168 {
1169 t << " <requiresclause>";
1171 t << " </requiresclause>\n";
1172 }
1173
1174 if (!md->isTypeAlias() && (md->hasOneLineInitializer() || md->hasMultiLineInitializer()))
1175 {
1176 t << " <initializer>";
1178 t << "</initializer>\n";
1179 }
1180
1181 if (!md->excpString().isEmpty())
1182 {
1183 t << " <exceptions>";
1185 t << "</exceptions>\n";
1186 }
1187
1188 if (md->memberType()==MemberType::Enumeration) // enum
1189 {
1190 for (const auto &emd : md->enumFieldList())
1191 {
1192 ti << " <member refid=\"" << memberOutputFileBase(md)
1193 << "_1" << emd->anchor() << "\" kind=\"enumvalue\"><name>"
1194 << convertToXML(emd->name()) << "</name></member>\n";
1195
1196 t << " <enumvalue id=\"" << memberOutputFileBase(md) << "_1"
1197 << emd->anchor() << "\" prot=\"" << to_string_lower(emd->protection());
1198 t << "\">\n";
1199 t << " <name>";
1200 writeXMLString(t,emd->name());
1201 t << "</name>\n";
1202 if (!emd->initializer().isEmpty())
1203 {
1204 t << " <initializer>";
1205 writeXMLString(t,emd->initializer());
1206 t << "</initializer>\n";
1207 }
1208 t << " <briefdescription>\n";
1209 writeXMLDocBlock(t,emd->briefFile(),emd->briefLine(),emd->getOuterScope(),emd,emd->briefDescription());
1210 t << " </briefdescription>\n";
1211 t << " <detaileddescription>\n";
1212 writeXMLDocBlock(t,emd->docFile(),emd->docLine(),emd->getOuterScope(),emd,emd->documentation());
1213 t << " </detaileddescription>\n";
1214 t << " </enumvalue>\n";
1215 }
1216 }
1217 t << " <briefdescription>\n";
1219 t << " </briefdescription>\n";
1220 t << " <detaileddescription>\n";
1221 writeXMLDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation());
1222 t << " </detaileddescription>\n";
1223 t << " <inbodydescription>\n";
1225 t << " </inbodydescription>\n";
1226 if (md->getDefLine()!=-1)
1227 {
1228 t << " <location file=\""
1229 << convertToXML(stripFromPath(md->getDefFileName())) << "\" line=\""
1230 << md->getDefLine() << "\" column=\""
1231 << md->getDefColumn() << "\"" ;
1232 if (md->getStartBodyLine()!=-1)
1233 {
1234 const FileDef *bodyDef = md->getBodyDef();
1235 if (bodyDef)
1236 {
1237 t << " bodyfile=\"" << convertToXML(stripFromPath(bodyDef->absFilePath())) << "\"";
1238 }
1239 t << " bodystart=\"" << md->getStartBodyLine() << "\" bodyend=\""
1240 << md->getEndBodyLine() << "\"";
1241 }
1242 if (md->getDeclLine()!=-1)
1243 {
1244 t << " declfile=\"" << convertToXML(stripFromPath(md->getDeclFileName())) << "\" declline=\""
1245 << md->getDeclLine() << "\" declcolumn=\""
1246 << md->getDeclColumn() << "\"";
1247 }
1248 t << "/>\n";
1249 }
1250
1251 //printf("md->getReferencesMembers()=%p\n",md->getReferencesMembers());
1252 auto refList = md->getReferencesMembers();
1253 for (const auto &refmd : refList)
1254 {
1255 writeMemberReference(t,def,refmd,"references");
1256 }
1257 auto refByList = md->getReferencedByMembers();
1258 for (const auto &refmd : refByList)
1259 {
1260 writeMemberReference(t,def,refmd,"referencedby");
1261 }
1262
1263 t << " </memberdef>\n";
1264}
1265
1266// namespace members are also inserted in the file scope, but
1267// to prevent this duplication in the XML output, we optionally filter those here.
1268static bool memberVisible(const Definition *d,const MemberDef *md)
1269{
1270 return Config_getBool(XML_NS_MEMB_FILE_SCOPE) ||
1272 md->getNamespaceDef()==nullptr;
1273}
1274
1276 const MemberList *ml,const QCString &kind,const QCString &header=QCString(),
1277 const QCString &documentation=QCString())
1278{
1279 if (ml==nullptr) return;
1280 int count=0;
1281 for (const auto &md : *ml)
1282 {
1283 if (memberVisible(d,md) && (md->memberType()!=MemberType::EnumValue) &&
1284 !md->isHidden())
1285 {
1286 count++;
1287 }
1288 }
1289 if (count==0) return; // empty list
1290
1291 t << " <sectiondef kind=\"" << kind << "\">\n";
1292 if (!header.isEmpty())
1293 {
1294 t << " <header>" << convertToXML(header) << "</header>\n";
1295 }
1296 if (!documentation.isEmpty())
1297 {
1298 t << " <description>";
1299 writeXMLDocBlock(t,d->docFile(),d->docLine(),d,nullptr,documentation);
1300 t << "</description>\n";
1301 }
1302 for (const auto &md : *ml)
1303 {
1304 if (memberVisible(d,md))
1305 {
1306 generateXMLForMember(md,ti,t,d);
1307 }
1308 }
1309 t << " </sectiondef>\n";
1310}
1311
1313{
1314 t << " <listofallmembers>\n";
1315 for (auto &mni : cd->memberNameInfoLinkedMap())
1316 {
1317 for (auto &mi : *mni)
1318 {
1319 const MemberDef *md=mi->memberDef();
1320 if (!md->isAnonymous())
1321 {
1322 Protection prot = mi->prot();
1323 Specifier virt=md->virtualness();
1324 t << " <member refid=\"" << memberOutputFileBase(md) << "_1" <<
1325 md->anchor() << "\" prot=\"" << to_string_lower(prot);
1326 t << "\" virt=\"" << to_string_lower(virt) << "\"";
1327 if (!mi->ambiguityResolutionScope().isEmpty())
1328 {
1329 t << " ambiguityscope=\"" << convertToXML(mi->ambiguityResolutionScope()) << "\"";
1330 }
1331 t << "><scope>" << convertToXML(cd->name()) << "</scope><name>" <<
1332 convertToXML(md->name()) << "</name></member>\n";
1333 }
1334 }
1335 }
1336 t << " </listofallmembers>\n";
1337}
1338
1340{
1341 for (const auto &cd : cl)
1342 {
1343 if (!cd->isHidden() && !cd->isAnonymous())
1344 {
1345 t << " <innerclass refid=\"" << classOutputFileBase(cd)
1346 << "\" prot=\"" << to_string_lower(cd->protection());
1347 t << "\">" << convertToXML(cd->name()) << "</innerclass>\n";
1348 }
1349 }
1350}
1351
1353{
1354 for (const auto &cd : cl)
1355 {
1356 if (cd->isHidden())
1357 {
1358 t << " <innerconcept refid=\"" << cd->getOutputFileBase()
1359 << "\">" << convertToXML(cd->name()) << "</innerconcept>\n";
1360 }
1361 }
1362}
1363
1365{
1366 for (const auto &mod : ml)
1367 {
1368 if (mod->isHidden())
1369 {
1370 t << " <innermodule refid=\"" << mod->getOutputFileBase()
1371 << "\">" << convertToXML(mod->name()) << "</innermodule>\n";
1372 }
1373 }
1374}
1375
1377{
1378 for (const auto &nd : nl)
1379 {
1380 if (!nd->isHidden() && !nd->isAnonymous())
1381 {
1382 t << " <innernamespace refid=\"" << nd->getOutputFileBase()
1383 << "\"" << (nd->isInline() ? " inline=\"yes\"" : "")
1384 << ">" << convertToXML(nd->name()) << "</innernamespace>\n";
1385 }
1386 }
1387}
1388
1389static void writeExports(const ImportInfoMap &exportMap,TextStream &t)
1390{
1391 if (exportMap.empty()) return;
1392 t << " <exports>\n";
1393 for (const auto &[moduleName,importInfoList] : exportMap)
1394 {
1395 for (const auto &importInfo : importInfoList)
1396 {
1397 t << " <export";
1398 ModuleDef *mod = ModuleManager::instance().getPrimaryInterface(importInfo.importName);
1399 if (mod && mod->isLinkableInProject())
1400 {
1401 t << " refid=\"" << mod->getOutputFileBase() << "\"";
1402 }
1403 t << ">";
1404 t << importInfo.importName;
1405 t << "</export>\n";
1406 }
1407 }
1408 t << " </exports>\n";
1409}
1410
1411static void writeInnerFiles(const FileList &fl,TextStream &t)
1412{
1413 for (const auto &fd : fl)
1414 {
1415 t << " <innerfile refid=\"" << fd->getOutputFileBase()
1416 << "\">" << convertToXML(fd->name()) << "</innerfile>\n";
1417 }
1418}
1419
1421{
1422 for (const auto &pd : pl)
1423 {
1424 t << " <innerpage refid=\"" << pd->getOutputFileBase();
1425 if (pd->getGroupDef())
1426 {
1427 t << "_" << pd->name();
1428 }
1429 t << "\">" << convertToXML(pd->title()) << "</innerpage>\n";
1430 }
1431}
1432
1433static void writeInnerGroups(const GroupList &gl,TextStream &t)
1434{
1435 for (const auto &sgd : gl)
1436 {
1437 t << " <innergroup refid=\"" << sgd->getOutputFileBase()
1438 << "\">" << convertToXML(sgd->groupTitle())
1439 << "</innergroup>\n";
1440 }
1441}
1442
1443static void writeInnerDirs(const DirList *dl,TextStream &t)
1444{
1445 if (dl)
1446 {
1447 for(const auto subdir : *dl)
1448 {
1449 t << " <innerdir refid=\"" << subdir->getOutputFileBase()
1450 << "\">" << convertToXML(subdir->displayName()) << "</innerdir>\n";
1451 }
1452 }
1453}
1454
1455static void writeIncludeInfo(const IncludeInfo *ii,TextStream &t)
1456{
1457 if (ii)
1458 {
1459 QCString nm = ii->includeName;
1460 if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName();
1461 if (!nm.isEmpty())
1462 {
1463 t << " <includes";
1464 if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references
1465 {
1466 t << " refid=\"" << ii->fileDef->getOutputFileBase() << "\"";
1467 }
1468 t << " local=\"" << ((ii->kind & IncludeKind_LocalMask) ? "yes" : "no") << "\">";
1469 t << nm;
1470 t << "</includes>\n";
1471 }
1472 }
1473}
1474
1475static void generateXMLForClass(const ClassDef *cd,TextStream &ti)
1476{
1477 // + brief description
1478 // + detailed description
1479 // + template argument list(s)
1480 // - include file
1481 // + member groups
1482 // + inheritance diagram
1483 // + list of direct super classes
1484 // + list of direct sub classes
1485 // + list of inner classes
1486 // + collaboration diagram
1487 // + list of all members
1488 // + user defined member sections
1489 // + standard member sections
1490 // + detailed member documentation
1491 // - examples using the class
1492
1493 if (cd->isReference()) return; // skip external references.
1494 if (cd->isHidden()) return; // skip hidden classes.
1495 if (cd->isAnonymous()) return; // skip anonymous compounds.
1496 if (cd->isImplicitTemplateInstance()) return; // skip generated template instances.
1497 if (cd->isArtificial()) return; // skip artificially created classes
1498
1499 msg("Generating XML output for class {}\n",cd->name());
1500
1501 ti << " <compound refid=\"" << classOutputFileBase(cd)
1502 << "\" kind=\"" << cd->compoundTypeString()
1503 << "\"><name>" << convertToXML(cd->name()) << "</name>\n";
1504
1505 QCString outputDirectory = Config_getString(XML_OUTPUT);
1506 QCString fileName=outputDirectory+"/"+ classOutputFileBase(cd)+".xml";
1507 std::ofstream f = Portable::openOutputStream(fileName);
1508 if (!f.is_open())
1509 {
1510 err("Cannot open file {} for writing!\n",fileName);
1511 return;
1512 }
1513 TextStream t(&f);
1514
1515 writeXMLHeader(t);
1516 t << " <compounddef id=\""
1517 << classOutputFileBase(cd) << "\" kind=\""
1518 << cd->compoundTypeString() << "\" language=\""
1519 << langToString(cd->getLanguage()) << "\" prot=\"";
1520 t << to_string_lower(cd->protection());
1521 if (cd->isFinal()) t << "\" final=\"yes";
1522 if (cd->isSealed()) t << "\" sealed=\"yes";
1523 if (cd->isAbstract()) t << "\" abstract=\"yes";
1524 t << "\">\n";
1525 t << " <compoundname>";
1526 QCString nameStr = cd->name();
1527 stripAnonymousMarkers(nameStr);
1528 writeXMLString(t,nameStr);
1529 t << "</compoundname>\n";
1530 for (const auto &bcd : cd->baseClasses())
1531 {
1532 t << " <basecompoundref ";
1533 if (bcd.classDef->isLinkable())
1534 {
1535 t << "refid=\"" << classOutputFileBase(bcd.classDef) << "\" ";
1536 }
1537 if (bcd.prot == Protection::Package) ASSERT(0);
1538 t << "prot=\"";
1539 t << to_string_lower(bcd.prot);
1540 t << "\" virt=\"";
1541 t << to_string_lower(bcd.virt);
1542 t << "\">";
1543 if (!bcd.templSpecifiers.isEmpty())
1544 {
1545 t << convertToXML(
1547 bcd.classDef->name(),bcd.templSpecifiers)
1548 );
1549 }
1550 else
1551 {
1552 t << convertToXML(bcd.classDef->displayName());
1553 }
1554 t << "</basecompoundref>\n";
1555 }
1556 for (const auto &bcd : cd->subClasses())
1557 {
1558 if (bcd.prot == Protection::Package) ASSERT(0);
1559 t << " <derivedcompoundref refid=\""
1560 << classOutputFileBase(bcd.classDef)
1561 << "\" prot=\"";
1562 t << to_string_lower(bcd.prot);
1563 t << "\" virt=\"";
1564 t << to_string_lower(bcd.virt);
1565 t << "\">" << convertToXML(bcd.classDef->displayName())
1566 << "</derivedcompoundref>\n";
1567 }
1568
1570
1572
1573 writeTemplateList(cd,t);
1574 for (const auto &mg : cd->getMemberGroups())
1575 {
1576 generateXMLSection(cd,ti,t,&mg->members(),"user-defined",mg->header(),
1577 mg->documentation());
1578 }
1579
1580 for (const auto &ml : cd->getMemberLists())
1581 {
1582 if (!ml->listType().isDetailed())
1583 {
1584 generateXMLSection(cd,ti,t,ml.get(),ml->listType().toXML());
1585 }
1586 }
1587
1588 if (!cd->requiresClause().isEmpty())
1589 {
1590 t << " <requiresclause>";
1591 linkifyText(TextGeneratorXMLImpl(t),cd,cd->getFileDef(),nullptr,cd->requiresClause());
1592 t << " </requiresclause>\n";
1593 }
1594
1595 for (const auto &qcd : cd->getQualifiers())
1596 {
1597 t << " <qualifier>" << convertToXML(qcd.c_str()) << "</qualifier>\n";
1598 }
1599
1600 t << " <briefdescription>\n";
1601 writeXMLDocBlock(t,cd->briefFile(),cd->briefLine(),cd,nullptr,cd->briefDescription());
1602 t << " </briefdescription>\n";
1603 t << " <detaileddescription>\n";
1604 writeXMLDocBlock(t,cd->docFile(),cd->docLine(),cd,nullptr,cd->documentation());
1605 t << " </detaileddescription>\n";
1606 DotClassGraph inheritanceGraph(cd,GraphType::Inheritance);
1607 if (!inheritanceGraph.isTrivial())
1608 {
1609 t << " <inheritancegraph>\n";
1610 inheritanceGraph.writeXML(t);
1611 t << " </inheritancegraph>\n";
1612 }
1613 DotClassGraph collaborationGraph(cd,GraphType::Collaboration);
1614 if (!collaborationGraph.isTrivial())
1615 {
1616 t << " <collaborationgraph>\n";
1617 collaborationGraph.writeXML(t);
1618 t << " </collaborationgraph>\n";
1619 }
1620 t << " <location file=\""
1621 << convertToXML(stripFromPath(cd->getDefFileName())) << "\" line=\""
1622 << cd->getDefLine() << "\"" << " column=\""
1623 << cd->getDefColumn() << "\"" ;
1624 if (cd->getStartBodyLine()!=-1)
1625 {
1626 const FileDef *bodyDef = cd->getBodyDef();
1627 if (bodyDef)
1628 {
1629 t << " bodyfile=\"" << convertToXML(stripFromPath(bodyDef->absFilePath())) << "\"";
1630 }
1631 t << " bodystart=\"" << cd->getStartBodyLine() << "\" bodyend=\""
1632 << cd->getEndBodyLine() << "\"";
1633 }
1634 t << "/>\n";
1636 t << " </compounddef>\n";
1637 t << "</doxygen>\n";
1638
1639 ti << " </compound>\n";
1640}
1641
1643{
1644 if (cd->isReference() || cd->isHidden()) return; // skip external references.
1645
1646 ti << " <compound refid=\"" << cd->getOutputFileBase()
1647 << "\" kind=\"concept\"" << "><name>"
1648 << convertToXML(cd->name()) << "</name>\n";
1649
1650 QCString outputDirectory = Config_getString(XML_OUTPUT);
1651 QCString fileName=outputDirectory+"/"+cd->getOutputFileBase()+".xml";
1652 std::ofstream f = Portable::openOutputStream(fileName);
1653 if (!f.is_open())
1654 {
1655 err("Cannot open file {} for writing!\n",fileName);
1656 return;
1657 }
1658 TextStream t(&f);
1659 writeXMLHeader(t);
1660 t << " <compounddef id=\"" << cd->getOutputFileBase()
1661 << "\" kind=\"concept\">\n";
1662 t << " <compoundname>";
1663 QCString nameStr = cd->name();
1664 stripAnonymousMarkers(nameStr);
1665 writeXMLString(t,nameStr);
1666 t << "</compoundname>\n";
1668 writeTemplateList(cd,t);
1669 t << " <initializer>";
1670 linkifyText(TextGeneratorXMLImpl(t),cd,cd->getFileDef(),nullptr,cd->initializer());
1671 t << " </initializer>\n";
1672 t << " <briefdescription>\n";
1673 writeXMLDocBlock(t,cd->briefFile(),cd->briefLine(),cd,nullptr,cd->briefDescription());
1674 t << " </briefdescription>\n";
1675 t << " <detaileddescription>\n";
1676 writeXMLDocBlock(t,cd->docFile(),cd->docLine(),cd,nullptr,cd->documentation());
1677 t << " </detaileddescription>\n";
1678 t << " <location file=\""
1679 << convertToXML(stripFromPath(cd->getDefFileName())) << "\" line=\""
1680 << cd->getDefLine() << "\"" << " column=\""
1681 << cd->getDefColumn() << "\"/>\n" ;
1682 t << " </compounddef>\n";
1683 t << "</doxygen>\n";
1684
1685 ti << " </compound>\n";
1686}
1687
1688static void generateXMLForModule(const ModuleDef *mod,TextStream &ti)
1689{
1690 if (mod->isReference() || mod->isHidden() || !mod->isPrimaryInterface()) return;
1691 ti << " <compound refid=\"" << mod->getOutputFileBase()
1692 << "\" kind=\"module\"" << "><name>"
1693 << convertToXML(mod->name()) << "</name>\n";
1694
1695 QCString outputDirectory = Config_getString(XML_OUTPUT);
1696 QCString fileName=outputDirectory+"/"+mod->getOutputFileBase()+".xml";
1697 std::ofstream f = Portable::openOutputStream(fileName);
1698 if (!f.is_open())
1699 {
1700 err("Cannot open file {} for writing!\n",fileName);
1701 return;
1702 }
1703 TextStream t(&f);
1704 writeXMLHeader(t);
1705 t << " <compounddef id=\"" << mod->getOutputFileBase()
1706 << "\" kind=\"module\">\n";
1707 t << " <compoundname>";
1708 writeXMLString(t,mod->name());
1709 t << "</compoundname>\n";
1710 writeInnerFiles(mod->getUsedFiles(),t);
1711 writeInnerClasses(mod->getClasses(),t);
1713 for (const auto &ml : mod->getMemberLists())
1714 {
1715 if (ml->listType().isDeclaration())
1716 {
1717 generateXMLSection(mod,ti,t,ml.get(),ml->listType().toXML());
1718 }
1719 }
1720 for (const auto &mg : mod->getMemberGroups())
1721 {
1722 generateXMLSection(mod,ti,t,&mg->members(),"user-defined",mg->header(),
1723 mg->documentation());
1724 }
1725 t << " <briefdescription>\n";
1726 writeXMLDocBlock(t,mod->briefFile(),mod->briefLine(),mod,nullptr,mod->briefDescription());
1727 t << " </briefdescription>\n";
1728 t << " <detaileddescription>\n";
1729 writeXMLDocBlock(t,mod->docFile(),mod->docLine(),mod,nullptr,mod->documentation());
1730 t << " </detaileddescription>\n";
1731 writeExports(mod->getExports(),t);
1732 t << " <location file=\""
1733 << convertToXML(stripFromPath(mod->getDefFileName())) << "\" line=\""
1734 << mod->getDefLine() << "\"" << " column=\""
1735 << mod->getDefColumn() << "\"/>\n" ;
1736 t << " </compounddef>\n";
1737 t << "</doxygen>\n";
1738
1739 ti << " </compound>\n";
1740
1741}
1742
1744{
1745 // + contained class definitions
1746 // + contained namespace definitions
1747 // + member groups
1748 // + normal members
1749 // + brief desc
1750 // + detailed desc
1751 // + location
1752 // - files containing (parts of) the namespace definition
1753
1754 if (nd->isReference() || nd->isHidden()) return; // skip external references
1755
1756 ti << " <compound refid=\"" << nd->getOutputFileBase()
1757 << "\" kind=\"namespace\"" << "><name>"
1758 << convertToXML(nd->name()) << "</name>\n";
1759
1760 QCString outputDirectory = Config_getString(XML_OUTPUT);
1761 QCString fileName=outputDirectory+"/"+nd->getOutputFileBase()+".xml";
1762 std::ofstream f = Portable::openOutputStream(fileName);
1763 if (!f.is_open())
1764 {
1765 err("Cannot open file {} for writing!\n",fileName);
1766 return;
1767 }
1768 TextStream t(&f);
1769
1770 writeXMLHeader(t);
1771 t << " <compounddef id=\"" << nd->getOutputFileBase()
1772 << "\" kind=\"namespace\" "
1773 << (nd->isInline()?"inline=\"yes\" ":"")
1774 << "language=\""
1775 << langToString(nd->getLanguage()) << "\">\n";
1776 t << " <compoundname>";
1777 QCString nameStr = nd->name();
1778 stripAnonymousMarkers(nameStr);
1779 writeXMLString(t,nameStr);
1780 t << "</compoundname>\n";
1781
1785
1786 for (const auto &mg : nd->getMemberGroups())
1787 {
1788 generateXMLSection(nd,ti,t,&mg->members(),"user-defined",mg->header(),
1789 mg->documentation());
1790 }
1791
1792 for (const auto &ml : nd->getMemberLists())
1793 {
1794 if (ml->listType().isDeclaration())
1795 {
1796 generateXMLSection(nd,ti,t,ml.get(),ml->listType().toXML());
1797 }
1798 }
1799
1800 t << " <briefdescription>\n";
1801 writeXMLDocBlock(t,nd->briefFile(),nd->briefLine(),nd,nullptr,nd->briefDescription());
1802 t << " </briefdescription>\n";
1803 t << " <detaileddescription>\n";
1804 writeXMLDocBlock(t,nd->docFile(),nd->docLine(),nd,nullptr,nd->documentation());
1805 t << " </detaileddescription>\n";
1806 t << " <location file=\""
1807 << convertToXML(stripFromPath(nd->getDefFileName())) << "\" line=\""
1808 << nd->getDefLine() << "\"" << " column=\""
1809 << nd->getDefColumn() << "\"/>\n" ;
1810 t << " </compounddef>\n";
1811 t << "</doxygen>\n";
1812
1813 ti << " </compound>\n";
1814}
1815
1817{
1818 // + includes files
1819 // + includedby files
1820 // + include graph
1821 // + included by graph
1822 // + contained class definitions
1823 // + contained namespace definitions
1824 // + member groups
1825 // + normal members
1826 // + brief desc
1827 // + detailed desc
1828 // + source code
1829 // + location
1830 // - number of lines
1831
1832 if (fd->isReference()) return; // skip external references
1833
1834 ti << " <compound refid=\"" << fd->getOutputFileBase()
1835 << "\" kind=\"file\"><name>" << convertToXML(fd->name())
1836 << "</name>\n";
1837
1838 QCString outputDirectory = Config_getString(XML_OUTPUT);
1839 QCString fileName=outputDirectory+"/"+fd->getOutputFileBase()+".xml";
1840 std::ofstream f = Portable::openOutputStream(fileName);
1841 if (!f.is_open())
1842 {
1843 err("Cannot open file {} for writing!\n",fileName);
1844 return;
1845 }
1846 TextStream t(&f);
1847
1848 writeXMLHeader(t);
1849 t << " <compounddef id=\"" << fd->getOutputFileBase()
1850 << "\" kind=\"file\" language=\""
1851 << langToString(fd->getLanguage()) << "\">\n";
1852 t << " <compoundname>";
1853 writeXMLString(t,fd->name());
1854 t << "</compoundname>\n";
1855
1856 for (const auto &inc : fd->includeFileList())
1857 {
1858 t << " <includes";
1859 if (inc.fileDef && !inc.fileDef->isReference()) // TODO: support external references
1860 {
1861 t << " refid=\"" << inc.fileDef->getOutputFileBase() << "\"";
1862 }
1863 t << " local=\"" << ((inc.kind & IncludeKind_LocalMask) ? "yes" : "no") << "\">";
1864 t << convertToXML(inc.includeName);
1865 t << "</includes>\n";
1866 }
1867
1868 for (const auto &inc : fd->includedByFileList())
1869 {
1870 t << " <includedby";
1871 if (inc.fileDef && !inc.fileDef->isReference()) // TODO: support external references
1872 {
1873 t << " refid=\"" << inc.fileDef->getOutputFileBase() << "\"";
1874 }
1875 t << " local=\"" << ((inc.kind &IncludeKind_LocalMask) ? "yes" : "no") << "\">";
1876 t << convertToXML(inc.includeName);
1877 t << "</includedby>\n";
1878 }
1879
1880 DotInclDepGraph incDepGraph(fd,FALSE);
1881 if (!incDepGraph.isTrivial())
1882 {
1883 t << " <incdepgraph>\n";
1884 incDepGraph.writeXML(t);
1885 t << " </incdepgraph>\n";
1886 }
1887
1888 DotInclDepGraph invIncDepGraph(fd,TRUE);
1889 if (!invIncDepGraph.isTrivial())
1890 {
1891 t << " <invincdepgraph>\n";
1892 invIncDepGraph.writeXML(t);
1893 t << " </invincdepgraph>\n";
1894 }
1895
1899
1900 for (const auto &mg : fd->getMemberGroups())
1901 {
1902 generateXMLSection(fd,ti,t,&mg->members(),"user-defined",mg->header(),
1903 mg->documentation());
1904 }
1905
1906 for (const auto &ml : fd->getMemberLists())
1907 {
1908 if (ml->listType().isDeclaration())
1909 {
1910 generateXMLSection(fd,ti,t,ml.get(),ml->listType().toXML());
1911 }
1912 }
1913
1914 t << " <briefdescription>\n";
1915 writeXMLDocBlock(t,fd->briefFile(),fd->briefLine(),fd,nullptr,fd->briefDescription());
1916 t << " </briefdescription>\n";
1917 t << " <detaileddescription>\n";
1918 writeXMLDocBlock(t,fd->docFile(),fd->docLine(),fd,nullptr,fd->documentation());
1919 t << " </detaileddescription>\n";
1920 if (Config_getBool(XML_PROGRAMLISTING))
1921 {
1922 writeXMLCodeBlock(t,fd);
1923 }
1924 t << " <location file=\"" << convertToXML(stripFromPath(fd->getDefFileName())) << "\"/>\n";
1925 t << " </compounddef>\n";
1926 t << "</doxygen>\n";
1927
1928 ti << " </compound>\n";
1929}
1930
1931static void generateXMLForGroup(const GroupDef *gd,TextStream &ti)
1932{
1933 // + members
1934 // + member groups
1935 // + files
1936 // + classes
1937 // + namespaces
1938 // - packages
1939 // + pages
1940 // + child groups
1941 // - examples
1942 // + brief description
1943 // + detailed description
1944
1945 if (gd->isReference()) return; // skip external references
1946
1947 ti << " <compound refid=\"" << gd->getOutputFileBase()
1948 << "\" kind=\"group\"><name>" << convertToXML(gd->name()) << "</name>\n";
1949
1950 QCString outputDirectory = Config_getString(XML_OUTPUT);
1951 QCString fileName=outputDirectory+"/"+gd->getOutputFileBase()+".xml";
1952 std::ofstream f = Portable::openOutputStream(fileName);
1953 if (!f.is_open())
1954 {
1955 err("Cannot open file {} for writing!\n",fileName);
1956 return;
1957 }
1958 TextStream t(&f);
1959
1960 writeXMLHeader(t);
1961 t << " <compounddef id=\""
1962 << gd->getOutputFileBase() << "\" kind=\"group\">\n";
1963 t << " <compoundname>" << convertToXML(gd->name()) << "</compoundname>\n";
1964 t << " <title>" << convertToXML(gd->groupTitle()) << "</title>\n";
1965
1967 writeInnerFiles(gd->getFiles(),t);
1971 writeInnerPages(gd->getPages(),t);
1973
1974 for (const auto &mg : gd->getMemberGroups())
1975 {
1976 generateXMLSection(gd,ti,t,&mg->members(),"user-defined",mg->header(),
1977 mg->documentation());
1978 }
1979
1980 for (const auto &ml : gd->getMemberLists())
1981 {
1982 if (ml->listType().isDeclaration())
1983 {
1984 generateXMLSection(gd,ti,t,ml.get(),ml->listType().toXML());
1985 }
1986 }
1987
1988 t << " <briefdescription>\n";
1989 writeXMLDocBlock(t,gd->briefFile(),gd->briefLine(),gd,nullptr,gd->briefDescription());
1990 t << " </briefdescription>\n";
1991 t << " <detaileddescription>\n";
1992 writeXMLDocBlock(t,gd->docFile(),gd->docLine(),gd,nullptr,gd->documentation());
1993 t << " </detaileddescription>\n";
1994 t << " </compounddef>\n";
1995 t << "</doxygen>\n";
1996
1997 ti << " </compound>\n";
1998}
1999
2001{
2002 if (dd->isReference()) return; // skip external references
2003 ti << " <compound refid=\"" << dd->getOutputFileBase()
2004 << "\" kind=\"dir\"><name>" << convertToXML(dd->displayName())
2005 << "</name>\n";
2006
2007 QCString outputDirectory = Config_getString(XML_OUTPUT);
2008 QCString fileName=outputDirectory+"/"+dd->getOutputFileBase()+".xml";
2009 std::ofstream f = Portable::openOutputStream(fileName);
2010 if (!f.is_open())
2011 {
2012 err("Cannot open file {} for writing!\n",fileName);
2013 return;
2014 }
2015 TextStream t(&f);
2016
2017 writeXMLHeader(t);
2018 t << " <compounddef id=\""
2019 << dd->getOutputFileBase() << "\" kind=\"dir\">\n";
2020 t << " <compoundname>" << convertToXML(dd->displayName()) << "</compoundname>\n";
2021
2022 writeInnerDirs(&dd->subDirs(),t);
2023 writeInnerFiles(dd->getFiles(),t);
2024
2025 t << " <briefdescription>\n";
2026 writeXMLDocBlock(t,dd->briefFile(),dd->briefLine(),dd,nullptr,dd->briefDescription());
2027 t << " </briefdescription>\n";
2028 t << " <detaileddescription>\n";
2029 writeXMLDocBlock(t,dd->docFile(),dd->docLine(),dd,nullptr,dd->documentation());
2030 t << " </detaileddescription>\n";
2031 t << " <location file=\"" << convertToXML(stripFromPath(dd->name())) << "\"/>\n";
2032 t << " </compounddef>\n";
2033 t << "</doxygen>\n";
2034
2035 ti << " </compound>\n";
2036}
2037
2038static void generateXMLForPage(PageDef *pd,TextStream &ti,bool isExample)
2039{
2040 // + name
2041 // + title
2042 // + documentation
2043 // + location
2044
2045 const char *kindName = isExample ? "example" : "page";
2046
2047 if (pd->isReference()) return;
2048
2049 QCString pageName = pd->getOutputFileBase();
2050 if (pd->getGroupDef())
2051 {
2052 pageName+=QCString("_")+pd->name();
2053 }
2054 if (pageName=="index") pageName="indexpage"; // to prevent overwriting the generated index page.
2055
2056 ti << " <compound refid=\"" << pageName
2057 << "\" kind=\"" << kindName << "\"><name>" << convertToXML(pd->name())
2058 << "</name>\n";
2059
2060 QCString outputDirectory = Config_getString(XML_OUTPUT);
2061 QCString fileName=outputDirectory+"/"+pageName+".xml";
2062 std::ofstream f = Portable::openOutputStream(fileName);
2063 if (!f.is_open())
2064 {
2065 err("Cannot open file {} for writing!\n",fileName);
2066 return;
2067 }
2068 TextStream t(&f);
2069
2070 writeXMLHeader(t);
2071 t << " <compounddef id=\"" << pageName;
2072 t << "\" kind=\"" << kindName << "\">\n";
2073 t << " <compoundname>" << convertToXML(pd->name())
2074 << "</compoundname>\n";
2075
2076 if (pd==Doxygen::mainPage.get()) // main page is special
2077 {
2078 QCString title;
2079 if (mainPageHasTitle())
2080 {
2082 }
2083 else
2084 {
2085 title = Config_getString(PROJECT_NAME);
2086 }
2087 t << " <title>" << convertToXML(convertCharEntitiesToUTF8(title))
2088 << "</title>\n";
2089 }
2090 else
2091 {
2092 const SectionInfo *si = SectionManager::instance().find(pd->name());
2093 if (si)
2094 {
2095 t << " <title>" << convertToXML(filterTitle(convertCharEntitiesToUTF8(si->title())))
2096 << "</title>\n";
2097 }
2098 }
2100 const SectionRefs &sectionRefs = pd->getSectionRefs();
2101 if (pd->localToc().isXmlEnabled() && !sectionRefs.empty())
2102 {
2103 int level=1;
2104 int indent=0;
2105 auto writeIndent = [&]() { for (int i=0;i<4+indent*2;i++) t << " "; };
2106 auto incIndent = [&](const char *text) { writeIndent(); t << text << "\n"; indent++; };
2107 auto decIndent = [&](const char *text) { indent--; writeIndent(); t << text << "\n"; };
2108 incIndent("<tableofcontents>");
2109 int maxLevel = pd->localToc().xmlLevel();
2110 BoolVector inLi(maxLevel+1,false);
2111 for (const SectionInfo *si : sectionRefs)
2112 {
2113 if (si->type().isSection())
2114 {
2115 //printf(" level=%d title=%s\n",level,qPrint(si->title));
2116 int nextLevel = si->type().level();
2117 if (nextLevel>level)
2118 {
2119 for (int l=level;l<nextLevel;l++)
2120 {
2121 if (l < maxLevel) incIndent("<tableofcontents>");
2122 }
2123 }
2124 else if (nextLevel<level)
2125 {
2126 for (int l=level;l>nextLevel;l--)
2127 {
2128 if (l <= maxLevel && inLi[l]) decIndent("</tocsect>");
2129 inLi[l]=false;
2130 if (l <= maxLevel) decIndent("</tableofcontents>");
2131 }
2132 }
2133 if (nextLevel <= maxLevel)
2134 {
2135 if (inLi[nextLevel])
2136 {
2137 decIndent("</tocsect>");
2138 }
2139 else if (level>nextLevel)
2140 {
2141 decIndent("</tableofcontents>");
2142 incIndent("<tableofcontents>");
2143 }
2144 QCString titleDoc = convertToXML(si->title());
2145 QCString label = convertToXML(si->label());
2146 if (titleDoc.isEmpty()) titleDoc = label;
2147 incIndent("<tocsect>");
2148 writeIndent(); t << "<name>" << titleDoc << "</name>\n"; // kept for backwards compatibility
2149 writeIndent(); t << "<docs>";
2150 if (!si->title().isEmpty())
2151 {
2152 writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,nullptr,si->title());
2153 }
2154 t << "</docs>\n";
2155 writeIndent(); t << "<reference>" << convertToXML(pageName) << "_1" << label << "</reference>\n";
2156 inLi[nextLevel]=true;
2157 level = nextLevel;
2158 }
2159 }
2160 }
2161 while (level>1 && level <= maxLevel)
2162 {
2163 if (inLi[level]) decIndent("</tocsect>");
2164 inLi[level]=false;
2165 decIndent("</tableofcontents>");
2166 level--;
2167 }
2168 if (level <= maxLevel && inLi[level]) decIndent("</tocsect>");
2169 inLi[level]=false;
2170 decIndent("</tableofcontents>");
2171 }
2172 t << " <briefdescription>\n";
2173 writeXMLDocBlock(t,pd->briefFile(),pd->briefLine(),pd,nullptr,pd->briefDescription());
2174 t << " </briefdescription>\n";
2175 t << " <detaileddescription>\n";
2176 if (isExample)
2177 {
2178 writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,nullptr,
2179 pd->documentation()+"\n\\include "+pd->name());
2180 }
2181 else
2182 {
2183 writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,nullptr,
2184 pd->documentation());
2185 }
2186 t << " </detaileddescription>\n";
2187
2188 t << " <location file=\"" << convertToXML(stripFromPath(pd->getDefFileName())) << "\"/>\n";
2189
2190 t << " </compounddef>\n";
2191 t << "</doxygen>\n";
2192
2193 ti << " </compound>\n";
2194}
2195
2197{
2198 // + classes
2199 // + concepts
2200 // + namespaces
2201 // + files
2202 // + groups
2203 // + related pages
2204 // - examples
2205
2206 QCString outputDirectory = Config_getString(XML_OUTPUT);
2207 Dir xmlDir(outputDirectory.str());
2208 createSubDirs(xmlDir);
2209
2210 ResourceMgr::instance().copyResource("xml.xsd",outputDirectory);
2211 ResourceMgr::instance().copyResource("index.xsd",outputDirectory);
2212
2213 QCString fileName=outputDirectory+"/compound.xsd";
2214 std::ofstream f = Portable::openOutputStream(fileName);
2215 if (!f.is_open())
2216 {
2217 err("Cannot open file {} for writing!\n",fileName);
2218 return;
2219 }
2220 {
2221 TextStream t(&f);
2222
2223 // write compound.xsd, but replace special marker with the entities
2224 QCString compound_xsd = ResourceMgr::instance().getAsString("compound.xsd");
2225 const char *startLine = compound_xsd.data();
2226 while (*startLine)
2227 {
2228 // find end of the line
2229 const char *endLine = startLine+1;
2230 while (*endLine && *(endLine-1)!='\n') endLine++; // skip to end of the line including \n
2231 int len=static_cast<int>(endLine-startLine);
2232 if (len>0)
2233 {
2234 QCString s(startLine,len);
2235 if (s.find("<!-- Automatically insert here the HTML entities -->")!=-1)
2236 {
2238 }
2239 else
2240 {
2241 t.write(startLine,len);
2242 }
2243 }
2244 startLine=endLine;
2245 }
2246 }
2247 f.close();
2248
2249 fileName=outputDirectory+"/doxyfile.xsd";
2250 f = Portable::openOutputStream(fileName);
2251 if (!f.is_open())
2252 {
2253 err("Cannot open file {} for writing!\n",fileName);
2254 return;
2255 }
2256 {
2257 TextStream t(&f);
2258
2259 // write doxyfile.xsd, but replace special marker with the entities
2260 QCString doxyfile_xsd = ResourceMgr::instance().getAsString("doxyfile.xsd");
2261 const char *startLine = doxyfile_xsd.data();
2262 while (*startLine)
2263 {
2264 // find end of the line
2265 const char *endLine = startLine+1;
2266 while (*endLine && *(endLine-1)!='\n') endLine++; // skip to end of the line including \n
2267 int len=static_cast<int>(endLine-startLine);
2268 if (len>0)
2269 {
2270 QCString s(startLine,len);
2271 if (s.find("<!-- Automatically insert here the configuration settings -->")!=-1)
2272 {
2274 }
2275 else
2276 {
2277 t.write(startLine,len);
2278 }
2279 }
2280 startLine=endLine;
2281 }
2282 }
2283 f.close();
2284
2285 fileName=outputDirectory+"/Doxyfile.xml";
2286 f = Portable::openOutputStream(fileName);
2287 if (!f.is_open())
2288 {
2289 err("Cannot open file {} for writing\n",fileName);
2290 return;
2291 }
2292 else
2293 {
2294 TextStream t(&f);
2296 }
2297 f.close();
2298
2299 fileName=outputDirectory+"/index.xml";
2300 f = Portable::openOutputStream(fileName);
2301 if (!f.is_open())
2302 {
2303 err("Cannot open file {} for writing!\n",fileName);
2304 return;
2305 }
2306 else
2307 {
2308 TextStream t(&f);
2309
2310 // write index header
2311 t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n";
2312 t << "<doxygenindex xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
2313 t << "xsi:noNamespaceSchemaLocation=\"index.xsd\" ";
2314 t << "version=\"" << getDoxygenVersion() << "\" ";
2315 t << "xml:lang=\"" << theTranslator->trISOLang() << "\"";
2316 t << ">\n";
2317
2318 for (const auto &cd : *Doxygen::classLinkedMap)
2319 {
2320 generateXMLForClass(cd.get(),t);
2321 }
2322 for (const auto &cd : *Doxygen::conceptLinkedMap)
2323 {
2324 msg("Generating XML output for concept {}\n",cd->displayName());
2325 generateXMLForConcept(cd.get(),t);
2326 }
2327 for (const auto &nd : *Doxygen::namespaceLinkedMap)
2328 {
2329 msg("Generating XML output for namespace {}\n",nd->displayName());
2330 generateXMLForNamespace(nd.get(),t);
2331 }
2332 for (const auto &fn : *Doxygen::inputNameLinkedMap)
2333 {
2334 for (const auto &fd : *fn)
2335 {
2336 msg("Generating XML output for file {}\n",fd->name());
2337 generateXMLForFile(fd.get(),t);
2338 }
2339 }
2340 for (const auto &gd : *Doxygen::groupLinkedMap)
2341 {
2342 msg("Generating XML output for group {}\n",gd->name());
2343 generateXMLForGroup(gd.get(),t);
2344 }
2345 for (const auto &pd : *Doxygen::pageLinkedMap)
2346 {
2347 msg("Generating XML output for page {}\n",pd->name());
2348 generateXMLForPage(pd.get(),t,FALSE);
2349 }
2350 for (const auto &dd : *Doxygen::dirLinkedMap)
2351 {
2352 msg("Generate XML output for dir {}\n",dd->name());
2353 generateXMLForDir(dd.get(),t);
2354 }
2355 for (const auto &mod : ModuleManager::instance().modules())
2356 {
2357 msg("Generating XML output for module {}\n",mod->name());
2358 generateXMLForModule(mod.get(),t);
2359 }
2360 for (const auto &pd : *Doxygen::exampleLinkedMap)
2361 {
2362 msg("Generating XML output for example {}\n",pd->name());
2363 generateXMLForPage(pd.get(),t,TRUE);
2364 }
2366 {
2367 msg("Generating XML output for the main page\n");
2369 }
2370
2371 //t << " </compoundlist>\n";
2372 t << "</doxygenindex>\n";
2373 }
2374
2376 clearSubDirs(xmlDir);
2377}
2378
2379
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: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:617
int xmlLevel() const
Definition types.h:622
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:383
constexpr const char * toXML() const
Definition types.h:414
constexpr bool isDeclaration() const
Definition types.h:384
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 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
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
QCString & remove(size_t index, size_t len)
Definition qcstring.h:427
void resize(size_t newlen)
Definition qcstring.h:167
const std::string & str() const
Definition qcstring.h:537
size_t size() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:156
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: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: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
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, bool indexWords, bool isExample, const QCString &exampleName, bool singleLine, bool linkFromIndex, bool markdownSupport, bool autolinkSupport)
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: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: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 const char * to_string_lower(Protection prot)
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:7391
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5718
bool mainPageHasTitle()
Definition util.cpp:6795
QCString insertTemplateSpecifierInScope(const QCString &scope, const QCString &templ)
Definition util.cpp:4259
void clearSubDirs(const Dir &d)
Definition util.cpp:4180
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
Definition util.cpp:1442
QCString filterTitle(const QCString &title)
Definition util.cpp:6127
void createSubDirs(const Dir &d)
Definition util.cpp:4153
static QCString stripFromPath(const QCString &p, const StringVector &l)
Definition util.cpp:310
QCString convertToXML(const QCString &s, bool keepEntities)
Definition util.cpp:4425
QCString langToString(SrcLangExt lang)
Returns a string representation of lang.
Definition util.cpp:6404
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
Definition util.cpp:6410
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:905
QCString convertCharEntitiesToUTF8(const QCString &str)
Definition util.cpp:4557
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:1931
void generateXML()
Definition xmlgen.cpp:2196
static void writeInnerConcepts(const ConceptLinkedRefMap &cl, TextStream &t)
Definition xmlgen.cpp:1352
static void writeInnerGroups(const GroupList &gl, TextStream &t)
Definition xmlgen.cpp:1433
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:1443
static void writeListOfAllMembers(const ClassDef *cd, TextStream &t)
Definition xmlgen.cpp:1312
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:1475
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:1816
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 stripKeyword(QCString &str, const char *keyword, bool needSpace)
Definition xmlgen.cpp:590
static bool memberVisible(const Definition *d, const MemberDef *md)
Definition xmlgen.cpp:1268
static void writeIncludeInfo(const IncludeInfo *ii, TextStream &t)
Definition xmlgen.cpp:1455
static void stripQualifiers(QCString &typeStr)
Definition xmlgen.cpp:551
static void writeInnerPages(const PageLinkedRefMap &pl, TextStream &t)
Definition xmlgen.cpp:1420
static void generateXMLForNamespace(const NamespaceDef *nd, TextStream &ti)
Definition xmlgen.cpp:1743
static void writeXMLHeader(TextStream &t)
Definition xmlgen.cpp:124
static void writeInnerModules(const ModuleLinkedRefMap &ml, TextStream &t)
Definition xmlgen.cpp:1364
static void generateXMLForModule(const ModuleDef *mod, TextStream &ti)
Definition xmlgen.cpp:1688
static void generateXMLForConcept(const ConceptDef *cd, TextStream &ti)
Definition xmlgen.cpp:1642
static void writeExports(const ImportInfoMap &exportMap, TextStream &t)
Definition xmlgen.cpp:1389
static void writeInnerFiles(const FileList &fl, TextStream &t)
Definition xmlgen.cpp:1411
static void generateXMLForMember(const MemberDef *md, TextStream &ti, TextStream &t, const Definition *def)
Definition xmlgen.cpp:678
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:1275
static void writeInnerClasses(const ClassLinkedRefMap &cl, TextStream &t)
Definition xmlgen.cpp:1339
static void writeInnerNamespaces(const NamespaceLinkedRefMap &nl, TextStream &t)
Definition xmlgen.cpp:1376
static void generateXMLForDir(DirDef *dd, TextStream &ti)
Definition xmlgen.cpp:2000
static void generateXMLForPage(PageDef *pd, TextStream &ti, bool isExample)
Definition xmlgen.cpp:2038
static QCString extractNoExcept(QCString &argsStr)
Definition xmlgen.cpp:634
static void writeCombineScript()
Definition xmlgen.cpp:134