Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

xmlparser.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     xmlparser.h  -  Definition of XmlParser class
00003                              -------------------
00004     begin                : June 21 2002
00005     copyright            : (C) 2003 by Vojtìch Toman
00006     email                : vtoman@lit.cz
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00027 #ifdef __GNUG__
00028 # pragma interface
00029 #endif
00030 
00031 #ifndef XMLPARSER_H
00032 #define XMLPARSER_H
00033 
00034 
00035 
00036 #include "defs.h"
00037 #include "xmlparserbase.h"
00038 #include "xmlchar.h"
00039 #include "options.h"
00040 
00041 
00043 #define XML_BUFFER_SIZE         4096
00044 
00045 
00046 
00052 class XmlParser : public XmlParserBase
00053 {
00054 public:
00056   XmlParser(void);
00057 
00059   XmlParser(const XmlChar *encoding);
00060 
00062   virtual ~XmlParser(void);
00063 
00065   virtual long parse(void) throw (ExaltParserException, ExaltEncodingException, ExaltIOException);
00066 
00067 
00069   virtual long parsePush(const char *data, int length, bool isFinal) throw (ExaltParserException, ExaltEncodingException, ExaltIOException);
00070 
00072   virtual void reportError(void);
00073 
00075   virtual void startElement(void *userData,
00076                                    const XmlChar *name,
00077                                    const XmlChar **atts);
00078 
00080   virtual void endElement(void *userData,
00081                                  const XmlChar *name);
00082 
00084   virtual void characterData(void *userData,
00085                                     const XmlChar *data,
00086                                     int length);
00087 
00089   virtual void processingInstruction(void *userData,
00090                                             const XmlChar *target,
00091                                             const XmlChar *data);
00092 
00094   virtual void comment(void *userData,
00095                               const XmlChar *data);
00096 
00098   virtual void startCDATASection(void *userData);
00099 
00100 
00102   virtual void endCDATASection(void *userData);
00103 
00105   virtual void defaultHandler(void *userData,
00106                               const XmlChar *data,
00107                               int length);
00108 
00110   virtual int unknownEncoding(void *unknownEncodingData,
00111                                      const XmlChar *name,
00112                                      XML_Encoding *info);
00113 
00115   virtual void xmlDecl(void *userData,
00116                               const XmlChar *version,
00117                               const XmlChar *encoding,
00118                               int standalone);
00119 
00121   virtual void startDoctypeDecl(void *userData,
00122                                        const XmlChar *doctypeName,
00123                                        const XmlChar *systemId,
00124                                        const XmlChar *publicId,
00125                                        int hasInternalSubset);
00126 
00128   virtual void endDoctypeDecl(void *userData);
00129 
00131   virtual void entityDecl(void *userData,
00132                                  const XmlChar *entityName,
00133                                  int isParameterEntity,
00134                                  const XmlChar *value,
00135                                  int valueLength,
00136                                  const XmlChar *base,
00137                                  const XmlChar *systemId,
00138                                  const XmlChar *publicId,
00139                                  const XmlChar *notationName);
00140 
00142   virtual void notationDecl(void *userData,
00143                                    const XmlChar *notationName,
00144                                    const XmlChar *base,
00145                                    const XmlChar *systemId,
00146                                    const XmlChar *publicId);
00147 
00148 protected:
00154   XmlInnerParser innerParser;
00155 
00161   char xmlDataBuff[XML_BUFFER_SIZE];
00162 
00164   virtual void initParser(const XmlChar *encoding);
00165 
00167   void exposeEvent(XmlModelEvent *ev);
00168 
00170   unsigned long charactersTotal;
00171 };
00172 
00173 
00174 
00180 struct ParseInfo
00181 {
00183   XmlParserBase *parser;
00184 
00186   unsigned long depth;
00187 };
00188 
00189 
00193 struct EncodingInfo
00194 {
00196   TextCodec *textCodec;
00197 
00199   Encodings::MIB mib;
00200 };
00201 
00202 
00203 #endif //XMLPARSER_H

Generated on Wed Feb 5 10:43:03 2003 for Exalt by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002