xmlgen.cpp

Go to the documentation of this file.
00001 /******************************************************************************
00002  *
00003  * $Id: xml.cpp,v 1.2 2001/01/01 10:15:18 root Exp $
00004  *
00005  *
00006  * Copyright (C) 1997-2008 by Dimitri van Heesch.
00007  *
00008  * Permission to use, copy, modify, and distribute this software and its
00009  * documentation under the terms of the GNU General Public License is hereby 
00010  * granted. No representations are made about the suitability of this software 
00011  * for any purpose. It is provided "as is" without express or implied warranty.
00012  * See the GNU General Public License for more details.
00013  *
00014  * Documents produced by Doxygen are derivative works derived from the
00015  * input used in their production; they are not affected by this license.
00016  *
00017  */
00018 
00019 #include <stdlib.h>
00020 
00021 #include "qtbc.h"
00022 #include "xmlgen.h"
00023 #include "doxygen.h"
00024 #include "message.h"
00025 #include "config.h"
00026 #include "classlist.h"
00027 #include "util.h"
00028 #include "defargs.h"
00029 #include "outputgen.h"
00030 #include "dot.h"
00031 #include "pagedef.h"
00032 #include "filename.h"
00033 #include "version.h"
00034 #include "xmldocvisitor.h"
00035 #include "docparser.h"
00036 #include "language.h"
00037 #include "parserintf.h"
00038 
00039 #include <qdir.h>
00040 #include <qfile.h>
00041 #include <qtextstream.h>
00042 #include <qintdict.h>
00043 
00044 // no debug info
00045 #define XML_DB(x) do {} while(0)
00046 // debug to stdout
00047 //#define XML_DB(x) printf x
00048 // debug inside output
00049 //#define XML_DB(x) QCString __t;__t.sprintf x;m_t << __t
00050 
00051 //------------------
00052 
00053 static const char index_xsd[] =
00054 #include "index_xsd.h"
00055 ;
00056 
00057 //------------------
00058 //
00059 static const char compound_xsd[] =
00060 #include "compound_xsd.h"
00061 ;
00062 
00063 //------------------
00064 
00065 class XmlSectionMapper : public QIntDict<char>
00066 {
00067   public:
00068     XmlSectionMapper() : QIntDict<char>(47)
00069     {
00070       insert(MemberList::pubTypes,"public-type");
00071       insert(MemberList::pubMethods,"public-func");
00072       insert(MemberList::pubAttribs,"public-attrib");
00073       insert(MemberList::pubSlots,"public-slot");
00074       insert(MemberList::signals,"signal");
00075       insert(MemberList::dcopMethods,"dcop-func");
00076       insert(MemberList::properties,"property");
00077       insert(MemberList::events,"event");
00078       insert(MemberList::pubStaticMethods,"public-static-func");
00079       insert(MemberList::pubStaticAttribs,"public-static-attrib");
00080       insert(MemberList::proTypes,"protected-type");
00081       insert(MemberList::proMethods,"protected-func");
00082       insert(MemberList::proAttribs,"protected-attrib");
00083       insert(MemberList::proSlots,"protected-slot");
00084       insert(MemberList::proStaticMethods,"protected-static-func");
00085       insert(MemberList::proStaticAttribs,"protected-static-attrib");
00086       insert(MemberList::pacTypes,"package-type");
00087       insert(MemberList::pacMethods,"package-func");
00088       insert(MemberList::pacAttribs,"package-attrib");
00089       insert(MemberList::pacStaticMethods,"package-static-func");
00090       insert(MemberList::pacStaticAttribs,"package-static-attrib");
00091       insert(MemberList::priTypes,"private-type");
00092       insert(MemberList::priMethods,"private-func");
00093       insert(MemberList::priAttribs,"private-attrib");
00094       insert(MemberList::priSlots,"private-slot");
00095       insert(MemberList::priStaticMethods,"private-static-func");
00096       insert(MemberList::priStaticAttribs,"private-static-attrib");
00097       insert(MemberList::friends,"friend");
00098       insert(MemberList::related,"related");
00099       insert(MemberList::decDefineMembers,"define");
00100       insert(MemberList::decProtoMembers,"prototype");
00101       insert(MemberList::decTypedefMembers,"typedef");
00102       insert(MemberList::decEnumMembers,"enum");
00103       insert(MemberList::decFuncMembers,"func");
00104       insert(MemberList::decVarMembers,"var");
00105     }
00106 };
00107 
00108 static XmlSectionMapper g_xmlSectionMapper;
00109 
00110 
00111 inline void writeXMLString(QTextStream &t,const char *s)
00112 {
00113   t << convertToXML(s);
00114 }
00115 
00116 inline void writeXMLCodeString(QTextStream &t,const char *s, int &col)
00117 {
00118   char c;
00119   while ((c=*s++))
00120   {
00121     switch(c)
00122     {
00123       case '\t': 
00124       { 
00125         int spacesToNextTabStop = 
00126           Config_getInt("TAB_SIZE") - (col%Config_getInt("TAB_SIZE")); 
00127         col+=spacesToNextTabStop;
00128         while (spacesToNextTabStop--) t << "<sp/>";
00129         break;
00130         }
00131       case ' ':  t << "<sp/>"; col++;  break;
00132       case '<':  t << "&lt;"; col++;   break;
00133       case '>':  t << "&gt;"; col++;   break;
00134       case '&':  t << "&amp;"; col++;  break;
00135       case '\'': t << "&apos;"; col++; break; 
00136       case '"':  t << "&quot;"; col++; break;
00137       default:   t << c; col++;        break;         
00138     }
00139   } 
00140 }
00141 
00142 
00143 static void writeXMLHeader(QTextStream &t)
00144 {
00145   t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << endl;;
00146   t << "<doxygen xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
00147   t << "xsi:noNamespaceSchemaLocation=\"compound.xsd\" ";
00148   t << "version=\"" << versionString << "\">" << endl;
00149 }
00150 
00151 static void writeCombineScript()
00152 {
00153   QCString outputDirectory = Config_getString("XML_OUTPUT");
00154   QCString fileName=outputDirectory+"/combine.xslt";
00155   QFile f(fileName);
00156   if (!f.open(IO_WriteOnly))
00157   {
00158     err("Cannot open file %s for writing!\n",fileName.data());
00159     return;
00160   }
00161   QTextStream t(&f);
00162   t.setEncoding(QTextStream::UnicodeUTF8);
00163 
00164   t <<
00165   "<!-- XSLT script to combine the generated output into a single file. \n"
00166   "     If you have xsltproc you could use:\n"
00167   "     xsltproc combine.xslt index.xml >all.xml\n"
00168   "-->\n"
00169   "<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">\n"
00170   "  <xsl:output method=\"xml\" version=\"1.0\" indent=\"yes\" standalone=\"yes\" />\n"
00171   "  <xsl:template match=\"/\">\n"
00172   "    <doxygen version=\"{doxygenindex/@version}\">\n"
00173   "      <!-- Load all doxgen generated xml files -->\n"
00174   "      <xsl:for-each select=\"doxygenindex/compound\">\n"
00175   "        <xsl:copy-of select=\"document( concat( @refid, '.xml' ) )/doxygen/*\" />\n"
00176   "      </xsl:for-each>\n"
00177   "    </doxygen>\n"
00178   "  </xsl:template>\n"
00179   "</xsl:stylesheet>\n";
00180 
00181 }
00182 
00183 void writeXMLLink(QTextStream &t,const char *extRef,const char *compoundId,
00184                   const char *anchorId,const char *text,const char *tooltip)
00185 {
00186   t << "<ref refid=\"" << compoundId;
00187   if (anchorId) t << "_1" << anchorId;
00188   t << "\" kindref=\"";
00189   if (anchorId) t << "member"; else t << "compound"; 
00190   t << "\"";
00191   if (extRef) t << " external=\"" << extRef << "\"";
00192   if (tooltip) t << " tooltip=\"" << convertToXML(tooltip) << "\"";
00193   t << ">";
00194   writeXMLString(t,text);
00195   t << "</ref>";
00196 }
00197 
00198 class TextGeneratorXMLImpl : public TextGeneratorIntf
00199 {
00200   public:
00201     TextGeneratorXMLImpl(QTextStream &t): m_t(t) {}
00202     void writeString(const char *s,bool /*keepSpaces*/) const
00203     {
00204       writeXMLString(m_t,s); 
00205     }
00206     void writeBreak() const {}
00207     void writeLink(const char *extRef,const char *file,
00208                    const char *anchor,const char *text
00209                   ) const
00210     {
00211       writeXMLLink(m_t,extRef,file,anchor,text,0);
00212     }
00213   private:
00214     QTextStream &m_t;
00215 };
00216 
00217 template<class T> class ValStack
00218 {
00219   public:
00220     ValStack() : m_values(10), m_sp(0), m_size(10) {}
00221     virtual ~ValStack() {}
00222     ValStack(const ValStack<T> &s)
00223     {
00224       m_values=s.m_values.copy();
00225       m_sp=s.m_sp;
00226       m_size=s.m_size;
00227     }
00228     ValStack &operator=(const ValStack<T> &s)
00229     {
00230       m_values=s.m_values.copy();
00231       m_sp=s.m_sp;
00232       m_size=s.m_size;
00233       return *this;
00234     }
00235     void push(T v)
00236     {
00237       m_sp++;
00238       if (m_sp>=m_size)
00239       {
00240         m_size+=10;
00241         m_values.resize(m_size);
00242       }
00243       m_values[m_sp]=v;
00244     }
00245     T pop()
00246     {
00247       ASSERT(m_sp!=0);
00248       return m_values[m_sp--];
00249     }
00250     T& top()
00251     {
00252       ASSERT(m_sp!=0);
00253       return m_values[m_sp];
00254     }
00255     bool isEmpty()
00256     {
00257       return m_sp==0;
00258     }
00259     uint count() const
00260     {
00261       return m_sp;
00262     }
00263     
00264   private:
00265     QArray<T> m_values;
00266     int m_sp;
00267     int m_size;
00268 };
00269 
00270 
00271 class XMLCodeGenerator : public CodeOutputInterface
00272 {
00273   public:
00274 
00275     XMLCodeGenerator(QTextStream &t) : m_t(t), m_lineNumber(-1),
00276       m_insideCodeLine(FALSE), m_normalHLNeedStartTag(TRUE), 
00277       m_insideSpecialHL(FALSE) {}
00278     virtual ~XMLCodeGenerator() { }
00279     
00280     void codify(const char *text) 
00281     {
00282       XML_DB(("(codify \"%s\")\n",text));
00283       if (m_insideCodeLine && !m_insideSpecialHL && m_normalHLNeedStartTag)
00284       {
00285         m_t << "<highlight class=\"normal\">";
00286         m_normalHLNeedStartTag=FALSE;
00287       }
00288       writeXMLCodeString(m_t,text,col);
00289     }
00290     void writeCodeLink(const char *ref,const char *file,
00291                        const char *anchor,const char *name,
00292                        const char *tooltip) 
00293     {
00294       XML_DB(("(writeCodeLink)\n"));
00295       if (m_insideCodeLine && !m_insideSpecialHL && m_normalHLNeedStartTag)
00296       {
00297         m_t << "<highlight class=\"normal\">";
00298         m_normalHLNeedStartTag=FALSE;
00299       }
00300       writeXMLLink(m_t,ref,file,anchor,name,tooltip);
00301       col+=strlen(name);
00302     }
00303     void startCodeLine() 
00304     {
00305       XML_DB(("(startCodeLine)\n"));
00306       m_t << "<codeline";
00307       if (m_lineNumber!=-1)
00308       {
00309         m_t << " lineno=\"" << m_lineNumber << "\"";
00310         if (!m_refId.isEmpty())
00311         {
00312           m_t << " refid=\"" << m_refId << "\"";
00313           if (m_isMemberRef)
00314           {
00315             m_t << " refkind=\"member\"";
00316           }
00317           else
00318           {
00319             m_t << " refkind=\"compound\"";
00320           }
00321         }
00322         if (!m_external.isEmpty())
00323         {
00324           m_t << " external=\"" << m_external << "\"";
00325         }
00326       }
00327       m_t << ">"; 
00328       m_insideCodeLine=TRUE;
00329       col=0;
00330     }
00331     void endCodeLine() 
00332     {
00333       XML_DB(("(endCodeLine)\n"));
00334       if (!m_insideSpecialHL && !m_normalHLNeedStartTag)
00335       {
00336         m_t << "</highlight>";
00337         m_normalHLNeedStartTag=TRUE;
00338       }
00339       m_t << "</codeline>" << endl; // non DocBook
00340       m_lineNumber = -1;
00341       m_refId.resize(0);
00342       m_external.resize(0);
00343       m_insideCodeLine=FALSE;
00344     }
00345     void startCodeAnchor(const char *id) 
00346     {
00347       XML_DB(("(startCodeAnchor)\n"));
00348       if (m_insideCodeLine && !m_insideSpecialHL && m_normalHLNeedStartTag)
00349       {
00350         m_t << "<highlight class=\"normal\">";
00351         m_normalHLNeedStartTag=FALSE;
00352       }
00353       m_t << "<anchor id=\"" << id << "\">";
00354     }
00355     void endCodeAnchor() 
00356     {
00357       XML_DB(("(endCodeAnchor)\n"));
00358       m_t << "</anchor>";
00359     }
00360     void startFontClass(const char *colorClass) 
00361     {
00362       XML_DB(("(startFontClass)\n"));
00363       if (m_insideCodeLine && !m_insideSpecialHL && !m_normalHLNeedStartTag)
00364       {
00365         m_t << "</highlight>";
00366         m_normalHLNeedStartTag=TRUE;
00367       }
00368       m_t << "<highlight class=\"" << colorClass << "\">"; // non DocBook
00369       m_insideSpecialHL=TRUE;
00370     }
00371     void endFontClass()
00372     {
00373       XML_DB(("(endFontClass)\n"));
00374       m_t << "</highlight>"; // non DocBook
00375       m_insideSpecialHL=FALSE;
00376     }
00377     void writeCodeAnchor(const char *)
00378     {
00379       XML_DB(("(writeCodeAnchor)\n"));
00380     }
00381     void writeLineNumber(const char *extRef,const char *compId,
00382                          const char *anchorId,int l)
00383     {
00384       XML_DB(("(writeLineNumber)\n"));
00385       // we remember the information provided here to use it 
00386       // at the <codeline> start tag.
00387       m_lineNumber = l;
00388       if (compId)
00389       {
00390         m_refId=compId;
00391         if (anchorId) m_refId+=(QCString)"_1"+anchorId;
00392         m_isMemberRef = anchorId!=0;
00393         if (extRef) m_external=extRef;
00394       }
00395     }
00396     void linkableSymbol(int, const char *,Definition *,Definition *) 
00397     {
00398     }
00399 
00400     void finish()
00401     {
00402       if (m_insideCodeLine) endCodeLine();
00403     }
00404 
00405   private:
00406     QTextStream &m_t;  
00407     QCString m_refId;
00408     QCString m_external;
00409     int m_lineNumber;
00410     bool m_isMemberRef;
00411     int col;
00412 
00413     bool m_insideCodeLine;
00414     bool m_normalHLNeedStartTag;
00415     bool m_insideSpecialHL;
00416 };
00417 
00418 
00419 static void writeTemplateArgumentList(ArgumentList *al,
00420                                       QTextStream &t,
00421                                       Definition *scope,
00422                                       FileDef *fileScope,
00423                                       int indent)
00424 {
00425   QCString indentStr;
00426   indentStr.fill(' ',indent);
00427   if (al)
00428   {
00429     t << indentStr << "<templateparamlist>" << endl;
00430     ArgumentListIterator ali(*al);
00431     Argument *a;
00432     for (ali.toFirst();(a=ali.current());++ali)
00433     {
00434       t << indentStr << "  <param>" << endl;
00435       if (!a->type.isEmpty())
00436       {
00437         t << indentStr <<  "    <type>";
00438         linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a->type);
00439         t << "</type>" << endl;
00440       }
00441       if (!a->name.isEmpty())
00442       {
00443         t << indentStr <<  "    <declname>" << a->name << "</declname>" << endl;
00444         t << indentStr <<  "    <defname>" << a->name << "</defname>" << endl;
00445       }
00446       if (!a->defval.isEmpty())
00447       {
00448         t << indentStr << "    <defval>";
00449         linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a->defval);
00450         t << "</defval>" << endl;
00451       }
00452       t << indentStr << "  </param>" << endl;
00453     }
00454     t << indentStr << "</templateparamlist>" << endl;
00455   }
00456 }
00457 
00458 static void writeMemberTemplateLists(MemberDef *md,QTextStream &t)
00459 {
00460   LockingPtr<ArgumentList> templMd = md->templateArguments();
00461   if (templMd!=0) // function template prefix
00462   {
00463     writeTemplateArgumentList(templMd.pointer(),t,md->getClassDef(),md->getFileDef(),8);
00464   }
00465 }
00466 
00467 static void writeTemplateList(ClassDef *cd,QTextStream &t)
00468 {
00469   writeTemplateArgumentList(cd->templateArguments(),t,cd,0,4);
00470 }
00471 
00472 static void writeXMLDocBlock(QTextStream &t,
00473                       const QCString &fileName,
00474                       int lineNr,
00475                       Definition *scope,
00476                       MemberDef * md,
00477                       const QCString &text)
00478 {
00479   QCString stext = text.stripWhiteSpace();
00480   if (stext.isEmpty()) return;
00481   // convert the documentation string into an abstract syntax tree
00482   DocNode *root = validatingParseDoc(fileName,lineNr,scope,md,text+"\n",FALSE,FALSE);
00483   // create a code generator
00484   XMLCodeGenerator *xmlCodeGen = new XMLCodeGenerator(t);
00485   // create a parse tree visitor for XML
00486   XmlDocVisitor *visitor = new XmlDocVisitor(t,*xmlCodeGen);
00487   // visit all nodes
00488   root->accept(visitor);
00489   // clean up
00490   delete visitor;
00491   delete xmlCodeGen;
00492   delete root;
00493   
00494 }
00495 
00496 void writeXMLCodeBlock(QTextStream &t,FileDef *fd)
00497 {
00498   ParserInterface *pIntf=Doxygen::parserManager->getParser(fd->getDefFileExtension());
00499   pIntf->resetCodeParserState();
00500   XMLCodeGenerator *xmlGen = new XMLCodeGenerator(t);
00501   pIntf->parseCode(*xmlGen,
00502                 0,
00503                 fileToString(fd->absFilePath(),Config_getBool("FILTER_SOURCE_FILES")),
00504                 FALSE,
00505                 0,
00506                 fd);
00507   xmlGen->finish();
00508   delete xmlGen;
00509 }
00510 
00511 static void writeMemberReference(QTextStream &t,Definition *def,MemberDef *rmd,const char *tagName)
00512 {
00513   QCString scope = rmd->getScopeString();
00514   QCString name = rmd->name();
00515   if (!scope.isEmpty() && scope!=def->name())
00516   {
00517     name.prepend(scope+"::");
00518   }
00519   t << "        <" << tagName << " refid=\"";
00520   t << rmd->getOutputFileBase() << "_1" << rmd->anchor() << "\"";
00521   if (rmd->getStartBodyLine()!=-1 && rmd->getBodyDef()) 
00522   {
00523     t << " compoundref=\"" << rmd->getBodyDef()->getOutputFileBase() << "\"";
00524     t << " startline=\"" << rmd->getStartBodyLine() << "\"";
00525     if (rmd->getEndBodyLine()!=-1)
00526     {
00527       t << " endline=\"" << rmd->getEndBodyLine() << "\"";
00528     }
00529   }
00530   t << ">" << convertToXML(name) << "</" << tagName << ">" << endl;
00531   
00532 }
00533 
00534 static void stripQualifiers(QCString &typeStr)
00535 {
00536   bool done=FALSE;
00537   while (!done)
00538   {
00539     if (typeStr.stripPrefix("static "));
00540     else if (typeStr.stripPrefix("virtual "));
00541     else if (typeStr.stripPrefix("volatile "));
00542     else if (typeStr=="virtual") typeStr="";
00543     else done=TRUE;
00544   }
00545 }
00546 
00547 static void generateXMLForMember(MemberDef *md,QTextStream &ti,QTextStream &t,Definition *def)
00548 {
00549 
00550   // + declaration/definition arg lists
00551   // + reimplements
00552   // + reimplementedBy
00553   // + exceptions
00554   // + const/volatile specifiers
00555   // - examples
00556   // + source definition
00557   // + source references
00558   // + source referenced by
00559   // - body code 
00560   // + template arguments 
00561   //     (templateArguments(), definitionTemplateParameterLists())
00562   // - call graph
00563   
00564   // enum values are written as part of the enum
00565   if (md->memberType()==MemberDef::EnumValue) return;
00566   if (md->isHidden()) return;
00567   if (md->name().at(0)=='@') return; // anonymous member
00568 
00569   // group members are only visible in their group
00570   //if (def->definitionType()!=Definition::TypeGroup && md->getGroupDef()) return;
00571 
00572   QCString memType;
00573   bool isFunc=FALSE;
00574   switch (md->memberType())
00575   {
00576     case MemberDef::Define:      memType="define";    break;
00577     case MemberDef::EnumValue:   ASSERT(0);           break;
00578     case MemberDef::Property:    memType="property";  break;
00579     case MemberDef::Event:       memType="event";     break;
00580     case MemberDef::Variable:    memType="variable";  break;
00581     case MemberDef::Typedef:     memType="typedef";   break;
00582     case MemberDef::Enumeration: memType="enum";      break;
00583     case MemberDef::Function:    memType="function";  isFunc=TRUE; break;
00584     case MemberDef::Signal:      memType="signal";    isFunc=TRUE; break;
00585     case MemberDef::Prototype:   memType="prototype"; isFunc=TRUE; break;
00586     case MemberDef::Friend:      memType="friend";    isFunc=TRUE; break;
00587     case MemberDef::DCOP:        memType="dcop";      isFunc=TRUE; break;
00588     case MemberDef::Slot:        memType="slot";      isFunc=TRUE; break;
00589   }
00590 
00591   ti << "    <member refid=\"" << md->getOutputFileBase() 
00592      << "_1" << md->anchor() << "\" kind=\"" << memType << "\"><name>" 
00593      << convertToXML(md->name()) << "</name></member>" << endl;
00594   
00595   QCString scopeName;
00596   if (md->getClassDef()) 
00597     scopeName=md->getClassDef()->name();
00598   else if (md->getNamespaceDef()) 
00599     scopeName=md->getNamespaceDef()->name();
00600     
00601   t << "      <memberdef kind=\"";
00602   //enum { define_t,variable_t,typedef_t,enum_t,function_t } xmlType = function_t;
00603   t << memType << "\" id=\"";
00604   if (md->getGroupDef() && def->definitionType()==Definition::TypeGroup)
00605   {
00606     t << md->getGroupDef()->getOutputFileBase();
00607   }
00608   else
00609   {
00610     t << md->getOutputFileBase();
00611   }
00612   t << "_1"      // encoded `:' character (see util.cpp:convertNameToFile)
00613     << md->anchor();
00614   t << "\" prot=\"";
00615   switch(md->protection())
00616   {
00617     case Public:    t << "public";     break;
00618     case Protected: t << "protected";  break;
00619     case Private:   t << "private";    break;
00620     case Package:   t << "package";    break;
00621   }
00622   t << "\"";
00623 
00624   t << " static=\"";
00625   if (md->isStatic()) t << "yes"; else t << "no";
00626   t << "\"";
00627 
00628   if (isFunc)
00629   {
00630     LockingPtr<ArgumentList> al = md->argumentList();
00631     t << " const=\"";
00632     if (al!=0 && al->constSpecifier)    t << "yes"; else t << "no"; 
00633     t << "\"";
00634 
00635     t << " explicit=\"";
00636     if (md->isExplicit()) t << "yes"; else t << "no";
00637     t << "\"";
00638 
00639     t << " inline=\"";
00640     if (md->isInline()) t << "yes"; else t << "no";
00641     t << "\"";
00642 
00643     if (md->isFinal())
00644     {
00645       t << " final=\"yes\"";
00646     }
00647 
00648     if (md->isSealed())
00649     {
00650       t << " sealed=\"yes\"";
00651     }
00652 
00653     if (md->isNew())
00654     {
00655       t << " new=\"yes\"";
00656     }
00657 
00658     t << " virt=\"";
00659     switch (md->virtualness())
00660     {
00661       case Normal:  t << "non-virtual";  break;
00662       case Virtual: t << "virtual";      break;
00663       case Pure:    t << "pure-virtual"; break;
00664       default: ASSERT(0);
00665     }
00666     t << "\"";
00667   }
00668 
00669   if (md->memberType() == MemberDef::Variable)
00670   {
00671     //ArgumentList *al = md->argumentList();
00672     //t << " volatile=\"";
00673     //if (al && al->volatileSpecifier) t << "yes"; else t << "no"; 
00674 
00675     t << " mutable=\"";
00676     if (md->isMutable()) t << "yes"; else t << "no";
00677     t << "\"";
00678     
00679     if (md->isInitonly())
00680     {
00681       t << " initonly=\"yes\"";
00682     }
00683     
00684   }
00685   else if (md->memberType() == MemberDef::Property)
00686   {
00687     t << " readable=\"";
00688     if (md->isReadable()) t << "yes"; else t << "no";
00689     t << "\"";
00690 
00691     t << " writable=\"";
00692     if (md->isWritable()) t << "yes"; else t << "no";
00693     t << "\"";
00694 
00695     t << " gettable=\"";
00696     if (md->isGettable()) t << "yes"; else t << "no";
00697     t << "\"";
00698 
00699     t << " settable=\"";
00700     if (md->isSettable()) t << "yes"; else t << "no";
00701     t << "\"";
00702   }
00703   else if (md->memberType() == MemberDef::Event)
00704   {
00705     t << " add=\"";
00706     if (md->isAddable()) t << "yes"; else t << "no";
00707     t << "\"";
00708 
00709     t << " remove=\"";
00710     if (md->isRemovable()) t << "yes"; else t << "no";
00711     t << "\"";
00712 
00713     t << " raise=\"";
00714     if (md->isRaisable()) t << "yes"; else t << "no";
00715     t << "\"";
00716   }
00717 
00718   t << ">" << endl;
00719 
00720   if (md->memberType()!=MemberDef::Define &&
00721       md->memberType()!=MemberDef::Enumeration
00722      )
00723   {
00724     if (md->memberType()!=MemberDef::Typedef)
00725     {
00726       writeMemberTemplateLists(md,t);
00727     }
00728     QCString typeStr = md->typeString(); //replaceAnonymousScopes(md->typeString());
00729     stripQualifiers(typeStr);
00730     t << "        <type>";
00731     linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),typeStr);
00732     t << "</type>" << endl;
00733     t << "        <definition>" << convertToXML(md->definition()) << "</definition>" << endl;
00734     t << "        <argsstring>" << convertToXML(md->argsString()) << "</argsstring>" << endl;
00735   }
00736 
00737   t << "        <name>" << convertToXML(md->name()) << "</name>" << endl;
00738   
00739   if (md->memberType() == MemberDef::Property)
00740   {
00741     if (md->isReadable())
00742       t << "        <read>" << convertToXML(md->getReadAccessor()) << "</read>" << endl;
00743     if (md->isWritable())
00744       t << "        <write>" << convertToXML(md->getWriteAccessor()) << "</write>" << endl;
00745   }
00746   if (md->memberType()==MemberDef::Variable && md->bitfieldString())
00747   {
00748     QCString bitfield = md->bitfieldString();
00749     if (bitfield.at(0)==':') bitfield=bitfield.mid(1);
00750     t << "        <bitfield>" << bitfield << "</bitfield>" << endl;
00751   }
00752   
00753   MemberDef *rmd = md->reimplements();
00754   if (rmd)
00755   {
00756     t << "        <reimplements refid=\"" 
00757       << rmd->getOutputFileBase() << "_1" << rmd->anchor() << "\">"
00758       << convertToXML(rmd->name()) << "</reimplements>" << endl;
00759   }
00760   LockingPtr<MemberList> rbml = md->reimplementedBy();
00761   if (rbml!=0)
00762   {
00763     MemberListIterator mli(*rbml);
00764     for (mli.toFirst();(rmd=mli.current());++mli)
00765     {
00766       t << "        <reimplementedby refid=\"" 
00767         << rmd->getOutputFileBase() << "_1" << rmd->anchor() << "\">"
00768         << convertToXML(rmd->name()) << "</reimplementedby>" << endl;
00769     }
00770   }
00771 
00772   if (isFunc) //function
00773   {
00774     LockingPtr<ArgumentList> declAl = md->declArgumentList();
00775     LockingPtr<ArgumentList> defAl = md->argumentList();
00776     if (declAl!=0 && declAl->count()>0)
00777     {
00778       ArgumentListIterator declAli(*declAl);
00779       ArgumentListIterator defAli(*defAl);
00780       Argument *a;
00781       for (declAli.toFirst();(a=declAli.current());++declAli)
00782       {
00783         Argument *defArg = defAli.current();
00784         t << "        <param>" << endl;
00785         if (!a->attrib.isEmpty())
00786         {
00787           t << "          <attributes>";
00788           writeXMLString(t,a->attrib);
00789           t << "</attributes>" << endl;
00790         }
00791         if (!a->type.isEmpty())
00792         {
00793           t << "          <type>";
00794           linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),a->type);
00795           t << "</type>" << endl;
00796         }
00797         if (!a->name.isEmpty())
00798         {
00799           t << "          <declname>";
00800           writeXMLString(t,a->name); 
00801           t << "</declname>" << endl;
00802         }
00803         if (defArg && !defArg->name.isEmpty() && defArg->name!=a->name)
00804         {
00805           t << "          <defname>";
00806           writeXMLString(t,defArg->name);
00807           t << "</defname>" << endl;
00808         }
00809         if (!a->array.isEmpty())
00810         {
00811           t << "          <array>"; 
00812           writeXMLString(t,a->array); 
00813           t << "</array>" << endl;
00814         }
00815         if (!a->defval.isEmpty())
00816         {
00817           t << "          <defval>";
00818           linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),a->defval);
00819           t << "</defval>" << endl;
00820         }
00821         if (defArg && defArg->hasDocumentation())
00822         {
00823           t << "          <briefdescription>";
00824           writeXMLDocBlock(t,md->getDefFileName(),md->getDefLine(),
00825                            md->getOuterScope(),md,defArg->docs);
00826           t << "</briefdescription>" << endl;
00827         }
00828         t << "        </param>" << endl;
00829         if (defArg) ++defAli;
00830       }
00831     }
00832   }
00833   else if (md->memberType()==MemberDef::Define && 
00834           md->argsString()) // define
00835   {
00836     if (md->argumentList()->count()==0) // special case for "foo()" to
00837                                         // disguish it from "foo".
00838     {
00839       t << "        <param></param>" << endl;
00840     }
00841     else
00842     {
00843       ArgumentListIterator ali(*md->argumentList());
00844       Argument *a;
00845       for (ali.toFirst();(a=ali.current());++ali)
00846       {
00847         t << "        <param><defname>" << a->type << "</defname></param>" << endl;
00848       }
00849     }
00850   }
00851   // avoid that extremely large tables are written to the output. 
00852   // todo: it's better to adhere to MAX_INITIALIZER_LINES.
00853   if (!md->initializer().isEmpty() && md->initializer().length()<2000)
00854   {
00855     t << "        <initializer>";
00856     linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),md->initializer());
00857     t << "</initializer>" << endl;
00858   }
00859 
00860   if (md->excpString())
00861   {
00862     t << "        <exceptions>";
00863     linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),md->excpString());
00864     t << "</exceptions>" << endl;
00865   }
00866   
00867   if (md->memberType()==MemberDef::Enumeration) // enum
00868   {
00869     LockingPtr<MemberList> enumFields = md->enumFieldList();
00870     if (enumFields!=0)
00871     {
00872       MemberListIterator emli(*enumFields);
00873       MemberDef *emd;
00874       for (emli.toFirst();(emd=emli.current());++emli)
00875       {
00876         ti << "    <member refid=\"" << emd->getOutputFileBase() 
00877            << "_1" << emd->anchor() << "\" kind=\"enumvalue\"><name>" 
00878            << convertToXML(emd->name()) << "</name></member>" << endl;
00879 
00880         t << "        <enumvalue id=\"" << emd->getOutputFileBase() << "_1" 
00881           << emd->anchor() << "\" prot=\"";
00882         switch (emd->protection())
00883         {
00884           case Public:    t << "public";    break;
00885           case Protected: t << "protected"; break;
00886           case Private:   t << "private";   break;
00887           case Package:   t << "package";   break;
00888         }
00889         t << "\">" << endl;
00890         t << "          <name>";
00891         writeXMLString(t,emd->name());
00892         t << "</name>" << endl;
00893         if (!emd->initializer().isEmpty())
00894         {
00895           t << "          <initializer>";
00896           writeXMLString(t,emd->initializer());
00897           t << "</initializer>" << endl;
00898         }
00899         t << "          <briefdescription>" << endl;
00900         writeXMLDocBlock(t,emd->briefFile(),emd->briefLine(),emd->getOuterScope(),emd,emd->briefDescription());
00901         t << "          </briefdescription>" << endl;
00902         t << "          <detaileddescription>" << endl;
00903         writeXMLDocBlock(t,emd->docFile(),emd->docLine(),emd->getOuterScope(),emd,emd->documentation());
00904         t << "          </detaileddescription>" << endl;
00905         t << "        </enumvalue>" << endl;
00906       }
00907     }
00908   }
00909   t << "        <briefdescription>" << endl;
00910   writeXMLDocBlock(t,md->briefFile(),md->briefLine(),md->getOuterScope(),md,md->briefDescription());
00911   t << "        </briefdescription>" << endl;
00912   t << "        <detaileddescription>" << endl;
00913   writeXMLDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation());
00914   t << "        </detaileddescription>" << endl;
00915   t << "        <inbodydescription>" << endl;
00916   writeXMLDocBlock(t,md->docFile(),md->inbodyLine(),md->getOuterScope(),md,md->inbodyDocumentation());
00917   t << "        </inbodydescription>" << endl;
00918   if (md->getDefLine()!=-1)
00919   {
00920     t << "        <location file=\"" 
00921       << md->getDefFileName() << "\" line=\"" 
00922       << md->getDefLine() << "\"";
00923     if (md->getStartBodyLine()!=-1)
00924     {
00925       FileDef *bodyDef = md->getBodyDef();
00926       if (bodyDef)
00927       {
00928         t << " bodyfile=\"" << bodyDef->absFilePath() << "\"";
00929       }
00930       t << " bodystart=\"" << md->getStartBodyLine() << "\" bodyend=\"" 
00931         << md->getEndBodyLine() << "\"";
00932     }
00933     t << "/>" << endl;
00934   }
00935 
00936   //printf("md->getReferencesMembers()=%p\n",md->getReferencesMembers());
00937   LockingPtr<MemberSDict> mdict = md->getReferencesMembers();
00938   if (mdict!=0)
00939   {
00940     MemberSDict::Iterator mdi(*mdict);
00941     MemberDef *rmd;
00942     for (mdi.toFirst();(rmd=mdi.current());++mdi)
00943     {
00944       writeMemberReference(t,def,rmd,"references");
00945     }
00946   }
00947   mdict = md->getReferencedByMembers();
00948   if (mdict!=0)
00949   {
00950     MemberSDict::Iterator mdi(*mdict);
00951     MemberDef *rmd;
00952     for (mdi.toFirst();(rmd=mdi.current());++mdi)
00953     {
00954       writeMemberReference(t,def,rmd,"referencedby");
00955     }
00956   }
00957   
00958   t << "      </memberdef>" << endl;
00959 }
00960 
00961 static void generateXMLSection(Definition *d,QTextStream &ti,QTextStream &t,
00962                       MemberList *ml,const char *kind,const char *header=0,
00963                       const char *documentation=0)
00964 {
00965   if (ml==0) return;
00966   MemberListIterator mli(*ml);
00967   MemberDef *md;
00968   int count=0;
00969   for (mli.toFirst();(md=mli.current());++mli)
00970   {
00971     // namespace members are also inserted in the file scope, but 
00972     // to prevent this duplication in the XML output, we filter those here.
00973     if (d->definitionType()!=Definition::TypeFile || md->getNamespaceDef()==0)
00974     {
00975       count++;
00976     }
00977   }
00978   if (count==0) return; // empty list
00979 
00980   t << "      <sectiondef kind=\"" << kind << "\">" << endl;
00981   if (header)
00982   {
00983     t << "      <header>" << convertToXML(header) << "</header>" << endl;
00984   }
00985   if (documentation)
00986   {
00987     t << "      <description>";
00988     writeXMLDocBlock(t,d->docFile(),d->docLine(),d,0,documentation);
00989     t << "</description>" << endl;
00990   }
00991   for (mli.toFirst();(md=mli.current());++mli)
00992   {
00993     // namespace members are also inserted in the file scope, but 
00994     // to prevent this duplication in the XML output, we filter those here.
00995     if (d->definitionType()!=Definition::TypeFile || md->getNamespaceDef()==0)
00996     {
00997       generateXMLForMember(md,ti,t,d);
00998     }
00999   }
01000   t << "      </sectiondef>" << endl;
01001 }
01002 
01003 static void writeListOfAllMembers(ClassDef *cd,QTextStream &t)
01004 {
01005   t << "    <listofallmembers>" << endl;
01006   if (cd->memberNameInfoSDict())
01007   {
01008     MemberNameInfoSDict::Iterator mnii(*cd->memberNameInfoSDict());
01009     MemberNameInfo *mni;
01010     for (mnii.toFirst();(mni=mnii.current());++mnii)
01011     {
01012       MemberNameInfoIterator mii(*mni);
01013       MemberInfo *mi;
01014       for (mii.toFirst();(mi=mii.current());++mii)
01015       {
01016         MemberDef *md=mi->memberDef;
01017         if (md->name().at(0)!='@') // skip anonymous members
01018         {
01019           Protection prot = mi->prot;
01020           Specifier virt=md->virtualness();
01021           t << "      <member refid=\"" << md->getOutputFileBase() << "_1" <<
01022             md->anchor() << "\" prot=\"";
01023           switch (prot)
01024           {
01025             case Public:    t << "public";    break;
01026             case Protected: t << "protected"; break;
01027             case Private:   t << "private";   break;
01028             case Package:   t << "package";   break;
01029           }
01030           t << "\" virt=\"";
01031           switch(virt)
01032           {
01033             case Normal:  t << "non-virtual";  break;
01034             case Virtual: t << "virtual";      break;
01035             case Pure:    t << "pure-virtual"; break;
01036           }
01037           t << "\"";
01038           if (!mi->ambiguityResolutionScope.isEmpty())
01039           {
01040             t << " ambiguityscope=\"" << convertToXML(mi->ambiguityResolutionScope) << "\"";
01041           }
01042           t << "><scope>" << convertToXML(cd->name()) << "</scope><name>" << 
01043             convertToXML(md->name()) << "</name></member>" << endl;
01044         }
01045       }
01046     }
01047   }
01048   t << "    </listofallmembers>" << endl;
01049 }
01050 
01051 static void writeInnerClasses(const ClassSDict *cl,QTextStream &t)
01052 {
01053   if (cl)
01054   {
01055     ClassSDict::Iterator cli(*cl);
01056     ClassDef *cd;
01057     for (cli.toFirst();(cd=cli.current());++cli)
01058     {
01059       if (!cd->isHidden() && cd->name().find('@')==-1) // skip anonymous scopes
01060       {
01061         t << "    <innerclass refid=\"" << cd->getOutputFileBase()
01062           << "\" prot=\"";
01063         switch(cd->protection())
01064         {
01065            case Public:    t << "public";     break;
01066            case Protected: t << "protected";  break;
01067            case Private:   t << "private";    break;
01068            case Package:   t << "package";    break;
01069         }
01070         t << "\">" << convertToXML(cd->name()) << "</innerclass>" << endl;
01071       }
01072     }
01073   }
01074 }
01075 
01076 static void writeInnerNamespaces(const NamespaceSDict *nl,QTextStream &t)
01077 {
01078   if (nl)
01079   {
01080     NamespaceSDict::Iterator nli(*nl);
01081     NamespaceDef *nd;
01082     for (nli.toFirst();(nd=nli.current());++nli)
01083     {
01084       if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymouse scopes
01085       {
01086         t << "    <innernamespace refid=\"" << nd->getOutputFileBase()
01087           << "\">" << convertToXML(nd->name()) << "</innernamespace>" << endl;
01088       }
01089     }
01090   }
01091 }
01092 
01093 static void writeInnerFiles(const FileList *fl,QTextStream &t)
01094 {
01095   if (fl)
01096   {
01097     QListIterator<FileDef> fli(*fl);
01098     FileDef *fd;
01099     for (fli.toFirst();(fd=fli.current());++fli)
01100     {
01101       t << "    <innerfile refid=\"" << fd->getOutputFileBase() 
01102         << "\">" << convertToXML(fd->name()) << "</innerfile>" << endl;
01103     }
01104   }
01105 }
01106 
01107 static void writeInnerPages(const PageSDict *pl,QTextStream &t)
01108 {
01109   if (pl)
01110   {
01111     PageSDict::Iterator pli(*pl);
01112     PageDef *pd;
01113     for (pli.toFirst();(pd=pli.current());++pli)
01114     {
01115       t << "    <innerpage refid=\"" << pd->getOutputFileBase();
01116       if (pd->getGroupDef())
01117       {
01118         t << "_" << pd->name();
01119       }
01120       t << "\">" << convertToXML(pd->title()) << "</innerpage>" << endl;
01121     }
01122   }
01123 }
01124 
01125 static void writeInnerGroups(const GroupList *gl,QTextStream &t)
01126 {
01127   if (gl)
01128   {
01129     GroupListIterator gli(*gl);
01130     GroupDef *sgd;
01131     for (gli.toFirst();(sgd=gli.current());++gli)
01132     {
01133       t << "    <innergroup refid=\"" << sgd->getOutputFileBase()
01134         << "\">" << convertToXML(sgd->groupTitle()) 
01135         << "</innergroup>" << endl;
01136     }
01137   }
01138 }
01139 
01140 static void writeInnerDirs(const DirList *dl,QTextStream &t)
01141 {
01142   if (dl)
01143   {
01144     QListIterator<DirDef> subdirs(*dl);
01145     DirDef *subdir;
01146     for (subdirs.toFirst();(subdir=subdirs.current());++subdirs)
01147     {
01148       t << "    <innerdir refid=\"" << subdir->getOutputFileBase() 
01149         << "\">" << convertToXML(subdir->displayName()) << "</innerdir>" << endl;
01150     }
01151   }
01152 }
01153   
01154 
01155 static void generateXMLForClass(ClassDef *cd,QTextStream &ti)
01156 {
01157   // + brief description
01158   // + detailed description
01159   // + template argument list(s)
01160   // - include file
01161   // + member groups
01162   // + inheritance diagram
01163   // + list of direct super classes
01164   // + list of direct sub classes
01165   // + list of inner classes
01166   // + collaboration diagram
01167   // + list of all members
01168   // + user defined member sections
01169   // + standard member sections
01170   // + detailed member documentation
01171   // - examples using the class
01172   
01173   if (cd->isReference())        return; // skip external references.
01174   if (cd->isHidden())           return; // skip hidden classes.
01175   if (cd->name().find('@')!=-1) return; // skip anonymous compounds.
01176   if (cd->templateMaster()!=0)  return; // skip generated template instances.
01177 
01178   msg("Generating XML output for class %s\n",cd->name().data());
01179 
01180   ti << "  <compound refid=\"" << cd->getOutputFileBase() 
01181      << "\" kind=\"" << cd->compoundTypeString()
01182      << "\"><name>" << convertToXML(cd->name()) << "</name>" << endl;
01183   
01184   QCString outputDirectory = Config_getString("XML_OUTPUT");
01185   QCString fileName=outputDirectory+"/"+cd->getOutputFileBase()+".xml";
01186   QFile f(fileName);
01187   if (!f.open(IO_WriteOnly))
01188   {
01189     err("Cannot open file %s for writing!\n",fileName.data());
01190     return;
01191   }
01192   QTextStream t(&f);
01193   t.setEncoding(QTextStream::UnicodeUTF8);
01194 
01195   writeXMLHeader(t);
01196   t << "  <compounddef id=\"" 
01197     << cd->getOutputFileBase() << "\" kind=\"" 
01198     << cd->compoundTypeString() << "\" prot=\"";
01199   switch (cd->protection())
01200   {
01201     case Public:    t << "public";    break;
01202     case Protected: t << "protected"; break;
01203     case Private:   t << "private";   break;
01204     case Package:   t << "package";   break;
01205   }
01206   t << "\">" << endl;
01207   t << "    <compoundname>"; 
01208   writeXMLString(t,cd->name()); 
01209   t << "</compoundname>" << endl;
01210   if (cd->baseClasses())
01211   {
01212     BaseClassListIterator bcli(*cd->baseClasses());
01213     BaseClassDef *bcd;
01214     for (bcli.toFirst();(bcd=bcli.current());++bcli)
01215     {
01216       t << "    <basecompoundref ";
01217       if (bcd->classDef->isLinkable())
01218       {
01219         t << "refid=\"" << bcd->classDef->getOutputFileBase() << "\" ";
01220       }
01221       t << "prot=\"";
01222       switch (bcd->prot)
01223       {
01224         case Public:    t << "public";    break;
01225         case Protected: t << "protected"; break;
01226         case Private:   t << "private";   break;
01227         case Package: ASSERT(0); break;
01228       }
01229       t << "\" virt=\"";
01230       switch(bcd->virt)
01231       {
01232         case Normal:  t << "non-virtual";  break;
01233         case Virtual: t << "virtual";      break;
01234         case Pure:    t <<"pure-virtual"; break;
01235       }
01236       t << "\">";
01237       if (!bcd->templSpecifiers.isEmpty())
01238       {
01239         t << convertToXML(
01240               insertTemplateSpecifierInScope(
01241               bcd->classDef->displayName(),bcd->templSpecifiers)
01242            );
01243       }
01244       else
01245       {
01246         t << convertToXML(bcd->classDef->displayName());
01247       }
01248       t  << "</basecompoundref>" << endl;
01249     }
01250   }
01251   if (cd->subClasses())
01252   {
01253     BaseClassListIterator bcli(*cd->subClasses());
01254     BaseClassDef *bcd;
01255     for (bcli.toFirst();(bcd=bcli.current());++bcli)
01256     {
01257       t << "    <derivedcompoundref refid=\"" 
01258         << bcd->classDef->getOutputFileBase()
01259         << "\" prot=\"";
01260       switch (bcd->prot)
01261       {
01262         case Public:    t << "public";    break;
01263         case Protected: t << "protected"; break;
01264         case Private:   t << "private";   break;
01265         case Package: ASSERT(0); break;
01266       }
01267       t << "\" virt=\"";
01268       switch(bcd->virt)
01269       {
01270         case Normal:  t << "non-virtual";  break;
01271         case Virtual: t << "virtual";      break;
01272         case Pure:    t << "pure-virtual"; break;
01273       }
01274       t << "\">" << convertToXML(bcd->classDef->displayName()) 
01275         << "</derivedcompoundref>" << endl;
01276     }
01277   }
01278 
01279   IncludeInfo *ii=cd->includeInfo();
01280   if (ii)
01281   {
01282     QCString nm = ii->includeName;
01283     if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName();
01284     if (!nm.isEmpty())
01285     {
01286       t << "    <includes";
01287       if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references
01288       {
01289         t << " refid=\"" << ii->fileDef->getOutputFileBase() << "\"";
01290       }
01291       t << " local=\"" << (ii->local ? "yes" : "no") << "\">";
01292       t << nm;
01293       t << "</includes>" << endl;
01294     }
01295   }
01296 
01297   writeInnerClasses(cd->getInnerClasses(),t);
01298 
01299   writeTemplateList(cd,t);
01300   if (cd->getMemberGroupSDict())
01301   {
01302     MemberGroupSDict::Iterator mgli(*cd->getMemberGroupSDict());
01303     MemberGroup *mg;
01304     for (;(mg=mgli.current());++mgli)
01305     {
01306       generateXMLSection(cd,ti,t,mg->members(),"user-defined",mg->header(),
01307           mg->documentation());
01308     }
01309   }
01310 
01311   QListIterator<MemberList> mli(cd->getMemberLists());
01312   MemberList *ml;
01313   for (mli.toFirst();(ml=mli.current());++mli)
01314   {
01315     if ((ml->listType()&MemberList::detailedLists)==0)
01316     {
01317       generateXMLSection(cd,ti,t,ml,g_xmlSectionMapper.find(ml->listType()));
01318     }
01319   }
01320 #if 0
01321   generateXMLSection(cd,ti,t,cd->pubTypes,"public-type");
01322   generateXMLSection(cd,ti,t,cd->pubMethods,"public-func");
01323   generateXMLSection(cd,ti,t,cd->pubAttribs,"public-attrib");
01324   generateXMLSection(cd,ti,t,cd->pubSlots,"public-slot");
01325   generateXMLSection(cd,ti,t,cd->signals,"signal");
01326   generateXMLSection(cd,ti,t,cd->dcopMethods,"dcop-func");
01327   generateXMLSection(cd,ti,t,cd->properties,"property");
01328   generateXMLSection(cd,ti,t,cd->events,"event");
01329   generateXMLSection(cd,ti,t,cd->pubStaticMethods,"public-static-func");
01330   generateXMLSection(cd,ti,t,cd->pubStaticAttribs,"public-static-attrib");
01331   generateXMLSection(cd,ti,t,cd->proTypes,"protected-type");
01332   generateXMLSection(cd,ti,t,cd->proMethods,"protected-func");
01333   generateXMLSection(cd,ti,t,cd->proAttribs,"protected-attrib");
01334   generateXMLSection(cd,ti,t,cd->proSlots,"protected-slot");
01335   generateXMLSection(cd,ti,t,cd->proStaticMethods,"protected-static-func");
01336   generateXMLSection(cd,ti,t,cd->proStaticAttribs,"protected-static-attrib");
01337   generateXMLSection(cd,ti,t,cd->pacTypes,"package-type");
01338   generateXMLSection(cd,ti,t,cd->pacMethods,"package-func");
01339   generateXMLSection(cd,ti,t,cd->pacAttribs,"package-attrib");
01340   generateXMLSection(cd,ti,t,cd->pacStaticMethods,"package-static-func");
01341   generateXMLSection(cd,ti,t,cd->pacStaticAttribs,"package-static-attrib");
01342   generateXMLSection(cd,ti,t,cd->priTypes,"private-type");
01343   generateXMLSection(cd,ti,t,cd->priMethods,"private-func");
01344   generateXMLSection(cd,ti,t,cd->priAttribs,"private-attrib");
01345   generateXMLSection(cd,ti,t,cd->priSlots,"private-slot");
01346   generateXMLSection(cd,ti,t,cd->priStaticMethods,"private-static-func");
01347   generateXMLSection(cd,ti,t,cd->priStaticAttribs,"private-static-attrib");
01348   generateXMLSection(cd,ti,t,cd->friends,"friend");
01349   generateXMLSection(cd,ti,t,cd->related,"related");
01350 #endif
01351 
01352   t << "    <briefdescription>" << endl;
01353   writeXMLDocBlock(t,cd->briefFile(),cd->briefLine(),cd,0,cd->briefDescription());
01354   t << "    </briefdescription>" << endl;
01355   t << "    <detaileddescription>" << endl;
01356   writeXMLDocBlock(t,cd->docFile(),cd->docLine(),cd,0,cd->documentation());
01357   t << "    </detaileddescription>" << endl;
01358   DotClassGraph inheritanceGraph(cd,DotNode::Inheritance);
01359   if (!inheritanceGraph.isTrivial())
01360   {
01361     t << "    <inheritancegraph>" << endl;
01362     inheritanceGraph.writeXML(t);
01363     t << "    </inheritancegraph>" << endl;
01364   }
01365   DotClassGraph collaborationGraph(cd,DotNode::Collaboration);
01366   if (!collaborationGraph.isTrivial())
01367   {
01368     t << "    <collaborationgraph>" << endl;
01369     collaborationGraph.writeXML(t);
01370     t << "    </collaborationgraph>" << endl;
01371   }
01372   t << "    <location file=\"" 
01373     << cd->getDefFileName() << "\" line=\"" 
01374     << cd->getDefLine() << "\"";
01375     if (cd->getStartBodyLine()!=-1)
01376     {
01377       FileDef *bodyDef = cd->getBodyDef();
01378       if (bodyDef)
01379       {
01380         t << " bodyfile=\"" << bodyDef->absFilePath() << "\"";
01381       }
01382       t << " bodystart=\"" << cd->getStartBodyLine() << "\" bodyend=\"" 
01383         << cd->getEndBodyLine() << "\"";
01384     }
01385   t << "/>" << endl;
01386   writeListOfAllMembers(cd,t);
01387   t << "  </compounddef>" << endl;
01388   t << "</doxygen>" << endl;
01389 
01390   ti << "  </compound>" << endl;
01391 }
01392 
01393 static void generateXMLForNamespace(NamespaceDef *nd,QTextStream &ti)
01394 {
01395   // + contained class definitions
01396   // + contained namespace definitions
01397   // + member groups
01398   // + normal members
01399   // + brief desc
01400   // + detailed desc
01401   // + location
01402   // - files containing (parts of) the namespace definition
01403 
01404   if (nd->isReference() || nd->isHidden()) return; // skip external references
01405 
01406   ti << "  <compound refid=\"" << nd->getOutputFileBase() 
01407      << "\" kind=\"namespace\"" << "><name>" 
01408      << convertToXML(nd->name()) << "</name>" << endl;
01409   
01410   QCString outputDirectory = Config_getString("XML_OUTPUT");
01411   QCString fileName=outputDirectory+"/"+nd->getOutputFileBase()+".xml";
01412   QFile f(fileName);
01413   if (!f.open(IO_WriteOnly))
01414   {
01415     err("Cannot open file %s for writing!\n",fileName.data());
01416     return;
01417   }
01418   QTextStream t(&f);
01419   t.setEncoding(QTextStream::UnicodeUTF8);
01420   
01421   writeXMLHeader(t);
01422   t << "  <compounddef id=\"" 
01423     << nd->getOutputFileBase() << "\" kind=\"namespace\">" << endl;
01424   t << "    <compoundname>";
01425   writeXMLString(t,nd->name());
01426   t << "</compoundname>" << endl;
01427 
01428   writeInnerClasses(nd->getClassSDict(),t);
01429   writeInnerNamespaces(nd->getNamespaceSDict(),t);
01430 
01431   if (nd->getMemberGroupSDict())
01432   {
01433     MemberGroupSDict::Iterator mgli(*nd->getMemberGroupSDict());
01434     MemberGroup *mg;
01435     for (;(mg=mgli.current());++mgli)
01436     {
01437       generateXMLSection(nd,ti,t,mg->members(),"user-defined",mg->header(),
01438           mg->documentation());
01439     }
01440   }
01441 
01442   QListIterator<MemberList> mli(nd->getMemberLists());
01443   MemberList *ml;
01444   for (mli.toFirst();(ml=mli.current());++mli)
01445   {
01446     if ((ml->listType()&MemberList::declarationLists)!=0)
01447     {
01448       generateXMLSection(nd,ti,t,ml,g_xmlSectionMapper.find(ml->listType()));
01449     }
01450   }
01451 #if 0
01452   generateXMLSection(nd,ti,t,&nd->decDefineMembers,"define");
01453   generateXMLSection(nd,ti,t,&nd->decProtoMembers,"prototype");
01454   generateXMLSection(nd,ti,t,&nd->decTypedefMembers,"typedef");
01455   generateXMLSection(nd,ti,t,&nd->decEnumMembers,"enum");
01456   generateXMLSection(nd,ti,t,&nd->decFuncMembers,"func");
01457   generateXMLSection(nd,ti,t,&nd->decVarMembers,"var");
01458 #endif
01459 
01460   t << "    <briefdescription>" << endl;
01461   writeXMLDocBlock(t,nd->briefFile(),nd->briefLine(),nd,0,nd->briefDescription());
01462   t << "    </briefdescription>" << endl;
01463   t << "    <detaileddescription>" << endl;
01464   writeXMLDocBlock(t,nd->docFile(),nd->docLine(),nd,0,nd->documentation());
01465   t << "    </detaileddescription>" << endl;
01466   t << "    <location file=\"" 
01467     << nd->getDefFileName() << "\" line=\"" 
01468     << nd->getDefLine() << "\"/>" << endl;
01469   t << "  </compounddef>" << endl;
01470   t << "</doxygen>" << endl;
01471 
01472   ti << "  </compound>" << endl;
01473 }
01474 
01475 static void generateXMLForFile(FileDef *fd,QTextStream &ti)
01476 {
01477   // + includes files
01478   // + includedby files
01479   // + include graph
01480   // + included by graph
01481   // + contained class definitions
01482   // + contained namespace definitions
01483   // + member groups
01484   // + normal members
01485   // + brief desc
01486   // + detailed desc
01487   // + source code
01488   // + location
01489   // - number of lines
01490   
01491   if (fd->isReference()) return; // skip external references
01492   
01493   ti << "  <compound refid=\"" << fd->getOutputFileBase() 
01494      << "\" kind=\"file\"><name>" << convertToXML(fd->name()) 
01495      << "</name>" << endl;
01496   
01497   QCString outputDirectory = Config_getString("XML_OUTPUT");
01498   QCString fileName=outputDirectory+"/"+fd->getOutputFileBase()+".xml";
01499   QFile f(fileName);
01500   if (!f.open(IO_WriteOnly))
01501   {
01502     err("Cannot open file %s for writing!\n",fileName.data());
01503     return;
01504   }
01505   QTextStream t(&f);
01506   t.setEncoding(QTextStream::UnicodeUTF8);
01507 
01508   writeXMLHeader(t);
01509   t << "  <compounddef id=\"" 
01510     << fd->getOutputFileBase() << "\" kind=\"file\">" << endl;
01511   t << "    <compoundname>";
01512   writeXMLString(t,fd->name());
01513   t << "</compoundname>" << endl;
01514 
01515   IncludeInfo *inc;
01516 
01517   if (fd->includeFileList())
01518   {
01519     QListIterator<IncludeInfo> ili1(*fd->includeFileList());
01520     for (ili1.toFirst();(inc=ili1.current());++ili1)
01521     {
01522       t << "    <includes";
01523       if (inc->fileDef && !inc->fileDef->isReference()) // TODO: support external references
01524       {
01525         t << " refid=\"" << inc->fileDef->getOutputFileBase() << "\"";
01526       }
01527       t << " local=\"" << (inc->local ? "yes" : "no") << "\">";
01528       t << inc->includeName;
01529       t << "</includes>" << endl;
01530     }
01531   }
01532 
01533   if (fd->includedByFileList())
01534   {
01535     QListIterator<IncludeInfo> ili2(*fd->includedByFileList());
01536     for (ili2.toFirst();(inc=ili2.current());++ili2)
01537     {
01538       t << "    <includedby";
01539       if (inc->fileDef && !inc->fileDef->isReference()) // TODO: support external references
01540       {
01541         t << " refid=\"" << inc->fileDef->getOutputFileBase() << "\"";
01542       }
01543       t << " local=\"" << (inc->local ? "yes" : "no") << "\">";
01544       t << inc->includeName;
01545       t << "</includedby>" << endl;
01546     }
01547   }
01548 
01549   DotInclDepGraph incDepGraph(fd,FALSE);
01550   if (!incDepGraph.isTrivial())
01551   {
01552     t << "    <incdepgraph>" << endl;
01553     incDepGraph.writeXML(t);
01554     t << "    </incdepgraph>" << endl;
01555   }
01556 
01557   DotInclDepGraph invIncDepGraph(fd,TRUE);
01558   if (!invIncDepGraph.isTrivial())
01559   {
01560     t << "    <invincdepgraph>" << endl;
01561     invIncDepGraph.writeXML(t);
01562     t << "    </invincdepgraph>" << endl;
01563   }
01564 
01565   if (fd->getClassSDict())
01566   {
01567     writeInnerClasses(fd->getClassSDict(),t);
01568   }
01569   if (fd->getNamespaceSDict())
01570   {
01571     writeInnerNamespaces(fd->getNamespaceSDict(),t);
01572   }
01573 
01574   if (fd->getMemberGroupSDict())
01575   {
01576     MemberGroupSDict::Iterator mgli(*fd->getMemberGroupSDict());
01577     MemberGroup *mg;
01578     for (;(mg=mgli.current());++mgli)
01579     {
01580       generateXMLSection(fd,ti,t,mg->members(),"user-defined",mg->header(),
01581           mg->documentation());
01582     }
01583   }
01584 
01585   QListIterator<MemberList> mli(fd->getMemberLists());
01586   MemberList *ml;
01587   for (mli.toFirst();(ml=mli.current());++mli)
01588   {
01589     if ((ml->listType()&MemberList::declarationLists)!=0)
01590     {
01591       generateXMLSection(fd,ti,t,ml,g_xmlSectionMapper.find(ml->listType()));
01592     }
01593   }
01594 #if 0
01595   generateXMLSection(fd,ti,t,fd->decDefineMembers,"define");
01596   generateXMLSection(fd,ti,t,fd->decProtoMembers,"prototype");
01597   generateXMLSection(fd,ti,t,fd->decTypedefMembers,"typedef");
01598   generateXMLSection(fd,ti,t,fd->decEnumMembers,"enum");
01599   generateXMLSection(fd,ti,t,fd->decFuncMembers,"func");
01600   generateXMLSection(fd,ti,t,fd->decVarMembers,"var");
01601 #endif
01602 
01603   t << "    <briefdescription>" << endl;
01604   writeXMLDocBlock(t,fd->briefFile(),fd->briefLine(),fd,0,fd->briefDescription());
01605   t << "    </briefdescription>" << endl;
01606   t << "    <detaileddescription>" << endl;
01607   writeXMLDocBlock(t,fd->docFile(),fd->docLine(),fd,0,fd->documentation());
01608   t << "    </detaileddescription>" << endl;
01609   if (Config_getBool("XML_PROGRAMLISTING"))
01610   {
01611     t << "    <programlisting>" << endl;
01612     writeXMLCodeBlock(t,fd);
01613     t << "    </programlisting>" << endl;
01614   }
01615   t << "    <location file=\"" << fd->getDefFileName() << "\"/>" << endl;
01616   t << "  </compounddef>" << endl;
01617   t << "</doxygen>" << endl;
01618 
01619   ti << "  </compound>" << endl;
01620 }
01621 
01622 static void generateXMLForGroup(GroupDef *gd,QTextStream &ti)
01623 {
01624   // + members
01625   // + member groups
01626   // + files
01627   // + classes
01628   // + namespaces
01629   // - packages
01630   // + pages
01631   // + child groups
01632   // - examples
01633   // + brief description
01634   // + detailed description
01635 
01636   if (gd->isReference()) return; // skip external references
01637 
01638   ti << "  <compound refid=\"" << gd->getOutputFileBase() 
01639      << "\" kind=\"group\"><name>" << convertToXML(gd->name()) << "</name>" << endl;
01640   
01641   QCString outputDirectory = Config_getString("XML_OUTPUT");
01642   QCString fileName=outputDirectory+"/"+gd->getOutputFileBase()+".xml";
01643   QFile f(fileName);
01644   if (!f.open(IO_WriteOnly))
01645   {
01646     err("Cannot open file %s for writing!\n",fileName.data());
01647     return;
01648   }
01649 
01650   QTextStream t(&f);
01651   t.setEncoding(QTextStream::UnicodeUTF8);
01652   writeXMLHeader(t);
01653   t << "  <compounddef id=\"" 
01654     << gd->getOutputFileBase() << "\" kind=\"group\">" << endl;
01655   t << "    <compoundname>" << convertToXML(gd->name()) << "</compoundname>" << endl;
01656   t << "    <title>" << convertToXML(gd->groupTitle()) << "</title>" << endl;
01657 
01658   writeInnerFiles(gd->getFiles(),t);
01659   writeInnerClasses(gd->getClasses(),t);
01660   writeInnerNamespaces(gd->getNamespaces(),t);
01661   writeInnerPages(gd->getPages(),t);
01662   writeInnerGroups(gd->getSubGroups(),t);
01663 
01664   if (gd->getMemberGroupSDict())
01665   {
01666     MemberGroupSDict::Iterator mgli(*gd->getMemberGroupSDict());
01667     MemberGroup *mg;
01668     for (;(mg=mgli.current());++mgli)
01669     {
01670       generateXMLSection(gd,ti,t,mg->members(),"user-defined",mg->header(),
01671           mg->documentation());
01672     }
01673   }
01674 
01675   QListIterator<MemberList> mli(gd->getMemberLists());
01676   MemberList *ml;
01677   for (mli.toFirst();(ml=mli.current());++mli)
01678   {
01679     if ((ml->listType()&MemberList::declarationLists)!=0)
01680     {
01681       generateXMLSection(gd,ti,t,ml,g_xmlSectionMapper.find(ml->listType()));
01682     }
01683   }
01684 #if 0
01685   generateXMLSection(gd,ti,t,&gd->decDefineMembers,"define");
01686   generateXMLSection(gd,ti,t,&gd->decProtoMembers,"prototype");
01687   generateXMLSection(gd,ti,t,&gd->decTypedefMembers,"typedef");
01688   generateXMLSection(gd,ti,t,&gd->decEnumMembers,"enum");
01689   generateXMLSection(gd,ti,t,&gd->decFuncMembers,"func");
01690   generateXMLSection(gd,ti,t,&gd->decVarMembers,"var");
01691 #endif
01692 
01693   t << "    <briefdescription>" << endl;
01694   writeXMLDocBlock(t,gd->briefFile(),gd->briefLine(),gd,0,gd->briefDescription());
01695   t << "    </briefdescription>" << endl;
01696   t << "    <detaileddescription>" << endl;
01697   writeXMLDocBlock(t,gd->docFile(),gd->docLine(),gd,0,gd->documentation());
01698   t << "    </detaileddescription>" << endl;
01699   t << "  </compounddef>" << endl;
01700   t << "</doxygen>" << endl;
01701 
01702   ti << "  </compound>" << endl;
01703 }
01704 
01705 static void generateXMLForDir(DirDef *dd,QTextStream &ti)
01706 {
01707   if (dd->isReference()) return; // skip external references
01708   ti << "  <compound refid=\"" << dd->getOutputFileBase() 
01709      << "\" kind=\"dir\"><name>" << convertToXML(dd->displayName()) 
01710      << "</name>" << endl;
01711 
01712   QCString outputDirectory = Config_getString("XML_OUTPUT");
01713   QCString fileName=outputDirectory+"/"+dd->getOutputFileBase()+".xml";
01714   QFile f(fileName);
01715   if (!f.open(IO_WriteOnly))
01716   {
01717     err("Cannot open file %s for writing!\n",fileName.data());
01718     return;
01719   }
01720 
01721   QTextStream t(&f);
01722   t.setEncoding(QTextStream::UnicodeUTF8);
01723   writeXMLHeader(t);
01724   t << "  <compounddef id=\"" 
01725     << dd->getOutputFileBase() << "\" kind=\"dir\">" << endl;
01726   t << "    <compoundname>" << convertToXML(dd->displayName()) << "</compoundname>" << endl;
01727 
01728   writeInnerDirs(&dd->subDirs(),t);
01729   writeInnerFiles(dd->getFiles(),t);
01730 
01731   t << "    <briefdescription>" << endl;
01732   writeXMLDocBlock(t,dd->briefFile(),dd->briefLine(),dd,0,dd->briefDescription());
01733   t << "    </briefdescription>" << endl;
01734   t << "    <detaileddescription>" << endl;
01735   writeXMLDocBlock(t,dd->docFile(),dd->docLine(),dd,0,dd->documentation());
01736   t << "    </detaileddescription>" << endl;
01737   t << "    <location file=\"" << dd->name() << "\"/>" << endl; 
01738   t << "  </compounddef>" << endl;
01739   t << "</doxygen>" << endl;
01740 
01741   ti << "  </compound>" << endl;
01742 }
01743 
01744 static void generateXMLForPage(PageDef *pd,QTextStream &ti,bool isExample)
01745 {
01746   // + name
01747   // + title
01748   // + documentation
01749 
01750   const char *kindName = isExample ? "example" : "page";
01751 
01752   if (pd->isReference()) return;
01753   
01754   QCString pageName = pd->getOutputFileBase();
01755   if (pd->getGroupDef())
01756   {
01757     pageName+=(QCString)"_"+pd->name();
01758   }
01759   if (pageName=="index") pageName="indexpage"; // to prevent overwriting the generated index page.
01760   
01761   ti << "  <compound refid=\"" << pageName
01762      << "\" kind=\"" << kindName << "\"><name>" << convertToXML(pd->name()) 
01763      << "</name>" << endl;
01764   
01765   QCString outputDirectory = Config_getString("XML_OUTPUT");
01766   QCString fileName=outputDirectory+"/"+pageName+".xml";
01767   QFile f(fileName);
01768   if (!f.open(IO_WriteOnly))
01769   {
01770     err("Cannot open file %s for writing!\n",fileName.data());
01771     return;
01772   }
01773 
01774   QTextStream t(&f);
01775   t.setEncoding(QTextStream::UnicodeUTF8);
01776   writeXMLHeader(t);
01777   t << "  <compounddef id=\"" << pageName;
01778   t << "\" kind=\"" << kindName << "\">" << endl;
01779   t << "    <compoundname>" << convertToXML(pd->name()) 
01780     << "</compoundname>" << endl;
01781 
01782   SectionInfo *si = Doxygen::sectionDict.find(pd->name());
01783   if (si)
01784   {
01785     t << "    <title>" << convertToXML(si->title) << "</title>" << endl;
01786   }
01787   t << "    <detaileddescription>" << endl;
01788   if (isExample)
01789   {
01790     writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,0,
01791         pd->documentation()+"\n\\include "+pd->name());
01792   }
01793   else
01794   {
01795     writeXMLDocBlock(t,pd->docFile(),pd->docLine(),pd,0,
01796         pd->documentation());
01797   }
01798   t << "    </detaileddescription>" << endl;
01799 
01800   t << "  </compounddef>" << endl;
01801   t << "</doxygen>" << endl;
01802 
01803   ti << "  </compound>" << endl;
01804 }
01805 
01806 void generateXML()
01807 {
01808 
01809   // + classes
01810   // + namespaces
01811   // + files
01812   // + groups
01813   // + related pages
01814   // - examples
01815   
01816   QCString outputDirectory = Config_getString("XML_OUTPUT");
01817   if (outputDirectory.isEmpty())
01818   {
01819     outputDirectory=QDir::currentDirPath();
01820   }
01821   else
01822   {
01823     QDir dir(outputDirectory);
01824     if (!dir.exists())
01825     {
01826       dir.setPath(QDir::currentDirPath());
01827       if (!dir.mkdir(outputDirectory))
01828       {
01829         err("Error: tag XML_OUTPUT: Output directory `%s' does not "
01830             "exist and cannot be created\n",outputDirectory.data());
01831         exit(1);
01832       }
01833       else if (!Config_getBool("QUIET"))
01834       {
01835         err("Notice: Output directory `%s' does not exist. "
01836             "I have created it for you.\n", outputDirectory.data());
01837       }
01838       dir.cd(outputDirectory);
01839     }
01840     outputDirectory=dir.absPath();
01841   }
01842 
01843   QDir dir(outputDirectory);
01844   if (!dir.exists())
01845   {
01846     dir.setPath(QDir::currentDirPath());
01847     if (!dir.mkdir(outputDirectory))
01848     {
01849       err("Cannot create directory %s\n",outputDirectory.data());
01850       return;
01851     }
01852   }
01853   QDir xmlDir(outputDirectory);
01854   createSubDirs(xmlDir);
01855   QCString fileName=outputDirectory+"/index.xsd";
01856   QFile f(fileName);
01857   if (!f.open(IO_WriteOnly))
01858   {
01859     err("Cannot open file %s for writing!\n",fileName.data());
01860     return;
01861   }
01862   f.writeBlock(index_xsd,strlen(index_xsd));
01863   f.close();
01864 
01865   fileName=outputDirectory+"/compound.xsd";
01866   f.setName(fileName);
01867   if (!f.open(IO_WriteOnly))
01868   {
01869     err("Cannot open file %s for writing!\n",fileName.data());
01870     return;
01871   }
01872   f.writeBlock(compound_xsd,strlen(compound_xsd));
01873   f.close();
01874 
01875   fileName=outputDirectory+"/index.xml";
01876   f.setName(fileName);
01877   if (!f.open(IO_WriteOnly))
01878   {
01879     err("Cannot open file %s for writing!\n",fileName.data());
01880     return;
01881   }
01882   QTextStream t(&f);
01883   t.setEncoding(QTextStream::UnicodeUTF8);
01884 
01885   // write index header
01886   t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << endl;;
01887   t << "<doxygenindex xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
01888   t << "xsi:noNamespaceSchemaLocation=\"index.xsd\" ";
01889   t << "version=\"" << versionString << "\">" << endl;
01890 
01891   {
01892     ClassSDict::Iterator cli(*Doxygen::classSDict);
01893     ClassDef *cd;
01894     for (cli.toFirst();(cd=cli.current());++cli)
01895     {
01896       generateXMLForClass(cd,t);
01897     }
01898   }
01899   //{
01900   //  ClassSDict::Iterator cli(Doxygen::hiddenClasses);
01901   //  ClassDef *cd;
01902   //  for (cli.toFirst();(cd=cli.current());++cli)
01903   //  {
01904   //    msg("Generating XML output for class %s\n",cd->name().data());
01905   //    generateXMLForClass(cd,t);
01906   //  }
01907   //}
01908   NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict);
01909   NamespaceDef *nd;
01910   for (nli.toFirst();(nd=nli.current());++nli)
01911   {
01912     msg("Generating XML output for namespace %s\n",nd->name().data());
01913     generateXMLForNamespace(nd,t);
01914   }
01915   FileNameListIterator fnli(*Doxygen::inputNameList);
01916   FileName *fn;
01917   for (;(fn=fnli.current());++fnli)
01918   {
01919     FileNameIterator fni(*fn);
01920     FileDef *fd;
01921     for (;(fd=fni.current());++fni)
01922     {
01923       msg("Generating XML output for file %s\n",fd->name().data());
01924       generateXMLForFile(fd,t);
01925     }
01926   }
01927   GroupSDict::Iterator gli(*Doxygen::groupSDict);
01928   GroupDef *gd;
01929   for (;(gd=gli.current());++gli)
01930   {
01931     msg("Generating XML output for group %s\n",gd->name().data());
01932     generateXMLForGroup(gd,t);
01933   }
01934   {
01935     PageSDict::Iterator pdi(*Doxygen::pageSDict);
01936     PageDef *pd=0;
01937     for (pdi.toFirst();(pd=pdi.current());++pdi)
01938     {
01939       msg("Generating XML output for page %s\n",pd->name().data());
01940       generateXMLForPage(pd,t,FALSE);
01941     }
01942   }
01943   {
01944     DirDef *dir;
01945     DirSDict::Iterator sdi(*Doxygen::directories);
01946     for (sdi.toFirst();(dir=sdi.current());++sdi)
01947     {
01948       msg("Generate XML output for dir %s\n",dir->name().data());
01949       generateXMLForDir(dir,t);
01950     }
01951   }
01952   {
01953     PageSDict::Iterator pdi(*Doxygen::exampleSDict);
01954     PageDef *pd=0;
01955     for (pdi.toFirst();(pd=pdi.current());++pdi)
01956     {
01957       msg("Generating XML output for example %s\n",pd->name().data());
01958       generateXMLForPage(pd,t,TRUE);
01959     }
01960   }
01961   if (Doxygen::mainPage)
01962   {
01963     msg("Generating XML output for the main page\n");
01964     generateXMLForPage(Doxygen::mainPage,t,FALSE);
01965   }
01966 
01967   //t << "  </compoundlist>" << endl;
01968   t << "</doxygenindex>" << endl;
01969 
01970   writeCombineScript();
01971 }
01972 
01973 



Generated on Mon Mar 31 10:58:50 2008 by  doxygen 1.5.1