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