Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/util/doxygen/src/xmlgen.cpp

Source at commit 1322 created 9 years 5 months ago.
By meklort, Add doxygen to utils folder
1/******************************************************************************
2 *
3 * $Id: xml.cpp,v 1.2 2001/01/01 10:15:18 root Exp $
4 *
5 *
6 * Copyright (C) 1997-2011 by Dimitri van Heesch.
7 *
8 * Permission to use, copy, modify, and distribute this software and its
9 * documentation under the terms of the GNU General Public License is hereby
10 * granted. No representations are made about the suitability of this software
11 * for any purpose. It is provided "as is" without express or implied warranty.
12 * See the GNU General Public License for more details.
13 *
14 * Documents produced by Doxygen are derivative works derived from the
15 * input used in their production; they are not affected by this license.
16 *
17 */
18
19#include <stdlib.h>
20
21#include "qtbc.h"
22#include "xmlgen.h"
23#include "doxygen.h"
24#include "message.h"
25#include "config.h"
26#include "classlist.h"
27#include "util.h"
28#include "defargs.h"
29#include "outputgen.h"
30#include "dot.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
39#include <qdir.h>
40#include <qfile.h>
41#include <qtextstream.h>
42#include <qintdict.h>
43
44// no debug info
45#define XML_DB(x) do {} while(0)
46// debug to stdout
47//#define XML_DB(x) printf x
48// debug inside output
49//#define XML_DB(x) QCString __t;__t.sprintf x;m_t << __t
50
51//------------------
52
53static const char index_xsd[] =
54#include "index_xsd.h"
55;
56
57//------------------
58//
59static const char compound_xsd[] =
60#include "compound_xsd.h"
61;
62
63//------------------
64
65class XmlSectionMapper : public QIntDict<char>
66{
67 public:
68 XmlSectionMapper() : QIntDict<char>(47)
69 {
70 insert(MemberList::pubTypes,"public-type");
71 insert(MemberList::pubMethods,"public-func");
72 insert(MemberList::pubAttribs,"public-attrib");
73 insert(MemberList::pubSlots,"public-slot");
74 insert(MemberList::signals,"signal");
75 insert(MemberList::dcopMethods,"dcop-func");
76 insert(MemberList::properties,"property");
77 insert(MemberList::events,"event");
78 insert(MemberList::pubStaticMethods,"public-static-func");
79 insert(MemberList::pubStaticAttribs,"public-static-attrib");
80 insert(MemberList::proTypes,"protected-type");
81 insert(MemberList::proMethods,"protected-func");
82 insert(MemberList::proAttribs,"protected-attrib");
83 insert(MemberList::proSlots,"protected-slot");
84 insert(MemberList::proStaticMethods,"protected-static-func");
85 insert(MemberList::proStaticAttribs,"protected-static-attrib");
86 insert(MemberList::pacTypes,"package-type");
87 insert(MemberList::pacMethods,"package-func");
88 insert(MemberList::pacAttribs,"package-attrib");
89 insert(MemberList::pacStaticMethods,"package-static-func");
90 insert(MemberList::pacStaticAttribs,"package-static-attrib");
91 insert(MemberList::priTypes,"private-type");
92 insert(MemberList::priMethods,"private-func");
93 insert(MemberList::priAttribs,"private-attrib");
94 insert(MemberList::priSlots,"private-slot");
95 insert(MemberList::priStaticMethods,"private-static-func");
96 insert(MemberList::priStaticAttribs,"private-static-attrib");
97 insert(MemberList::friends,"friend");
98 insert(MemberList::related,"related");
99 insert(MemberList::decDefineMembers,"define");
100 insert(MemberList::decProtoMembers,"prototype");
101 insert(MemberList::decTypedefMembers,"typedef");
102 insert(MemberList::decEnumMembers,"enum");
103 insert(MemberList::decFuncMembers,"func");
104 insert(MemberList::decVarMembers,"var");
105 }
106};
107
108static XmlSectionMapper g_xmlSectionMapper;
109
110
111inline void writeXMLString(FTextStream &t,const char *s)
112{
113 t << convertToXML(s);
114}
115
116inline void writeXMLCodeString(FTextStream &t,const char *s, int &col)
117{
118 char c;
119 while ((c=*s++))
120 {
121 switch(c)
122 {
123 case '\t':
124 {
125int spacesToNextTabStop =
126 Config_getInt("TAB_SIZE") - (col%Config_getInt("TAB_SIZE"));
127col+=spacesToNextTabStop;
128while (spacesToNextTabStop--) t << "<sp/>";
129break;
130}
131 case ' ': t << "<sp/>"; col++; break;
132 case '<': t << "&lt;"; col++; break;
133 case '>': t << "&gt;"; col++; break;
134 case '&': t << "&amp;"; col++; break;
135 case '\'': t << "&apos;"; col++; break;
136 case '"': t << "&quot;"; col++; break;
137 default: t << c; col++; break;
138 }
139 }
140}
141
142
143static void writeXMLHeader(FTextStream &t)
144{
145 t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << endl;;
146 t << "<doxygen xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
147 t << "xsi:noNamespaceSchemaLocation=\"compound.xsd\" ";
148 t << "version=\"" << versionString << "\">" << endl;
149}
150
151static void writeCombineScript()
152{
153 QCString outputDirectory = Config_getString("XML_OUTPUT");
154 QCString fileName=outputDirectory+"/combine.xslt";
155 QFile f(fileName);
156 if (!f.open(IO_WriteOnly))
157 {
158 err("Cannot open file %s for writing!\n",fileName.data());
159 return;
160 }
161 FTextStream t(&f);
162 //t.setEncoding(FTextStream::UnicodeUTF8);
163
164 t <<
165 "<!-- XSLT script to combine the generated output into a single file. \n"
166 " If you have xsltproc you could use:\n"
167 " xsltproc combine.xslt index.xml >all.xml\n"
168 "-->\n"
169 "<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">\n"
170 " <xsl:output method=\"xml\" version=\"1.0\" indent=\"no\" standalone=\"yes\" />\n"
171 " <xsl:template match=\"/\">\n"
172 " <doxygen version=\"{doxygenindex/@version}\">\n"
173 " <!-- Load all doxgen generated xml files -->\n"
174 " <xsl:for-each select=\"doxygenindex/compound\">\n"
175 " <xsl:copy-of select=\"document( concat( @refid, '.xml' ) )/doxygen/*\" />\n"
176 " </xsl:for-each>\n"
177 " </doxygen>\n"
178 " </xsl:template>\n"
179 "</xsl:stylesheet>\n";
180
181}
182
183void writeXMLLink(FTextStream &t,const char *extRef,const char *compoundId,
184 const char *anchorId,const char *text,const char *tooltip)
185{
186 t << "<ref refid=\"" << compoundId;
187 if (anchorId) t << "_1" << anchorId;
188 t << "\" kindref=\"";
189 if (anchorId) t << "member"; else t << "compound";
190 t << "\"";
191 if (extRef) t << " external=\"" << extRef << "\"";
192 if (tooltip) t << " tooltip=\"" << convertToXML(tooltip) << "\"";
193 t << ">";
194 writeXMLString(t,text);
195 t << "</ref>";
196}
197
198class TextGeneratorXMLImpl : public TextGeneratorIntf
199{
200 public:
201 TextGeneratorXMLImpl(FTextStream &t): m_t(t) {}
202 void writeString(const char *s,bool /*keepSpaces*/) const
203 {
204 writeXMLString(m_t,s);
205 }
206 void writeBreak() const {}
207 void writeLink(const char *extRef,const char *file,
208 const char *anchor,const char *text
209 ) const
210 {
211 writeXMLLink(m_t,extRef,file,anchor,text,0);
212 }
213 private:
214 FTextStream &m_t;
215};
216
217template<class T> class ValStack
218{
219 public:
220 ValStack() : m_values(10), m_sp(0), m_size(10) {}
221 virtual ~ValStack() {}
222 ValStack(const ValStack<T> &s)
223 {
224 m_values=s.m_values.copy();
225 m_sp=s.m_sp;
226 m_size=s.m_size;
227 }
228 ValStack &operator=(const ValStack<T> &s)
229 {
230 m_values=s.m_values.copy();
231 m_sp=s.m_sp;
232 m_size=s.m_size;
233 return *this;
234 }
235 void push(T v)
236 {
237 m_sp++;
238 if (m_sp>=m_size)
239 {
240 m_size+=10;
241 m_values.resize(m_size);
242 }
243 m_values[m_sp]=v;
244 }
245 T pop()
246 {
247 ASSERT(m_sp!=0);
248 return m_values[m_sp--];
249 }
250 T& top()
251 {
252 ASSERT(m_sp!=0);
253 return m_values[m_sp];
254 }
255 bool isEmpty()
256 {
257 return m_sp==0;
258 }
259 uint count() const
260 {
261 return m_sp;
262 }
263
264 private:
265 QArray<T> m_values;
266 int m_sp;
267 int m_size;
268};
269
270
271class XMLCodeGenerator : public CodeOutputInterface
272{
273 public:
274
275 XMLCodeGenerator(FTextStream &t) : m_t(t), m_lineNumber(-1),
276 m_insideCodeLine(FALSE), m_normalHLNeedStartTag(TRUE),
277 m_insideSpecialHL(FALSE) {}
278 virtual ~XMLCodeGenerator() { }
279
280 void codify(const char *text)
281 {
282 XML_DB(("(codify \"%s\")\n",text));
283 if (m_insideCodeLine && !m_insideSpecialHL && m_normalHLNeedStartTag)
284 {
285 m_t << "<highlight class=\"normal\">";
286 m_normalHLNeedStartTag=FALSE;
287 }
288 writeXMLCodeString(m_t,text,col);
289 }
290 void writeCodeLink(const char *ref,const char *file,
291 const char *anchor,const char *name,
292 const char *tooltip)
293 {
294 XML_DB(("(writeCodeLink)\n"));
295 if (m_insideCodeLine && !m_insideSpecialHL && m_normalHLNeedStartTag)
296 {
297 m_t << "<highlight class=\"normal\">";
298 m_normalHLNeedStartTag=FALSE;
299 }
300 writeXMLLink(m_t,ref,file,anchor,name,tooltip);
301 col+=strlen(name);
302 }
303 void startCodeLine()
304 {
305 XML_DB(("(startCodeLine)\n"));
306 m_t << "<codeline";
307 if (m_lineNumber!=-1)
308 {
309 m_t << " lineno=\"" << m_lineNumber << "\"";
310 if (!m_refId.isEmpty())
311 {
312 m_t << " refid=\"" << m_refId << "\"";
313 if (m_isMemberRef)
314 {
315 m_t << " refkind=\"member\"";
316 }
317 else
318 {
319 m_t << " refkind=\"compound\"";
320 }
321 }
322 if (!m_external.isEmpty())
323 {
324 m_t << " external=\"" << m_external << "\"";
325 }
326 }
327 m_t << ">";
328 m_insideCodeLine=TRUE;
329 col=0;
330 }
331 void endCodeLine()
332 {
333 XML_DB(("(endCodeLine)\n"));
334 if (!m_insideSpecialHL && !m_normalHLNeedStartTag)
335 {
336 m_t << "</highlight>";
337 m_normalHLNeedStartTag=TRUE;
338 }
339 m_t << "</codeline>" << endl; // non DocBook
340 m_lineNumber = -1;
341 m_refId.resize(0);
342 m_external.resize(0);
343 m_insideCodeLine=FALSE;
344 }
345 void startCodeAnchor(const char *id)
346 {
347 XML_DB(("(startCodeAnchor)\n"));
348 if (m_insideCodeLine && !m_insideSpecialHL && m_normalHLNeedStartTag)
349 {
350 m_t << "<highlight class=\"normal\">";
351 m_normalHLNeedStartTag=FALSE;
352 }
353 m_t << "<anchor id=\"" << id << "\">";
354 }
355 void endCodeAnchor()
356 {
357 XML_DB(("(endCodeAnchor)\n"));
358 m_t << "</anchor>";
359 }
360 void startFontClass(const char *colorClass)
361 {
362 XML_DB(("(startFontClass)\n"));
363 if (m_insideCodeLine && !m_insideSpecialHL && !m_normalHLNeedStartTag)
364 {
365 m_t << "</highlight>";
366 m_normalHLNeedStartTag=TRUE;
367 }
368 m_t << "<highlight class=\"" << colorClass << "\">"; // non DocBook
369 m_insideSpecialHL=TRUE;
370 }
371 void endFontClass()
372 {
373 XML_DB(("(endFontClass)\n"));
374 m_t << "</highlight>"; // non DocBook
375 m_insideSpecialHL=FALSE;
376 }
377 void writeCodeAnchor(const char *)
378 {
379 XML_DB(("(writeCodeAnchor)\n"));
380 }
381 void writeLineNumber(const char *extRef,const char *compId,
382 const char *anchorId,int l)
383 {
384 XML_DB(("(writeLineNumber)\n"));
385 // we remember the information provided here to use it
386 // at the <codeline> start tag.
387 m_lineNumber = l;
388 if (compId)
389 {
390 m_refId=compId;
391 if (anchorId) m_refId+=(QCString)"_1"+anchorId;
392 m_isMemberRef = anchorId!=0;
393 if (extRef) m_external=extRef;
394 }
395 }
396 void linkableSymbol(int, const char *,Definition *,Definition *)
397 {
398 }
399
400 void finish()
401 {
402 if (m_insideCodeLine) endCodeLine();
403 }
404
405 private:
406 FTextStream &m_t;
407 QCString m_refId;
408 QCString m_external;
409 int m_lineNumber;
410 bool m_isMemberRef;
411 int col;
412
413 bool m_insideCodeLine;
414 bool m_normalHLNeedStartTag;
415 bool m_insideSpecialHL;
416};
417
418
419static void writeTemplateArgumentList(ArgumentList *al,
420 FTextStream &t,
421 Definition *scope,
422 FileDef *fileScope,
423 int indent)
424{
425 QCString indentStr;
426 indentStr.fill(' ',indent);
427 if (al)
428 {
429 t << indentStr << "<templateparamlist>" << endl;
430 ArgumentListIterator ali(*al);
431 Argument *a;
432 for (ali.toFirst();(a=ali.current());++ali)
433 {
434 t << indentStr << " <param>" << endl;
435 if (!a->type.isEmpty())
436 {
437 t << indentStr << " <type>";
438 linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a->type);
439 t << "</type>" << endl;
440 }
441 if (!a->name.isEmpty())
442 {
443 t << indentStr << " <declname>" << a->name << "</declname>" << endl;
444 t << indentStr << " <defname>" << a->name << "</defname>" << endl;
445 }
446 if (!a->defval.isEmpty())
447 {
448 t << indentStr << " <defval>";
449 linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a->defval);
450 t << "</defval>" << endl;
451 }
452 t << indentStr << " </param>" << endl;
453 }
454 t << indentStr << "</templateparamlist>" << endl;
455 }
456}
457
458static void writeMemberTemplateLists(MemberDef *md,FTextStream &t)
459{
460 LockingPtr<ArgumentList> templMd = md->templateArguments();
461 if (templMd!=0) // function template prefix
462 {
463 writeTemplateArgumentList(templMd.pointer(),t,md->getClassDef(),md->getFileDef(),8);
464 }
465}
466
467static void writeTemplateList(ClassDef *cd,FTextStream &t)
468{
469 writeTemplateArgumentList(cd->templateArguments(),t,cd,0,4);
470}
471
472static void writeXMLDocBlock(FTextStream &t,
473 const QCString &fileName,
474 int lineNr,
475 Definition *scope,
476 MemberDef * md,
477 const QCString &text)
478{
479 QCString stext = text.stripWhiteSpace();
480 if (stext.isEmpty()) return;
481 // convert the documentation string into an abstract syntax tree
482 DocNode *root = validatingParseDoc(fileName,lineNr,scope,md,text+"\n",FALSE,FALSE);
483 // create a code generator
484 XMLCodeGenerator *xmlCodeGen = new XMLCodeGenerator(t);
485 // create a parse tree visitor for XML
486 XmlDocVisitor *visitor = new XmlDocVisitor(t,*xmlCodeGen);
487 // visit all nodes
488 root->accept(visitor);
489 // clean up
490 delete visitor;
491 delete xmlCodeGen;
492 delete root;
493
494}
495
496void writeXMLCodeBlock(FTextStream &t,FileDef *fd)
497{
498 ParserInterface *pIntf=Doxygen::parserManager->getParser(fd->getDefFileExtension());
499 pIntf->resetCodeParserState();
500 XMLCodeGenerator *xmlGen = new XMLCodeGenerator(t);
501 pIntf->parseCode(*xmlGen,
502 0,
503 fileToString(fd->absFilePath(),Config_getBool("FILTER_SOURCE_FILES")),
504 FALSE,
505 0,
506 fd);
507 xmlGen->finish();
508 delete xmlGen;
509}
510
511static void writeMemberReference(FTextStream &t,Definition *def,MemberDef *rmd,const char *tagName)
512{
513 QCString scope = rmd->getScopeString();
514 QCString name = rmd->name();
515 if (!scope.isEmpty() && scope!=def->name())
516 {
517 name.prepend(scope+"::");
518 }
519 t << " <" << tagName << " refid=\"";
520 t << rmd->getOutputFileBase() << "_1" << rmd->anchor() << "\"";
521 if (rmd->getStartBodyLine()!=-1 && rmd->getBodyDef())
522 {
523 t << " compoundref=\"" << rmd->getBodyDef()->getOutputFileBase() << "\"";
524 t << " startline=\"" << rmd->getStartBodyLine() << "\"";
525 if (rmd->getEndBodyLine()!=-1)
526 {
527 t << " endline=\"" << rmd->getEndBodyLine() << "\"";
528 }
529 }
530 t << ">" << convertToXML(name) << "</" << tagName << ">" << endl;
531
532}
533
534static void stripQualifiers(QCString &typeStr)
535{
536 bool done=FALSE;
537 while (!done)
538 {
539 if (typeStr.stripPrefix("static "));
540 else if (typeStr.stripPrefix("virtual "));
541 else if (typeStr.stripPrefix("volatile "));
542 else if (typeStr=="virtual") typeStr="";
543 else done=TRUE;
544 }
545}
546
547static QCString classOutputFileBase(ClassDef *cd)
548{
549 static bool inlineGroupedClasses = Config_getBool("INLINE_GROUPED_CLASSES");
550 if (inlineGroupedClasses && cd->partOfGroups()!=0)
551 return cd->getXmlOutputFileBase();
552 else
553 return cd->getOutputFileBase();
554}
555
556static QCString memberOutputFileBase(MemberDef *md)
557{
558 static 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}
564
565
566static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,Definition *def)
567{
568
569 // + declaration/definition arg lists
570 // + reimplements
571 // + reimplementedBy
572 // + exceptions
573 // + const/volatile specifiers
574 // - examples
575 // + source definition
576 // + source references
577 // + source referenced by
578 // - body code
579 // + template arguments
580 // (templateArguments(), definitionTemplateParameterLists())
581 // - call graph
582
583 // enum values are written as part of the enum
584 if (md->memberType()==MemberDef::EnumValue) return;
585 if (md->isHidden()) return;
586 //if (md->name().at(0)=='@') return; // anonymous member
587
588 // group members are only visible in their group
589 //if (def->definitionType()!=Definition::TypeGroup && md->getGroupDef()) return;
590
591 QCString memType;
592 bool isFunc=FALSE;
593 switch (md->memberType())
594 {
595 case MemberDef::Define: memType="define"; break;
596 case MemberDef::EnumValue: ASSERT(0); break;
597 case MemberDef::Property: memType="property"; break;
598 case MemberDef::Event: memType="event"; break;
599 case MemberDef::Variable: memType="variable"; break;
600 case MemberDef::Typedef: memType="typedef"; break;
601 case MemberDef::Enumeration: memType="enum"; break;
602 case MemberDef::Function: memType="function"; isFunc=TRUE; break;
603 case MemberDef::Signal: memType="signal"; isFunc=TRUE; break;
604 case MemberDef::Friend: memType="friend"; isFunc=TRUE; break;
605 case MemberDef::DCOP: memType="dcop"; isFunc=TRUE; break;
606 case MemberDef::Slot: memType="slot"; isFunc=TRUE; break;
607 }
608
609 ti << " <member refid=\"" << memberOutputFileBase(md)
610 << "_1" << md->anchor() << "\" kind=\"" << memType << "\"><name>"
611 << convertToXML(md->name()) << "</name></member>" << endl;
612
613 QCString scopeName;
614 if (md->getClassDef())
615 scopeName=md->getClassDef()->name();
616 else if (md->getNamespaceDef())
617 scopeName=md->getNamespaceDef()->name();
618
619 t << " <memberdef kind=\"";
620 //enum { define_t,variable_t,typedef_t,enum_t,function_t } xmlType = function_t;
621 t << memType << "\" id=\"";
622 if (md->getGroupDef() && def->definitionType()==Definition::TypeGroup)
623 {
624 t << md->getGroupDef()->getOutputFileBase();
625 }
626 else
627 {
628 t << memberOutputFileBase(md);
629 }
630 t << "_1" // encoded `:' character (see util.cpp:convertNameToFile)
631 << md->anchor();
632 t << "\" prot=\"";
633 switch(md->protection())
634 {
635 case Public: t << "public"; break;
636 case Protected: t << "protected"; break;
637 case Private: t << "private"; break;
638 case Package: t << "package"; break;
639 }
640 t << "\"";
641
642 t << " static=\"";
643 if (md->isStatic()) t << "yes"; else t << "no";
644 t << "\"";
645
646 if (isFunc)
647 {
648 LockingPtr<ArgumentList> al = md->argumentList();
649 t << " const=\"";
650 if (al!=0 && al->constSpecifier) t << "yes"; else t << "no";
651 t << "\"";
652
653 t << " explicit=\"";
654 if (md->isExplicit()) t << "yes"; else t << "no";
655 t << "\"";
656
657 t << " inline=\"";
658 if (md->isInline()) t << "yes"; else t << "no";
659 t << "\"";
660
661 if (md->isFinal())
662 {
663 t << " final=\"yes\"";
664 }
665
666 if (md->isSealed())
667 {
668 t << " sealed=\"yes\"";
669 }
670
671 if (md->isNew())
672 {
673 t << " new=\"yes\"";
674 }
675
676 if (md->isOptional())
677 {
678 t << " optional=\"yes\"";
679 }
680
681 if (md->isRequired())
682 {
683 t << " required=\"yes\"";
684 }
685
686 t << " virt=\"";
687 switch (md->virtualness())
688 {
689 case Normal: t << "non-virtual"; break;
690 case Virtual: t << "virtual"; break;
691 case Pure: t << "pure-virtual"; break;
692 default: ASSERT(0);
693 }
694 t << "\"";
695 }
696
697 if (md->memberType() == MemberDef::Variable)
698 {
699 //ArgumentList *al = md->argumentList();
700 //t << " volatile=\"";
701 //if (al && al->volatileSpecifier) t << "yes"; else t << "no";
702
703 t << " mutable=\"";
704 if (md->isMutable()) t << "yes"; else t << "no";
705 t << "\"";
706
707 if (md->isInitonly())
708 {
709 t << " initonly=\"yes\"";
710 }
711
712 }
713 else if (md->memberType() == MemberDef::Property)
714 {
715 t << " readable=\"";
716 if (md->isReadable()) t << "yes"; else t << "no";
717 t << "\"";
718
719 t << " writable=\"";
720 if (md->isWritable()) t << "yes"; else t << "no";
721 t << "\"";
722
723 t << " gettable=\"";
724 if (md->isGettable()) t << "yes"; else t << "no";
725 t << "\"";
726
727 t << " settable=\"";
728 if (md->isSettable()) t << "yes"; else t << "no";
729 t << "\"";
730
731 if (md->isAssign() || md->isCopy() || md->isRetain())
732 {
733 t << " accessor=\"";
734 if (md->isAssign()) t << "assign";
735 else if (md->isCopy()) t << "copy";
736 else if (md->isRetain()) t << "retain";
737 t << "\"";
738 }
739 }
740 else if (md->memberType() == MemberDef::Event)
741 {
742 t << " add=\"";
743 if (md->isAddable()) t << "yes"; else t << "no";
744 t << "\"";
745
746 t << " remove=\"";
747 if (md->isRemovable()) t << "yes"; else t << "no";
748 t << "\"";
749
750 t << " raise=\"";
751 if (md->isRaisable()) t << "yes"; else t << "no";
752 t << "\"";
753 }
754
755 t << ">" << endl;
756
757 if (md->memberType()!=MemberDef::Define &&
758 md->memberType()!=MemberDef::Enumeration
759 )
760 {
761 if (md->memberType()!=MemberDef::Typedef)
762 {
763 writeMemberTemplateLists(md,t);
764 }
765 QCString typeStr = md->typeString(); //replaceAnonymousScopes(md->typeString());
766 stripQualifiers(typeStr);
767 t << " <type>";
768 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),typeStr);
769 t << "</type>" << endl;
770 t << " <definition>" << convertToXML(md->definition()) << "</definition>" << endl;
771 t << " <argsstring>" << convertToXML(md->argsString()) << "</argsstring>" << endl;
772 }
773
774 t << " <name>" << convertToXML(md->name()) << "</name>" << endl;
775
776 if (md->memberType() == MemberDef::Property)
777 {
778 if (md->isReadable())
779 t << " <read>" << convertToXML(md->getReadAccessor()) << "</read>" << endl;
780 if (md->isWritable())
781 t << " <write>" << convertToXML(md->getWriteAccessor()) << "</write>" << endl;
782 }
783 if (md->memberType()==MemberDef::Variable && md->bitfieldString())
784 {
785 QCString bitfield = md->bitfieldString();
786 if (bitfield.at(0)==':') bitfield=bitfield.mid(1);
787 t << " <bitfield>" << bitfield << "</bitfield>" << endl;
788 }
789
790 MemberDef *rmd = md->reimplements();
791 if (rmd)
792 {
793 t << " <reimplements refid=\""
794 << memberOutputFileBase(rmd) << "_1" << rmd->anchor() << "\">"
795 << convertToXML(rmd->name()) << "</reimplements>" << endl;
796 }
797 LockingPtr<MemberList> rbml = md->reimplementedBy();
798 if (rbml!=0)
799 {
800 MemberListIterator mli(*rbml);
801 for (mli.toFirst();(rmd=mli.current());++mli)
802 {
803 t << " <reimplementedby refid=\""
804 << memberOutputFileBase(rmd) << "_1" << rmd->anchor() << "\">"
805 << convertToXML(rmd->name()) << "</reimplementedby>" << endl;
806 }
807 }
808
809 if (isFunc) //function
810 {
811 LockingPtr<ArgumentList> declAl = md->declArgumentList();
812 LockingPtr<ArgumentList> defAl = md->argumentList();
813 if (declAl!=0 && declAl->count()>0)
814 {
815 ArgumentListIterator declAli(*declAl);
816 ArgumentListIterator defAli(*defAl);
817 Argument *a;
818 for (declAli.toFirst();(a=declAli.current());++declAli)
819 {
820 Argument *defArg = defAli.current();
821 t << " <param>" << endl;
822 if (!a->attrib.isEmpty())
823 {
824 t << " <attributes>";
825 writeXMLString(t,a->attrib);
826 t << "</attributes>" << endl;
827 }
828 if (!a->type.isEmpty())
829 {
830 t << " <type>";
831 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),a->type);
832 t << "</type>" << endl;
833 }
834 if (!a->name.isEmpty())
835 {
836 t << " <declname>";
837 writeXMLString(t,a->name);
838 t << "</declname>" << endl;
839 }
840 if (defArg && !defArg->name.isEmpty() && defArg->name!=a->name)
841 {
842 t << " <defname>";
843 writeXMLString(t,defArg->name);
844 t << "</defname>" << endl;
845 }
846 if (!a->array.isEmpty())
847 {
848 t << " <array>";
849 writeXMLString(t,a->array);
850 t << "</array>" << endl;
851 }
852 if (!a->defval.isEmpty())
853 {
854 t << " <defval>";
855 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),a->defval);
856 t << "</defval>" << endl;
857 }
858 if (defArg && defArg->hasDocumentation())
859 {
860 t << " <briefdescription>";
861 writeXMLDocBlock(t,md->getDefFileName(),md->getDefLine(),
862 md->getOuterScope(),md,defArg->docs);
863 t << "</briefdescription>" << endl;
864 }
865 t << " </param>" << endl;
866 if (defArg) ++defAli;
867 }
868 }
869 }
870 else if (md->memberType()==MemberDef::Define &&
871 md->argsString()) // define
872 {
873 if (md->argumentList()->count()==0) // special case for "foo()" to
874 // disguish it from "foo".
875 {
876 t << " <param></param>" << endl;
877 }
878 else
879 {
880 ArgumentListIterator ali(*md->argumentList());
881 Argument *a;
882 for (ali.toFirst();(a=ali.current());++ali)
883 {
884 t << " <param><defname>" << a->type << "</defname></param>" << endl;
885 }
886 }
887 }
888 // avoid that extremely large tables are written to the output.
889 // todo: it's better to adhere to MAX_INITIALIZER_LINES.
890 if (!md->initializer().isEmpty() && md->initializer().length()<2000)
891 {
892 t << " <initializer>";
893 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),md->initializer());
894 t << "</initializer>" << endl;
895 }
896
897 if (md->excpString())
898 {
899 t << " <exceptions>";
900 linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),md->excpString());
901 t << "</exceptions>" << endl;
902 }
903
904 if (md->memberType()==MemberDef::Enumeration) // enum
905 {
906 LockingPtr<MemberList> enumFields = md->enumFieldList();
907 if (enumFields!=0)
908 {
909 MemberListIterator emli(*enumFields);
910 MemberDef *emd;
911 for (emli.toFirst();(emd=emli.current());++emli)
912 {
913 ti << " <member refid=\"" << memberOutputFileBase(emd)
914 << "_1" << emd->anchor() << "\" kind=\"enumvalue\"><name>"
915 << convertToXML(emd->name()) << "</name></member>" << endl;
916
917 t << " <enumvalue id=\"" << memberOutputFileBase(emd) << "_1"
918 << emd->anchor() << "\" prot=\"";
919 switch (emd->protection())
920 {
921 case Public: t << "public"; break;
922 case Protected: t << "protected"; break;
923 case Private: t << "private"; break;
924 case Package: t << "package"; break;
925 }
926 t << "\">" << endl;
927 t << " <name>";
928 writeXMLString(t,emd->name());
929 t << "</name>" << endl;
930 if (!emd->initializer().isEmpty())
931 {
932 t << " <initializer>";
933 writeXMLString(t,emd->initializer());
934 t << "</initializer>" << endl;
935 }
936 t << " <briefdescription>" << endl;
937 writeXMLDocBlock(t,emd->briefFile(),emd->briefLine(),emd->getOuterScope(),emd,emd->briefDescription());
938 t << " </briefdescription>" << endl;
939 t << " <detaileddescription>" << endl;
940 writeXMLDocBlock(t,emd->docFile(),emd->docLine(),emd->getOuterScope(),emd,emd->documentation());
941 t << " </detaileddescription>" << endl;
942 t << " </enumvalue>" << endl;
943 }
944 }
945 }
946 t << " <briefdescription>" << endl;
947 writeXMLDocBlock(t,md->briefFile(),md->briefLine(),md->getOuterScope(),md,md->briefDescription());
948 t << " </briefdescription>" << endl;
949 t << " <detaileddescription>" << endl;
950 writeXMLDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation());
951 t << " </detaileddescription>" << endl;
952 t << " <inbodydescription>" << endl;
953 writeXMLDocBlock(t,md->docFile(),md->inbodyLine(),md->getOuterScope(),md,md->inbodyDocumentation());
954 t << " </inbodydescription>" << endl;
955 if (md->getDefLine()!=-1)
956 {
957 t << " <location file=\""
958 << md->getDefFileName() << "\" line=\""
959 << md->getDefLine() << "\"";
960 if (md->getStartBodyLine()!=-1)
961 {
962 FileDef *bodyDef = md->getBodyDef();
963 if (bodyDef)
964 {
965 t << " bodyfile=\"" << bodyDef->absFilePath() << "\"";
966 }
967 t << " bodystart=\"" << md->getStartBodyLine() << "\" bodyend=\""
968 << md->getEndBodyLine() << "\"";
969 }
970 t << "/>" << endl;
971 }
972
973 //printf("md->getReferencesMembers()=%p\n",md->getReferencesMembers());
974 LockingPtr<MemberSDict> mdict = md->getReferencesMembers();
975 if (mdict!=0)
976 {
977 MemberSDict::Iterator mdi(*mdict);
978 MemberDef *rmd;
979 for (mdi.toFirst();(rmd=mdi.current());++mdi)
980 {
981 writeMemberReference(t,def,rmd,"references");
982 }
983 }
984 mdict = md->getReferencedByMembers();
985 if (mdict!=0)
986 {
987 MemberSDict::Iterator mdi(*mdict);
988 MemberDef *rmd;
989 for (mdi.toFirst();(rmd=mdi.current());++mdi)
990 {
991 writeMemberReference(t,def,rmd,"referencedby");
992 }
993 }
994
995 t << " </memberdef>" << endl;
996}
997
998static void generateXMLSection(Definition *d,FTextStream &ti,FTextStream &t,
999 MemberList *ml,const char *kind,const char *header=0,
1000 const char *documentation=0)
1001{
1002 if (ml==0) return;
1003 MemberListIterator mli(*ml);
1004 MemberDef *md;
1005 int count=0;
1006 for (mli.toFirst();(md=mli.current());++mli)
1007 {
1008 // namespace members are also inserted in the file scope, but
1009 // to prevent this duplication in the XML output, we filter those here.
1010 if (d->definitionType()!=Definition::TypeFile || md->getNamespaceDef()==0)
1011 {
1012 count++;
1013 }
1014 }
1015 if (count==0) return; // empty list
1016
1017 t << " <sectiondef kind=\"" << kind << "\">" << endl;
1018 if (header)
1019 {
1020 t << " <header>" << convertToXML(header) << "</header>" << endl;
1021 }
1022 if (documentation)
1023 {
1024 t << " <description>";
1025 writeXMLDocBlock(t,d->docFile(),d->docLine(),d,0,documentation);
1026 t << "</description>" << endl;
1027 }
1028 for (mli.toFirst();(md=mli.current());++mli)
1029 {
1030 // namespace members are also inserted in the file scope, but
1031 // to prevent this duplication in the XML output, we filter those here.
1032 if (d->definitionType()!=Definition::TypeFile || md->getNamespaceDef()==0)
1033 {
1034 generateXMLForMember(md,ti,t,d);
1035 }
1036 }
1037 t << " </sectiondef>" << endl;
1038}
1039
1040static void writeListOfAllMembers(ClassDef *cd,FTextStream &t)
1041{
1042 t << " <listofallmembers>" << endl;
1043 if (cd->memberNameInfoSDict())
1044 {
1045 MemberNameInfoSDict::Iterator mnii(*cd->memberNameInfoSDict());
1046 MemberNameInfo *mni;
1047 for (mnii.toFirst();(mni=mnii.current());++mnii)
1048 {
1049 MemberNameInfoIterator mii(*mni);
1050 MemberInfo *mi;
1051 for (mii.toFirst();(mi=mii.current());++mii)
1052 {
1053 MemberDef *md=mi->memberDef;
1054 if (md->name().at(0)!='@') // skip anonymous members
1055 {
1056 Protection prot = mi->prot;
1057 Specifier virt=md->virtualness();
1058 t << " <member refid=\"" << memberOutputFileBase(md) << "_1" <<
1059 md->anchor() << "\" prot=\"";
1060 switch (prot)
1061 {
1062 case Public: t << "public"; break;
1063 case Protected: t << "protected"; break;
1064 case Private: t << "private"; break;
1065 case Package: t << "package"; break;
1066 }
1067 t << "\" virt=\"";
1068 switch(virt)
1069 {
1070 case Normal: t << "non-virtual"; break;
1071 case Virtual: t << "virtual"; break;
1072 case Pure: t << "pure-virtual"; break;
1073 }
1074 t << "\"";
1075 if (!mi->ambiguityResolutionScope.isEmpty())
1076 {
1077 t << " ambiguityscope=\"" << convertToXML(mi->ambiguityResolutionScope) << "\"";
1078 }
1079 t << "><scope>" << convertToXML(cd->name()) << "</scope><name>" <<
1080 convertToXML(md->name()) << "</name></member>" << endl;
1081 }
1082 }
1083 }
1084 }
1085 t << " </listofallmembers>" << endl;
1086}
1087
1088static void writeInnerClasses(const ClassSDict *cl,FTextStream &t)
1089{
1090 if (cl)
1091 {
1092 ClassSDict::Iterator cli(*cl);
1093 ClassDef *cd;
1094 for (cli.toFirst();(cd=cli.current());++cli)
1095 {
1096 if (!cd->isHidden() && cd->name().find('@')==-1) // skip anonymous scopes
1097 {
1098 t << " <innerclass refid=\"" << cd->getOutputFileBase()
1099 << "\" prot=\"";
1100 switch(cd->protection())
1101 {
1102 case Public: t << "public"; break;
1103 case Protected: t << "protected"; break;
1104 case Private: t << "private"; break;
1105 case Package: t << "package"; break;
1106 }
1107 t << "\">" << convertToXML(cd->name()) << "</innerclass>" << endl;
1108 }
1109 }
1110 }
1111}
1112
1113static void writeInnerNamespaces(const NamespaceSDict *nl,FTextStream &t)
1114{
1115 if (nl)
1116 {
1117 NamespaceSDict::Iterator nli(*nl);
1118 NamespaceDef *nd;
1119 for (nli.toFirst();(nd=nli.current());++nli)
1120 {
1121 if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymouse scopes
1122 {
1123 t << " <innernamespace refid=\"" << nd->getOutputFileBase()
1124 << "\">" << convertToXML(nd->name()) << "</innernamespace>" << endl;
1125 }
1126 }
1127 }
1128}
1129
1130static void writeInnerFiles(const FileList *fl,FTextStream &t)
1131{
1132 if (fl)
1133 {
1134 QListIterator<FileDef> fli(*fl);
1135 FileDef *fd;
1136 for (fli.toFirst();(fd=fli.current());++fli)
1137 {
1138 t << " <innerfile refid=\"" << fd->getOutputFileBase()
1139 << "\">" << convertToXML(fd->name()) << "</innerfile>" << endl;
1140 }
1141 }
1142}
1143
1144static void writeInnerPages(const PageSDict *pl,FTextStream &t)
1145{
1146 if (pl)
1147 {
1148 PageSDict::Iterator pli(*pl);
1149 PageDef *pd;
1150 for (pli.toFirst();(pd=pli.current());++pli)
1151 {
1152 t << " <innerpage refid=\"" << pd->getOutputFileBase();
1153 if (pd->getGroupDef())
1154 {
1155 t << "_" << pd->name();
1156 }
1157 t << "\">" << convertToXML(pd->title()) << "</innerpage>" << endl;
1158 }
1159 }
1160}
1161
1162static void writeInnerGroups(const GroupList *gl,FTextStream &t)
1163{
1164 if (gl)
1165 {
1166 GroupListIterator gli(*gl);
1167 GroupDef *sgd;
1168 for (gli.toFirst();(sgd=gli.current());++gli)
1169 {
1170 t << " <innergroup refid=\"" << sgd->getOutputFileBase()
1171 << "\">" << convertToXML(sgd->groupTitle())
1172 << "</innergroup>" << endl;
1173 }
1174 }
1175}
1176
1177static void writeInnerDirs(const DirList *dl,FTextStream &t)
1178{
1179 if (dl)
1180 {
1181 QListIterator<DirDef> subdirs(*dl);
1182 DirDef *subdir;
1183 for (subdirs.toFirst();(subdir=subdirs.current());++subdirs)
1184 {
1185 t << " <innerdir refid=\"" << subdir->getOutputFileBase()
1186 << "\">" << convertToXML(subdir->displayName()) << "</innerdir>" << endl;
1187 }
1188 }
1189}
1190
1191static void generateXMLForClass(ClassDef *cd,FTextStream &ti)
1192{
1193 // + brief description
1194 // + detailed description
1195 // + template argument list(s)
1196 // - include file
1197 // + member groups
1198 // + inheritance diagram
1199 // + list of direct super classes
1200 // + list of direct sub classes
1201 // + list of inner classes
1202 // + collaboration diagram
1203 // + list of all members
1204 // + user defined member sections
1205 // + standard member sections
1206 // + detailed member documentation
1207 // - examples using the class
1208
1209 if (cd->isReference()) return; // skip external references.
1210 if (cd->isHidden()) return; // skip hidden classes.
1211 if (cd->name().find('@')!=-1) return; // skip anonymous compounds.
1212 if (cd->templateMaster()!=0) return; // skip generated template instances.
1213
1214 msg("Generating XML output for class %s\n",cd->name().data());
1215
1216 ti << " <compound refid=\"" << classOutputFileBase(cd)
1217 << "\" kind=\"" << cd->compoundTypeString()
1218 << "\"><name>" << convertToXML(cd->name()) << "</name>" << endl;
1219
1220 QCString outputDirectory = Config_getString("XML_OUTPUT");
1221 QCString fileName=outputDirectory+"/"+ classOutputFileBase(cd)+".xml";
1222 QFile f(fileName);
1223 if (!f.open(IO_WriteOnly))
1224 {
1225 err("Cannot open file %s for writing!\n",fileName.data());
1226 return;
1227 }
1228 FTextStream t(&f);
1229 //t.setEncoding(FTextStream::UnicodeUTF8);
1230
1231 writeXMLHeader(t);
1232 t << " <compounddef id=\""
1233 << classOutputFileBase(cd) << "\" kind=\""
1234 << cd->compoundTypeString() << "\" prot=\"";
1235 switch (cd->protection())
1236 {
1237 case Public: t << "public"; break;
1238 case Protected: t << "protected"; break;
1239 case Private: t << "private"; break;
1240 case Package: t << "package"; break;
1241 }
1242 t << "\">" << endl;
1243 t << " <compoundname>";
1244 writeXMLString(t,cd->name());
1245 t << "</compoundname>" << endl;
1246 if (cd->baseClasses())
1247 {
1248 BaseClassListIterator bcli(*cd->baseClasses());
1249 BaseClassDef *bcd;
1250 for (bcli.toFirst();(bcd=bcli.current());++bcli)
1251 {
1252 t << " <basecompoundref ";
1253 if (bcd->classDef->isLinkable())
1254 {
1255 t << "refid=\"" << classOutputFileBase(bcd->classDef) << "\" ";
1256 }
1257 t << "prot=\"";
1258 switch (bcd->prot)
1259 {
1260 case Public: t << "public"; break;
1261 case Protected: t << "protected"; break;
1262 case Private: t << "private"; break;
1263 case Package: ASSERT(0); break;
1264 }
1265 t << "\" virt=\"";
1266 switch(bcd->virt)
1267 {
1268 case Normal: t << "non-virtual"; break;
1269 case Virtual: t << "virtual"; break;
1270 case Pure: t <<"pure-virtual"; break;
1271 }
1272 t << "\">";
1273 if (!bcd->templSpecifiers.isEmpty())
1274 {
1275 t << convertToXML(
1276 insertTemplateSpecifierInScope(
1277 bcd->classDef->name(),bcd->templSpecifiers)
1278 );
1279 }
1280 else
1281 {
1282 t << convertToXML(bcd->classDef->displayName());
1283 }
1284 t << "</basecompoundref>" << endl;
1285 }
1286 }
1287 if (cd->subClasses())
1288 {
1289 BaseClassListIterator bcli(*cd->subClasses());
1290 BaseClassDef *bcd;
1291 for (bcli.toFirst();(bcd=bcli.current());++bcli)
1292 {
1293 t << " <derivedcompoundref refid=\""
1294 << classOutputFileBase(bcd->classDef)
1295 << "\" prot=\"";
1296 switch (bcd->prot)
1297 {
1298 case Public: t << "public"; break;
1299 case Protected: t << "protected"; break;
1300 case Private: t << "private"; break;
1301 case Package: ASSERT(0); break;
1302 }
1303 t << "\" virt=\"";
1304 switch(bcd->virt)
1305 {
1306 case Normal: t << "non-virtual"; break;
1307 case Virtual: t << "virtual"; break;
1308 case Pure: t << "pure-virtual"; break;
1309 }
1310 t << "\">" << convertToXML(bcd->classDef->displayName())
1311 << "</derivedcompoundref>" << endl;
1312 }
1313 }
1314
1315 IncludeInfo *ii=cd->includeInfo();
1316 if (ii)
1317 {
1318 QCString nm = ii->includeName;
1319 if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName();
1320 if (!nm.isEmpty())
1321 {
1322 t << " <includes";
1323 if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references
1324 {
1325 t << " refid=\"" << ii->fileDef->getOutputFileBase() << "\"";
1326 }
1327 t << " local=\"" << (ii->local ? "yes" : "no") << "\">";
1328 t << nm;
1329 t << "</includes>" << endl;
1330 }
1331 }
1332
1333 writeInnerClasses(cd->getInnerClasses(),t);
1334
1335 writeTemplateList(cd,t);
1336 if (cd->getMemberGroupSDict())
1337 {
1338 MemberGroupSDict::Iterator mgli(*cd->getMemberGroupSDict());
1339 MemberGroup *mg;
1340 for (;(mg=mgli.current());++mgli)
1341 {
1342 generateXMLSection(cd,ti,t,mg->members(),"user-defined",mg->header(),
1343 mg->documentation());
1344 }
1345 }
1346
1347 QListIterator<MemberList> mli(cd->getMemberLists());
1348 MemberList *ml;
1349 for (mli.toFirst();(ml=mli.current());++mli)
1350 {
1351 if ((ml->listType()&MemberList::detailedLists)==0)
1352 {
1353 generateXMLSection(cd,ti,t,ml,g_xmlSectionMapper.find(ml->listType()));
1354 }
1355 }
1356#if 0
1357 generateXMLSection(cd,ti,t,cd->pubTypes,"public-type");
1358 generateXMLSection(cd,ti,t,cd->pubMethods,"public-func");
1359 generateXMLSection(cd,ti,t,cd->pubAttribs,"public-attrib");
1360 generateXMLSection(cd,ti,t,cd->pubSlots,"public-slot");
1361 generateXMLSection(cd,ti,t,cd->signals,"signal");
1362 generateXMLSection(cd,ti,t,cd->dcopMethods,"dcop-func");
1363 generateXMLSection(cd,ti,t,cd->properties,"property");
1364 generateXMLSection(cd,ti,t,cd->events,"event");
1365 generateXMLSection(cd,ti,t,cd->pubStaticMethods,"public-static-func");
1366 generateXMLSection(cd,ti,t,cd->pubStaticAttribs,"public-static-attrib");
1367 generateXMLSection(cd,ti,t,cd->proTypes,"protected-type");
1368 generateXMLSection(cd,ti,t,cd->proMethods,"protected-func");
1369 generateXMLSection(cd,ti,t,cd->proAttribs,"protected-attrib");
1370 generateXMLSection(cd,ti,t,cd->proSlots,"protected-slot");
1371 generateXMLSection(cd,ti,t,cd->proStaticMethods,"protected-static-func");
1372 generateXMLSection(cd,ti,t,cd->proStaticAttribs,"protected-static-attrib");
1373 generateXMLSection(cd,ti,t,cd->pacTypes,"package-type");
1374 generateXMLSection(cd,ti,t,cd->pacMethods,"package-func");
1375 generateXMLSection(cd,ti,t,cd->pacAttribs,"package-attrib");
1376 generateXMLSection(cd,ti,t,cd->pacStaticMethods,"package-static-func");
1377 generateXMLSection(cd,ti,t,cd->pacStaticAttribs,"package-static-attrib");
1378 generateXMLSection(cd,ti,t,cd->priTypes,"private-type");
1379 generateXMLSection(cd,ti,t,cd->priMethods,"private-func");
1380 generateXMLSection(cd,ti,t,cd->priAttribs,"private-attrib");
1381 generateXMLSection(cd,ti,t,cd->priSlots,"private-slot");
1382 generateXMLSection(cd,ti,t,cd->priStaticMethods,"private-static-func");
1383 generateXMLSection(cd,ti,t,cd->priStaticAttribs,"private-static-attrib");
1384 generateXMLSection(cd,ti,t,cd->friends,"friend");
1385 generateXMLSection(cd,ti,t,cd->related,"related");
1386#endif
1387
1388 t << " <briefdescription>" << endl;
1389 writeXMLDocBlock(t,cd->briefFile(),cd->briefLine(),cd,0,cd->briefDescription());
1390 t << " </briefdescription>" << endl;
1391 t << " <detaileddescription>" << endl;
1392 writeXMLDocBlock(t,cd->docFile(),cd->docLine(),cd,0,cd->documentation());
1393 t << " </detaileddescription>" << endl;
1394 DotClassGraph inheritanceGraph(cd,DotNode::Inheritance);
1395 if (!inheritanceGraph.isTrivial())
1396 {
1397 t << " <inheritancegraph>" << endl;
1398 inheritanceGraph.writeXML(t);
1399 t << " </inheritancegraph>" << endl;
1400 }
1401 DotClassGraph collaborationGraph(cd,DotNode::Collaboration);
1402 if (!collaborationGraph.isTrivial())
1403 {
1404 t << " <collaborationgraph>" << endl;
1405 collaborationGraph.writeXML(t);
1406 t << " </collaborationgraph>" << endl;
1407 }
1408 t << " <location file=\""
1409 << cd->getDefFileName() << "\" line=\""
1410 << cd->getDefLine() << "\"";
1411 if (cd->getStartBodyLine()!=-1)
1412 {
1413 FileDef *bodyDef = cd->getBodyDef();
1414 if (bodyDef)
1415 {
1416 t << " bodyfile=\"" << bodyDef->absFilePath() << "\"";
1417 }
1418 t << " bodystart=\"" << cd->getStartBodyLine() << "\" bodyend=\""
1419 << cd->getEndBodyLine() << "\"";
1420 }
1421 t << "/>" << endl;
1422 writeListOfAllMembers(cd,t);
1423 t << " </compounddef>" << endl;
1424 t << "</doxygen>" << endl;
1425
1426 ti << " </compound>" << endl;
1427}
1428
1429static void generateXMLForNamespace(NamespaceDef *nd,FTextStream &ti)
1430{
1431 // + contained class definitions
1432 // + contained namespace definitions
1433 // + member groups
1434 // + normal members
1435 // + brief desc
1436 // + detailed desc
1437 // + location
1438 // - files containing (parts of) the namespace definition
1439
1440 if (nd->isReference() || nd->isHidden()) return; // skip external references
1441
1442 ti << " <compound refid=\"" << nd->getOutputFileBase()
1443 << "\" kind=\"namespace\"" << "><name>"
1444 << convertToXML(nd->name()) << "</name>" << endl;
1445
1446 QCString outputDirectory = Config_getString("XML_OUTPUT");
1447 QCString fileName=outputDirectory+"/"+nd->getOutputFileBase()+".xml";
1448 QFile f(fileName);
1449 if (!f.open(IO_WriteOnly))
1450 {
1451 err("Cannot open file %s for writing!\n",fileName.data());
1452 return;
1453 }
1454 FTextStream t(&f);
1455 //t.setEncoding(FTextStream::UnicodeUTF8);
1456
1457 writeXMLHeader(t);
1458 t << " <compounddef id=\""
1459 << nd->getOutputFileBase() << "\" kind=\"namespace\">" << endl;
1460 t << " <compoundname>";
1461 writeXMLString(t,nd->name());
1462 t << "</compoundname>" << endl;
1463
1464 writeInnerClasses(nd->getClassSDict(),t);
1465 writeInnerNamespaces(nd->getNamespaceSDict(),t);
1466
1467 if (nd->getMemberGroupSDict())
1468 {
1469 MemberGroupSDict::Iterator mgli(*nd->getMemberGroupSDict());
1470 MemberGroup *mg;
1471 for (;(mg=mgli.current());++mgli)
1472 {
1473 generateXMLSection(nd,ti,t,mg->members(),"user-defined",mg->header(),
1474 mg->documentation());
1475 }
1476 }
1477
1478 QListIterator<MemberList> mli(nd->getMemberLists());
1479 MemberList *ml;
1480 for (mli.toFirst();(ml=mli.current());++mli)
1481 {
1482 if ((ml->listType()&MemberList::declarationLists)!=0)
1483 {
1484 generateXMLSection(nd,ti,t,ml,g_xmlSectionMapper.find(ml->listType()));
1485 }
1486 }
1487#if 0
1488 generateXMLSection(nd,ti,t,&nd->decDefineMembers,"define");
1489 generateXMLSection(nd,ti,t,&nd->decProtoMembers,"prototype");
1490 generateXMLSection(nd,ti,t,&nd->decTypedefMembers,"typedef");
1491 generateXMLSection(nd,ti,t,&nd->decEnumMembers,"enum");
1492 generateXMLSection(nd,ti,t,&nd->decFuncMembers,"func");
1493 generateXMLSection(nd,ti,t,&nd->decVarMembers,"var");
1494#endif
1495
1496 t << " <briefdescription>" << endl;
1497 writeXMLDocBlock(t,nd->briefFile(),nd->briefLine(),nd,0,nd->briefDescription());
1498 t << " </briefdescription>" << endl;
1499 t << " <detaileddescription>" << endl;
1500 writeXMLDocBlock(t,nd->docFile(),nd->docLine(),nd,0,nd->documentation());
1501 t << " </detaileddescription>" << endl;
1502 t << " <location file=\""
1503 << nd->getDefFileName() << "\" line=\""
1504 << nd->getDefLine() << "\"/>" << endl;
1505 t << " </compounddef>" << endl;
1506 t << "</doxygen>" << endl;
1507
1508 ti << " </compound>" << endl;
1509}
1510
1511static void generateXMLForFile(FileDef *fd,FTextStream &ti)
1512{
1513 // + includes files
1514 // + includedby files
1515 // + include graph
1516 // + included by graph
1517 // + contained class definitions
1518 // + contained namespace definitions
1519 // + member groups
1520 // + normal members
1521 // + brief desc
1522 // + detailed desc
1523 // + source code
1524 // + location
1525 // - number of lines
1526
1527 if (fd->isReference()) return; // skip external references
1528
1529 ti << " <compound refid=\"" << fd->getOutputFileBase()
1530 << "\" kind=\"file\"><name>" << convertToXML(fd->name())
1531 << "</name>" << endl;
1532
1533 QCString outputDirectory = Config_getString("XML_OUTPUT");
1534 QCString fileName=outputDirectory+"/"+fd->getOutputFileBase()+".xml";
1535 QFile f(fileName);
1536 if (!f.open(IO_WriteOnly))
1537 {
1538 err("Cannot open file %s for writing!\n",fileName.data());
1539 return;
1540 }
1541 FTextStream t(&f);
1542 //t.setEncoding(FTextStream::UnicodeUTF8);
1543
1544 writeXMLHeader(t);
1545 t << " <compounddef id=\""
1546 << fd->getOutputFileBase() << "\" kind=\"file\">" << endl;
1547 t << " <compoundname>";
1548 writeXMLString(t,fd->name());
1549 t << "</compoundname>" << endl;
1550
1551 IncludeInfo *inc;
1552
1553 if (fd->includeFileList())
1554 {
1555 QListIterator<IncludeInfo> ili1(*fd->includeFileList());
1556 for (ili1.toFirst();(inc=ili1.current());++ili1)
1557 {
1558 t << " <includes";
1559 if (inc->fileDef && !inc->fileDef->isReference()) // TODO: support external references
1560 {
1561 t << " refid=\"" << inc->fileDef->getOutputFileBase() << "\"";
1562 }
1563 t << " local=\"" << (inc->local ? "yes" : "no") << "\">";
1564 t << inc->includeName;
1565 t << "</includes>" << endl;
1566 }
1567 }
1568
1569 if (fd->includedByFileList())
1570 {
1571 QListIterator<IncludeInfo> ili2(*fd->includedByFileList());
1572 for (ili2.toFirst();(inc=ili2.current());++ili2)
1573 {
1574 t << " <includedby";
1575 if (inc->fileDef && !inc->fileDef->isReference()) // TODO: support external references
1576 {
1577 t << " refid=\"" << inc->fileDef->getOutputFileBase() << "\"";
1578 }
1579 t << " local=\"" << (inc->local ? "yes" : "no") << "\">";
1580 t << inc->includeName;
1581 t << "</includedby>" << endl;
1582 }
1583 }
1584
1585 DotInclDepGraph incDepGraph(fd,FALSE);
1586 if (!incDepGraph.isTrivial())
1587 {
1588 t << " <incdepgraph>" << endl;
1589 incDepGraph.writeXML(t);
1590 t << " </incdepgraph>" << endl;
1591 }
1592
1593 DotInclDepGraph invIncDepGraph(fd,TRUE);
1594 if (!invIncDepGraph.isTrivial())
1595 {
1596 t << " <invincdepgraph>" << endl;
1597 invIncDepGraph.writeXML(t);
1598 t << " </invincdepgraph>" << endl;
1599 }
1600
1601 if (fd->getClassSDict())
1602 {
1603 writeInnerClasses(fd->getClassSDict(),t);
1604 }
1605 if (fd->getNamespaceSDict())
1606 {
1607 writeInnerNamespaces(fd->getNamespaceSDict(),t);
1608 }
1609
1610 if (fd->getMemberGroupSDict())
1611 {
1612 MemberGroupSDict::Iterator mgli(*fd->getMemberGroupSDict());
1613 MemberGroup *mg;
1614 for (;(mg=mgli.current());++mgli)
1615 {
1616 generateXMLSection(fd,ti,t,mg->members(),"user-defined",mg->header(),
1617 mg->documentation());
1618 }
1619 }
1620
1621 QListIterator<MemberList> mli(fd->getMemberLists());
1622 MemberList *ml;
1623 for (mli.toFirst();(ml=mli.current());++mli)
1624 {
1625 if ((ml->listType()&MemberList::declarationLists)!=0)
1626 {
1627 generateXMLSection(fd,ti,t,ml,g_xmlSectionMapper.find(ml->listType()));
1628 }
1629 }
1630#if 0
1631 generateXMLSection(fd,ti,t,fd->decDefineMembers,"define");
1632 generateXMLSection(fd,ti,t,fd->decProtoMembers,"prototype");
1633 generateXMLSection(fd,ti,t,fd->decTypedefMembers,"typedef");
1634 generateXMLSection(fd,ti,t,fd->decEnumMembers,"enum");
1635 generateXMLSection(fd,ti,t,fd->decFuncMembers,"func");
1636 generateXMLSection(fd,ti,t,fd->decVarMembers,"var");
1637#endif
1638
1639 t << " <briefdescription>" << endl;
1640 writeXMLDocBlock(t,fd->briefFile(),fd->briefLine(),fd,0,fd->briefDescription());
1641 t << " </briefdescription>" << endl;
1642 t << " <detaileddescription>" << endl;
1643 writeXMLDocBlock(t,fd->docFile(),fd->docLine(),fd,0,fd->documentation());
1644 t << " </detaileddescription>" << endl;
1645 if (Config_getBool("XML_PROGRAMLISTING"))
1646 {
1647 t << " <programlisting>" << endl;
1648 writeXMLCodeBlock(t,fd);
1649 t << " </programlisting>" << endl;
1650 }
1651 t << " <location file=\"" << fd->getDefFileName() << "\"/>" << endl;
1652 t << " </compounddef>" << endl;
1653 t << "</doxygen>" << endl;
1654
1655 ti << " </compound>" << endl;
1656}
1657
1658static void generateXMLForGroup(GroupDef *gd,FTextStream &ti)
1659{
1660 // + members
1661 // + member groups
1662 // + files
1663 // + classes
1664 // + namespaces
1665 // - packages
1666 // + pages
1667 // + child groups
1668 // - examples
1669 // + brief description
1670 // + detailed description
1671
1672 if (gd->isReference()) return; // skip external references
1673
1674 ti << " <compound refid=\"" << gd->getOutputFileBase()
1675 << "\" kind=\"group\"><name>" << convertToXML(gd->name()) << "</name>" << endl;
1676
1677 QCString outputDirectory = Config_getString("XML_OUTPUT");
1678 QCString fileName=outputDirectory+"/"+gd->getOutputFileBase()+".xml";
1679 QFile f(fileName);
1680 if (!f.open(IO_WriteOnly))
1681 {
1682 err("Cannot open file %s for writing!\n",fileName.data());
1683 return;
1684 }
1685
1686 FTextStream t(&f);
1687 //t.setEncoding(FTextStream::UnicodeUTF8);
1688 writeXMLHeader(t);
1689 t << " <compounddef id=\""
1690 << gd->getOutputFileBase() << "\" kind=\"group\">" << endl;
1691 t << " <compoundname>" << convertToXML(gd->name()) << "</compoundname>" << endl;
1692 t << " <title>" << convertToXML(gd->groupTitle()) << "</title>" << endl;
1693
1694 writeInnerFiles(gd->getFiles(),t);
1695 writeInnerClasses(gd->getClasses(),t);
1696 writeInnerNamespaces(gd->getNamespaces(),t);
1697 writeInnerPages(gd->getPages(),t);
1698 writeInnerGroups(gd->getSubGroups(),t);
1699
1700 if (gd->getMemberGroupSDict())
1701 {
1702 MemberGroupSDict::Iterator mgli(*gd->getMemberGroupSDict());
1703 MemberGroup *mg;
1704 for (;(mg=mgli.current());++mgli)
1705 {
1706 generateXMLSection(gd,ti,t,mg->members(),"user-defined",mg->header(),
1707 mg->documentation());
1708 }
1709 }
1710
1711 QListIterator<MemberList> mli(gd->getMemberLists());
1712 MemberList *ml;
1713 for (mli.toFirst();(ml=mli.current());++mli)
1714 {
1715 if ((ml->listType()&MemberList::declarationLists)!=0)
1716 {
1717 generateXMLSection(gd,ti,t,ml,g_xmlSectionMapper.find(ml->listType()));
1718 }
1719 }
1720#if 0
1721 generateXMLSection(gd,ti,t,&gd->decDefineMembers,"define");
1722 generateXMLSection(gd,ti,t,&gd->decProtoMembers,"prototype");
1723 generateXMLSection(gd,ti,t,&gd->decTypedefMembers,"typedef");
1724 generateXMLSection(gd,ti,t,&gd->decEnumMembers,"enum");
1725 generateXMLSection(gd,ti,t,&gd->decFuncMembers,"func");
1726 generateXMLSection(gd,ti,t,&gd->decVarMembers,"var");
1727#endif
1728
1729 t << " <briefdescription>" << endl;
1730 writeXMLDocBlock(t,gd->briefFile(),gd->briefLine(),gd,0,gd->briefDescription());
1731 t << " </briefdescription>" << endl;
1732 t << " <detaileddescription>" << endl;
1733 writeXMLDocBlock(t,gd->docFile(),gd->docLine(),gd,0,gd->documentation());
1734 t << " </detaileddescription>" << endl;
1735 t << " </compounddef>" << endl;
1736 t << "</doxygen>" << endl;
1737
1738 ti << " </compound>" << endl;
1739}
1740
1741static void generateXMLForDir(DirDef *dd,FTextStream &ti)
1742{
1743 if (dd->isReference()) return; // skip external references
1744 ti << " <compound refid=\"" << dd->getOutputFileBase()
1745 << "\" kind=\"dir\"><name>" << convertToXML(dd->displayName())
1746 << "</name>" << endl;
1747
1748 QCString outputDirectory = Config_getString("XML_OUTPUT");
1749 QCString fileName=outputDirectory+"/"+dd->getOutputFileBase()+".xml";
1750 QFile f(fileName);
1751 if (!f.open(IO_WriteOnly))
1752 {
1753 err("Cannot open file %s for writing!\n",fileName.data());
1754 return;
1755 }
1756
1757 FTextStream t(&f);
1758 //t.setEncoding(FTextStream::UnicodeUTF8);
1759 writeXMLHeader(t);
1760 t << " <compounddef id=\""
1761 << dd->getOutputFileBase() << "\" kind=\"dir\">" << endl;
1762 t << " <compoundname>" << convertToXML(dd->displayName()) << "</compoundname>" << endl;
1763
1764 writeInnerDirs(&dd->subDirs(),t);
1765 writeInnerFiles(dd->getFiles(),t);
1766
1767 t << " <briefdescription>" << endl;
1768 writeXMLDocBlock(t,dd->briefFile(),dd->briefLine(),dd,0,dd->briefDescription());
1769 t << " </briefdescription>" << endl;
1770 t << " <detaileddescription>" << endl;
1771 writeXMLDocBlock(t,dd->docFile(),dd->docLine(),dd,0,dd->documentation());
1772 t << " </detaileddescription>" << endl;
1773 t << " <location file=\"" << dd->name() << "\"/>" << endl;
1774 t << " </compounddef>" << endl;
1775 t << "</doxygen>" << endl;
1776
1777 ti << " </compound>" << endl;
1778}
1779
1780static void generateXMLForPage(PageDef *pd,FTextStream &ti,bool isExample)
1781{
1782 // + name
1783 // + title
1784 // + documentation
1785
1786 const char *kindName = isExample ? "example" : "page";
1787
1788 if (pd->isReference()) return;
1789
1790 QCString pageName = pd->getOutputFileBase();
1791 if (pd->getGroupDef())
1792 {
1793 pageName+=(QCString)"_"+pd->name();
1794 }
1795 if (pageName=="index") pageName="indexpage"; // to prevent overwriting the generated index page.
1796
1797 ti << " <compound refid=\"" << pageName
1798 << "\" kind=\"" << kindName << "\"><name>" << convertToXML(pd->name())
1799 << "</name>" << endl;
1800
1801 QCString outputDirectory = Config_getString("XML_OUTPUT");
1802 QCString fileName=outputDirectory+"/"+pageName+".xml";
1803 QFile f(fileName);
1804 if (!f.open(IO_WriteOnly))
1805 {
1806 err("Cannot open file %s for writing!\n",fileName.data());
1807 return;
1808 }
1809
1810 FTextStream t(&f);
1811 //t.setEncoding(FTextStream::UnicodeUTF8);
1812 writeXMLHeader(t);
1813 t << " <compounddef id=\"" << pageName;
1814 t << "\" kind=\"" << kindName << "\">" << endl;
1815 t << " <compoundname>" << convertToXML(pd->name())
1816 << "</compoundname>" << endl;
1817
1818 SectionInfo *si = Doxygen::sectionDict.find(pd->name());
1819 if (si)
1820 {
1821 t << " <title>" << convertToXML(si->title) << "</title>" << endl;
1822 }
1823 writeInnerPages(pd->getSubPages(),t);
1824 t << " <detaileddescription>" << endl;
1825 if (isExample)
1826 {
1827 writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,0,
1828 pd->documentation()+"\n\\include "+pd->name());
1829 }
1830 else
1831 {
1832 writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,0,
1833 pd->documentation());
1834 }
1835 t << " </detaileddescription>" << endl;
1836
1837 t << " </compounddef>" << endl;
1838 t << "</doxygen>" << endl;
1839
1840 ti << " </compound>" << endl;
1841}
1842
1843void generateXML()
1844{
1845
1846 // + classes
1847 // + namespaces
1848 // + files
1849 // + groups
1850 // + related pages
1851 // - examples
1852
1853 QCString outputDirectory = Config_getString("XML_OUTPUT");
1854 if (outputDirectory.isEmpty())
1855 {
1856 outputDirectory=QDir::currentDirPath();
1857 }
1858 else
1859 {
1860 QDir dir(outputDirectory);
1861 if (!dir.exists())
1862 {
1863 dir.setPath(QDir::currentDirPath());
1864 if (!dir.mkdir(outputDirectory))
1865 {
1866 err("error: tag XML_OUTPUT: Output directory `%s' does not "
1867 "exist and cannot be created\n",outputDirectory.data());
1868 exit(1);
1869 }
1870 else if (!Config_getBool("QUIET"))
1871 {
1872 err("notice: Output directory `%s' does not exist. "
1873 "I have created it for you.\n", outputDirectory.data());
1874 }
1875 dir.cd(outputDirectory);
1876 }
1877 outputDirectory=dir.absPath();
1878 }
1879
1880 QDir dir(outputDirectory);
1881 if (!dir.exists())
1882 {
1883 dir.setPath(QDir::currentDirPath());
1884 if (!dir.mkdir(outputDirectory))
1885 {
1886 err("Cannot create directory %s\n",outputDirectory.data());
1887 return;
1888 }
1889 }
1890 QDir xmlDir(outputDirectory);
1891 createSubDirs(xmlDir);
1892 QCString fileName=outputDirectory+"/index.xsd";
1893 QFile f(fileName);
1894 if (!f.open(IO_WriteOnly))
1895 {
1896 err("Cannot open file %s for writing!\n",fileName.data());
1897 return;
1898 }
1899 f.writeBlock(index_xsd,strlen(index_xsd));
1900 f.close();
1901
1902 fileName=outputDirectory+"/compound.xsd";
1903 f.setName(fileName);
1904 if (!f.open(IO_WriteOnly))
1905 {
1906 err("Cannot open file %s for writing!\n",fileName.data());
1907 return;
1908 }
1909 f.writeBlock(compound_xsd,strlen(compound_xsd));
1910 f.close();
1911
1912 fileName=outputDirectory+"/index.xml";
1913 f.setName(fileName);
1914 if (!f.open(IO_WriteOnly))
1915 {
1916 err("Cannot open file %s for writing!\n",fileName.data());
1917 return;
1918 }
1919 FTextStream t(&f);
1920 //t.setEncoding(FTextStream::UnicodeUTF8);
1921
1922 // write index header
1923 t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << endl;;
1924 t << "<doxygenindex xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
1925 t << "xsi:noNamespaceSchemaLocation=\"index.xsd\" ";
1926 t << "version=\"" << versionString << "\">" << endl;
1927
1928 {
1929 ClassSDict::Iterator cli(*Doxygen::classSDict);
1930 ClassDef *cd;
1931 for (cli.toFirst();(cd=cli.current());++cli)
1932 {
1933 generateXMLForClass(cd,t);
1934 }
1935 }
1936 //{
1937 // ClassSDict::Iterator cli(Doxygen::hiddenClasses);
1938 // ClassDef *cd;
1939 // for (cli.toFirst();(cd=cli.current());++cli)
1940 // {
1941 // msg("Generating XML output for class %s\n",cd->name().data());
1942 // generateXMLForClass(cd,t);
1943 // }
1944 //}
1945 NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict);
1946 NamespaceDef *nd;
1947 for (nli.toFirst();(nd=nli.current());++nli)
1948 {
1949 msg("Generating XML output for namespace %s\n",nd->name().data());
1950 generateXMLForNamespace(nd,t);
1951 }
1952 FileNameListIterator fnli(*Doxygen::inputNameList);
1953 FileName *fn;
1954 for (;(fn=fnli.current());++fnli)
1955 {
1956 FileNameIterator fni(*fn);
1957 FileDef *fd;
1958 for (;(fd=fni.current());++fni)
1959 {
1960 msg("Generating XML output for file %s\n",fd->name().data());
1961 generateXMLForFile(fd,t);
1962 }
1963 }
1964 GroupSDict::Iterator gli(*Doxygen::groupSDict);
1965 GroupDef *gd;
1966 for (;(gd=gli.current());++gli)
1967 {
1968 msg("Generating XML output for group %s\n",gd->name().data());
1969 generateXMLForGroup(gd,t);
1970 }
1971 {
1972 PageSDict::Iterator pdi(*Doxygen::pageSDict);
1973 PageDef *pd=0;
1974 for (pdi.toFirst();(pd=pdi.current());++pdi)
1975 {
1976 msg("Generating XML output for page %s\n",pd->name().data());
1977 generateXMLForPage(pd,t,FALSE);
1978 }
1979 }
1980 {
1981 DirDef *dir;
1982 DirSDict::Iterator sdi(*Doxygen::directories);
1983 for (sdi.toFirst();(dir=sdi.current());++sdi)
1984 {
1985 msg("Generate XML output for dir %s\n",dir->name().data());
1986 generateXMLForDir(dir,t);
1987 }
1988 }
1989 {
1990 PageSDict::Iterator pdi(*Doxygen::exampleSDict);
1991 PageDef *pd=0;
1992 for (pdi.toFirst();(pd=pdi.current());++pdi)
1993 {
1994 msg("Generating XML output for example %s\n",pd->name().data());
1995 generateXMLForPage(pd,t,TRUE);
1996 }
1997 }
1998 if (Doxygen::mainPage)
1999 {
2000 msg("Generating XML output for the main page\n");
2001 generateXMLForPage(Doxygen::mainPage,t,FALSE);
2002 }
2003
2004 //t << " </compoundlist>" << endl;
2005 t << "</doxygenindex>" << endl;
2006
2007 writeCombineScript();
2008}
2009
2010
2011

Archive Download this file

Revision: 1322