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