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 if (stripKeyword(typeStr, "=default", false))
753 {
754 argsStr += "=default";
755 }
756 if (stripKeyword(typeStr, "=delete", false))
757 {
758 argsStr += "=delete";
759 }
760 i=defStr.find("auto ");
761 if (i!=-1)
762 {
763 defStr=defStr.left(i)+typeStr+defStr.mid(i+4);
764 }
765 }
766 }
767 QCString noExceptExpr = extractNoExcept(argsStr);
768
769 stripAnonymousMarkers(nameStr);
770 ti << " <member refid=\"" << memberOutputFileBase(md)
771 << "_1" << md->anchor() << "\" kind=\"" << memType << "\"><name>"
772 << convertToXML(nameStr) << "</name></member>\n";
773
774 if (groupMember)
775 {
776 t << " <member refid=\""
778 << "_1" << md->anchor() << "\" kind=\"" << memType << "\"><name>"
779 << convertToXML(nameStr) << "</name></member>\n";
780 return;
781 }
782 else
783 {
784 t << " <memberdef kind=\"";
785 t << memType << "\" id=\"";
786 t << memberOutputFileBase(md);
787 t << "_1" // encoded ':' character (see util.cpp:convertNameToFile)
788 << md->anchor();
789 }
790 //enum { define_t,variable_t,typedef_t,enum_t,function_t } xmlType = function_t;
791
792 t << "\" prot=\"" << to_string_lower(md->protection());
793 t << "\"";
794
795 t << " static=\"";
796 if (md->isStatic()) t << "yes"; else t << "no";
797 t << "\"";
798
799 if (md->isNoDiscard())
800 {
801 t << " nodiscard=\"yes\"";
802 }
803
804 if (md->isConstExpr())
805 {
806 t << " constexpr=\"yes\"";
807 }
808
809 if (md->isConstEval())
810 {
811 t << " consteval=\"yes\"";
812 }
813
814 if (md->isConstInit())
815 {
816 t << " constinit=\"yes\"";
817 }
818
819 if (md->isExternal())
820 {
821 t << " extern=\"yes\"";
822 }
823
824 if (isFunc)
825 {
826 const ArgumentList &al = md->argumentList();
827 t << " const=\"";
828 if (al.constSpecifier()) t << "yes"; else t << "no";
829 t << "\"";
830
831 t << " explicit=\"";
832 if (md->isExplicit()) t << "yes"; else t << "no";
833 t << "\"";
834
835 t << " inline=\"";
836 if (md->isInline()) t << "yes"; else t << "no";
837 t << "\"";
838
840 {
841 t << " refqual=\"";
842 if (al.refQualifier()==RefQualifierType::LValue) t << "lvalue"; else t << "rvalue";
843 t << "\"";
844 }
845
846 if (md->isFinal())
847 {
848 t << " final=\"yes\"";
849 }
850
851 if (md->isSealed())
852 {
853 t << " sealed=\"yes\"";
854 }
855
856 if (md->isNew())
857 {
858 t << " new=\"yes\"";
859 }
860
861 if (md->isOptional())
862 {
863 t << " optional=\"yes\"";
864 }
865
866 if (md->isRequired())
867 {
868 t << " required=\"yes\"";
869 }
870
871 if (md->isNoExcept())
872 {
873 t << " noexcept=\"yes\"";
874 }
875
876 if (!noExceptExpr.isEmpty())
877 {
878 t << " noexceptexpression=\"" << convertToXML(noExceptExpr) << "\"";
879 }
880
881 if (al.volatileSpecifier())
882 {
883 t << " volatile=\"yes\"";
884 }
885
886 t << " virt=\"" << to_string_lower(md->virtualness());
887 t << "\"";
888 }
889
891 {
892 t << " strong=\"";
893 if (md->isStrong()) t << "yes"; else t << "no";
894 t << "\"";
895 }
896
897 if (md->memberType() == MemberType::Variable)
898 {
899 //ArgumentList *al = md->argumentList();
900 //t << " volatile=\"";
901 //if (al && al->volatileSpecifier) t << "yes"; else t << "no";
902
903 t << " mutable=\"";
904 if (md->isMutable()) t << "yes"; else t << "no";
905 t << "\"";
906
907 if (md->isInitonly())
908 {
909 t << " initonly=\"yes\"";
910 }
911 if (md->isAttribute())
912 {
913 t << " attribute=\"yes\"";
914 }
915 if (md->isUNOProperty())
916 {
917 t << " property=\"yes\"";
918 }
919 if (md->isReadonly())
920 {
921 t << " readonly=\"yes\"";
922 }
923 if (md->isBound())
924 {
925 t << " bound=\"yes\"";
926 }
927 if (md->isRemovable())
928 {
929 t << " removable=\"yes\"";
930 }
931 if (md->isConstrained())
932 {
933 t << " constrained=\"yes\"";
934 }
935 if (md->isTransient())
936 {
937 t << " transient=\"yes\"";
938 }
939 if (md->isMaybeVoid())
940 {
941 t << " maybevoid=\"yes\"";
942 }
943 if (md->isMaybeDefault())
944 {
945 t << " maybedefault=\"yes\"";
946 }
947 if (md->isMaybeAmbiguous())
948 {
949 t << " maybeambiguous=\"yes\"";
950 }
951 }
952 else if (md->memberType() == MemberType::Property)
953 {
954 t << " readable=\"";
955 if (md->isReadable()) t << "yes"; else t << "no";
956 t << "\"";
957
958 t << " writable=\"";
959 if (md->isWritable()) t << "yes"; else t << "no";
960 t << "\"";
961
962 t << " gettable=\"";
963 if (md->isGettable()) t << "yes"; else t << "no";
964 t << "\"";
965
966 t << " privategettable=\"";
967 if (md->isPrivateGettable()) t << "yes"; else t << "no";
968 t << "\"";
969
970 t << " protectedgettable=\"";
971 if (md->isProtectedGettable()) t << "yes"; else t << "no";
972 t << "\"";
973
974 t << " settable=\"";
975 if (md->isSettable()) t << "yes"; else t << "no";
976 t << "\"";
977
978 t << " privatesettable=\"";
979 if (md->isPrivateSettable()) t << "yes"; else t << "no";
980 t << "\"";
981
982 t << " protectedsettable=\"";
983 if (md->isProtectedSettable()) t << "yes"; else t << "no";
984 t << "\"";
985
986 if (md->isAssign() || md->isCopy() || md->isRetain() || md->isStrong() || md->isWeak())
987 {
988 t << " accessor=\"";
989 if (md->isAssign()) t << "assign";
990 else if (md->isCopy()) t << "copy";
991 else if (md->isRetain()) t << "retain";
992 else if (md->isStrong()) t << "strong";
993 else if (md->isWeak()) t << "weak";
994 t << "\"";
995 }
996 }
997 else if (md->memberType() == MemberType::Event)
998 {
999 t << " add=\"";
1000 if (md->isAddable()) t << "yes"; else t << "no";
1001 t << "\"";
1002
1003 t << " remove=\"";
1004 if (md->isRemovable()) t << "yes"; else t << "no";
1005 t << "\"";
1006
1007 t << " raise=\"";
1008 if (md->isRaisable()) t << "yes"; else t << "no";
1009 t << "\"";
1010 }
1011
1012 t << ">\n";
1013
1014 if (md->memberType()!=MemberType::Define &&
1016 )
1017 {
1019 t << " <type>";
1020 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,typeStr);
1021 t << "</type>\n";
1022 if (md->isTypeAlias())
1023 {
1024 defStr+=" = "+md->initializer();
1025 }
1026 stripAnonymousMarkers(defStr);
1027 t << " <definition>" << convertToXML(defStr) << "</definition>\n";
1028 t << " <argsstring>" << convertToXML(argsStr) << "</argsstring>\n";
1029 }
1030
1032 {
1033 t << " <type>";
1035 t << "</type>\n";
1036 }
1037
1038 QCString qualifiedNameStr = md->qualifiedName();
1039 stripAnonymousMarkers(qualifiedNameStr);
1040 t << " <name>" << convertToXML(nameStr) << "</name>\n";
1041 if (nameStr!=qualifiedNameStr)
1042 {
1043 t << " <qualifiedname>" << convertToXML(qualifiedNameStr) << "</qualifiedname>\n";
1044 }
1045
1046 if (md->memberType() == MemberType::Property)
1047 {
1048 if (md->isReadable())
1049 t << " <read>" << convertToXML(md->getReadAccessor()) << "</read>\n";
1050 if (md->isWritable())
1051 t << " <write>" << convertToXML(md->getWriteAccessor()) << "</write>\n";
1052 }
1053
1055 {
1056 QCString bitfield = md->bitfieldString();
1057 if (bitfield.at(0)==':') bitfield=bitfield.mid(1);
1058 t << " <bitfield>" << convertToXML(bitfield) << "</bitfield>\n";
1059 }
1060
1061 const MemberDef *rmd = md->reimplements();
1062 if (rmd)
1063 {
1064 t << " <reimplements refid=\""
1065 << memberOutputFileBase(rmd) << "_1" << rmd->anchor() << "\">"
1066 << convertToXML(rmd->name()) << "</reimplements>\n";
1067 }
1068 for (const auto &rbmd : md->reimplementedBy())
1069 {
1070 t << " <reimplementedby refid=\""
1071 << memberOutputFileBase(rbmd) << "_1" << rbmd->anchor() << "\">"
1072 << convertToXML(rbmd->name()) << "</reimplementedby>\n";
1073 }
1074
1075 for (const auto &qmd : md->getQualifiers())
1076 {
1077 t << " <qualifier>" << convertToXML(qmd.c_str()) << "</qualifier>\n";
1078 }
1079
1080 if (md->isFriendClass()) // for friend classes we show a link to the class as a "parameter"
1081 {
1082 t << " <param>\n";
1083 t << " <type>";
1084 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,nameStr);
1085 t << "</type>\n";
1086 t << " </param>\n";
1087 }
1088 else if (isFunc) //function
1089 {
1090 const ArgumentList &declAl = md->declArgumentList();
1091 const ArgumentList &defAl = md->argumentList();
1092 bool isFortran = md->getLanguage()==SrcLangExt::Fortran;
1093 if (declAl.hasParameters())
1094 {
1095 auto defIt = defAl.begin();
1096 for (const Argument &a : declAl)
1097 {
1098 //const Argument *defArg = defAli.current();
1099 const Argument *defArg = nullptr;
1100 if (defIt!=defAl.end())
1101 {
1102 defArg = &(*defIt);
1103 ++defIt;
1104 }
1105 t << " <param>\n";
1106 if (!a.attrib.isEmpty())
1107 {
1108 t << " <attributes>";
1109 writeXMLString(t,a.attrib);
1110 t << "</attributes>\n";
1111 }
1112 if (isFortran && defArg && !defArg->type.isEmpty())
1113 {
1114 t << " <type>";
1115 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,defArg->type);
1116 t << "</type>\n";
1117 }
1118 else if (!a.type.isEmpty())
1119 {
1120 t << " <type>";
1121 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,a.type);
1122 t << "</type>\n";
1123 }
1124 if (!a.name.isEmpty())
1125 {
1126 t << " <declname>";
1127 writeXMLString(t,a.name);
1128 t << "</declname>\n";
1129 }
1130 if (defArg && !defArg->name.isEmpty() && defArg->name!=a.name)
1131 {
1132 t << " <defname>";
1133 writeXMLString(t,defArg->name);
1134 t << "</defname>\n";
1135 }
1136 if (!a.array.isEmpty())
1137 {
1138 t << " <array>";
1139 writeXMLString(t,a.array);
1140 t << "</array>\n";
1141 }
1142 if (!a.defval.isEmpty())
1143 {
1144 t << " <defval>";
1145 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,a.defval);
1146 t << "</defval>\n";
1147 }
1148 if (defArg && defArg->hasDocumentation())
1149 {
1150 t << " <briefdescription>";
1152 md->getOuterScope(),md,defArg->docs);
1153 t << "</briefdescription>\n";
1154 }
1155 t << " </param>\n";
1156 }
1157 }
1158 }
1159 else if (md->memberType()==MemberType::Define &&
1160 !md->argsString().isEmpty()) // define
1161 {
1162 if (md->argumentList().empty()) // special case for "foo()" to
1163 // distinguish it from "foo".
1164 {
1165 t << " <param></param>\n";
1166 }
1167 else
1168 {
1169 for (const Argument &a : md->argumentList())
1170 {
1171 t << " <param><defname>" << a.type << "</defname></param>\n";
1172 }
1173 }
1174 }
1175 if (!md->requiresClause().isEmpty())
1176 {
1177 t << " <requiresclause>";
1179 t << " </requiresclause>\n";
1180 }
1181
1182 if (!md->isTypeAlias() && (md->hasOneLineInitializer() || md->hasMultiLineInitializer()))
1183 {
1184 t << " <initializer>";
1186 t << "</initializer>\n";
1187 }
1188
1189 if (!md->excpString().isEmpty())
1190 {
1191 t << " <exceptions>";
1193 t << "</exceptions>\n";
1194 }
1195
1196 if (md->memberType()==MemberType::Enumeration) // enum
1197 {
1198 for (const auto &emd : md->enumFieldList())
1199 {
1200 ti << " <member refid=\"" << memberOutputFileBase(md)
1201 << "_1" << emd->anchor() << "\" kind=\"enumvalue\"><name>"
1202 << convertToXML(emd->name()) << "</name></member>\n";
1203
1204 t << " <enumvalue id=\"" << memberOutputFileBase(md) << "_1"
1205 << emd->anchor() << "\" prot=\"" << to_string_lower(emd->protection());
1206 t << "\">\n";
1207 t << " <name>";
1208 writeXMLString(t,emd->name());
1209 t << "</name>\n";
1210 if (!emd->initializer().isEmpty())
1211 {
1212 t << " <initializer>";
1213 writeXMLString(t,emd->initializer());
1214 t << "</initializer>\n";
1215 }
1216 t << " <briefdescription>\n";
1217 writeXMLDocBlock(t,emd->briefFile(),emd->briefLine(),emd->getOuterScope(),emd,emd->briefDescription());
1218 t << " </briefdescription>\n";
1219 t << " <detaileddescription>\n";
1220 writeXMLDocBlock(t,emd->docFile(),emd->docLine(),emd->getOuterScope(),emd,emd->documentation());
1221 t << " </detaileddescription>\n";
1222 t << " </enumvalue>\n";
1223 }
1224 }
1225 t << " <briefdescription>\n";
1227 t << " </briefdescription>\n";
1228 t << " <detaileddescription>\n";
1229 writeXMLDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation());
1230 t << " </detaileddescription>\n";
1231 t << " <inbodydescription>\n";
1233 t << " </inbodydescription>\n";
1234 if (md->getDefLine()!=-1)
1235 {
1236 t << " <location file=\""
1237 << convertToXML(stripFromPath(md->getDefFileName())) << "\" line=\""
1238 << md->getDefLine() << "\" column=\""
1239 << md->getDefColumn() << "\"" ;
1240 if (md->getStartBodyLine()!=-1)
1241 {
1242 const FileDef *bodyDef = md->getBodyDef();
1243 if (bodyDef)
1244 {
1245 t << " bodyfile=\"" << convertToXML(stripFromPath(bodyDef->absFilePath())) << "\"";
1246 }
1247 t << " bodystart=\"" << md->getStartBodyLine() << "\" bodyend=\""
1248 << md->getEndBodyLine() << "\"";
1249 }
1250 if (md->getDeclLine()!=-1)
1251 {
1252 t << " declfile=\"" << convertToXML(stripFromPath(md->getDeclFileName())) << "\" declline=\""
1253 << md->getDeclLine() << "\" declcolumn=\""
1254 << md->getDeclColumn() << "\"";
1255 }
1256 t << "/>\n";
1257 }
1258
1259 //printf("md->getReferencesMembers()=%p\n",md->getReferencesMembers());
1260 auto refList = md->getReferencesMembers();
1261 for (const auto &refmd : refList)
1262 {
1263 writeMemberReference(t,def,refmd,"references");
1264 }
1265 auto refByList = md->getReferencedByMembers();
1266 for (const auto &refmd : refByList)
1267 {
1268 writeMemberReference(t,def,refmd,"referencedby");
1269 }
1270
1271 t << " </memberdef>\n";
1272}
1273
1274// namespace members are also inserted in the file scope, but
1275// to prevent this duplication in the XML output, we optionally filter those here.
1276static bool memberVisible(const Definition *d,const MemberDef *md)
1277{
1278 return Config_getBool(XML_NS_MEMB_FILE_SCOPE) ||
1280 md->getNamespaceDef()==nullptr;
1281}
1282
1284 const MemberList *ml,const QCString &kind,const QCString &header=QCString(),
1285 const QCString &documentation=QCString())
1286{
1287 if (ml==nullptr) return;
1288 int count=0;
1289 for (const auto &md : *ml)
1290 {
1291 if (memberVisible(d,md) && (md->memberType()!=MemberType::EnumValue) &&
1292 !md->isHidden())
1293 {
1294 count++;
1295 }
1296 }
1297 if (count==0) return; // empty list
1298
1299 t << " <sectiondef kind=\"" << kind << "\">\n";
1300 if (!header.isEmpty())
1301 {
1302 t << " <header>" << convertToXML(header) << "</header>\n";
1303 }
1304 if (!documentation.isEmpty())
1305 {
1306 t << " <description>";
1307 writeXMLDocBlock(t,d->docFile(),d->docLine(),d,nullptr,documentation);
1308 t << "</description>\n";
1309 }
1310 for (const auto &md : *ml)
1311 {
1312 if (memberVisible(d,md))
1313 {
1314 generateXMLForMember(md,ti,t,d);
1315 }
1316 }
1317 t << " </sectiondef>\n";
1318}
1319
1321{
1322 t << " <listofallmembers>\n";
1323 for (auto &mni : cd->memberNameInfoLinkedMap())
1324 {
1325 for (auto &mi : *mni)
1326 {
1327 const MemberDef *md=mi->memberDef();
1328 if (!md->isAnonymous())
1329 {
1330 Protection prot = mi->prot();
1331 Specifier virt=md->virtualness();
1332 t << " <member refid=\"" << memberOutputFileBase(md) << "_1" <<
1333 md->anchor() << "\" prot=\"" << to_string_lower(prot);
1334 t << "\" virt=\"" << to_string_lower(virt) << "\"";
1335 if (!mi->ambiguityResolutionScope().isEmpty())
1336 {
1337 t << " ambiguityscope=\"" << convertToXML(mi->ambiguityResolutionScope()) << "\"";
1338 }
1339 t << "><scope>" << convertToXML(cd->name()) << "</scope><name>" <<
1340 convertToXML(md->name()) << "</name></member>\n";
1341 }
1342 }
1343 }
1344 t << " </listofallmembers>\n";
1345}
1346
1348{
1349 for (const auto &cd : cl)
1350 {
1351 if (!cd->isHidden() && !cd->isAnonymous())
1352 {
1353 t << " <innerclass refid=\"" << classOutputFileBase(cd)
1354 << "\" prot=\"" << to_string_lower(cd->protection());
1355 t << "\">" << convertToXML(cd->name()) << "</innerclass>\n";
1356 }
1357 }
1358}
1359
1361{
1362 for (const auto &cd : cl)
1363 {
1364 if (cd->isHidden())
1365 {
1366 t << " <innerconcept refid=\"" << cd->getOutputFileBase()
1367 << "\">" << convertToXML(cd->name()) << "</innerconcept>\n";
1368 }
1369 }
1370}
1371
1373{
1374 for (const auto &mod : ml)
1375 {
1376 if (mod->isHidden())
1377 {
1378 t << " <innermodule refid=\"" << mod->getOutputFileBase()
1379 << "\">" << convertToXML(mod->name()) << "</innermodule>\n";
1380 }
1381 }
1382}
1383
1385{
1386 for (const auto &nd : nl)
1387 {
1388 if (!nd->isHidden() && !nd->isAnonymous())
1389 {
1390 t << " <innernamespace refid=\"" << nd->getOutputFileBase()
1391 << "\"" << (nd->isInline() ? " inline=\"yes\"" : "")
1392 << ">" << convertToXML(nd->name()) << "</innernamespace>\n";
1393 }
1394 }
1395}
1396
1397static void writeExports(const ImportInfoMap &exportMap,TextStream &t)
1398{
1399 if (exportMap.empty()) return;
1400 t << " <exports>\n";
1401 for (const auto &[moduleName,importInfoList] : exportMap)
1402 {
1403 for (const auto &importInfo : importInfoList)
1404 {
1405 t << " <export";
1406 ModuleDef *mod = ModuleManager::instance().getPrimaryInterface(importInfo.importName);
1407 if (mod && mod->isLinkableInProject())
1408 {
1409 t << " refid=\"" << mod->getOutputFileBase() << "\"";
1410 }
1411 t << ">";
1412 t << importInfo.importName;
1413 t << "</export>\n";
1414 }
1415 }
1416 t << " </exports>\n";
1417}
1418
1419static void writeInnerFiles(const FileList &fl,TextStream &t)
1420{
1421 for (const auto &fd : fl)
1422 {
1423 t << " <innerfile refid=\"" << fd->getOutputFileBase()
1424 << "\">" << convertToXML(fd->name()) << "</innerfile>\n";
1425 }
1426}
1427
1429{
1430 for (const auto &pd : pl)
1431 {
1432 t << " <innerpage refid=\"" << pd->getOutputFileBase();
1433 if (pd->getGroupDef())
1434 {
1435 t << "_" << pd->name();
1436 }
1437 t << "\">" << convertToXML(pd->title()) << "</innerpage>\n";
1438 }
1439}
1440
1441static void writeInnerGroups(const GroupList &gl,TextStream &t)
1442{
1443 for (const auto &sgd : gl)
1444 {
1445 t << " <innergroup refid=\"" << sgd->getOutputFileBase()
1446 << "\">" << convertToXML(sgd->groupTitle())
1447 << "</innergroup>\n";
1448 }
1449}
1450
1451static void writeInnerDirs(const DirList *dl,TextStream &t)
1452{
1453 if (dl)
1454 {
1455 for(const auto subdir : *dl)
1456 {
1457 t << " <innerdir refid=\"" << subdir->getOutputFileBase()
1458 << "\">" << convertToXML(subdir->displayName()) << "</innerdir>\n";
1459 }
1460 }
1461}
1462
1463static void writeIncludeInfo(const IncludeInfo *ii,TextStream &t)
1464{
1465 if (ii)
1466 {
1467 QCString nm = ii->includeName;
1468 if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName();
1469 if (!nm.isEmpty())
1470 {
1471 t << " <includes";
1472 if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references
1473 {
1474 t << " refid=\"" << ii->fileDef->getOutputFileBase() << "\"";
1475 }
1476 t << " local=\"" << ((ii->kind & IncludeKind_LocalMask) ? "yes" : "no") << "\">";
1477 t << nm;
1478 t << "</includes>\n";
1479 }
1480 }
1481}
1482
1483static void generateXMLForClass(const ClassDef *cd,TextStream &ti)
1484{
1485 // + brief description
1486 // + detailed description
1487 // + template argument list(s)
1488 // - include file
1489 // + member groups
1490 // + inheritance diagram
1491 // + list of direct super classes
1492 // + list of direct sub classes
1493 // + list of inner classes
1494 // + collaboration diagram
1495 // + list of all members
1496 // + user defined member sections
1497 // + standard member sections
1498 // + detailed member documentation
1499 // - examples using the class
1500
1501 if (cd->isReference()) return; // skip external references.
1502 if (cd->isHidden()) return; // skip hidden classes.
1503 if (cd->isAnonymous()) return; // skip anonymous compounds.
1504 if (cd->isImplicitTemplateInstance()) return; // skip generated template instances.
1505 if (cd->isArtificial()) return; // skip artificially created classes
1506
1507 msg("Generating XML output for class {}\n",cd->name());
1508
1509 ti << " <compound refid=\"" << classOutputFileBase(cd)
1510 << "\" kind=\"" << cd->compoundTypeString()
1511 << "\"><name>" << convertToXML(cd->name()) << "</name>\n";
1512
1513 QCString outputDirectory = Config_getString(XML_OUTPUT);
1514 QCString fileName=outputDirectory+"/"+ classOutputFileBase(cd)+".xml";
1515 std::ofstream f = Portable::openOutputStream(fileName);
1516 if (!f.is_open())
1517 {
1518 err("Cannot open file {} for writing!\n",fileName);
1519 return;
1520 }
1521 TextStream t(&f);
1522
1523 writeXMLHeader(t);
1524 t << " <compounddef id=\""
1525 << classOutputFileBase(cd) << "\" kind=\""
1526 << cd->compoundTypeString() << "\" language=\""
1527 << langToString(cd->getLanguage()) << "\" prot=\"";
1528 t << to_string_lower(cd->protection());
1529 if (cd->isFinal()) t << "\" final=\"yes";
1530 if (cd->isSealed()) t << "\" sealed=\"yes";
1531 if (cd->isAbstract()) t << "\" abstract=\"yes";
1532 t << "\">\n";
1533 t << " <compoundname>";
1534 QCString nameStr = cd->name();
1535 stripAnonymousMarkers(nameStr);
1536 writeXMLString(t,nameStr);
1537 t << "</compoundname>\n";
1538 for (const auto &bcd : cd->baseClasses())
1539 {
1540 t << " <basecompoundref ";
1541 if (bcd.classDef->isLinkable())
1542 {
1543 t << "refid=\"" << classOutputFileBase(bcd.classDef) << "\" ";
1544 }
1545 if (bcd.prot == Protection::Package) ASSERT(0);
1546 t << "prot=\"";
1547 t << to_string_lower(bcd.prot);
1548 t << "\" virt=\"";
1549 t << to_string_lower(bcd.virt);
1550 t << "\">";
1551 if (!bcd.templSpecifiers.isEmpty())
1552 {
1553 t << convertToXML(
1555 bcd.classDef->name(),bcd.templSpecifiers)
1556 );
1557 }
1558 else
1559 {
1560 t << convertToXML(bcd.classDef->displayName());
1561 }
1562 t << "</basecompoundref>\n";
1563 }
1564 for (const auto &bcd : cd->subClasses())
1565 {
1566 if (bcd.prot == Protection::Package) ASSERT(0);
1567 t << " <derivedcompoundref refid=\""
1568 << classOutputFileBase(bcd.classDef)
1569 << "\" prot=\"";
1570 t << to_string_lower(bcd.prot);
1571 t << "\" virt=\"";
1572 t << to_string_lower(bcd.virt);
1573 t << "\">" << convertToXML(bcd.classDef->displayName())
1574 << "</derivedcompoundref>\n";
1575 }
1576
1578
1580
1581 writeTemplateList(cd,t);
1582 for (const auto &mg : cd->getMemberGroups())
1583 {
1584 generateXMLSection(cd,ti,t,&mg->members(),"user-defined",mg->header(),
1585 mg->documentation());
1586 }
1587
1588 for (const auto &ml : cd->getMemberLists())
1589 {
1590 if (!ml->listType().isDetailed())
1591 {
1592 generateXMLSection(cd,ti,t,ml.get(),ml->listType().toXML());
1593 }
1594 }
1595
1596 if (!cd->requiresClause().isEmpty())
1597 {
1598 t << " <requiresclause>";
1599 linkifyText(TextGeneratorXMLImpl(t),cd,cd->getFileDef(),nullptr,cd->requiresClause());
1600 t << " </requiresclause>\n";
1601 }
1602
1603 for (const auto &qcd : cd->getQualifiers())
1604 {
1605 t << " <qualifier>" << convertToXML(qcd.c_str()) << "</qualifier>\n";
1606 }
1607
1608 t << " <briefdescription>\n";
1609 writeXMLDocBlock(t,cd->briefFile(),cd->briefLine(),cd,nullptr,cd->briefDescription());
1610 t << " </briefdescription>\n";
1611 t << " <detaileddescription>\n";
1612 writeXMLDocBlock(t,cd->docFile(),cd->docLine(),cd,nullptr,cd->documentation());
1613 t << " </detaileddescription>\n";
1614 DotClassGraph inheritanceGraph(cd,GraphType::Inheritance);
1615 if (!inheritanceGraph.isTrivial())
1616 {
1617 t << " <inheritancegraph>\n";
1618 inheritanceGraph.writeXML(t);
1619 t << " </inheritancegraph>\n";
1620 }
1621 DotClassGraph collaborationGraph(cd,GraphType::Collaboration);
1622 if (!collaborationGraph.isTrivial())
1623 {
1624 t << " <collaborationgraph>\n";
1625 collaborationGraph.writeXML(t);
1626 t << " </collaborationgraph>\n";
1627 }
1628 t << " <location file=\""
1629 << convertToXML(stripFromPath(cd->getDefFileName())) << "\" line=\""
1630 << cd->getDefLine() << "\"" << " column=\""
1631 << cd->getDefColumn() << "\"" ;
1632 if (cd->getStartBodyLine()!=-1)
1633 {
1634 const FileDef *bodyDef = cd->getBodyDef();
1635 if (bodyDef)
1636 {
1637 t << " bodyfile=\"" << convertToXML(stripFromPath(bodyDef->absFilePath())) << "\"";
1638 }
1639 t << " bodystart=\"" << cd->getStartBodyLine() << "\" bodyend=\""
1640 << cd->getEndBodyLine() << "\"";
1641 }
1642 t << "/>\n";
1644 t << " </compounddef>\n";
1645 t << "</doxygen>\n";
1646
1647 ti << " </compound>\n";
1648}
1649
1651{
1652 if (cd->isReference() || cd->isHidden()) return; // skip external references.
1653
1654 ti << " <compound refid=\"" << cd->getOutputFileBase()
1655 << "\" kind=\"concept\"" << "><name>"
1656 << convertToXML(cd->name()) << "</name>\n";
1657
1658 QCString outputDirectory = Config_getString(XML_OUTPUT);
1659 QCString fileName=outputDirectory+"/"+cd->getOutputFileBase()+".xml";
1660 std::ofstream f = Portable::openOutputStream(fileName);
1661 if (!f.is_open())
1662 {
1663 err("Cannot open file {} for writing!\n",fileName);
1664 return;
1665 }
1666 TextStream t(&f);
1667 writeXMLHeader(t);
1668 t << " <compounddef id=\"" << cd->getOutputFileBase()
1669 << "\" kind=\"concept\">\n";
1670 t << " <compoundname>";
1671 QCString nameStr = cd->name();
1672 stripAnonymousMarkers(nameStr);
1673 writeXMLString(t,nameStr);
1674 t << "</compoundname>\n";
1676 writeTemplateList(cd,t);
1677 t << " <initializer>";
1678 linkifyText(TextGeneratorXMLImpl(t),cd,cd->getFileDef(),nullptr,cd->initializer());
1679 t << " </initializer>\n";
1680 t << " <briefdescription>\n";
1681 writeXMLDocBlock(t,cd->briefFile(),cd->briefLine(),cd,nullptr,cd->briefDescription());
1682 t << " </briefdescription>\n";
1683 t << " <detaileddescription>\n";
1684 writeXMLDocBlock(t,cd->docFile(),cd->docLine(),cd,nullptr,cd->documentation());
1685 t << " </detaileddescription>\n";
1686 t << " <location file=\""
1687 << convertToXML(stripFromPath(cd->getDefFileName())) << "\" line=\""
1688 << cd->getDefLine() << "\"" << " column=\""
1689 << cd->getDefColumn() << "\"/>\n" ;
1690 t << " </compounddef>\n";
1691 t << "</doxygen>\n";
1692
1693 ti << " </compound>\n";
1694}
1695
1696static void generateXMLForModule(const ModuleDef *mod,TextStream &ti)
1697{
1698 if (mod->isReference() || mod->isHidden() || !mod->isPrimaryInterface()) return;
1699 ti << " <compound refid=\"" << mod->getOutputFileBase()
1700 << "\" kind=\"module\"" << "><name>"
1701 << convertToXML(mod->name()) << "</name>\n";
1702
1703 QCString outputDirectory = Config_getString(XML_OUTPUT);
1704 QCString fileName=outputDirectory+"/"+mod->getOutputFileBase()+".xml";
1705 std::ofstream f = Portable::openOutputStream(fileName);
1706 if (!f.is_open())
1707 {
1708 err("Cannot open file {} for writing!\n",fileName);
1709 return;
1710 }
1711 TextStream t(&f);
1712 writeXMLHeader(t);
1713 t << " <compounddef id=\"" << mod->getOutputFileBase()
1714 << "\" kind=\"module\">\n";
1715 t << " <compoundname>";
1716 writeXMLString(t,mod->name());
1717 t << "</compoundname>\n";
1718 writeInnerFiles(mod->getUsedFiles(),t);
1719 writeInnerClasses(mod->getClasses(),t);
1721 for (const auto &ml : mod->getMemberLists())
1722 {
1723 if (ml->listType().isDeclaration())
1724 {
1725 generateXMLSection(mod,ti,t,ml.get(),ml->listType().toXML());
1726 }
1727 }
1728 for (const auto &mg : mod->getMemberGroups())
1729 {
1730 generateXMLSection(mod,ti,t,&mg->members(),"user-defined",mg->header(),
1731 mg->documentation());
1732 }
1733 t << " <briefdescription>\n";
1734 writeXMLDocBlock(t,mod->briefFile(),mod->briefLine(),mod,nullptr,mod->briefDescription());
1735 t << " </briefdescription>\n";
1736 t << " <detaileddescription>\n";
1737 writeXMLDocBlock(t,mod->docFile(),mod->docLine(),mod,nullptr,mod->documentation());
1738 t << " </detaileddescription>\n";
1739 writeExports(mod->getExports(),t);
1740 t << " <location file=\""
1741 << convertToXML(stripFromPath(mod->getDefFileName())) << "\" line=\""
1742 << mod->getDefLine() << "\"" << " column=\""
1743 << mod->getDefColumn() << "\"/>\n" ;
1744 t << " </compounddef>\n";
1745 t << "</doxygen>\n";
1746
1747 ti << " </compound>\n";
1748
1749}
1750
1752{
1753 // + contained class definitions
1754 // + contained namespace definitions
1755 // + member groups
1756 // + normal members
1757 // + brief desc
1758 // + detailed desc
1759 // + location
1760 // - files containing (parts of) the namespace definition
1761
1762 if (nd->isReference() || nd->isHidden()) return; // skip external references
1763
1764 ti << " <compound refid=\"" << nd->getOutputFileBase()
1765 << "\" kind=\"namespace\"" << "><name>"
1766 << convertToXML(nd->name()) << "</name>\n";
1767
1768 QCString outputDirectory = Config_getString(XML_OUTPUT);
1769 QCString fileName=outputDirectory+"/"+nd->getOutputFileBase()+".xml";
1770 std::ofstream f = Portable::openOutputStream(fileName);
1771 if (!f.is_open())
1772 {
1773 err("Cannot open file {} for writing!\n",fileName);
1774 return;
1775 }
1776 TextStream t(&f);
1777
1778 writeXMLHeader(t);
1779 t << " <compounddef id=\"" << nd->getOutputFileBase()
1780 << "\" kind=\"namespace\" "
1781 << (nd->isInline()?"inline=\"yes\" ":"")
1782 << "language=\""
1783 << langToString(nd->getLanguage()) << "\">\n";
1784 t << " <compoundname>";
1785 QCString nameStr = nd->name();
1786 stripAnonymousMarkers(nameStr);
1787 writeXMLString(t,nameStr);
1788 t << "</compoundname>\n";
1789
1793
1794 for (const auto &mg : nd->getMemberGroups())
1795 {
1796 generateXMLSection(nd,ti,t,&mg->members(),"user-defined",mg->header(),
1797 mg->documentation());
1798 }
1799
1800 for (const auto &ml : nd->getMemberLists())
1801 {
1802 if (ml->listType().isDeclaration())
1803 {
1804 generateXMLSection(nd,ti,t,ml.get(),ml->listType().toXML());
1805 }
1806 }
1807
1808 t << " <briefdescription>\n";
1809 writeXMLDocBlock(t,nd->briefFile(),nd->briefLine(),nd,nullptr,nd->briefDescription());
1810 t << " </briefdescription>\n";
1811 t << " <detaileddescription>\n";
1812 writeXMLDocBlock(t,nd->docFile(),nd->docLine(),nd,nullptr,nd->documentation());
1813 t << " </detaileddescription>\n";
1814 t << " <location file=\""
1815 << convertToXML(stripFromPath(nd->getDefFileName())) << "\" line=\""
1816 << nd->getDefLine() << "\"" << " column=\""
1817 << nd->getDefColumn() << "\"/>\n" ;
1818 t << " </compounddef>\n";
1819 t << "</doxygen>\n";
1820
1821 ti << " </compound>\n";
1822}
1823
1825{
1826 // + includes files
1827 // + includedby files
1828 // + include graph
1829 // + included by graph
1830 // + contained class definitions
1831 // + contained namespace definitions
1832 // + member groups
1833 // + normal members
1834 // + brief desc
1835 // + detailed desc
1836 // + source code
1837 // + location
1838 // - number of lines
1839
1840 if (fd->isReference()) return; // skip external references
1841
1842 ti << " <compound refid=\"" << fd->getOutputFileBase()
1843 << "\" kind=\"file\"><name>" << convertToXML(fd->name())
1844 << "</name>\n";
1845
1846 QCString outputDirectory = Config_getString(XML_OUTPUT);
1847 QCString fileName=outputDirectory+"/"+fd->getOutputFileBase()+".xml";
1848 std::ofstream f = Portable::openOutputStream(fileName);
1849 if (!f.is_open())
1850 {
1851 err("Cannot open file {} for writing!\n",fileName);
1852 return;
1853 }
1854 TextStream t(&f);
1855
1856 writeXMLHeader(t);
1857 t << " <compounddef id=\"" << fd->getOutputFileBase()
1858 << "\" kind=\"file\" language=\""
1859 << langToString(fd->getLanguage()) << "\">\n";
1860 t << " <compoundname>";
1861 writeXMLString(t,fd->name());
1862 t << "</compoundname>\n";
1863
1864 for (const auto &inc : fd->includeFileList())
1865 {
1866 t << " <includes";
1867 if (inc.fileDef && !inc.fileDef->isReference()) // TODO: support external references
1868 {
1869 t << " refid=\"" << inc.fileDef->getOutputFileBase() << "\"";
1870 }
1871 t << " local=\"" << ((inc.kind & IncludeKind_LocalMask) ? "yes" : "no") << "\">";
1872 t << convertToXML(inc.includeName);
1873 t << "</includes>\n";
1874 }
1875
1876 for (const auto &inc : fd->includedByFileList())
1877 {
1878 t << " <includedby";
1879 if (inc.fileDef && !inc.fileDef->isReference()) // TODO: support external references
1880 {
1881 t << " refid=\"" << inc.fileDef->getOutputFileBase() << "\"";
1882 }
1883 t << " local=\"" << ((inc.kind &IncludeKind_LocalMask) ? "yes" : "no") << "\">";
1884 t << convertToXML(inc.includeName);
1885 t << "</includedby>\n";
1886 }
1887
1888 DotInclDepGraph incDepGraph(fd,FALSE);
1889 if (!incDepGraph.isTrivial())
1890 {
1891 t << " <incdepgraph>\n";
1892 incDepGraph.writeXML(t);
1893 t << " </incdepgraph>\n";
1894 }
1895
1896 DotInclDepGraph invIncDepGraph(fd,TRUE);
1897 if (!invIncDepGraph.isTrivial())
1898 {
1899 t << " <invincdepgraph>\n";
1900 invIncDepGraph.writeXML(t);
1901 t << " </invincdepgraph>\n";
1902 }
1903
1907
1908 for (const auto &mg : fd->getMemberGroups())
1909 {
1910 generateXMLSection(fd,ti,t,&mg->members(),"user-defined",mg->header(),
1911 mg->documentation());
1912 }
1913
1914 for (const auto &ml : fd->getMemberLists())
1915 {
1916 if (ml->listType().isDeclaration())
1917 {
1918 generateXMLSection(fd,ti,t,ml.get(),ml->listType().toXML());
1919 }
1920 }
1921
1922 t << " <briefdescription>\n";
1923 writeXMLDocBlock(t,fd->briefFile(),fd->briefLine(),fd,nullptr,fd->briefDescription());
1924 t << " </briefdescription>\n";
1925 t << " <detaileddescription>\n";
1926 writeXMLDocBlock(t,fd->docFile(),fd->docLine(),fd,nullptr,fd->documentation());
1927 t << " </detaileddescription>\n";
1928 if (Config_getBool(XML_PROGRAMLISTING))
1929 {
1930 writeXMLCodeBlock(t,fd);
1931 }
1932 t << " <location file=\"" << convertToXML(stripFromPath(fd->getDefFileName())) << "\"/>\n";
1933 t << " </compounddef>\n";
1934 t << "</doxygen>\n";
1935
1936 ti << " </compound>\n";
1937}
1938
1939static void generateXMLForGroup(const GroupDef *gd,TextStream &ti)
1940{
1941 // + members
1942 // + member groups
1943 // + files
1944 // + classes
1945 // + namespaces
1946 // - packages
1947 // + pages
1948 // + child groups
1949 // - examples
1950 // + brief description
1951 // + detailed description
1952
1953 if (gd->isReference()) return; // skip external references
1954
1955 ti << " <compound refid=\"" << gd->getOutputFileBase()
1956 << "\" kind=\"group\"><name>" << convertToXML(gd->name()) << "</name>\n";
1957
1958 QCString outputDirectory = Config_getString(XML_OUTPUT);
1959 QCString fileName=outputDirectory+"/"+gd->getOutputFileBase()+".xml";
1960 std::ofstream f = Portable::openOutputStream(fileName);
1961 if (!f.is_open())
1962 {
1963 err("Cannot open file {} for writing!\n",fileName);
1964 return;
1965 }
1966 TextStream t(&f);
1967
1968 writeXMLHeader(t);
1969 t << " <compounddef id=\""
1970 << gd->getOutputFileBase() << "\" kind=\"group\">\n";
1971 t << " <compoundname>" << convertToXML(gd->name()) << "</compoundname>\n";
1972 t << " <title>" << convertToXML(gd->groupTitle()) << "</title>\n";
1973
1975 writeInnerFiles(gd->getFiles(),t);
1979 writeInnerPages(gd->getPages(),t);
1981
1982 for (const auto &mg : gd->getMemberGroups())
1983 {
1984 generateXMLSection(gd,ti,t,&mg->members(),"user-defined",mg->header(),
1985 mg->documentation());
1986 }
1987
1988 for (const auto &ml : gd->getMemberLists())
1989 {
1990 if (ml->listType().isDeclaration())
1991 {
1992 generateXMLSection(gd,ti,t,ml.get(),ml->listType().toXML());
1993 }
1994 }
1995
1996 t << " <briefdescription>\n";
1997 writeXMLDocBlock(t,gd->briefFile(),gd->briefLine(),gd,nullptr,gd->briefDescription());
1998 t << " </briefdescription>\n";
1999 t << " <detaileddescription>\n";
2000 writeXMLDocBlock(t,gd->docFile(),gd->docLine(),gd,nullptr,gd->documentation());
2001 t << " </detaileddescription>\n";
2002 t << " </compounddef>\n";
2003 t << "</doxygen>\n";
2004
2005 ti << " </compound>\n";
2006}
2007
2009{
2010 if (dd->isReference()) return; // skip external references
2011 ti << " <compound refid=\"" << dd->getOutputFileBase()
2012 << "\" kind=\"dir\"><name>" << convertToXML(dd->displayName())
2013 << "</name>\n";
2014
2015 QCString outputDirectory = Config_getString(XML_OUTPUT);
2016 QCString fileName=outputDirectory+"/"+dd->getOutputFileBase()+".xml";
2017 std::ofstream f = Portable::openOutputStream(fileName);
2018 if (!f.is_open())
2019 {
2020 err("Cannot open file {} for writing!\n",fileName);
2021 return;
2022 }
2023 TextStream t(&f);
2024
2025 writeXMLHeader(t);
2026 t << " <compounddef id=\""
2027 << dd->getOutputFileBase() << "\" kind=\"dir\">\n";
2028 t << " <compoundname>" << convertToXML(dd->displayName()) << "</compoundname>\n";
2029
2030 writeInnerDirs(&dd->subDirs(),t);
2031 writeInnerFiles(dd->getFiles(),t);
2032
2033 t << " <briefdescription>\n";
2034 writeXMLDocBlock(t,dd->briefFile(),dd->briefLine(),dd,nullptr,dd->briefDescription());
2035 t << " </briefdescription>\n";
2036 t << " <detaileddescription>\n";
2037 writeXMLDocBlock(t,dd->docFile(),dd->docLine(),dd,nullptr,dd->documentation());
2038 t << " </detaileddescription>\n";
2039 t << " <location file=\"" << convertToXML(stripFromPath(dd->name())) << "\"/>\n";
2040 t << " </compounddef>\n";
2041 t << "</doxygen>\n";
2042
2043 ti << " </compound>\n";
2044}
2045
2046static void generateXMLForPage(PageDef *pd,TextStream &ti,bool isExample)
2047{
2048 // + name
2049 // + title
2050 // + documentation
2051 // + location
2052
2053 const char *kindName = isExample ? "example" : "page";
2054
2055 if (pd->isReference()) return;
2056
2057 QCString pageName = pd->getOutputFileBase();
2058 if (pd->getGroupDef())
2059 {
2060 pageName+=QCString("_")+pd->name();
2061 }
2062 if (pageName=="index") pageName="indexpage"; // to prevent overwriting the generated index page.
2063
2064 ti << " <compound refid=\"" << pageName
2065 << "\" kind=\"" << kindName << "\"><name>" << convertToXML(pd->name())
2066 << "</name>\n";
2067
2068 QCString outputDirectory = Config_getString(XML_OUTPUT);
2069 QCString fileName=outputDirectory+"/"+pageName+".xml";
2070 std::ofstream f = Portable::openOutputStream(fileName);
2071 if (!f.is_open())
2072 {
2073 err("Cannot open file {} for writing!\n",fileName);
2074 return;
2075 }
2076 TextStream t(&f);
2077
2078 writeXMLHeader(t);
2079 t << " <compounddef id=\"" << pageName;
2080 t << "\" kind=\"" << kindName << "\">\n";
2081 t << " <compoundname>" << convertToXML(pd->name())
2082 << "</compoundname>\n";
2083
2084 if (pd==Doxygen::mainPage.get()) // main page is special
2085 {
2086 QCString title;
2087 if (mainPageHasTitle())
2088 {
2090 }
2091 else
2092 {
2093 title = Config_getString(PROJECT_NAME);
2094 }
2095 t << " <title>" << convertToXML(convertCharEntitiesToUTF8(title))
2096 << "</title>\n";
2097 }
2098 else
2099 {
2100 const SectionInfo *si = SectionManager::instance().find(pd->name());
2101 if (si)
2102 {
2103 t << " <title>" << convertToXML(filterTitle(convertCharEntitiesToUTF8(si->title())))
2104 << "</title>\n";
2105 }
2106 }
2108 const SectionRefs &sectionRefs = pd->getSectionRefs();
2109 if (pd->localToc().isXmlEnabled() && !sectionRefs.empty())
2110 {
2111 int level=1;
2112 int indent=0;
2113 auto writeIndent = [&]() { for (int i=0;i<4+indent*2;i++) t << " "; };
2114 auto incIndent = [&](const char *text) { writeIndent(); t << text << "\n"; indent++; };
2115 auto decIndent = [&](const char *text) { indent--; writeIndent(); t << text << "\n"; };
2116 incIndent("<tableofcontents>");
2117 int maxLevel = pd->localToc().xmlLevel();
2118 BoolVector inLi(maxLevel+1,false);
2119 for (const SectionInfo *si : sectionRefs)
2120 {
2121 if (si->type().isSection())
2122 {
2123 //printf(" level=%d title=%s\n",level,qPrint(si->title));
2124 int nextLevel = si->type().level();
2125 if (nextLevel>level)
2126 {
2127 for (int l=level;l<nextLevel;l++)
2128 {
2129 if (l < maxLevel) incIndent("<tableofcontents>");
2130 }
2131 }
2132 else if (nextLevel<level)
2133 {
2134 for (int l=level;l>nextLevel;l--)
2135 {
2136 if (l <= maxLevel && inLi[l]) decIndent("</tocsect>");
2137 inLi[l]=false;
2138 if (l <= maxLevel) decIndent("</tableofcontents>");
2139 }
2140 }
2141 if (nextLevel <= maxLevel)
2142 {
2143 if (inLi[nextLevel])
2144 {
2145 decIndent("</tocsect>");
2146 }
2147 else if (level>nextLevel)
2148 {
2149 decIndent("</tableofcontents>");
2150 incIndent("<tableofcontents>");
2151 }
2152 QCString titleDoc = convertToXML(si->title());
2153 QCString label = convertToXML(si->label());
2154 if (titleDoc.isEmpty()) titleDoc = label;
2155 incIndent("<tocsect>");
2156 writeIndent(); t << "<name>" << titleDoc << "</name>\n"; // kept for backwards compatibility
2157 writeIndent(); t << "<docs>";
2158 if (!si->title().isEmpty())
2159 {
2160 writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,nullptr,si->title());
2161 }
2162 t << "</docs>\n";
2163 writeIndent(); t << "<reference>" << convertToXML(pageName) << "_1" << label << "</reference>\n";
2164 inLi[nextLevel]=true;
2165 level = nextLevel;
2166 }
2167 }
2168 }
2169 while (level>1 && level <= maxLevel)
2170 {
2171 if (inLi[level]) decIndent("</tocsect>");
2172 inLi[level]=false;
2173 decIndent("</tableofcontents>");
2174 level--;
2175 }
2176 if (level <= maxLevel && inLi[level]) decIndent("</tocsect>");
2177 inLi[level]=false;
2178 decIndent("</tableofcontents>");
2179 }
2180 t << " <briefdescription>\n";
2181 writeXMLDocBlock(t,pd->briefFile(),pd->briefLine(),pd,nullptr,pd->briefDescription());
2182 t << " </briefdescription>\n";
2183 t << " <detaileddescription>\n";
2184 if (isExample)
2185 {
2186 writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,nullptr,
2187 pd->documentation()+"\n\\include "+pd->name());
2188 }
2189 else
2190 {
2191 writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,nullptr,
2192 pd->documentation());
2193 }
2194 t << " </detaileddescription>\n";
2195
2196 t << " <location file=\"" << convertToXML(stripFromPath(pd->getDefFileName())) << "\"/>\n";
2197
2198 t << " </compounddef>\n";
2199 t << "</doxygen>\n";
2200
2201 ti << " </compound>\n";
2202}
2203
2205{
2206 // + classes
2207 // + concepts
2208 // + namespaces
2209 // + files
2210 // + groups
2211 // + related pages
2212 // - examples
2213
2214 QCString outputDirectory = Config_getString(XML_OUTPUT);
2215 Dir xmlDir(outputDirectory.str());
2216 createSubDirs(xmlDir);
2217
2218 ResourceMgr::instance().copyResource("xml.xsd",outputDirectory);
2219 ResourceMgr::instance().copyResource("index.xsd",outputDirectory);
2220
2221 QCString fileName=outputDirectory+"/compound.xsd";
2222 std::ofstream f = Portable::openOutputStream(fileName);
2223 if (!f.is_open())
2224 {
2225 err("Cannot open file {} for writing!\n",fileName);
2226 return;
2227 }
2228 {
2229 TextStream t(&f);
2230
2231 // write compound.xsd, but replace special marker with the entities
2232 QCString compound_xsd = ResourceMgr::instance().getAsString("compound.xsd");
2233 const char *startLine = compound_xsd.data();
2234 while (*startLine)
2235 {
2236 // find end of the line
2237 const char *endLine = startLine+1;
2238 while (*endLine && *(endLine-1)!='\n') endLine++; // skip to end of the line including \n
2239 int len=static_cast<int>(endLine-startLine);
2240 if (len>0)
2241 {
2242 QCString s(startLine,len);
2243 if (s.find("<!-- Automatically insert here the HTML entities -->")!=-1)
2244 {
2246 }
2247 else
2248 {
2249 t.write(startLine,len);
2250 }
2251 }
2252 startLine=endLine;
2253 }
2254 }
2255 f.close();
2256
2257 fileName=outputDirectory+"/doxyfile.xsd";
2258 f = Portable::openOutputStream(fileName);
2259 if (!f.is_open())
2260 {
2261 err("Cannot open file {} for writing!\n",fileName);
2262 return;
2263 }
2264 {
2265 TextStream t(&f);
2266
2267 // write doxyfile.xsd, but replace special marker with the entities
2268 QCString doxyfile_xsd = ResourceMgr::instance().getAsString("doxyfile.xsd");
2269 const char *startLine = doxyfile_xsd.data();
2270 while (*startLine)
2271 {
2272 // find end of the line
2273 const char *endLine = startLine+1;
2274 while (*endLine && *(endLine-1)!='\n') endLine++; // skip to end of the line including \n
2275 int len=static_cast<int>(endLine-startLine);
2276 if (len>0)
2277 {
2278 QCString s(startLine,len);
2279 if (s.find("<!-- Automatically insert here the configuration settings -->")!=-1)
2280 {
2282 }
2283 else
2284 {
2285 t.write(startLine,len);
2286 }
2287 }
2288 startLine=endLine;
2289 }
2290 }
2291 f.close();
2292
2293 fileName=outputDirectory+"/Doxyfile.xml";
2294 f = Portable::openOutputStream(fileName);
2295 if (!f.is_open())
2296 {
2297 err("Cannot open file {} for writing\n",fileName);
2298 return;
2299 }
2300 else
2301 {
2302 TextStream t(&f);
2304 }
2305 f.close();
2306
2307 fileName=outputDirectory+"/index.xml";
2308 f = Portable::openOutputStream(fileName);
2309 if (!f.is_open())
2310 {
2311 err("Cannot open file {} for writing!\n",fileName);
2312 return;
2313 }
2314 else
2315 {
2316 TextStream t(&f);
2317
2318 // write index header
2319 t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n";
2320 t << "<doxygenindex xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
2321 t << "xsi:noNamespaceSchemaLocation=\"index.xsd\" ";
2322 t << "version=\"" << getDoxygenVersion() << "\" ";
2323 t << "xml:lang=\"" << theTranslator->trISOLang() << "\"";
2324 t << ">\n";
2325
2326 for (const auto &cd : *Doxygen::classLinkedMap)
2327 {
2328 generateXMLForClass(cd.get(),t);
2329 }
2330 for (const auto &cd : *Doxygen::conceptLinkedMap)
2331 {
2332 msg("Generating XML output for concept {}\n",cd->displayName());
2333 generateXMLForConcept(cd.get(),t);
2334 }
2335 for (const auto &nd : *Doxygen::namespaceLinkedMap)
2336 {
2337 msg("Generating XML output for namespace {}\n",nd->displayName());
2338 generateXMLForNamespace(nd.get(),t);
2339 }
2340 for (const auto &fn : *Doxygen::inputNameLinkedMap)
2341 {
2342 for (const auto &fd : *fn)
2343 {
2344 msg("Generating XML output for file {}\n",fd->name());
2345 generateXMLForFile(fd.get(),t);
2346 }
2347 }
2348 for (const auto &gd : *Doxygen::groupLinkedMap)
2349 {
2350 msg("Generating XML output for group {}\n",gd->name());
2351 generateXMLForGroup(gd.get(),t);
2352 }
2353 for (const auto &pd : *Doxygen::pageLinkedMap)
2354 {
2355 msg("Generating XML output for page {}\n",pd->name());
2356 generateXMLForPage(pd.get(),t,FALSE);
2357 }
2358 for (const auto &dd : *Doxygen::dirLinkedMap)
2359 {
2360 msg("Generate XML output for dir {}\n",dd->name());
2361 generateXMLForDir(dd.get(),t);
2362 }
2363 for (const auto &mod : ModuleManager::instance().modules())
2364 {
2365 msg("Generating XML output for module {}\n",mod->name());
2366 generateXMLForModule(mod.get(),t);
2367 }
2368 for (const auto &pd : *Doxygen::exampleLinkedMap)
2369 {
2370 msg("Generating XML output for example {}\n",pd->name());
2371 generateXMLForPage(pd.get(),t,TRUE);
2372 }
2374 {
2375 msg("Generating XML output for the main page\n");
2377 }
2378
2379 //t << " </compoundlist>\n";
2380 t << "</doxygenindex>\n";
2381 }
2382
2384 clearSubDirs(xmlDir);
2385}
2386
2387
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:125
MemberListType listType() const
Definition memberlist.h:130
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
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
QCString s
Definition htmlgen.cpp:154
size_t i
Definition htmlgen.cpp:161
return out get()
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:7392
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5719
bool mainPageHasTitle()
Definition util.cpp:6796
QCString insertTemplateSpecifierInScope(const QCString &scope, const QCString &templ)
Definition util.cpp:4260
void clearSubDirs(const Dir &d)
Definition util.cpp:4181
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
Definition util.cpp:1442
QCString filterTitle(const QCString &title)
Definition util.cpp:6128
void createSubDirs(const Dir &d)
Definition util.cpp:4154
static QCString stripFromPath(const QCString &p, const StringVector &l)
Definition util.cpp:310
QCString convertToXML(const QCString &s, bool keepEntities)
Definition util.cpp:4426
QCString langToString(SrcLangExt lang)
Returns a string representation of lang.
Definition util.cpp:6405
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
Definition util.cpp:6411
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:4558
A bunch of utility functions.
static QCString classOutputFileBase(const ClassDef *cd)
Definition xmlgen.cpp:567
static void generateXMLForGroup(const GroupDef *gd, TextStream &ti)
Definition xmlgen.cpp:1939
void generateXML()
Definition xmlgen.cpp:2204
static void writeInnerConcepts(const ConceptLinkedRefMap &cl, TextStream &t)
Definition xmlgen.cpp:1360
static void writeInnerGroups(const GroupList &gl, TextStream &t)
Definition xmlgen.cpp:1441
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:1451
static void writeListOfAllMembers(const ClassDef *cd, TextStream &t)
Definition xmlgen.cpp:1320
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:1483
static void writeMemberReference(TextStream &t, const Definition *def, const MemberDef *rmd, const QCString &tagName)
Definition xmlgen.cpp:501
static void generateXMLForFile(FileDef *fd, TextStream &ti)
Definition xmlgen.cpp:1824
static QCString memberOutputFileBase(const MemberDef *md)
Definition xmlgen.cpp:576
static void writeMemberTemplateLists(const MemberDef *md, TextStream &t)
Definition xmlgen.cpp:432
void writeXMLCodeBlock(TextStream &t, FileDef *fd)
Definition xmlgen.cpp:475
static void writeTemplateList(const ClassDef *cd, TextStream &t)
Definition xmlgen.cpp:437
static bool stripKeyword(QCString &str, const char *keyword, bool needSpace)
Definition xmlgen.cpp:590
static bool memberVisible(const Definition *d, const MemberDef *md)
Definition xmlgen.cpp:1276
static void writeIncludeInfo(const IncludeInfo *ii, TextStream &t)
Definition xmlgen.cpp:1463
static void stripQualifiers(QCString &typeStr)
Definition xmlgen.cpp:551
static void writeInnerPages(const PageLinkedRefMap &pl, TextStream &t)
Definition xmlgen.cpp:1428
static void generateXMLForNamespace(const NamespaceDef *nd, TextStream &ti)
Definition xmlgen.cpp:1751
static void writeXMLHeader(TextStream &t)
Definition xmlgen.cpp:124
static void writeInnerModules(const ModuleLinkedRefMap &ml, TextStream &t)
Definition xmlgen.cpp:1372
static void generateXMLForModule(const ModuleDef *mod, TextStream &ti)
Definition xmlgen.cpp:1696
static void generateXMLForConcept(const ConceptDef *cd, TextStream &ti)
Definition xmlgen.cpp:1650
static void writeExports(const ImportInfoMap &exportMap, TextStream &t)
Definition xmlgen.cpp:1397
static void writeInnerFiles(const FileList &fl, TextStream &t)
Definition xmlgen.cpp:1419
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:1283
static void writeInnerClasses(const ClassLinkedRefMap &cl, TextStream &t)
Definition xmlgen.cpp:1347
static void writeInnerNamespaces(const NamespaceLinkedRefMap &nl, TextStream &t)
Definition xmlgen.cpp:1384
static void generateXMLForDir(DirDef *dd, TextStream &ti)
Definition xmlgen.cpp:2008
static void generateXMLForPage(PageDef *pd, TextStream &ti, bool isExample)
Definition xmlgen.cpp:2046
static QCString extractNoExcept(QCString &argsStr)
Definition xmlgen.cpp:634
static void writeCombineScript()
Definition xmlgen.cpp:134