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