Blame src/tagreader.cpp

Packit Service 50c9f2
/******************************************************************************
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * 
Packit Service 50c9f2
 *
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * Copyright (C) 1997-2015 by Dimitri van Heesch.
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * Permission to use, copy, modify, and distribute this software and its
Packit Service 50c9f2
 * documentation under the terms of the GNU General Public License is hereby 
Packit Service 50c9f2
 * granted. No representations are made about the suitability of this software 
Packit Service 50c9f2
 * for any purpose. It is provided "as is" without express or implied warranty.
Packit Service 50c9f2
 * See the GNU General Public License for more details.
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * Documents produced by Doxygen are derivative works derived from the
Packit Service 50c9f2
 * input used in their production; they are not affected by this license.
Packit Service 50c9f2
 *
Packit Service 50c9f2
 */
Packit Service 50c9f2
Packit Service 50c9f2
#include "tagreader.h"
Packit Service 50c9f2
Packit Service 50c9f2
#include <stdio.h>
Packit Service 50c9f2
#include <stdarg.h>
Packit Service 50c9f2
Packit Service 50c9f2
#include <qxml.h>
Packit Service 50c9f2
#include <qstack.h>
Packit Service 50c9f2
#include <qdict.h>
Packit Service 50c9f2
#include <qfileinfo.h>
Packit Service 50c9f2
#include <qlist.h>
Packit Service 50c9f2
#include <qstring.h>
Packit Service 50c9f2
#include <qstringlist.h>
Packit Service 50c9f2
Packit Service 50c9f2
#include "entry.h"
Packit Service 50c9f2
#include "classdef.h"
Packit Service 50c9f2
#include "doxygen.h"
Packit Service 50c9f2
#include "util.h"
Packit Service 50c9f2
#include "message.h"
Packit Service 50c9f2
#include "defargs.h"
Packit Service 50c9f2
#include "arguments.h"
Packit Service 50c9f2
#include "filedef.h"
Packit Service 50c9f2
#include "filename.h"
Packit Service 50c9f2
#include "section.h"
Packit Service 50c9f2
Packit Service 50c9f2
/** Information about an linkable anchor */
Packit Service 50c9f2
class TagAnchorInfo
Packit Service 50c9f2
{
Packit Service 50c9f2
  public:
Packit Service 50c9f2
    TagAnchorInfo(const QCString &f,
Packit Service 50c9f2
                  const QCString &l,
Packit Service 50c9f2
                  const QCString &t=QCString()) 
Packit Service 50c9f2
      : label(l), fileName(f), title(t) {}
Packit Service 50c9f2
    QCString label;
Packit Service 50c9f2
    QCString fileName;
Packit Service 50c9f2
    QCString title;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
/** List of TagAnchorInfo objects. */
Packit Service 50c9f2
class TagAnchorInfoList : public QList<TagAnchorInfo>
Packit Service 50c9f2
{
Packit Service 50c9f2
  public: 
Packit Service 50c9f2
    TagAnchorInfoList() : QList<TagAnchorInfo>() { setAutoDelete(TRUE); }
Packit Service 50c9f2
    virtual ~TagAnchorInfoList() {}
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
/** Container for enum values that are scoped within an enum */
Packit Service 50c9f2
class TagEnumValueInfo
Packit Service 50c9f2
{
Packit Service 50c9f2
  public:
Packit Service 50c9f2
    QCString name;
Packit Service 50c9f2
    QCString file;
Packit Service 50c9f2
    QCString anchor;
Packit Service 50c9f2
    QCString clangid;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
/** Container for member specific info that can be read from a tagfile */
Packit Service 50c9f2
class TagMemberInfo
Packit Service 50c9f2
{
Packit Service 50c9f2
  public:
Packit Service 50c9f2
    TagMemberInfo() : prot(Public), virt(Normal), isStatic(FALSE) 
Packit Service 50c9f2
    { enumValues.setAutoDelete(TRUE); }
Packit Service 50c9f2
    QCString type;
Packit Service 50c9f2
    QCString name;
Packit Service 50c9f2
    QCString anchorFile;
Packit Service 50c9f2
    QCString anchor;
Packit Service 50c9f2
    QCString arglist;
Packit Service 50c9f2
    QCString kind;
Packit Service 50c9f2
    QCString clangId;
Packit Service 50c9f2
    TagAnchorInfoList docAnchors;
Packit Service 50c9f2
    Protection prot;
Packit Service 50c9f2
    Specifier virt;
Packit Service 50c9f2
    bool isStatic; 
Packit Service 50c9f2
    QList<TagEnumValueInfo> enumValues;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
/** Container for class specific info that can be read from a tagfile */
Packit Service 50c9f2
class TagClassInfo
Packit Service 50c9f2
{
Packit Service 50c9f2
  public:
Packit Service 50c9f2
    enum Kind { Class, Struct, Union, Interface, Exception, Protocol, Category, Enum, Service, Singleton };
Packit Service 50c9f2
    TagClassInfo() { bases=0, templateArguments=0; members.setAutoDelete(TRUE); isObjC=FALSE; }
Packit Service 50c9f2
   ~TagClassInfo() { delete bases; delete templateArguments; }
Packit Service 50c9f2
    QCString name;
Packit Service 50c9f2
    QCString filename;
Packit Service 50c9f2
    QCString clangId;
Packit Service 50c9f2
    TagAnchorInfoList docAnchors;
Packit Service 50c9f2
    QList<BaseInfo> *bases;
Packit Service 50c9f2
    QList<TagMemberInfo> members;
Packit Service 50c9f2
    QList<QCString> *templateArguments;
Packit Service 50c9f2
    QStringList classList;
Packit Service 50c9f2
    Kind kind;
Packit Service 50c9f2
    bool isObjC;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
/** Container for namespace specific info that can be read from a tagfile */
Packit Service 50c9f2
class TagNamespaceInfo
Packit Service 50c9f2
{
Packit Service 50c9f2
  public:
Packit Service 50c9f2
    TagNamespaceInfo() { members.setAutoDelete(TRUE); }
Packit Service 50c9f2
    QCString name;
Packit Service 50c9f2
    QCString filename;
Packit Service 50c9f2
    QCString clangId;
Packit Service 50c9f2
    QStringList classList;
Packit Service 50c9f2
    QStringList namespaceList;
Packit Service 50c9f2
    TagAnchorInfoList docAnchors;
Packit Service 50c9f2
    QList<TagMemberInfo> members;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
/** Container for package specific info that can be read from a tagfile */
Packit Service 50c9f2
class TagPackageInfo
Packit Service 50c9f2
{
Packit Service 50c9f2
  public:
Packit Service 50c9f2
    TagPackageInfo() { members.setAutoDelete(TRUE); }
Packit Service 50c9f2
    QCString name;
Packit Service 50c9f2
    QCString filename;
Packit Service 50c9f2
    TagAnchorInfoList docAnchors;
Packit Service 50c9f2
    QList<TagMemberInfo> members;
Packit Service 50c9f2
    QStringList classList;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
/** Container for include info that can be read from a tagfile */
Packit Service 50c9f2
class TagIncludeInfo
Packit Service 50c9f2
{
Packit Service 50c9f2
  public:
Packit Service 50c9f2
    QCString id;
Packit Service 50c9f2
    QCString name;
Packit Service 50c9f2
    QCString text;
Packit Service 50c9f2
    bool isLocal;
Packit Service 50c9f2
    bool isImported;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
/** Container for file specific info that can be read from a tagfile */
Packit Service 50c9f2
class TagFileInfo
Packit Service 50c9f2
{
Packit Service 50c9f2
  public:
Packit Service 50c9f2
    TagFileInfo() { members.setAutoDelete(TRUE); includes.setAutoDelete(TRUE); }
Packit Service 50c9f2
    QCString name;
Packit Service 50c9f2
    QCString path;
Packit Service 50c9f2
    QCString filename;
Packit Service 50c9f2
    TagAnchorInfoList docAnchors;
Packit Service 50c9f2
    QList<TagMemberInfo> members;
Packit Service 50c9f2
    QStringList classList;
Packit Service 50c9f2
    QStringList namespaceList;
Packit Service 50c9f2
    QList<TagIncludeInfo> includes;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
/** Container for group specific info that can be read from a tagfile */
Packit Service 50c9f2
class TagGroupInfo
Packit Service 50c9f2
{
Packit Service 50c9f2
  public:
Packit Service 50c9f2
    TagGroupInfo() { members.setAutoDelete(TRUE); }
Packit Service 50c9f2
    QCString name;
Packit Service 50c9f2
    QCString title;
Packit Service 50c9f2
    QCString filename;
Packit Service 50c9f2
    TagAnchorInfoList docAnchors;
Packit Service 50c9f2
    QList<TagMemberInfo> members;
Packit Service 50c9f2
    QStringList subgroupList;
Packit Service 50c9f2
    QStringList classList;
Packit Service 50c9f2
    QStringList namespaceList;
Packit Service 50c9f2
    QStringList fileList;
Packit Service 50c9f2
    QStringList pageList;
Packit Service 50c9f2
    QStringList dirList;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
/** Container for page specific info that can be read from a tagfile */
Packit Service 50c9f2
class TagPageInfo
Packit Service 50c9f2
{
Packit Service 50c9f2
  public:
Packit Service 50c9f2
    QCString name;
Packit Service 50c9f2
    QCString title;
Packit Service 50c9f2
    QCString filename;
Packit Service 50c9f2
    TagAnchorInfoList docAnchors;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
/** Container for directory specific info that can be read from a tagfile */
Packit Service 50c9f2
class TagDirInfo
Packit Service 50c9f2
{
Packit Service 50c9f2
  public:
Packit Service 50c9f2
    QCString name;
Packit Service 50c9f2
    QCString filename;
Packit Service 50c9f2
    QCString path;
Packit Service 50c9f2
    QStringList subdirList;
Packit Service 50c9f2
    QStringList fileList;
Packit Service 50c9f2
    TagAnchorInfoList docAnchors;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
/** Tag file parser. 
Packit Service 50c9f2
 *
Packit Service 50c9f2
 *  Reads an XML-structured tagfile and builds up the structure in
Packit Service 50c9f2
 *  memory. The method buildLists() is used to transfer/translate 
Packit Service 50c9f2
 *  the structures to the doxygen engine.
Packit Service 50c9f2
 */
Packit Service 50c9f2
class TagFileParser : public QXmlDefaultHandler
Packit Service 50c9f2
{
Packit Service 50c9f2
    enum State { Invalid,
Packit Service 50c9f2
                 InClass,
Packit Service 50c9f2
                 InFile,
Packit Service 50c9f2
                 InNamespace,
Packit Service 50c9f2
                 InGroup,
Packit Service 50c9f2
                 InPage,
Packit Service 50c9f2
                 InMember,
Packit Service 50c9f2
                 InEnumValue,
Packit Service 50c9f2
                 InPackage,
Packit Service 50c9f2
                 InDir,
Packit Service 50c9f2
                 InTempArgList
Packit Service 50c9f2
               };
Packit Service 50c9f2
    class StartElementHandler
Packit Service 50c9f2
    {
Packit Service 50c9f2
        typedef void (TagFileParser::*Handler)(const QXmlAttributes &attrib); 
Packit Service 50c9f2
      public:
Packit Service 50c9f2
        StartElementHandler(TagFileParser *parent, Handler h) : m_parent(parent), m_handler(h) {}
Packit Service 50c9f2
        void operator()(const QXmlAttributes &attrib) { (m_parent->*m_handler)(attrib); }
Packit Service 50c9f2
      private:
Packit Service 50c9f2
        TagFileParser *m_parent;
Packit Service 50c9f2
        Handler m_handler;
Packit Service 50c9f2
    };
Packit Service 50c9f2
Packit Service 50c9f2
    class EndElementHandler
Packit Service 50c9f2
    {
Packit Service 50c9f2
        typedef void (TagFileParser::*Handler)(); 
Packit Service 50c9f2
      public:
Packit Service 50c9f2
        EndElementHandler(TagFileParser *parent, Handler h) : m_parent(parent), m_handler(h) {}
Packit Service 50c9f2
        void operator()() { (m_parent->*m_handler)(); }
Packit Service 50c9f2
      private:
Packit Service 50c9f2
        TagFileParser *m_parent;
Packit Service 50c9f2
        Handler m_handler;
Packit Service 50c9f2
    };
Packit Service 50c9f2
Packit Service 50c9f2
  public:
Packit Service 50c9f2
    TagFileParser(const char *tagName) : m_startElementHandlers(17),
Packit Service 50c9f2
                                         m_endElementHandlers(17),
Packit Service 50c9f2
                                         m_tagName(tagName)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      m_startElementHandlers.setAutoDelete(TRUE);
Packit Service 50c9f2
      m_endElementHandlers.setAutoDelete(TRUE);
Packit Service 50c9f2
      m_curClass=0;
Packit Service 50c9f2
      m_curFile=0;
Packit Service 50c9f2
      m_curNamespace=0;
Packit Service 50c9f2
      m_curPackage=0;
Packit Service 50c9f2
      m_curGroup=0;
Packit Service 50c9f2
      m_curPage=0;
Packit Service 50c9f2
      m_curDir=0;
Packit Service 50c9f2
      m_curMember=0;
Packit Service 50c9f2
      m_curEnumValue=0;
Packit Service 50c9f2
      m_curIncludes=0;
Packit Service 50c9f2
      m_state = Invalid;
Packit Service 50c9f2
      m_locator = 0;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void setDocumentLocator ( QXmlLocator * locator )
Packit Service 50c9f2
    {
Packit Service 50c9f2
      m_locator = locator;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void setFileName( const QString &fileName )
Packit Service 50c9f2
    {
Packit Service 50c9f2
      m_inputFileName = fileName.utf8();
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void warn(const char *fmt)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      ::warn(m_inputFileName,m_locator->lineNumber(),fmt);
Packit Service 50c9f2
    }
Packit Service 50c9f2
    void warn(const char *fmt,const char *s)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      ::warn(m_inputFileName,m_locator->lineNumber(),fmt,s);
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void startCompound( const QXmlAttributes& attrib )
Packit Service 50c9f2
    {
Packit Service 50c9f2
      m_curString = "";
Packit Service 50c9f2
      QString kind = attrib.value("kind");
Packit Service 50c9f2
      QString isObjC = attrib.value("objc");
Packit Service 50c9f2
      if (kind=="class")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curClass = new TagClassInfo;
Packit Service 50c9f2
        m_curClass->kind = TagClassInfo::Class;
Packit Service 50c9f2
        m_state = InClass;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else if (kind=="struct")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curClass = new TagClassInfo;
Packit Service 50c9f2
        m_curClass->kind = TagClassInfo::Struct;
Packit Service 50c9f2
        m_state = InClass;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else if (kind=="union")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curClass = new TagClassInfo;
Packit Service 50c9f2
        m_curClass->kind = TagClassInfo::Union;
Packit Service 50c9f2
        m_state = InClass;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else if (kind=="interface")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curClass = new TagClassInfo;
Packit Service 50c9f2
        m_curClass->kind = TagClassInfo::Interface;
Packit Service 50c9f2
        m_state = InClass;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else if (kind=="enum")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curClass = new TagClassInfo;
Packit Service 50c9f2
        m_curClass->kind = TagClassInfo::Enum;
Packit Service 50c9f2
        m_state = InClass;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else if (kind=="exception")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curClass = new TagClassInfo;
Packit Service 50c9f2
        m_curClass->kind = TagClassInfo::Exception;
Packit Service 50c9f2
        m_state = InClass;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else if (kind=="protocol")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curClass = new TagClassInfo;
Packit Service 50c9f2
        m_curClass->kind = TagClassInfo::Protocol;
Packit Service 50c9f2
        m_state = InClass;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else if (kind=="category")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curClass = new TagClassInfo;
Packit Service 50c9f2
        m_curClass->kind = TagClassInfo::Category;
Packit Service 50c9f2
        m_state = InClass;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else if (kind=="service")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curClass = new TagClassInfo;
Packit Service 50c9f2
        m_curClass->kind = TagClassInfo::Service;
Packit Service 50c9f2
        m_state = InClass;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else if (kind=="singleton")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curClass = new TagClassInfo;
Packit Service 50c9f2
        m_curClass->kind = TagClassInfo::Singleton;
Packit Service 50c9f2
        m_state = InClass;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else if (kind=="file")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curFile = new TagFileInfo;
Packit Service 50c9f2
        m_state = InFile;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else if (kind=="namespace")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curNamespace = new TagNamespaceInfo;
Packit Service 50c9f2
        m_state = InNamespace;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else if (kind=="group")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curGroup = new TagGroupInfo;
Packit Service 50c9f2
        m_state = InGroup;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else if (kind=="page")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curPage = new TagPageInfo;
Packit Service 50c9f2
        m_state = InPage;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else if (kind=="package")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curPackage = new TagPackageInfo;
Packit Service 50c9f2
        m_state = InPackage;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else if (kind=="dir")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curDir = new TagDirInfo;
Packit Service 50c9f2
        m_state = InDir;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else
Packit Service 50c9f2
      {
Packit Service 50c9f2
        warn("Unknown compound attribute `%s' found!\n",kind.data());
Packit Service 50c9f2
        m_state = Invalid;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      if (isObjC=="yes" && m_curClass)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curClass->isObjC = TRUE; 
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void endCompound()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      switch (m_state)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        case InClass:     m_tagFileClasses.append(m_curClass); 
Packit Service 50c9f2
                          m_curClass=0; break; 
Packit Service 50c9f2
        case InFile:      m_tagFileFiles.append(m_curFile); 
Packit Service 50c9f2
                          m_curFile=0; break; 
Packit Service 50c9f2
        case InNamespace: m_tagFileNamespaces.append(m_curNamespace); 
Packit Service 50c9f2
                          m_curNamespace=0; break; 
Packit Service 50c9f2
        case InGroup:     m_tagFileGroups.append(m_curGroup); 
Packit Service 50c9f2
                          m_curGroup=0; break; 
Packit Service 50c9f2
        case InPage:      m_tagFilePages.append(m_curPage); 
Packit Service 50c9f2
                          m_curPage=0; break; 
Packit Service 50c9f2
        case InDir:       m_tagFileDirs.append(m_curDir);
Packit Service 50c9f2
                          m_curDir=0; break;
Packit Service 50c9f2
        case InPackage:   m_tagFilePackages.append(m_curPackage); 
Packit Service 50c9f2
                          m_curPackage=0; break; 
Packit Service 50c9f2
        default:
Packit Service 50c9f2
                          warn("tag `compound' was not expected!\n");
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void startMember( const QXmlAttributes& attrib)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      m_curMember = new TagMemberInfo;
Packit Service 50c9f2
      m_curMember->kind = attrib.value("kind").utf8();
Packit Service 50c9f2
      QCString protStr   = attrib.value("protection").utf8();
Packit Service 50c9f2
      QCString virtStr   = attrib.value("virtualness").utf8();
Packit Service 50c9f2
      QCString staticStr = attrib.value("static").utf8();
Packit Service 50c9f2
      if (protStr=="protected")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curMember->prot = Protected;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else if (protStr=="private")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curMember->prot = Private;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      if (virtStr=="virtual")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curMember->virt = Virtual;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else if (virtStr=="pure")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curMember->virt = Pure;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      if (staticStr=="yes")
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curMember->isStatic = TRUE;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      m_stateStack.push(new State(m_state));
Packit Service 50c9f2
      m_state = InMember;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void endMember()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      m_state = *m_stateStack.top();
Packit Service 50c9f2
      m_stateStack.remove();
Packit Service 50c9f2
      switch(m_state)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        case InClass:     m_curClass->members.append(m_curMember); break;
Packit Service 50c9f2
        case InFile:      m_curFile->members.append(m_curMember); break;
Packit Service 50c9f2
        case InNamespace: m_curNamespace->members.append(m_curMember); break;
Packit Service 50c9f2
        case InGroup:     m_curGroup->members.append(m_curMember); break;
Packit Service 50c9f2
        case InPackage:   m_curPackage->members.append(m_curMember); break;
Packit Service 50c9f2
        default:   warn("Unexpected tag `member' found\n"); break; 
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void startEnumValue( const QXmlAttributes& attrib)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      if (m_state==InMember)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curString = "";
Packit Service 50c9f2
        m_curEnumValue = new TagEnumValueInfo;
Packit Service 50c9f2
        m_curEnumValue->file = attrib.value("file").utf8();
Packit Service 50c9f2
        m_curEnumValue->anchor = attrib.value("anchor").utf8();
Packit Service 50c9f2
        m_curEnumValue->clangid = attrib.value("clangid").utf8();
Packit Service 50c9f2
        m_stateStack.push(new State(m_state));
Packit Service 50c9f2
        m_state = InEnumValue;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else
Packit Service 50c9f2
      {
Packit Service 50c9f2
        warn("Found enumvalue tag outside of member tag\n");
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void endEnumValue()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      m_curEnumValue->name = m_curString.stripWhiteSpace(); 
Packit Service 50c9f2
      m_state = *m_stateStack.top();
Packit Service 50c9f2
      m_stateStack.remove();
Packit Service 50c9f2
      if (m_state==InMember)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curMember->enumValues.append(m_curEnumValue);
Packit Service 50c9f2
        m_curEnumValue=0;
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void endDocAnchor()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      switch(m_state)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        case InClass:     m_curClass->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString,m_title)); break;
Packit Service 50c9f2
        case InFile:      m_curFile->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString,m_title)); break;
Packit Service 50c9f2
        case InNamespace: m_curNamespace->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString,m_title)); break;
Packit Service 50c9f2
        case InGroup:     m_curGroup->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString,m_title)); break;
Packit Service 50c9f2
        case InPage:      m_curPage->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString,m_title)); break;
Packit Service 50c9f2
        case InMember:    m_curMember->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString,m_title)); break;
Packit Service 50c9f2
        case InPackage:   m_curPackage->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString,m_title)); break;
Packit Service 50c9f2
        case InDir:       m_curDir->docAnchors.append(new TagAnchorInfo(m_fileName,m_curString,m_title)); break;
Packit Service 50c9f2
        default:   warn("Unexpected tag `member' found\n"); break; 
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void endClass()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      switch(m_state)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        case InClass:     m_curClass->classList.append(m_curString); break;
Packit Service 50c9f2
        case InFile:      m_curFile->classList.append(m_curString); break;
Packit Service 50c9f2
        case InNamespace: m_curNamespace->classList.append(m_curString); break;
Packit Service 50c9f2
        case InGroup:     m_curGroup->classList.append(m_curString); break;
Packit Service 50c9f2
        case InPackage:   m_curPackage->classList.append(m_curString); break;
Packit Service 50c9f2
        default:   warn("Unexpected tag `class' found\n"); break; 
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void endNamespace()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      switch(m_state)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        case InNamespace: m_curNamespace->classList.append(m_curString); break;
Packit Service 50c9f2
        case InFile:      m_curFile->namespaceList.append(m_curString); break;
Packit Service 50c9f2
        case InGroup:     m_curGroup->namespaceList.append(m_curString); break;
Packit Service 50c9f2
        default:   warn("Unexpected tag `namespace' found\n"); break; 
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void endFile()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      switch(m_state)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        case InGroup:      m_curGroup->fileList.append(m_curString); break;
Packit Service 50c9f2
        case InDir:        m_curDir->fileList.append(m_curString); break;
Packit Service 50c9f2
        default:   warn("Unexpected tag `file' found\n"); break; 
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void endPage()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      switch(m_state)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        case InGroup:      m_curGroup->fileList.append(m_curString); break;
Packit Service 50c9f2
        default:   warn("Unexpected tag `page' found\n"); break; 
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void endDir()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      switch(m_state)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        case InDir:      m_curDir->subdirList.append(m_curString); break;
Packit Service 50c9f2
        default:   warn("Unexpected tag `page' found\n"); break; 
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void startStringValue(const QXmlAttributes& )
Packit Service 50c9f2
    {
Packit Service 50c9f2
      m_curString = "";
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void startDocAnchor(const QXmlAttributes& attrib )
Packit Service 50c9f2
    {
Packit Service 50c9f2
      m_fileName = attrib.value("file").utf8();
Packit Service 50c9f2
      m_title = attrib.value("title").utf8();
Packit Service 50c9f2
      m_curString = "";
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void endType()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      if (m_state==InMember)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curMember->type = m_curString; 
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else
Packit Service 50c9f2
      {
Packit Service 50c9f2
        warn("Unexpected tag `type' found\n");
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void endName()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      switch (m_state)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        case InClass:     m_curClass->name     = m_curString; break;
Packit Service 50c9f2
        case InFile:      m_curFile->name      = m_curString; break;
Packit Service 50c9f2
        case InNamespace: m_curNamespace->name = m_curString; break;
Packit Service 50c9f2
        case InGroup:     m_curGroup->name     = m_curString; break;
Packit Service 50c9f2
        case InPage:      m_curPage->name      = m_curString; break;
Packit Service 50c9f2
        case InDir:       m_curDir->name       = m_curString; break;
Packit Service 50c9f2
        case InMember:    m_curMember->name    = m_curString; break;
Packit Service 50c9f2
        case InPackage:   m_curPackage->name   = m_curString; break;
Packit Service 50c9f2
        default: warn("Unexpected tag `name' found\n"); break; 
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void startBase(const QXmlAttributes& attrib )
Packit Service 50c9f2
    {
Packit Service 50c9f2
      m_curString="";
Packit Service 50c9f2
      if (m_state==InClass && m_curClass)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        QString protStr = attrib.value("protection");
Packit Service 50c9f2
        QString virtStr = attrib.value("virtualness");
Packit Service 50c9f2
        Protection prot = Public;
Packit Service 50c9f2
        Specifier  virt = Normal;
Packit Service 50c9f2
        if (protStr=="protected")
Packit Service 50c9f2
        {
Packit Service 50c9f2
          prot = Protected;
Packit Service 50c9f2
        }
Packit Service 50c9f2
        else if (protStr=="private")
Packit Service 50c9f2
        {
Packit Service 50c9f2
          prot = Private;
Packit Service 50c9f2
        }
Packit Service 50c9f2
        if (virtStr=="virtual")
Packit Service 50c9f2
        {
Packit Service 50c9f2
          virt = Virtual;
Packit Service 50c9f2
        }
Packit Service 50c9f2
        if (m_curClass->bases==0) 
Packit Service 50c9f2
        {
Packit Service 50c9f2
          m_curClass->bases = new QList<BaseInfo>;
Packit Service 50c9f2
          m_curClass->bases->setAutoDelete(TRUE);
Packit Service 50c9f2
        }
Packit Service 50c9f2
        m_curClass->bases->append(new BaseInfo(m_curString,prot,virt));
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else
Packit Service 50c9f2
      {
Packit Service 50c9f2
        warn("Unexpected tag `base' found\n");
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void endBase()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      if (m_state==InClass && m_curClass)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curClass->bases->getLast()->name = m_curString;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else
Packit Service 50c9f2
      {
Packit Service 50c9f2
        warn("Unexpected tag `base' found\n");
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void startIncludes(const QXmlAttributes& attrib )
Packit Service 50c9f2
    {
Packit Service 50c9f2
      if (m_state==InFile && m_curFile)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curIncludes = new TagIncludeInfo;
Packit Service 50c9f2
        m_curIncludes->id = attrib.value("id").utf8();
Packit Service 50c9f2
        m_curIncludes->name = attrib.value("name").utf8();
Packit Service 50c9f2
        m_curIncludes->isLocal = attrib.value("local").utf8()=="yes" ? TRUE : FALSE;
Packit Service 50c9f2
        m_curIncludes->isImported = attrib.value("imported").utf8()=="yes" ? TRUE : FALSE;
Packit Service 50c9f2
        m_curFile->includes.append(m_curIncludes);
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else
Packit Service 50c9f2
      {
Packit Service 50c9f2
        warn("Unexpected tag `includes' found\n");
Packit Service 50c9f2
      }
Packit Service 50c9f2
      m_curString="";
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void endIncludes()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      m_curIncludes->text = m_curString;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void endTemplateArg()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      if (m_state==InClass && m_curClass)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        if (m_curClass->templateArguments==0) 
Packit Service 50c9f2
        {
Packit Service 50c9f2
          m_curClass->templateArguments = new QList<QCString>;
Packit Service 50c9f2
          m_curClass->templateArguments->setAutoDelete(TRUE);
Packit Service 50c9f2
        }
Packit Service 50c9f2
        m_curClass->templateArguments->append(new QCString(m_curString));
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else
Packit Service 50c9f2
      {
Packit Service 50c9f2
        warn("Unexpected tag `templarg' found\n");
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void endFilename()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      switch (m_state)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        case InClass:     m_curClass->filename     = m_curString;    break;
Packit Service 50c9f2
        case InNamespace: m_curNamespace->filename = m_curString;    break;
Packit Service 50c9f2
        case InFile:      m_curFile->filename      = m_curString;    break;
Packit Service 50c9f2
        case InGroup:     m_curGroup->filename     = m_curString;    break;
Packit Service 50c9f2
        case InPage:      m_curPage->filename      = m_curString;    break;
Packit Service 50c9f2
        case InPackage:   m_curPackage->filename   = m_curString;    break;
Packit Service 50c9f2
        case InDir:       m_curDir->filename       = m_curString;    break;
Packit Service 50c9f2
        default: warn("Unexpected tag `filename' found\n"); break; 
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void endPath()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      switch (m_state)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        case InFile:      m_curFile->path          = m_curString;    break;
Packit Service 50c9f2
        case InDir:       m_curDir->path           = m_curString;    break;
Packit Service 50c9f2
        default: warn("Unexpected tag `path' found\n");     break; 
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
    
Packit Service 50c9f2
    void endAnchor()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      if (m_state==InMember)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curMember->anchor = m_curString; 
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else
Packit Service 50c9f2
      {
Packit Service 50c9f2
        warn("Unexpected tag `anchor' found\n");
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void endClangId()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      if (m_state==InMember)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curMember->clangId = m_curString; 
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else if (m_state==InClass)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curClass->clangId =  m_curString;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else if (m_state==InNamespace)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curNamespace->clangId = m_curString;
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else
Packit Service 50c9f2
      {
Packit Service 50c9f2
        warn("warning: Unexpected tag `anchor' found\n");
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
Packit Service 50c9f2
    
Packit Service 50c9f2
    void endAnchorFile()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      if (m_state==InMember)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curMember->anchorFile = m_curString; 
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else
Packit Service 50c9f2
      {
Packit Service 50c9f2
        warn("Unexpected tag `anchorfile' found\n");
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
    
Packit Service 50c9f2
    void endArglist()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      if (m_state==InMember)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curMember->arglist = m_curString; 
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else
Packit Service 50c9f2
      {
Packit Service 50c9f2
        warn("Unexpected tag `arglist' found\n");
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
    void endTitle()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      switch (m_state)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        case InGroup:     m_curGroup->title     = m_curString;    break;
Packit Service 50c9f2
        case InPage:      m_curPage->title      = m_curString;    break;
Packit Service 50c9f2
        default: warn("Unexpected tag `title' found\n"); break; 
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void endSubgroup()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      if (m_state==InGroup)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        m_curGroup->subgroupList.append(m_curString);
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else
Packit Service 50c9f2
      {
Packit Service 50c9f2
        warn("Unexpected tag `subgroup' found\n");
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void startIgnoreElement(const QXmlAttributes& )
Packit Service 50c9f2
    {
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void endIgnoreElement()
Packit Service 50c9f2
    {
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    bool startDocument()
Packit Service 50c9f2
    {
Packit Service 50c9f2
      m_state = Invalid;
Packit Service 50c9f2
Packit Service 50c9f2
      m_curClass=0;
Packit Service 50c9f2
      m_curNamespace=0;
Packit Service 50c9f2
      m_curFile=0;
Packit Service 50c9f2
      m_curGroup=0;
Packit Service 50c9f2
      m_curPage=0;
Packit Service 50c9f2
      m_curPackage=0;
Packit Service 50c9f2
      m_curDir=0;
Packit Service 50c9f2
Packit Service 50c9f2
      m_stateStack.setAutoDelete(TRUE);
Packit Service 50c9f2
      m_tagFileClasses.setAutoDelete(TRUE);
Packit Service 50c9f2
      m_tagFileFiles.setAutoDelete(TRUE);
Packit Service 50c9f2
      m_tagFileNamespaces.setAutoDelete(TRUE);
Packit Service 50c9f2
      m_tagFileGroups.setAutoDelete(TRUE);
Packit Service 50c9f2
      m_tagFilePages.setAutoDelete(TRUE);
Packit Service 50c9f2
      m_tagFilePackages.setAutoDelete(TRUE);
Packit Service 50c9f2
      m_tagFileDirs.setAutoDelete(TRUE);
Packit Service 50c9f2
Packit Service 50c9f2
      m_startElementHandlers.insert("compound",    new StartElementHandler(this,&TagFileParser::startCompound));
Packit Service 50c9f2
      m_startElementHandlers.insert("member",      new StartElementHandler(this,&TagFileParser::startMember));
Packit Service 50c9f2
      m_startElementHandlers.insert("enumvalue",   new StartElementHandler(this,&TagFileParser::startEnumValue));
Packit Service 50c9f2
      m_startElementHandlers.insert("name",        new StartElementHandler(this,&TagFileParser::startStringValue));
Packit Service 50c9f2
      m_startElementHandlers.insert("base",        new StartElementHandler(this,&TagFileParser::startBase));
Packit Service 50c9f2
      m_startElementHandlers.insert("filename",    new StartElementHandler(this,&TagFileParser::startStringValue));
Packit Service 50c9f2
      m_startElementHandlers.insert("includes",    new StartElementHandler(this,&TagFileParser::startIncludes));
Packit Service 50c9f2
      m_startElementHandlers.insert("path",        new StartElementHandler(this,&TagFileParser::startStringValue));
Packit Service 50c9f2
      m_startElementHandlers.insert("anchorfile",  new StartElementHandler(this,&TagFileParser::startStringValue));
Packit Service 50c9f2
      m_startElementHandlers.insert("anchor",      new StartElementHandler(this,&TagFileParser::startStringValue));
Packit Service 50c9f2
      m_startElementHandlers.insert("clangid",     new StartElementHandler(this,&TagFileParser::startStringValue));
Packit Service 50c9f2
      m_startElementHandlers.insert("arglist",     new StartElementHandler(this,&TagFileParser::startStringValue));
Packit Service 50c9f2
      m_startElementHandlers.insert("title",       new StartElementHandler(this,&TagFileParser::startStringValue));
Packit Service 50c9f2
      m_startElementHandlers.insert("subgroup",    new StartElementHandler(this,&TagFileParser::startStringValue));
Packit Service 50c9f2
      m_startElementHandlers.insert("class",       new StartElementHandler(this,&TagFileParser::startStringValue));
Packit Service 50c9f2
      m_startElementHandlers.insert("namespace",   new StartElementHandler(this,&TagFileParser::startStringValue));
Packit Service 50c9f2
      m_startElementHandlers.insert("file",        new StartElementHandler(this,&TagFileParser::startStringValue));
Packit Service 50c9f2
      m_startElementHandlers.insert("dir",         new StartElementHandler(this,&TagFileParser::startStringValue));
Packit Service 50c9f2
      m_startElementHandlers.insert("page",        new StartElementHandler(this,&TagFileParser::startStringValue));
Packit Service 50c9f2
      m_startElementHandlers.insert("docanchor",   new StartElementHandler(this,&TagFileParser::startDocAnchor));
Packit Service 50c9f2
      m_startElementHandlers.insert("tagfile",     new StartElementHandler(this,&TagFileParser::startIgnoreElement));
Packit Service 50c9f2
      m_startElementHandlers.insert("templarg",    new StartElementHandler(this,&TagFileParser::startStringValue));
Packit Service 50c9f2
      m_startElementHandlers.insert("type",        new StartElementHandler(this,&TagFileParser::startStringValue));
Packit Service 50c9f2
Packit Service 50c9f2
      m_endElementHandlers.insert("compound",    new EndElementHandler(this,&TagFileParser::endCompound));
Packit Service 50c9f2
      m_endElementHandlers.insert("member",      new EndElementHandler(this,&TagFileParser::endMember));
Packit Service 50c9f2
      m_endElementHandlers.insert("enumvalue",   new EndElementHandler(this,&TagFileParser::endEnumValue));
Packit Service 50c9f2
      m_endElementHandlers.insert("name",        new EndElementHandler(this,&TagFileParser::endName));
Packit Service 50c9f2
      m_endElementHandlers.insert("base",        new EndElementHandler(this,&TagFileParser::endBase));
Packit Service 50c9f2
      m_endElementHandlers.insert("filename",    new EndElementHandler(this,&TagFileParser::endFilename));
Packit Service 50c9f2
      m_endElementHandlers.insert("includes",    new EndElementHandler(this,&TagFileParser::endIncludes));
Packit Service 50c9f2
      m_endElementHandlers.insert("path",        new EndElementHandler(this,&TagFileParser::endPath));
Packit Service 50c9f2
      m_endElementHandlers.insert("anchorfile",  new EndElementHandler(this,&TagFileParser::endAnchorFile));
Packit Service 50c9f2
      m_endElementHandlers.insert("anchor",      new EndElementHandler(this,&TagFileParser::endAnchor));
Packit Service 50c9f2
      m_endElementHandlers.insert("clangid",     new EndElementHandler(this,&TagFileParser::endClangId));
Packit Service 50c9f2
      m_endElementHandlers.insert("arglist",     new EndElementHandler(this,&TagFileParser::endArglist));
Packit Service 50c9f2
      m_endElementHandlers.insert("title",       new EndElementHandler(this,&TagFileParser::endTitle));
Packit Service 50c9f2
      m_endElementHandlers.insert("subgroup",    new EndElementHandler(this,&TagFileParser::endSubgroup));
Packit Service 50c9f2
      m_endElementHandlers.insert("class"   ,    new EndElementHandler(this,&TagFileParser::endClass));
Packit Service 50c9f2
      m_endElementHandlers.insert("namespace",   new EndElementHandler(this,&TagFileParser::endNamespace));
Packit Service 50c9f2
      m_endElementHandlers.insert("file",        new EndElementHandler(this,&TagFileParser::endFile));
Packit Service 50c9f2
      m_endElementHandlers.insert("dir",         new EndElementHandler(this,&TagFileParser::endDir));
Packit Service 50c9f2
      m_endElementHandlers.insert("page",        new EndElementHandler(this,&TagFileParser::endPage));
Packit Service 50c9f2
      m_endElementHandlers.insert("docanchor",   new EndElementHandler(this,&TagFileParser::endDocAnchor));
Packit Service 50c9f2
      m_endElementHandlers.insert("tagfile",     new EndElementHandler(this,&TagFileParser::endIgnoreElement));
Packit Service 50c9f2
      m_endElementHandlers.insert("templarg",    new EndElementHandler(this,&TagFileParser::endTemplateArg));
Packit Service 50c9f2
      m_endElementHandlers.insert("type",        new EndElementHandler(this,&TagFileParser::endType));
Packit Service 50c9f2
Packit Service 50c9f2
      return TRUE;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    bool startElement( const QString&, const QString&, 
Packit Service 50c9f2
                       const QString&name, const QXmlAttributes& attrib )
Packit Service 50c9f2
    {
Packit Service 50c9f2
      //printf("startElement `%s'\n",name.data());
Packit Service 50c9f2
      StartElementHandler *handler = m_startElementHandlers[name.utf8()];
Packit Service 50c9f2
      if (handler)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        (*handler)(attrib);
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else 
Packit Service 50c9f2
      {
Packit Service 50c9f2
        warn("Unknown tag `%s' found!\n",name.data());
Packit Service 50c9f2
      }
Packit Service 50c9f2
      return TRUE;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    bool endElement( const QString&, const QString&, const QString& name )
Packit Service 50c9f2
    {
Packit Service 50c9f2
      //printf("endElement `%s'\n",name.data());
Packit Service 50c9f2
      EndElementHandler *handler = m_endElementHandlers[name.utf8()];
Packit Service 50c9f2
      if (handler)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        (*handler)();
Packit Service 50c9f2
      }
Packit Service 50c9f2
      else 
Packit Service 50c9f2
      {
Packit Service 50c9f2
        warn("Unknown tag `%s' found!\n",name.data());
Packit Service 50c9f2
      }
Packit Service 50c9f2
      return TRUE;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    bool characters ( const QString & ch ) 
Packit Service 50c9f2
    {
Packit Service 50c9f2
      m_curString+=ch.utf8();
Packit Service 50c9f2
      return TRUE;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void dump();
Packit Service 50c9f2
    void buildLists(Entry *root);
Packit Service 50c9f2
    void addIncludes();
Packit Service 50c9f2
    
Packit Service 50c9f2
  private:
Packit Service 50c9f2
    void buildMemberList(Entry *ce,QList<TagMemberInfo> &members);
Packit Service 50c9f2
    void addDocAnchors(Entry *e,const TagAnchorInfoList &l);
Packit Service 50c9f2
    QList<TagClassInfo>        m_tagFileClasses;
Packit Service 50c9f2
    QList<TagFileInfo>         m_tagFileFiles;
Packit Service 50c9f2
    QList<TagNamespaceInfo>    m_tagFileNamespaces;
Packit Service 50c9f2
    QList<TagGroupInfo>        m_tagFileGroups;
Packit Service 50c9f2
    QList<TagPageInfo>         m_tagFilePages;
Packit Service 50c9f2
    QList<TagPackageInfo>      m_tagFilePackages;
Packit Service 50c9f2
    QList<TagDirInfo>          m_tagFileDirs;
Packit Service 50c9f2
    QDict<StartElementHandler> m_startElementHandlers;
Packit Service 50c9f2
    QDict<EndElementHandler>   m_endElementHandlers;
Packit Service 50c9f2
    TagClassInfo              *m_curClass;
Packit Service 50c9f2
    TagFileInfo               *m_curFile;
Packit Service 50c9f2
    TagNamespaceInfo          *m_curNamespace;
Packit Service 50c9f2
    TagPackageInfo            *m_curPackage;
Packit Service 50c9f2
    TagGroupInfo              *m_curGroup;
Packit Service 50c9f2
    TagPageInfo               *m_curPage;
Packit Service 50c9f2
    TagDirInfo                *m_curDir;
Packit Service 50c9f2
    TagMemberInfo             *m_curMember;
Packit Service 50c9f2
    TagEnumValueInfo          *m_curEnumValue;
Packit Service 50c9f2
    TagIncludeInfo            *m_curIncludes;
Packit Service 50c9f2
    QCString                   m_curString;
Packit Service 50c9f2
    QCString                   m_tagName;
Packit Service 50c9f2
    QCString                   m_fileName;
Packit Service 50c9f2
    QCString                   m_title;
Packit Service 50c9f2
    State                      m_state;
Packit Service 50c9f2
    QStack<State>              m_stateStack;
Packit Service 50c9f2
    QXmlLocator               *m_locator;
Packit Service 50c9f2
    QCString                   m_inputFileName;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
/** Error handler for the XML tag file parser. 
Packit Service 50c9f2
 *
Packit Service 50c9f2
 *  Basically dumps all fatal error to stderr using err().
Packit Service 50c9f2
 */
Packit Service 50c9f2
class TagFileErrorHandler : public QXmlErrorHandler
Packit Service 50c9f2
{
Packit Service 50c9f2
  public:
Packit Service 50c9f2
    virtual ~TagFileErrorHandler() {}
Packit Service 50c9f2
    bool warning( const QXmlParseException & )
Packit Service 50c9f2
    {
Packit Service 50c9f2
      return FALSE;
Packit Service 50c9f2
    }
Packit Service 50c9f2
    bool error( const QXmlParseException & )
Packit Service 50c9f2
    {
Packit Service 50c9f2
      return FALSE;
Packit Service 50c9f2
    }
Packit Service 50c9f2
    bool fatalError( const QXmlParseException &exception )
Packit Service 50c9f2
    {
Packit Service 50c9f2
      err("Fatal error at line %d column %d: %s\n",
Packit Service 50c9f2
          exception.lineNumber(),exception.columnNumber(),
Packit Service 50c9f2
          exception.message().data());
Packit Service 50c9f2
      return FALSE;
Packit Service 50c9f2
    }
Packit Service 50c9f2
    QString errorString() { return ""; }
Packit Service 50c9f2
Packit Service 50c9f2
  private:
Packit Service 50c9f2
    QString errorMsg;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
/*! Dumps the internal structures. For debugging only! */
Packit Service 50c9f2
void TagFileParser::dump()
Packit Service 50c9f2
{
Packit Service 50c9f2
  msg("Result:\n");
Packit Service 50c9f2
  QListIterator<TagClassInfo> lci(m_tagFileClasses);
Packit Service 50c9f2
Packit Service 50c9f2
  //============== CLASSES
Packit Service 50c9f2
  TagClassInfo *cd;
Packit Service 50c9f2
  for (;(cd=lci.current());++lci)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    msg("class `%s'\n",cd->name.data());
Packit Service 50c9f2
    msg("  filename `%s'\n",cd->filename.data());
Packit Service 50c9f2
    if (cd->bases)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      QListIterator<BaseInfo> bii(*cd->bases);
Packit Service 50c9f2
      BaseInfo *bi;
Packit Service 50c9f2
      for ( bii.toFirst() ; (bi=bii.current()) ; ++bii) 
Packit Service 50c9f2
      {
Packit Service 50c9f2
        msg( "  base: %s \n", bi->name.data() );
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    QListIterator<TagMemberInfo> mci(cd->members);
Packit Service 50c9f2
    TagMemberInfo *md;
Packit Service 50c9f2
    for (;(md=mci.current());++mci)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      msg("  member:\n");
Packit Service 50c9f2
      msg("    kind: `%s'\n",md->kind.data());
Packit Service 50c9f2
      msg("    name: `%s'\n",md->name.data());
Packit Service 50c9f2
      msg("    anchor: `%s'\n",md->anchor.data());
Packit Service 50c9f2
      msg("    arglist: `%s'\n",md->arglist.data());
Packit Service 50c9f2
    }
Packit Service 50c9f2
  }
Packit Service 50c9f2
  //============== NAMESPACES
Packit Service 50c9f2
  QListIterator<TagNamespaceInfo> lni(m_tagFileNamespaces);
Packit Service 50c9f2
  TagNamespaceInfo *nd;
Packit Service 50c9f2
  for (;(nd=lni.current());++lni)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    msg("namespace `%s'\n",nd->name.data());
Packit Service 50c9f2
    msg("  filename `%s'\n",nd->filename.data());
Packit Service 50c9f2
    QStringList::Iterator it;
Packit Service 50c9f2
    for ( it = nd->classList.begin(); 
Packit Service 50c9f2
        it != nd->classList.end(); ++it ) 
Packit Service 50c9f2
    {
Packit Service 50c9f2
      msg( "  class: %s \n", (*it).latin1() );
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    QListIterator<TagMemberInfo> mci(nd->members);
Packit Service 50c9f2
    TagMemberInfo *md;
Packit Service 50c9f2
    for (;(md=mci.current());++mci)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      msg("  member:\n");
Packit Service 50c9f2
      msg("    kind: `%s'\n",md->kind.data());
Packit Service 50c9f2
      msg("    name: `%s'\n",md->name.data());
Packit Service 50c9f2
      msg("    anchor: `%s'\n",md->anchor.data());
Packit Service 50c9f2
      msg("    arglist: `%s'\n",md->arglist.data());
Packit Service 50c9f2
    }
Packit Service 50c9f2
  }
Packit Service 50c9f2
  //============== FILES
Packit Service 50c9f2
  QListIterator<TagFileInfo> lfi(m_tagFileFiles);
Packit Service 50c9f2
  TagFileInfo *fd;
Packit Service 50c9f2
  for (;(fd=lfi.current());++lfi)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    msg("file `%s'\n",fd->name.data());
Packit Service 50c9f2
    msg("  filename `%s'\n",fd->filename.data());
Packit Service 50c9f2
    QStringList::Iterator it;
Packit Service 50c9f2
    for ( it = fd->namespaceList.begin(); 
Packit Service 50c9f2
        it != fd->namespaceList.end(); ++it ) 
Packit Service 50c9f2
    {
Packit Service 50c9f2
      msg( "  namespace: %s \n", (*it).latin1() );
Packit Service 50c9f2
    }
Packit Service 50c9f2
    for ( it = fd->classList.begin(); 
Packit Service 50c9f2
        it != fd->classList.end(); ++it ) 
Packit Service 50c9f2
    {
Packit Service 50c9f2
      msg( "  class: %s \n", (*it).latin1() );
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    QListIterator<TagMemberInfo> mci(fd->members);
Packit Service 50c9f2
    TagMemberInfo *md;
Packit Service 50c9f2
    for (;(md=mci.current());++mci)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      msg("  member:\n");
Packit Service 50c9f2
      msg("    kind: `%s'\n",md->kind.data());
Packit Service 50c9f2
      msg("    name: `%s'\n",md->name.data());
Packit Service 50c9f2
      msg("    anchor: `%s'\n",md->anchor.data());
Packit Service 50c9f2
      msg("    arglist: `%s'\n",md->arglist.data());
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    QListIterator<TagIncludeInfo> mii(fd->includes);
Packit Service 50c9f2
    TagIncludeInfo *ii;
Packit Service 50c9f2
    for (;(ii=mii.current());++mii)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      msg("  includes id: %s name: %s\n",ii->id.data(),ii->name.data());
Packit Service 50c9f2
    }
Packit Service 50c9f2
  }
Packit Service 50c9f2
Packit Service 50c9f2
  //============== GROUPS
Packit Service 50c9f2
  QListIterator<TagGroupInfo> lgi(m_tagFileGroups);
Packit Service 50c9f2
  TagGroupInfo *gd;
Packit Service 50c9f2
  for (;(gd=lgi.current());++lgi)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    msg("group `%s'\n",gd->name.data());
Packit Service 50c9f2
    msg("  filename `%s'\n",gd->filename.data());
Packit Service 50c9f2
    QStringList::Iterator it;
Packit Service 50c9f2
    for ( it = gd->namespaceList.begin(); 
Packit Service 50c9f2
        it != gd->namespaceList.end(); ++it ) 
Packit Service 50c9f2
    {
Packit Service 50c9f2
      msg( "  namespace: %s \n", (*it).latin1() );
Packit Service 50c9f2
    }
Packit Service 50c9f2
    for ( it = gd->classList.begin(); 
Packit Service 50c9f2
        it != gd->classList.end(); ++it ) 
Packit Service 50c9f2
    {
Packit Service 50c9f2
      msg( "  class: %s \n", (*it).latin1() );
Packit Service 50c9f2
    }
Packit Service 50c9f2
    for ( it = gd->fileList.begin(); 
Packit Service 50c9f2
        it != gd->fileList.end(); ++it ) 
Packit Service 50c9f2
    {
Packit Service 50c9f2
      msg( "  file: %s \n", (*it).latin1() );
Packit Service 50c9f2
    }
Packit Service 50c9f2
    for ( it = gd->subgroupList.begin(); 
Packit Service 50c9f2
        it != gd->subgroupList.end(); ++it ) 
Packit Service 50c9f2
    {
Packit Service 50c9f2
      msg( "  subgroup: %s \n", (*it).latin1() );
Packit Service 50c9f2
    }
Packit Service 50c9f2
    for ( it = gd->pageList.begin(); 
Packit Service 50c9f2
        it != gd->pageList.end(); ++it ) 
Packit Service 50c9f2
    {
Packit Service 50c9f2
      msg( "  page: %s \n", (*it).latin1() );
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    QListIterator<TagMemberInfo> mci(gd->members);
Packit Service 50c9f2
    TagMemberInfo *md;
Packit Service 50c9f2
    for (;(md=mci.current());++mci)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      msg("  member:\n");
Packit Service 50c9f2
      msg("    kind: `%s'\n",md->kind.data());
Packit Service 50c9f2
      msg("    name: `%s'\n",md->name.data());
Packit Service 50c9f2
      msg("    anchor: `%s'\n",md->anchor.data());
Packit Service 50c9f2
      msg("    arglist: `%s'\n",md->arglist.data());
Packit Service 50c9f2
    }
Packit Service 50c9f2
  }
Packit Service 50c9f2
  //============== PAGES
Packit Service 50c9f2
  QListIterator<TagPageInfo> lpi(m_tagFilePages);
Packit Service 50c9f2
  TagPageInfo *pd;
Packit Service 50c9f2
  for (;(pd=lpi.current());++lpi)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    msg("page `%s'\n",pd->name.data());
Packit Service 50c9f2
    msg("  title `%s'\n",pd->title.data());
Packit Service 50c9f2
    msg("  filename `%s'\n",pd->filename.data());
Packit Service 50c9f2
  }
Packit Service 50c9f2
  //============== DIRS
Packit Service 50c9f2
  QListIterator<TagDirInfo> ldi(m_tagFileDirs);
Packit Service 50c9f2
  TagDirInfo *dd;
Packit Service 50c9f2
  for (;(dd=ldi.current());++ldi)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    msg("dir `%s'\n",dd->name.data());
Packit Service 50c9f2
    msg("  path `%s'\n",dd->path.data());
Packit Service 50c9f2
    QStringList::Iterator it;
Packit Service 50c9f2
    for ( it = dd->fileList.begin(); 
Packit Service 50c9f2
        it != dd->fileList.end(); ++it ) 
Packit Service 50c9f2
    {
Packit Service 50c9f2
      msg( "  file: %s \n", (*it).latin1() );
Packit Service 50c9f2
    }
Packit Service 50c9f2
    for ( it = dd->subdirList.begin(); 
Packit Service 50c9f2
        it != dd->subdirList.end(); ++it ) 
Packit Service 50c9f2
    {
Packit Service 50c9f2
      msg( "  subdir: %s \n", (*it).latin1() );
Packit Service 50c9f2
    }
Packit Service 50c9f2
  }
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void TagFileParser::addDocAnchors(Entry *e,const TagAnchorInfoList &l)
Packit Service 50c9f2
{
Packit Service 50c9f2
  QListIterator<TagAnchorInfo> tli(l);
Packit Service 50c9f2
  TagAnchorInfo *ta;
Packit Service 50c9f2
  for (tli.toFirst();(ta=tli.current());++tli)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    if (Doxygen::sectionDict->find(ta->label)==0)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      //printf("New sectionInfo file=%s anchor=%s\n",
Packit Service 50c9f2
      //    ta->fileName.data(),ta->label.data());
Packit Service 50c9f2
      SectionInfo *si=new SectionInfo(ta->fileName,-1,ta->label,ta->title,
Packit Service 50c9f2
          SectionInfo::Anchor,0,m_tagName);
Packit Service 50c9f2
      Doxygen::sectionDict->append(ta->label,si);
Packit Service 50c9f2
      e->anchors->append(si);
Packit Service 50c9f2
    }
Packit Service 50c9f2
    else
Packit Service 50c9f2
    {
Packit Service 50c9f2
      warn("Duplicate anchor %s found\n",ta->label.data());
Packit Service 50c9f2
    }
Packit Service 50c9f2
  }
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void TagFileParser::buildMemberList(Entry *ce,QList<TagMemberInfo> &members)
Packit Service 50c9f2
{
Packit Service 50c9f2
  QListIterator<TagMemberInfo> mii(members);
Packit Service 50c9f2
  TagMemberInfo *tmi;
Packit Service 50c9f2
  for (;(tmi=mii.current());++mii)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    Entry *me      = new Entry;
Packit Service 50c9f2
    me->type       = tmi->type;
Packit Service 50c9f2
    me->name       = tmi->name;
Packit Service 50c9f2
    me->args       = tmi->arglist;
Packit Service 50c9f2
    if (!me->args.isEmpty())
Packit Service 50c9f2
    {
Packit Service 50c9f2
      delete me->argList;
Packit Service 50c9f2
      me->argList = new ArgumentList;
Packit Service 50c9f2
      stringToArgumentList(me->args,me->argList);
Packit Service 50c9f2
    }
Packit Service 50c9f2
    if (tmi->enumValues.count()>0)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      me->spec |= Entry::Strong;
Packit Service 50c9f2
      QListIterator<TagEnumValueInfo> evii(tmi->enumValues);
Packit Service 50c9f2
      TagEnumValueInfo *evi;
Packit Service 50c9f2
      for (evii.toFirst();(evi=evii.current());++evii)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        Entry *ev      = new Entry;
Packit Service 50c9f2
        ev->type       = "@";
Packit Service 50c9f2
        ev->name       = evi->name;
Packit Service 50c9f2
        ev->id         = evi->clangid;
Packit Service 50c9f2
        ev->section    = Entry::VARIABLE_SEC;
Packit Service 50c9f2
        TagInfo *ti    = new TagInfo;
Packit Service 50c9f2
        ti->tagName    = m_tagName;
Packit Service 50c9f2
        ti->anchor     = evi->anchor;
Packit Service 50c9f2
        ti->fileName   = evi->file;
Packit Service 50c9f2
        ev->tagInfo    = ti;
Packit Service 50c9f2
        me->addSubEntry(ev);
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
    me->protection = tmi->prot;
Packit Service 50c9f2
    me->virt       = tmi->virt;
Packit Service 50c9f2
    me->stat       = tmi->isStatic;
Packit Service 50c9f2
    me->fileName   = ce->fileName;
Packit Service 50c9f2
    me->id         = tmi->clangId;
Packit Service 50c9f2
    if (ce->section == Entry::GROUPDOC_SEC)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      me->groups->append(new Grouping(ce->name,Grouping::GROUPING_INGROUP));
Packit Service 50c9f2
    }
Packit Service 50c9f2
    addDocAnchors(me,tmi->docAnchors);
Packit Service 50c9f2
    TagInfo *ti    = new TagInfo;
Packit Service 50c9f2
    ti->tagName    = m_tagName;
Packit Service 50c9f2
    ti->anchor     = tmi->anchor;
Packit Service 50c9f2
    ti->fileName   = tmi->anchorFile;
Packit Service 50c9f2
    me->tagInfo    = ti;
Packit Service 50c9f2
    if (tmi->kind=="define")
Packit Service 50c9f2
    {
Packit Service 50c9f2
      me->type="#define";
Packit Service 50c9f2
      me->section = Entry::DEFINE_SEC;
Packit Service 50c9f2
    }
Packit Service 50c9f2
    else if (tmi->kind=="enumvalue")
Packit Service 50c9f2
    {
Packit Service 50c9f2
      me->section = Entry::VARIABLE_SEC;
Packit Service 50c9f2
      me->mtype = Method;
Packit Service 50c9f2
    }
Packit Service 50c9f2
    else if (tmi->kind=="property")
Packit Service 50c9f2
    {
Packit Service 50c9f2
      me->section = Entry::VARIABLE_SEC;
Packit Service 50c9f2
      me->mtype = Property;
Packit Service 50c9f2
    }
Packit Service 50c9f2
    else if (tmi->kind=="event")
Packit Service 50c9f2
    {
Packit Service 50c9f2
      me->section = Entry::VARIABLE_SEC;
Packit Service 50c9f2
      me->mtype = Event;
Packit Service 50c9f2
    }
Packit Service 50c9f2
    else if (tmi->kind=="variable")
Packit Service 50c9f2
    {
Packit Service 50c9f2
      me->section = Entry::VARIABLE_SEC;
Packit Service 50c9f2
      me->mtype = Method;
Packit Service 50c9f2
    }
Packit Service 50c9f2
    else if (tmi->kind=="typedef")
Packit Service 50c9f2
    {
Packit Service 50c9f2
      me->section = Entry::VARIABLE_SEC; //Entry::TYPEDEF_SEC;
Packit Service 50c9f2
      me->type.prepend("typedef ");
Packit Service 50c9f2
      me->mtype = Method;
Packit Service 50c9f2
    }
Packit Service 50c9f2
    else if (tmi->kind=="enumeration")
Packit Service 50c9f2
    {
Packit Service 50c9f2
      me->section = Entry::ENUM_SEC;
Packit Service 50c9f2
      me->mtype = Method;
Packit Service 50c9f2
    }
Packit Service 50c9f2
    else if (tmi->kind=="function")
Packit Service 50c9f2
    {
Packit Service 50c9f2
      me->section = Entry::FUNCTION_SEC;
Packit Service 50c9f2
      me->mtype = Method;
Packit Service 50c9f2
    }
Packit Service 50c9f2
    else if (tmi->kind=="signal")
Packit Service 50c9f2
    {
Packit Service 50c9f2
      me->section = Entry::FUNCTION_SEC;
Packit Service 50c9f2
      me->mtype = Signal;
Packit Service 50c9f2
    }
Packit Service 50c9f2
    else if (tmi->kind=="prototype")
Packit Service 50c9f2
    {
Packit Service 50c9f2
      me->section = Entry::FUNCTION_SEC;
Packit Service 50c9f2
      me->mtype = Method;
Packit Service 50c9f2
    }
Packit Service 50c9f2
    else if (tmi->kind=="friend")
Packit Service 50c9f2
    {
Packit Service 50c9f2
      me->section = Entry::FUNCTION_SEC;
Packit Service 50c9f2
      me->type.prepend("friend ");
Packit Service 50c9f2
      me->mtype = Method;
Packit Service 50c9f2
    }
Packit Service 50c9f2
    else if (tmi->kind=="dcop")
Packit Service 50c9f2
    {
Packit Service 50c9f2
      me->section = Entry::FUNCTION_SEC;
Packit Service 50c9f2
      me->mtype = DCOP;
Packit Service 50c9f2
    }
Packit Service 50c9f2
    else if (tmi->kind=="slot")
Packit Service 50c9f2
    {
Packit Service 50c9f2
      me->section = Entry::FUNCTION_SEC;
Packit Service 50c9f2
      me->mtype = Slot;
Packit Service 50c9f2
    }
Packit Service 50c9f2
    ce->addSubEntry(me);
Packit Service 50c9f2
  }
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
static QCString stripPath(const QCString &s)
Packit Service 50c9f2
{
Packit Service 50c9f2
  int i=s.findRev('/');
Packit Service 50c9f2
  if (i!=-1)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    return s.right(s.length()-i-1);
Packit Service 50c9f2
  }
Packit Service 50c9f2
  else
Packit Service 50c9f2
  {
Packit Service 50c9f2
    return s;
Packit Service 50c9f2
  }
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
/*! Injects the info gathered by the XML parser into the Entry tree.
Packit Service 50c9f2
 *  This tree contains the information extracted from the input in a 
Packit Service 50c9f2
 *  "unrelated" form.
Packit Service 50c9f2
 */
Packit Service 50c9f2
void TagFileParser::buildLists(Entry *root)
Packit Service 50c9f2
{
Packit Service 50c9f2
  // build class list
Packit Service 50c9f2
  QListIterator<TagClassInfo> cit(m_tagFileClasses);
Packit Service 50c9f2
  TagClassInfo *tci;
Packit Service 50c9f2
  for (cit.toFirst();(tci=cit.current());++cit)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    Entry *ce = new Entry;
Packit Service 50c9f2
    ce->section = Entry::CLASS_SEC;
Packit Service 50c9f2
    switch (tci->kind)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      case TagClassInfo::Class:     break;
Packit Service 50c9f2
      case TagClassInfo::Struct:    ce->spec = Entry::Struct;    break;
Packit Service 50c9f2
      case TagClassInfo::Union:     ce->spec = Entry::Union;     break;
Packit Service 50c9f2
      case TagClassInfo::Interface: ce->spec = Entry::Interface; break;
Packit Service 50c9f2
      case TagClassInfo::Enum:      ce->spec = Entry::Enum;      break;
Packit Service 50c9f2
      case TagClassInfo::Exception: ce->spec = Entry::Exception; break;
Packit Service 50c9f2
      case TagClassInfo::Protocol:  ce->spec = Entry::Protocol;  break;
Packit Service 50c9f2
      case TagClassInfo::Category:  ce->spec = Entry::Category;  break;
Packit Service 50c9f2
      case TagClassInfo::Service:   ce->spec = Entry::Service;   break;
Packit Service 50c9f2
      case TagClassInfo::Singleton: ce->spec = Entry::Singleton; break;
Packit Service 50c9f2
    }
Packit Service 50c9f2
    ce->name     = tci->name;
Packit Service 50c9f2
    if (tci->kind==TagClassInfo::Protocol)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      ce->name+="-p";
Packit Service 50c9f2
    }
Packit Service 50c9f2
    addDocAnchors(ce,tci->docAnchors);
Packit Service 50c9f2
    TagInfo *ti  = new TagInfo;
Packit Service 50c9f2
    ti->tagName  = m_tagName;
Packit Service 50c9f2
    ti->fileName = tci->filename;
Packit Service 50c9f2
    ce->id       = tci->clangId;
Packit Service 50c9f2
    ce->tagInfo  = ti;
Packit Service 50c9f2
    ce->lang     = tci->isObjC ? SrcLangExt_ObjC : SrcLangExt_Unknown;
Packit Service 50c9f2
    // transfer base class list
Packit Service 50c9f2
    if (tci->bases)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      delete ce->extends;
Packit Service 50c9f2
      ce->extends = tci->bases; tci->bases = 0;
Packit Service 50c9f2
    }
Packit Service 50c9f2
    if (tci->templateArguments)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      if (ce->tArgLists==0)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        ce->tArgLists = new QList<ArgumentList>;
Packit Service 50c9f2
        ce->tArgLists->setAutoDelete(TRUE);
Packit Service 50c9f2
      }
Packit Service 50c9f2
      ArgumentList *al = new ArgumentList;
Packit Service 50c9f2
      ce->tArgLists->append(al);
Packit Service 50c9f2
Packit Service 50c9f2
      QListIterator<QCString> sli(*tci->templateArguments);
Packit Service 50c9f2
      QCString *argName;
Packit Service 50c9f2
      for (;(argName=sli.current());++sli)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        Argument *a = new Argument;
Packit Service 50c9f2
        a->type = "class";
Packit Service 50c9f2
        a->name = *argName;
Packit Service 50c9f2
        al->append(a);
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    buildMemberList(ce,tci->members);
Packit Service 50c9f2
    root->addSubEntry(ce);
Packit Service 50c9f2
  }
Packit Service 50c9f2
Packit Service 50c9f2
  // build file list
Packit Service 50c9f2
  QListIterator<TagFileInfo> fit(m_tagFileFiles);
Packit Service 50c9f2
  TagFileInfo *tfi;
Packit Service 50c9f2
  for (fit.toFirst();(tfi=fit.current());++fit)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    Entry *fe = new Entry;
Packit Service 50c9f2
    fe->section = guessSection(tfi->name);
Packit Service 50c9f2
    fe->name     = tfi->name;
Packit Service 50c9f2
    addDocAnchors(fe,tfi->docAnchors);
Packit Service 50c9f2
    TagInfo *ti  = new TagInfo;
Packit Service 50c9f2
    ti->tagName  = m_tagName;
Packit Service 50c9f2
    ti->fileName = tfi->filename;
Packit Service 50c9f2
    fe->tagInfo  = ti;
Packit Service 50c9f2
    
Packit Service 50c9f2
    QCString fullName = m_tagName+":"+tfi->path+stripPath(tfi->name);
Packit Service 50c9f2
    fe->fileName = fullName;
Packit Service 50c9f2
    //printf("new FileDef() filename=%s\n",tfi->filename.data());
Packit Service 50c9f2
    FileDef *fd = new FileDef(m_tagName+":"+tfi->path,
Packit Service 50c9f2
                              tfi->name,m_tagName,
Packit Service 50c9f2
                              tfi->filename
Packit Service 50c9f2
                             );
Packit Service 50c9f2
    FileName *mn;
Packit Service 50c9f2
    if ((mn=Doxygen::inputNameDict->find(tfi->name)))
Packit Service 50c9f2
    {
Packit Service 50c9f2
      mn->append(fd);
Packit Service 50c9f2
    }
Packit Service 50c9f2
    else
Packit Service 50c9f2
    {
Packit Service 50c9f2
      mn = new FileName(fullName,tfi->name);
Packit Service 50c9f2
      mn->append(fd);
Packit Service 50c9f2
      Doxygen::inputNameList->inSort(mn);
Packit Service 50c9f2
      Doxygen::inputNameDict->insert(tfi->name,mn);
Packit Service 50c9f2
    }
Packit Service 50c9f2
    buildMemberList(fe,tfi->members);
Packit Service 50c9f2
    root->addSubEntry(fe);
Packit Service 50c9f2
  }
Packit Service 50c9f2
Packit Service 50c9f2
  // build namespace list
Packit Service 50c9f2
  QListIterator<TagNamespaceInfo> nit(m_tagFileNamespaces);
Packit Service 50c9f2
  TagNamespaceInfo *tni;
Packit Service 50c9f2
  for (nit.toFirst();(tni=nit.current());++nit)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    Entry *ne    = new Entry;
Packit Service 50c9f2
    ne->section  = Entry::NAMESPACE_SEC;
Packit Service 50c9f2
    ne->name     = tni->name;
Packit Service 50c9f2
    addDocAnchors(ne,tni->docAnchors);
Packit Service 50c9f2
    TagInfo *ti  = new TagInfo;
Packit Service 50c9f2
    ti->tagName  = m_tagName;
Packit Service 50c9f2
    ti->fileName = tni->filename;
Packit Service 50c9f2
    ne->id       = tni->clangId;
Packit Service 50c9f2
    ne->tagInfo  = ti;
Packit Service 50c9f2
Packit Service 50c9f2
    buildMemberList(ne,tni->members);
Packit Service 50c9f2
    root->addSubEntry(ne);
Packit Service 50c9f2
  }
Packit Service 50c9f2
Packit Service 50c9f2
  // build package list
Packit Service 50c9f2
  QListIterator<TagPackageInfo> pit(m_tagFilePackages);
Packit Service 50c9f2
  TagPackageInfo *tpgi;
Packit Service 50c9f2
  for (pit.toFirst();(tpgi=pit.current());++pit)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    Entry *pe    = new Entry;
Packit Service 50c9f2
    pe->section  = Entry::PACKAGE_SEC;
Packit Service 50c9f2
    pe->name     = tpgi->name;
Packit Service 50c9f2
    addDocAnchors(pe,tpgi->docAnchors);
Packit Service 50c9f2
    TagInfo *ti  = new TagInfo;
Packit Service 50c9f2
    ti->tagName  = m_tagName;
Packit Service 50c9f2
    ti->fileName = tpgi->filename;
Packit Service 50c9f2
    pe->tagInfo  = ti;
Packit Service 50c9f2
Packit Service 50c9f2
    buildMemberList(pe,tpgi->members);
Packit Service 50c9f2
    root->addSubEntry(pe);
Packit Service 50c9f2
  }
Packit Service 50c9f2
Packit Service 50c9f2
  // build group list
Packit Service 50c9f2
  QListIterator<TagGroupInfo> git(m_tagFileGroups);
Packit Service 50c9f2
  TagGroupInfo *tgi;
Packit Service 50c9f2
  for (git.toFirst();(tgi=git.current());++git)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    Entry *ge    = new Entry;
Packit Service 50c9f2
    ge->section  = Entry::GROUPDOC_SEC;
Packit Service 50c9f2
    ge->name     = tgi->name;
Packit Service 50c9f2
    ge->type     = tgi->title;
Packit Service 50c9f2
    addDocAnchors(ge,tgi->docAnchors);
Packit Service 50c9f2
    TagInfo *ti  = new TagInfo;
Packit Service 50c9f2
    ti->tagName  = m_tagName;
Packit Service 50c9f2
    ti->fileName = tgi->filename;
Packit Service 50c9f2
    ge->tagInfo  = ti;
Packit Service 50c9f2
Packit Service 50c9f2
    buildMemberList(ge,tgi->members);
Packit Service 50c9f2
    root->addSubEntry(ge);
Packit Service 50c9f2
  }
Packit Service 50c9f2
Packit Service 50c9f2
  // build page list
Packit Service 50c9f2
  QListIterator<TagPageInfo> pgit(m_tagFilePages);
Packit Service 50c9f2
  TagPageInfo *tpi;
Packit Service 50c9f2
  for (pgit.toFirst();(tpi=pgit.current());++pgit)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    Entry *pe    = new Entry;
Packit Service 50c9f2
    pe->section  = tpi->filename=="index" ? Entry::MAINPAGEDOC_SEC : Entry::PAGEDOC_SEC;
Packit Service 50c9f2
    pe->name     = tpi->name;
Packit Service 50c9f2
    pe->args     = tpi->title;
Packit Service 50c9f2
    addDocAnchors(pe,tpi->docAnchors);
Packit Service 50c9f2
    TagInfo *ti  = new TagInfo;
Packit Service 50c9f2
    ti->tagName  = m_tagName;
Packit Service 50c9f2
    ti->fileName = tpi->filename;
Packit Service 50c9f2
    pe->tagInfo  = ti;
Packit Service 50c9f2
    root->addSubEntry(pe);
Packit Service 50c9f2
  }
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void TagFileParser::addIncludes()
Packit Service 50c9f2
{
Packit Service 50c9f2
  QListIterator<TagFileInfo> fit(m_tagFileFiles);
Packit Service 50c9f2
  TagFileInfo *tfi;
Packit Service 50c9f2
  for (fit.toFirst();(tfi=fit.current());++fit)
Packit Service 50c9f2
  {
Packit Service 50c9f2
    //printf("tag file tagName=%s path=%s name=%s\n",m_tagName.data(),tfi->path.data(),tfi->name.data());
Packit Service 50c9f2
    FileName *fn = Doxygen::inputNameDict->find(tfi->name);
Packit Service 50c9f2
    if (fn)
Packit Service 50c9f2
    {
Packit Service 50c9f2
      //printf("found\n");
Packit Service 50c9f2
      FileNameIterator fni(*fn);
Packit Service 50c9f2
      FileDef *fd;
Packit Service 50c9f2
      for (;(fd=fni.current());++fni)
Packit Service 50c9f2
      {
Packit Service 50c9f2
        //printf("input file path=%s name=%s\n",fd->getPath().data(),fd->name().data());
Packit Service 50c9f2
        if (fd->getPath()==QCString(m_tagName+":"+tfi->path))
Packit Service 50c9f2
        {
Packit Service 50c9f2
          //printf("found\n");
Packit Service 50c9f2
          QListIterator<TagIncludeInfo> mii(tfi->includes);
Packit Service 50c9f2
          TagIncludeInfo *ii;
Packit Service 50c9f2
          for (;(ii=mii.current());++mii)
Packit Service 50c9f2
          {
Packit Service 50c9f2
            //printf("ii->name=`%s'\n",ii->name.data());
Packit Service 50c9f2
            FileName *ifn = Doxygen::inputNameDict->find(ii->name);
Packit Service 50c9f2
            ASSERT(ifn!=0);
Packit Service 50c9f2
            if (ifn)
Packit Service 50c9f2
            {
Packit Service 50c9f2
              FileNameIterator ifni(*ifn);
Packit Service 50c9f2
              FileDef *ifd;
Packit Service 50c9f2
              for (;(ifd=ifni.current());++ifni)
Packit Service 50c9f2
              {
Packit Service 50c9f2
                //printf("ifd->getOutputFileBase()=%s ii->id=%s\n",
Packit Service 50c9f2
                //        ifd->getOutputFileBase().data(),ii->id.data());
Packit Service 50c9f2
                if (ifd->getOutputFileBase()==QCString(ii->id))
Packit Service 50c9f2
                {
Packit Service 50c9f2
                  fd->addIncludeDependency(ifd,ii->text,ii->isLocal,ii->isImported,FALSE);
Packit Service 50c9f2
                }
Packit Service 50c9f2
              }
Packit Service 50c9f2
            }
Packit Service 50c9f2
          }
Packit Service 50c9f2
        }
Packit Service 50c9f2
      }
Packit Service 50c9f2
    }
Packit Service 50c9f2
  }
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
void parseTagFile(Entry *root,const char *fullName)
Packit Service 50c9f2
{
Packit Service 50c9f2
  QFileInfo fi(fullName);
Packit Service 50c9f2
  if (!fi.exists()) return;
Packit Service 50c9f2
  TagFileParser handler( fullName ); // tagName
Packit Service 50c9f2
  handler.setFileName(fullName);
Packit Service 50c9f2
  TagFileErrorHandler errorHandler;
Packit Service 50c9f2
  QFile xmlFile( fullName );
Packit Service 50c9f2
  QXmlInputSource source( xmlFile );
Packit Service 50c9f2
  QXmlSimpleReader reader;
Packit Service 50c9f2
  reader.setContentHandler( &handler );
Packit Service 50c9f2
  reader.setErrorHandler( &errorHandler );
Packit Service 50c9f2
  reader.parse( source );
Packit Service 50c9f2
  handler.buildLists(root);
Packit Service 50c9f2
  handler.addIncludes();
Packit Service 50c9f2
  //handler.dump();
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2