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:
178 void writeString(std::string_view s,bool /*keepSpaces*/) const override
179 {
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:
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 (const auto &[moduleName,importInfoList] : exportMap)
1356 {
1357 for (const auto &importInfo : importInfoList)
1358 {
1359 t << " <export";
1360 ModuleDef *mod = ModuleManager::instance().getPrimaryInterface(importInfo.importName);
1361 if (mod && mod->isLinkableInProject())
1362 {
1363 t << " refid=\"" << mod->getOutputFileBase() << "\"";
1364 }
1365 t << ">";
1366 t << importInfo.importName;
1367 t << "</export>\n";
1368 }
1369 }
1370 t << " </exports>\n";
1371}
1372
1373static void writeInnerFiles(const FileList &fl,TextStream &t)
1374{
1375 for (const auto &fd : fl)
1376 {
1377 t << " <innerfile refid=\"" << fd->getOutputFileBase()
1378 << "\">" << convertToXML(fd->name()) << "</innerfile>\n";
1379 }
1380}
1381
1383{
1384 for (const auto &pd : pl)
1385 {
1386 t << " <innerpage refid=\"" << pd->getOutputFileBase();
1387 if (pd->getGroupDef())
1388 {
1389 t << "_" << pd->name();
1390 }
1391 t << "\">" << convertToXML(pd->title()) << "</innerpage>\n";
1392 }
1393}
1394
1395static void writeInnerGroups(const GroupList &gl,TextStream &t)
1396{
1397 for (const auto &sgd : gl)
1398 {
1399 t << " <innergroup refid=\"" << sgd->getOutputFileBase()
1400 << "\">" << convertToXML(sgd->groupTitle())
1401 << "</innergroup>\n";
1402 }
1403}
1404
1405static void writeInnerDirs(const DirList *dl,TextStream &t)
1406{
1407 if (dl)
1408 {
1409 for(const auto subdir : *dl)
1410 {
1411 t << " <innerdir refid=\"" << subdir->getOutputFileBase()
1412 << "\">" << convertToXML(subdir->displayName()) << "</innerdir>\n";
1413 }
1414 }
1415}
1416
1417static void writeIncludeInfo(const IncludeInfo *ii,TextStream &t)
1418{
1419 if (ii)
1420 {
1421 QCString nm = ii->includeName;
1422 if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName();
1423 if (!nm.isEmpty())
1424 {
1425 t << " <includes";
1426 if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references
1427 {
1428 t << " refid=\"" << ii->fileDef->getOutputFileBase() << "\"";
1429 }
1430 t << " local=\"" << ((ii->kind & IncludeKind_LocalMask) ? "yes" : "no") << "\">";
1431 t << nm;
1432 t << "</includes>\n";
1433 }
1434 }
1435}
1436
1437static void generateXMLForClass(const ClassDef *cd,TextStream &ti)
1438{
1439 // + brief description
1440 // + detailed description
1441 // + template argument list(s)
1442 // - include file
1443 // + member groups
1444 // + inheritance diagram
1445 // + list of direct super classes
1446 // + list of direct sub classes
1447 // + list of inner classes
1448 // + collaboration diagram
1449 // + list of all members
1450 // + user defined member sections
1451 // + standard member sections
1452 // + detailed member documentation
1453 // - examples using the class
1454
1455 if (cd->isReference()) return; // skip external references.
1456 if (cd->isHidden()) return; // skip hidden classes.
1457 if (cd->isAnonymous()) return; // skip anonymous compounds.
1458 if (cd->templateMaster()!=nullptr) return; // skip generated template instances.
1459 if (cd->isArtificial()) return; // skip artificially created classes
1460
1461 msg("Generating XML output for class %s\n",qPrint(cd->name()));
1462
1463 ti << " <compound refid=\"" << classOutputFileBase(cd)
1464 << "\" kind=\"" << cd->compoundTypeString()
1465 << "\"><name>" << convertToXML(cd->name()) << "</name>\n";
1466
1467 QCString outputDirectory = Config_getString(XML_OUTPUT);
1468 QCString fileName=outputDirectory+"/"+ classOutputFileBase(cd)+".xml";
1469 std::ofstream f = Portable::openOutputStream(fileName);
1470 if (!f.is_open())
1471 {
1472 err("Cannot open file %s for writing!\n",qPrint(fileName));
1473 return;
1474 }
1475 TextStream t(&f);
1476
1477 writeXMLHeader(t);
1478 t << " <compounddef id=\""
1479 << classOutputFileBase(cd) << "\" kind=\""
1480 << cd->compoundTypeString() << "\" language=\""
1481 << langToString(cd->getLanguage()) << "\" prot=\"";
1482 switch (cd->protection())
1483 {
1484 case Protection::Public: t << "public"; break;
1485 case Protection::Protected: t << "protected"; break;
1486 case Protection::Private: t << "private"; break;
1487 case Protection::Package: t << "package"; break;
1488 }
1489 if (cd->isFinal()) t << "\" final=\"yes";
1490 if (cd->isSealed()) t << "\" sealed=\"yes";
1491 if (cd->isAbstract()) t << "\" abstract=\"yes";
1492 t << "\">\n";
1493 t << " <compoundname>";
1494 QCString nameStr = cd->name();
1495 stripAnonymousMarkers(nameStr);
1496 writeXMLString(t,nameStr);
1497 t << "</compoundname>\n";
1498 for (const auto &bcd : cd->baseClasses())
1499 {
1500 t << " <basecompoundref ";
1501 if (bcd.classDef->isLinkable())
1502 {
1503 t << "refid=\"" << classOutputFileBase(bcd.classDef) << "\" ";
1504 }
1505 t << "prot=\"";
1506 switch (bcd.prot)
1507 {
1508 case Protection::Public: t << "public"; break;
1509 case Protection::Protected: t << "protected"; break;
1510 case Protection::Private: t << "private"; break;
1511 case Protection::Package: ASSERT(0); break;
1512 }
1513 t << "\" virt=\"";
1514 switch(bcd.virt)
1515 {
1516 case Specifier::Normal: t << "non-virtual"; break;
1517 case Specifier::Virtual: t << "virtual"; break;
1518 case Specifier::Pure: t <<"pure-virtual"; break;
1519 }
1520 t << "\">";
1521 if (!bcd.templSpecifiers.isEmpty())
1522 {
1523 t << convertToXML(
1525 bcd.classDef->name(),bcd.templSpecifiers)
1526 );
1527 }
1528 else
1529 {
1530 t << convertToXML(bcd.classDef->displayName());
1531 }
1532 t << "</basecompoundref>\n";
1533 }
1534 for (const auto &bcd : cd->subClasses())
1535 {
1536 t << " <derivedcompoundref refid=\""
1537 << classOutputFileBase(bcd.classDef)
1538 << "\" prot=\"";
1539 switch (bcd.prot)
1540 {
1541 case Protection::Public: t << "public"; break;
1542 case Protection::Protected: t << "protected"; break;
1543 case Protection::Private: t << "private"; break;
1544 case Protection::Package: ASSERT(0); break;
1545 }
1546 t << "\" virt=\"";
1547 switch (bcd.virt)
1548 {
1549 case Specifier::Normal: t << "non-virtual"; break;
1550 case Specifier::Virtual: t << "virtual"; break;
1551 case Specifier::Pure: t << "pure-virtual"; break;
1552 }
1553 t << "\">" << convertToXML(bcd.classDef->displayName())
1554 << "</derivedcompoundref>\n";
1555 }
1556
1558
1560
1561 writeTemplateList(cd,t);
1562 for (const auto &mg : cd->getMemberGroups())
1563 {
1564 generateXMLSection(cd,ti,t,&mg->members(),"user-defined",mg->header(),
1565 mg->documentation());
1566 }
1567
1568 for (const auto &ml : cd->getMemberLists())
1569 {
1570 if (!ml->listType().isDetailed())
1571 {
1572 generateXMLSection(cd,ti,t,ml.get(),ml->listType().toXML());
1573 }
1574 }
1575
1576 if (!cd->requiresClause().isEmpty())
1577 {
1578 t << " <requiresclause>";
1579 linkifyText(TextGeneratorXMLImpl(t),cd,cd->getFileDef(),nullptr,cd->requiresClause());
1580 t << " </requiresclause>\n";
1581 }
1582
1583 for (const auto &qcd : cd->getQualifiers())
1584 {
1585 t << " <qualifier>" << convertToXML(qcd.c_str()) << "</qualifier>\n";
1586 }
1587
1588 t << " <briefdescription>\n";
1589 writeXMLDocBlock(t,cd->briefFile(),cd->briefLine(),cd,nullptr,cd->briefDescription());
1590 t << " </briefdescription>\n";
1591 t << " <detaileddescription>\n";
1592 writeXMLDocBlock(t,cd->docFile(),cd->docLine(),cd,nullptr,cd->documentation());
1593 t << " </detaileddescription>\n";
1594 DotClassGraph inheritanceGraph(cd,GraphType::Inheritance);
1595 if (!inheritanceGraph.isTrivial())
1596 {
1597 t << " <inheritancegraph>\n";
1598 inheritanceGraph.writeXML(t);
1599 t << " </inheritancegraph>\n";
1600 }
1601 DotClassGraph collaborationGraph(cd,GraphType::Collaboration);
1602 if (!collaborationGraph.isTrivial())
1603 {
1604 t << " <collaborationgraph>\n";
1605 collaborationGraph.writeXML(t);
1606 t << " </collaborationgraph>\n";
1607 }
1608 t << " <location file=\""
1609 << convertToXML(stripFromPath(cd->getDefFileName())) << "\" line=\""
1610 << cd->getDefLine() << "\"" << " column=\""
1611 << cd->getDefColumn() << "\"" ;
1612 if (cd->getStartBodyLine()!=-1)
1613 {
1614 const FileDef *bodyDef = cd->getBodyDef();
1615 if (bodyDef)
1616 {
1617 t << " bodyfile=\"" << convertToXML(stripFromPath(bodyDef->absFilePath())) << "\"";
1618 }
1619 t << " bodystart=\"" << cd->getStartBodyLine() << "\" bodyend=\""
1620 << cd->getEndBodyLine() << "\"";
1621 }
1622 t << "/>\n";
1624 t << " </compounddef>\n";
1625 t << "</doxygen>\n";
1626
1627 ti << " </compound>\n";
1628}
1629
1631{
1632 if (cd->isReference() || cd->isHidden()) return; // skip external references.
1633
1634 ti << " <compound refid=\"" << cd->getOutputFileBase()
1635 << "\" kind=\"concept\"" << "><name>"
1636 << convertToXML(cd->name()) << "</name>\n";
1637
1638 QCString outputDirectory = Config_getString(XML_OUTPUT);
1639 QCString fileName=outputDirectory+"/"+cd->getOutputFileBase()+".xml";
1640 std::ofstream f = Portable::openOutputStream(fileName);
1641 if (!f.is_open())
1642 {
1643 err("Cannot open file %s for writing!\n",qPrint(fileName));
1644 return;
1645 }
1646 TextStream t(&f);
1647 writeXMLHeader(t);
1648 t << " <compounddef id=\"" << cd->getOutputFileBase()
1649 << "\" kind=\"concept\">\n";
1650 t << " <compoundname>";
1651 QCString nameStr = cd->name();
1652 stripAnonymousMarkers(nameStr);
1653 writeXMLString(t,nameStr);
1654 t << "</compoundname>\n";
1656 writeTemplateList(cd,t);
1657 t << " <initializer>";
1658 linkifyText(TextGeneratorXMLImpl(t),cd,cd->getFileDef(),nullptr,cd->initializer());
1659 t << " </initializer>\n";
1660 t << " <briefdescription>\n";
1661 writeXMLDocBlock(t,cd->briefFile(),cd->briefLine(),cd,nullptr,cd->briefDescription());
1662 t << " </briefdescription>\n";
1663 t << " <detaileddescription>\n";
1664 writeXMLDocBlock(t,cd->docFile(),cd->docLine(),cd,nullptr,cd->documentation());
1665 t << " </detaileddescription>\n";
1666 t << " <location file=\""
1667 << convertToXML(stripFromPath(cd->getDefFileName())) << "\" line=\""
1668 << cd->getDefLine() << "\"" << " column=\""
1669 << cd->getDefColumn() << "\"/>\n" ;
1670 t << " </compounddef>\n";
1671 t << "</doxygen>\n";
1672
1673 ti << " </compound>\n";
1674}
1675
1676static void generateXMLForModule(const ModuleDef *mod,TextStream &ti)
1677{
1678 if (mod->isReference() || mod->isHidden() || !mod->isPrimaryInterface()) return;
1679 ti << " <compound refid=\"" << mod->getOutputFileBase()
1680 << "\" kind=\"module\"" << "><name>"
1681 << convertToXML(mod->name()) << "</name>\n";
1682
1683 QCString outputDirectory = Config_getString(XML_OUTPUT);
1684 QCString fileName=outputDirectory+"/"+mod->getOutputFileBase()+".xml";
1685 std::ofstream f = Portable::openOutputStream(fileName);
1686 if (!f.is_open())
1687 {
1688 err("Cannot open file %s for writing!\n",qPrint(fileName));
1689 return;
1690 }
1691 TextStream t(&f);
1692 writeXMLHeader(t);
1693 t << " <compounddef id=\"" << mod->getOutputFileBase()
1694 << "\" kind=\"module\">\n";
1695 t << " <compoundname>";
1696 writeXMLString(t,mod->name());
1697 t << "</compoundname>\n";
1698 writeInnerFiles(mod->getUsedFiles(),t);
1699 writeInnerClasses(mod->getClasses(),t);
1701 for (const auto &ml : mod->getMemberLists())
1702 {
1703 if (ml->listType().isDeclaration())
1704 {
1705 generateXMLSection(mod,ti,t,ml.get(),ml->listType().toXML());
1706 }
1707 }
1708 for (const auto &mg : mod->getMemberGroups())
1709 {
1710 generateXMLSection(mod,ti,t,&mg->members(),"user-defined",mg->header(),
1711 mg->documentation());
1712 }
1713 t << " <briefdescription>\n";
1714 writeXMLDocBlock(t,mod->briefFile(),mod->briefLine(),mod,nullptr,mod->briefDescription());
1715 t << " </briefdescription>\n";
1716 t << " <detaileddescription>\n";
1717 writeXMLDocBlock(t,mod->docFile(),mod->docLine(),mod,nullptr,mod->documentation());
1718 t << " </detaileddescription>\n";
1719 writeExports(mod->getExports(),t);
1720 t << " <location file=\""
1721 << convertToXML(stripFromPath(mod->getDefFileName())) << "\" line=\""
1722 << mod->getDefLine() << "\"" << " column=\""
1723 << mod->getDefColumn() << "\"/>\n" ;
1724 t << " </compounddef>\n";
1725 t << "</doxygen>\n";
1726
1727 ti << " </compound>\n";
1728
1729}
1730
1732{
1733 // + contained class definitions
1734 // + contained namespace definitions
1735 // + member groups
1736 // + normal members
1737 // + brief desc
1738 // + detailed desc
1739 // + location
1740 // - files containing (parts of) the namespace definition
1741
1742 if (nd->isReference() || nd->isHidden()) return; // skip external references
1743
1744 ti << " <compound refid=\"" << nd->getOutputFileBase()
1745 << "\" kind=\"namespace\"" << "><name>"
1746 << convertToXML(nd->name()) << "</name>\n";
1747
1748 QCString outputDirectory = Config_getString(XML_OUTPUT);
1749 QCString fileName=outputDirectory+"/"+nd->getOutputFileBase()+".xml";
1750 std::ofstream f = Portable::openOutputStream(fileName);
1751 if (!f.is_open())
1752 {
1753 err("Cannot open file %s for writing!\n",qPrint(fileName));
1754 return;
1755 }
1756 TextStream t(&f);
1757
1758 writeXMLHeader(t);
1759 t << " <compounddef id=\"" << nd->getOutputFileBase()
1760 << "\" kind=\"namespace\" "
1761 << (nd->isInline()?"inline=\"yes\" ":"")
1762 << "language=\""
1763 << langToString(nd->getLanguage()) << "\">\n";
1764 t << " <compoundname>";
1765 QCString nameStr = nd->name();
1766 stripAnonymousMarkers(nameStr);
1767 writeXMLString(t,nameStr);
1768 t << "</compoundname>\n";
1769
1773
1774 for (const auto &mg : nd->getMemberGroups())
1775 {
1776 generateXMLSection(nd,ti,t,&mg->members(),"user-defined",mg->header(),
1777 mg->documentation());
1778 }
1779
1780 for (const auto &ml : nd->getMemberLists())
1781 {
1782 if (ml->listType().isDeclaration())
1783 {
1784 generateXMLSection(nd,ti,t,ml.get(),ml->listType().toXML());
1785 }
1786 }
1787
1788 t << " <briefdescription>\n";
1789 writeXMLDocBlock(t,nd->briefFile(),nd->briefLine(),nd,nullptr,nd->briefDescription());
1790 t << " </briefdescription>\n";
1791 t << " <detaileddescription>\n";
1792 writeXMLDocBlock(t,nd->docFile(),nd->docLine(),nd,nullptr,nd->documentation());
1793 t << " </detaileddescription>\n";
1794 t << " <location file=\""
1795 << convertToXML(stripFromPath(nd->getDefFileName())) << "\" line=\""
1796 << nd->getDefLine() << "\"" << " column=\""
1797 << nd->getDefColumn() << "\"/>\n" ;
1798 t << " </compounddef>\n";
1799 t << "</doxygen>\n";
1800
1801 ti << " </compound>\n";
1802}
1803
1805{
1806 // + includes files
1807 // + includedby files
1808 // + include graph
1809 // + included by graph
1810 // + contained class definitions
1811 // + contained namespace definitions
1812 // + member groups
1813 // + normal members
1814 // + brief desc
1815 // + detailed desc
1816 // + source code
1817 // + location
1818 // - number of lines
1819
1820 if (fd->isReference()) return; // skip external references
1821
1822 ti << " <compound refid=\"" << fd->getOutputFileBase()
1823 << "\" kind=\"file\"><name>" << convertToXML(fd->name())
1824 << "</name>\n";
1825
1826 QCString outputDirectory = Config_getString(XML_OUTPUT);
1827 QCString fileName=outputDirectory+"/"+fd->getOutputFileBase()+".xml";
1828 std::ofstream f = Portable::openOutputStream(fileName);
1829 if (!f.is_open())
1830 {
1831 err("Cannot open file %s for writing!\n",qPrint(fileName));
1832 return;
1833 }
1834 TextStream t(&f);
1835
1836 writeXMLHeader(t);
1837 t << " <compounddef id=\"" << fd->getOutputFileBase()
1838 << "\" kind=\"file\" language=\""
1839 << langToString(fd->getLanguage()) << "\">\n";
1840 t << " <compoundname>";
1841 writeXMLString(t,fd->name());
1842 t << "</compoundname>\n";
1843
1844 for (const auto &inc : fd->includeFileList())
1845 {
1846 t << " <includes";
1847 if (inc.fileDef && !inc.fileDef->isReference()) // TODO: support external references
1848 {
1849 t << " refid=\"" << inc.fileDef->getOutputFileBase() << "\"";
1850 }
1851 t << " local=\"" << ((inc.kind & IncludeKind_LocalMask) ? "yes" : "no") << "\">";
1852 t << inc.includeName;
1853 t << "</includes>\n";
1854 }
1855
1856 for (const auto &inc : fd->includedByFileList())
1857 {
1858 t << " <includedby";
1859 if (inc.fileDef && !inc.fileDef->isReference()) // TODO: support external references
1860 {
1861 t << " refid=\"" << inc.fileDef->getOutputFileBase() << "\"";
1862 }
1863 t << " local=\"" << ((inc.kind &IncludeKind_LocalMask) ? "yes" : "no") << "\">";
1864 t << inc.includeName;
1865 t << "</includedby>\n";
1866 }
1867
1868 DotInclDepGraph incDepGraph(fd,FALSE);
1869 if (!incDepGraph.isTrivial())
1870 {
1871 t << " <incdepgraph>\n";
1872 incDepGraph.writeXML(t);
1873 t << " </incdepgraph>\n";
1874 }
1875
1876 DotInclDepGraph invIncDepGraph(fd,TRUE);
1877 if (!invIncDepGraph.isTrivial())
1878 {
1879 t << " <invincdepgraph>\n";
1880 invIncDepGraph.writeXML(t);
1881 t << " </invincdepgraph>\n";
1882 }
1883
1887
1888 for (const auto &mg : fd->getMemberGroups())
1889 {
1890 generateXMLSection(fd,ti,t,&mg->members(),"user-defined",mg->header(),
1891 mg->documentation());
1892 }
1893
1894 for (const auto &ml : fd->getMemberLists())
1895 {
1896 if (ml->listType().isDeclaration())
1897 {
1898 generateXMLSection(fd,ti,t,ml.get(),ml->listType().toXML());
1899 }
1900 }
1901
1902 t << " <briefdescription>\n";
1903 writeXMLDocBlock(t,fd->briefFile(),fd->briefLine(),fd,nullptr,fd->briefDescription());
1904 t << " </briefdescription>\n";
1905 t << " <detaileddescription>\n";
1906 writeXMLDocBlock(t,fd->docFile(),fd->docLine(),fd,nullptr,fd->documentation());
1907 t << " </detaileddescription>\n";
1908 if (Config_getBool(XML_PROGRAMLISTING))
1909 {
1910 writeXMLCodeBlock(t,fd);
1911 }
1912 t << " <location file=\"" << convertToXML(stripFromPath(fd->getDefFileName())) << "\"/>\n";
1913 t << " </compounddef>\n";
1914 t << "</doxygen>\n";
1915
1916 ti << " </compound>\n";
1917}
1918
1919static void generateXMLForGroup(const GroupDef *gd,TextStream &ti)
1920{
1921 // + members
1922 // + member groups
1923 // + files
1924 // + classes
1925 // + namespaces
1926 // - packages
1927 // + pages
1928 // + child groups
1929 // - examples
1930 // + brief description
1931 // + detailed description
1932
1933 if (gd->isReference()) return; // skip external references
1934
1935 ti << " <compound refid=\"" << gd->getOutputFileBase()
1936 << "\" kind=\"group\"><name>" << convertToXML(gd->name()) << "</name>\n";
1937
1938 QCString outputDirectory = Config_getString(XML_OUTPUT);
1939 QCString fileName=outputDirectory+"/"+gd->getOutputFileBase()+".xml";
1940 std::ofstream f = Portable::openOutputStream(fileName);
1941 if (!f.is_open())
1942 {
1943 err("Cannot open file %s for writing!\n",qPrint(fileName));
1944 return;
1945 }
1946 TextStream t(&f);
1947
1948 writeXMLHeader(t);
1949 t << " <compounddef id=\""
1950 << gd->getOutputFileBase() << "\" kind=\"group\">\n";
1951 t << " <compoundname>" << convertToXML(gd->name()) << "</compoundname>\n";
1952 t << " <title>" << convertToXML(gd->groupTitle()) << "</title>\n";
1953
1955 writeInnerFiles(gd->getFiles(),t);
1959 writeInnerPages(gd->getPages(),t);
1961
1962 for (const auto &mg : gd->getMemberGroups())
1963 {
1964 generateXMLSection(gd,ti,t,&mg->members(),"user-defined",mg->header(),
1965 mg->documentation());
1966 }
1967
1968 for (const auto &ml : gd->getMemberLists())
1969 {
1970 if (ml->listType().isDeclaration())
1971 {
1972 generateXMLSection(gd,ti,t,ml.get(),ml->listType().toXML());
1973 }
1974 }
1975
1976 t << " <briefdescription>\n";
1977 writeXMLDocBlock(t,gd->briefFile(),gd->briefLine(),gd,nullptr,gd->briefDescription());
1978 t << " </briefdescription>\n";
1979 t << " <detaileddescription>\n";
1980 writeXMLDocBlock(t,gd->docFile(),gd->docLine(),gd,nullptr,gd->documentation());
1981 t << " </detaileddescription>\n";
1982 t << " </compounddef>\n";
1983 t << "</doxygen>\n";
1984
1985 ti << " </compound>\n";
1986}
1987
1989{
1990 if (dd->isReference()) return; // skip external references
1991 ti << " <compound refid=\"" << dd->getOutputFileBase()
1992 << "\" kind=\"dir\"><name>" << convertToXML(dd->displayName())
1993 << "</name>\n";
1994
1995 QCString outputDirectory = Config_getString(XML_OUTPUT);
1996 QCString fileName=outputDirectory+"/"+dd->getOutputFileBase()+".xml";
1997 std::ofstream f = Portable::openOutputStream(fileName);
1998 if (!f.is_open())
1999 {
2000 err("Cannot open file %s for writing!\n",qPrint(fileName));
2001 return;
2002 }
2003 TextStream t(&f);
2004
2005 writeXMLHeader(t);
2006 t << " <compounddef id=\""
2007 << dd->getOutputFileBase() << "\" kind=\"dir\">\n";
2008 t << " <compoundname>" << convertToXML(dd->displayName()) << "</compoundname>\n";
2009
2010 writeInnerDirs(&dd->subDirs(),t);
2011 writeInnerFiles(dd->getFiles(),t);
2012
2013 t << " <briefdescription>\n";
2014 writeXMLDocBlock(t,dd->briefFile(),dd->briefLine(),dd,nullptr,dd->briefDescription());
2015 t << " </briefdescription>\n";
2016 t << " <detaileddescription>\n";
2017 writeXMLDocBlock(t,dd->docFile(),dd->docLine(),dd,nullptr,dd->documentation());
2018 t << " </detaileddescription>\n";
2019 t << " <location file=\"" << convertToXML(stripFromPath(dd->name())) << "\"/>\n";
2020 t << " </compounddef>\n";
2021 t << "</doxygen>\n";
2022
2023 ti << " </compound>\n";
2024}
2025
2026static void generateXMLForPage(PageDef *pd,TextStream &ti,bool isExample)
2027{
2028 // + name
2029 // + title
2030 // + documentation
2031 // + location
2032
2033 const char *kindName = isExample ? "example" : "page";
2034
2035 if (pd->isReference()) return;
2036
2037 QCString pageName = pd->getOutputFileBase();
2038 if (pd->getGroupDef())
2039 {
2040 pageName+=QCString("_")+pd->name();
2041 }
2042 if (pageName=="index") pageName="indexpage"; // to prevent overwriting the generated index page.
2043
2044 ti << " <compound refid=\"" << pageName
2045 << "\" kind=\"" << kindName << "\"><name>" << convertToXML(pd->name())
2046 << "</name>\n";
2047
2048 QCString outputDirectory = Config_getString(XML_OUTPUT);
2049 QCString fileName=outputDirectory+"/"+pageName+".xml";
2050 std::ofstream f = Portable::openOutputStream(fileName);
2051 if (!f.is_open())
2052 {
2053 err("Cannot open file %s for writing!\n",qPrint(fileName));
2054 return;
2055 }
2056 TextStream t(&f);
2057
2058 writeXMLHeader(t);
2059 t << " <compounddef id=\"" << pageName;
2060 t << "\" kind=\"" << kindName << "\">\n";
2061 t << " <compoundname>" << convertToXML(pd->name())
2062 << "</compoundname>\n";
2063
2064 if (pd==Doxygen::mainPage.get()) // main page is special
2065 {
2066 QCString title;
2067 if (mainPageHasTitle())
2068 {
2070 }
2071 else
2072 {
2073 title = Config_getString(PROJECT_NAME);
2074 }
2075 t << " <title>" << convertToXML(convertCharEntitiesToUTF8(title))
2076 << "</title>\n";
2077 }
2078 else
2079 {
2080 const SectionInfo *si = SectionManager::instance().find(pd->name());
2081 if (si)
2082 {
2083 t << " <title>" << convertToXML(filterTitle(convertCharEntitiesToUTF8(si->title())))
2084 << "</title>\n";
2085 }
2086 }
2088 const SectionRefs &sectionRefs = pd->getSectionRefs();
2089 if (pd->localToc().isXmlEnabled() && !sectionRefs.empty())
2090 {
2091 int level=1;
2092 int indent=0;
2093 auto writeIndent = [&]() { for (int i=0;i<4+indent*2;i++) t << " "; };
2094 auto incIndent = [&](const char *text) { writeIndent(); t << text << "\n"; indent++; };
2095 auto decIndent = [&](const char *text) { indent--; writeIndent(); t << text << "\n"; };
2096 incIndent("<tableofcontents>");
2097 int maxLevel = pd->localToc().xmlLevel();
2098 BoolVector inLi(maxLevel+1,false);
2099 for (const SectionInfo *si : sectionRefs)
2100 {
2101 if (si->type().isSection())
2102 {
2103 //printf(" level=%d title=%s\n",level,qPrint(si->title));
2104 int nextLevel = si->type().level();
2105 if (nextLevel>level)
2106 {
2107 for (int l=level;l<nextLevel;l++)
2108 {
2109 if (l < maxLevel) incIndent("<tableofcontents>");
2110 }
2111 }
2112 else if (nextLevel<level)
2113 {
2114 for (int l=level;l>nextLevel;l--)
2115 {
2116 if (l <= maxLevel && inLi[l]) decIndent("</tocsect>");
2117 inLi[l]=false;
2118 if (l <= maxLevel) decIndent("</tableofcontents>");
2119 }
2120 }
2121 if (nextLevel <= maxLevel)
2122 {
2123 if (inLi[nextLevel])
2124 {
2125 decIndent("</tocsect>");
2126 }
2127 else if (level>nextLevel)
2128 {
2129 decIndent("</tableofcontents>");
2130 incIndent("<tableofcontents>");
2131 }
2132 QCString titleDoc = convertToXML(si->title());
2133 QCString label = convertToXML(si->label());
2134 if (titleDoc.isEmpty()) titleDoc = label;
2135 incIndent("<tocsect>");
2136 writeIndent(); t << "<name>" << titleDoc << "</name>\n";
2137 writeIndent(); t << "<reference>" << convertToXML(pageName) << "_1" << label << "</reference>\n";
2138 inLi[nextLevel]=true;
2139 level = nextLevel;
2140 }
2141 }
2142 }
2143 while (level>1 && level <= maxLevel)
2144 {
2145 if (inLi[level]) decIndent("</tocsect>");
2146 inLi[level]=false;
2147 decIndent("</tableofcontents>");
2148 level--;
2149 }
2150 if (level <= maxLevel && inLi[level]) decIndent("</tocsect>");
2151 inLi[level]=false;
2152 decIndent("</tableofcontents>");
2153 }
2154 t << " <briefdescription>\n";
2155 writeXMLDocBlock(t,pd->briefFile(),pd->briefLine(),pd,nullptr,pd->briefDescription());
2156 t << " </briefdescription>\n";
2157 t << " <detaileddescription>\n";
2158 if (isExample)
2159 {
2160 writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,nullptr,
2161 pd->documentation()+"\n\\include "+pd->name());
2162 }
2163 else
2164 {
2165 writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,nullptr,
2166 pd->documentation());
2167 }
2168 t << " </detaileddescription>\n";
2169
2170 t << " <location file=\"" << convertToXML(stripFromPath(pd->getDefFileName())) << "\"/>\n";
2171
2172 t << " </compounddef>\n";
2173 t << "</doxygen>\n";
2174
2175 ti << " </compound>\n";
2176}
2177
2179{
2180 // + classes
2181 // + concepts
2182 // + namespaces
2183 // + files
2184 // + groups
2185 // + related pages
2186 // - examples
2187
2188 QCString outputDirectory = Config_getString(XML_OUTPUT);
2189 Dir xmlDir(outputDirectory.str());
2190 createSubDirs(xmlDir);
2191
2192 ResourceMgr::instance().copyResource("xml.xsd",outputDirectory);
2193 ResourceMgr::instance().copyResource("index.xsd",outputDirectory);
2194
2195 QCString fileName=outputDirectory+"/compound.xsd";
2196 std::ofstream f = Portable::openOutputStream(fileName);
2197 if (!f.is_open())
2198 {
2199 err("Cannot open file %s for writing!\n",qPrint(fileName));
2200 return;
2201 }
2202 {
2203 TextStream t(&f);
2204
2205 // write compound.xsd, but replace special marker with the entities
2206 QCString compound_xsd = ResourceMgr::instance().getAsString("compound.xsd");
2207 const char *startLine = compound_xsd.data();
2208 while (*startLine)
2209 {
2210 // find end of the line
2211 const char *endLine = startLine+1;
2212 while (*endLine && *(endLine-1)!='\n') endLine++; // skip to end of the line including \n
2213 int len=static_cast<int>(endLine-startLine);
2214 if (len>0)
2215 {
2216 QCString s(startLine,len);
2217 if (s.find("<!-- Automatically insert here the HTML entities -->")!=-1)
2218 {
2220 }
2221 else
2222 {
2223 t.write(startLine,len);
2224 }
2225 }
2226 startLine=endLine;
2227 }
2228 }
2229 f.close();
2230
2231 fileName=outputDirectory+"/doxyfile.xsd";
2232 f = Portable::openOutputStream(fileName);
2233 if (!f.is_open())
2234 {
2235 err("Cannot open file %s for writing!\n",qPrint(fileName));
2236 return;
2237 }
2238 {
2239 TextStream t(&f);
2240
2241 // write doxyfile.xsd, but replace special marker with the entities
2242 QCString doxyfile_xsd = ResourceMgr::instance().getAsString("doxyfile.xsd");
2243 const char *startLine = doxyfile_xsd.data();
2244 while (*startLine)
2245 {
2246 // find end of the line
2247 const char *endLine = startLine+1;
2248 while (*endLine && *(endLine-1)!='\n') endLine++; // skip to end of the line including \n
2249 int len=static_cast<int>(endLine-startLine);
2250 if (len>0)
2251 {
2252 QCString s(startLine,len);
2253 if (s.find("<!-- Automatically insert here the configuration settings -->")!=-1)
2254 {
2256 }
2257 else
2258 {
2259 t.write(startLine,len);
2260 }
2261 }
2262 startLine=endLine;
2263 }
2264 }
2265 f.close();
2266
2267 fileName=outputDirectory+"/Doxyfile.xml";
2268 f = Portable::openOutputStream(fileName);
2269 if (!f.is_open())
2270 {
2271 err("Cannot open file %s for writing\n",fileName.data());
2272 return;
2273 }
2274 else
2275 {
2276 TextStream t(&f);
2278 }
2279 f.close();
2280
2281 fileName=outputDirectory+"/index.xml";
2282 f = Portable::openOutputStream(fileName);
2283 if (!f.is_open())
2284 {
2285 err("Cannot open file %s for writing!\n",qPrint(fileName));
2286 return;
2287 }
2288 else
2289 {
2290 TextStream t(&f);
2291
2292 // write index header
2293 t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n";
2294 t << "<doxygenindex xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
2295 t << "xsi:noNamespaceSchemaLocation=\"index.xsd\" ";
2296 t << "version=\"" << getDoxygenVersion() << "\" ";
2297 t << "xml:lang=\"" << theTranslator->trISOLang() << "\"";
2298 t << ">\n";
2299
2300 for (const auto &cd : *Doxygen::classLinkedMap)
2301 {
2302 generateXMLForClass(cd.get(),t);
2303 }
2304 for (const auto &cd : *Doxygen::conceptLinkedMap)
2305 {
2306 msg("Generating XML output for concept %s\n",qPrint(cd->displayName()));
2307 generateXMLForConcept(cd.get(),t);
2308 }
2309 for (const auto &nd : *Doxygen::namespaceLinkedMap)
2310 {
2311 msg("Generating XML output for namespace %s\n",qPrint(nd->displayName()));
2312 generateXMLForNamespace(nd.get(),t);
2313 }
2314 for (const auto &fn : *Doxygen::inputNameLinkedMap)
2315 {
2316 for (const auto &fd : *fn)
2317 {
2318 msg("Generating XML output for file %s\n",qPrint(fd->name()));
2319 generateXMLForFile(fd.get(),t);
2320 }
2321 }
2322 for (const auto &gd : *Doxygen::groupLinkedMap)
2323 {
2324 msg("Generating XML output for group %s\n",qPrint(gd->name()));
2325 generateXMLForGroup(gd.get(),t);
2326 }
2327 for (const auto &pd : *Doxygen::pageLinkedMap)
2328 {
2329 msg("Generating XML output for page %s\n",qPrint(pd->name()));
2330 generateXMLForPage(pd.get(),t,FALSE);
2331 }
2332 for (const auto &dd : *Doxygen::dirLinkedMap)
2333 {
2334 msg("Generate XML output for dir %s\n",qPrint(dd->name()));
2335 generateXMLForDir(dd.get(),t);
2336 }
2337 for (const auto &mod : ModuleManager::instance().modules())
2338 {
2339 msg("Generating XML output for module %s\n",qPrint(mod->name()));
2340 generateXMLForModule(mod.get(),t);
2341 }
2342 for (const auto &pd : *Doxygen::exampleLinkedMap)
2343 {
2344 msg("Generating XML output for example %s\n",qPrint(pd->name()));
2345 generateXMLForPage(pd.get(),t,TRUE);
2346 }
2348 {
2349 msg("Generating XML output for the main page\n");
2351 }
2352
2353 //t << " </compoundlist>\n";
2354 t << "</doxygenindex>\n";
2355 }
2356
2358 clearSubDirs(xmlDir);
2359}
2360
2361
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:1460
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:578
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:245
void resize(size_t newlen)
Definition qcstring.h:167
const std::string & str() const
Definition qcstring.h:537
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, ImportInfoList > ImportInfoMap
Definition moduledef.h:61
void writeXMLDoxyfile(TextStream &t)
void writeXSDDoxyfile(TextStream &t)
std::ofstream openOutputStream(const QCString &name, bool append=false)
Definition portable.cpp:665
Portable versions of functions that are platform dependent.
const char * qPrint(const char *s)
Definition qcstring.h:672
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
#define ASSERT(x)
Definition qcstring.h:39
static void writeIndent(TextStream &t, int indent)
Definition qhp.cpp:37
This class contains the information about the argument of a function or template.
Definition arguments.h:27
QCString type
Definition arguments.h: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:7208
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5549
bool mainPageHasTitle()
Definition util.cpp:6612
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:5921
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:6204
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
Definition util.cpp:6230
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:1919
void generateXML()
Definition xmlgen.cpp:2178
static void writeInnerConcepts(const ConceptLinkedRefMap &cl, TextStream &t)
Definition xmlgen.cpp:1314
static void writeInnerGroups(const GroupList &gl, TextStream &t)
Definition xmlgen.cpp:1395
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:1405
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:1437
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:1804
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:1417
static void stripQualifiers(QCString &typeStr)
Definition xmlgen.cpp:531
static void writeInnerPages(const PageLinkedRefMap &pl, TextStream &t)
Definition xmlgen.cpp:1382
static void generateXMLForNamespace(const NamespaceDef *nd, TextStream &ti)
Definition xmlgen.cpp:1731
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:1676
static void generateXMLForConcept(const ConceptDef *cd, TextStream &ti)
Definition xmlgen.cpp:1630
static void writeExports(const ImportInfoMap &exportMap, TextStream &t)
Definition xmlgen.cpp:1351
static void writeInnerFiles(const FileList &fl, TextStream &t)
Definition xmlgen.cpp:1373
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:1988
static void generateXMLForPage(PageDef *pd, TextStream &ti, bool isExample)
Definition xmlgen.cpp:2026
static QCString extractNoExcept(QCString &argsStr)
Definition xmlgen.cpp:566
static void writeCombineScript()
Definition xmlgen.cpp:128