ulxr_expatwrap.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                  ulxr_expatwrap.cpp  -  c++ wrapper for expat
00003                              -------------------
00004     begin                : Thu Apr 30 2002
00005     copyright            : (C) 2002-2007 by Ewald Arnold
00006     email                : ulxmlrpcpp@ewald-arnold.de
00007 
00008     $Id: ulxr_expatwrap.h 940 2006-12-30 18:22:05Z ewald-arnold $
00009 
00010  ***************************************************************************/
00011 
00012 /**************************************************************************
00013  *
00014  * This program is free software; you can redistribute it and/or modify
00015  * it under the terms of the GNU Lesser General Public License as
00016  * published by the Free Software Foundation; either version 2 of the License,
00017  * or (at your option) any later version.
00018  *
00019  * This program is distributed in the hope that it will be useful,
00020  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022  * GNU General Public License for more details.
00023  *
00024  * You should have received a copy of the GNU Lesser General Public License
00025  * along with this program; if not, write to the Free Software
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00027  *
00028  ***************************************************************************/
00029 
00030 #ifndef ULXR_EXPATWRAP_H
00031 #define ULXR_EXPATWRAP_H
00032 
00033 #include <ulxmlrpcpp/ulxmlrpcpp.h>  // always first header
00034 
00035 #include <ulxmlrpcpp/ulxr_xmlparse_base.h>
00036 
00037 
00038 namespace ulxr {
00039 
00043 class ULXR_API_DECL0 ExpatWrapper : public XmlParserBase
00044 {
00045  public:
00046 
00050     ExpatWrapper(bool createParser=true);
00051 
00054     virtual ~ExpatWrapper();
00055 
00062     virtual int parse(const char* buffer, int len, int isFinal);
00063 
00067     virtual unsigned getErrorCode() const;
00068 
00073     virtual CppString getErrorString(unsigned code) const;
00074 
00078     virtual int getCurrentLineNumber() const;
00079 
00084     virtual int mapToFaultCode(int xpatcode) const;
00085 
00086  protected:
00087 
00090     operator XML_Parser() const;
00091 
00097     virtual void startElement(const XML_Char* name, const XML_Char** atts);
00098 
00103     virtual void endElement(const XML_Char *name);
00104 
00110     virtual void charData(const XML_Char *s, int len);
00111 
00118     static void startElementCallback(void *userData, const XML_Char* name, const XML_Char** atts);
00119 
00125     static void endElementCallback(void *userData, const XML_Char* name);
00126 
00133     static void charDataCallback(void *userData, const XML_Char* s, int len);
00134 
00135  private:
00136 
00139     void setHandler();
00140 
00143     void reset();
00144 
00145  private:
00146 
00147     XML_Parser expatParser;
00148 };
00149 
00150 
00151 }  // namespace ulxr
00152 
00153 
00154 #endif // ULXR_EXPATWRAP_H
00155 

Generated on Sun Aug 19 20:08:57 2007 for ulxmlrpcpp by  doxygen 1.5.1