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

skExpatParser.h

00001 /*
00002   Copyright 1996-2002
00003   Simon Whiteside
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 * $Id: skExpatParser.h,v 1.11 2002/12/16 16:11:46 sdw Exp $
00020 */
00021 
00022 #ifndef skEXPATPARSER_H
00023 #define skEXPATPARSER_H
00024 
00025 #include "skString.h"
00026 #ifdef STREAMS_ENABLED
00027 #include <iostream.h>
00028 #endif
00029 #include "skElement.h"
00030 #include <expat.h>
00031 #include "skExecutableContext.h"
00032 
00037 class CLASSEXPORT skExpatParser 
00038 {
00039  public:
00041   skExpatParser();
00042   ~skExpatParser();
00043 
00044 #ifdef STREAMS_ENABLED
00045 
00051   skElement * parse(istream& in);
00052 #endif
00053 
00061   skElement * parse(const skString& in,skExecutableContext& context);
00062  private:
00064   skExpatParser(const skExpatParser&);
00065   skExpatParser& operator=(const skExpatParser&);
00066 
00067   static void startElementHandler(void * userData,const Char *name, const Char **atts);
00068   void startElement(const Char *name, const Char **atts);
00069 
00070   static void endElementHandler(void * userData,const Char *name);
00071   void endElement(const Char *name);
00072 
00073   static void characterDataHandler(void *userData, const XML_Char *s,int len);
00074   void characterData(const XML_Char *s,int len);
00075 
00076   static  void startCDataHandler(void *userData);
00077   void startCData();
00078 
00079   static void endCDataHandler(void *userData);
00080   void endCData ();
00081 
00082   skNodeList m_ElementStack;
00083   bool m_InCData;
00084   skElement * m_RootElement;
00085 };
00086 #endif
00087 

Generated on Mon Dec 16 16:30:12 2002 for Simkin by doxygen1.3-rc1