ulxr_valueparse_wb.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                ulxr_valueparse_wb.h  -  parse wbxml-rpc primitive values
00003                              -------------------
00004     begin                : Fri Jan 09 2004
00005     copyright            : (C) 2002-2007 by Ewald Arnold
00006     email                : ulxmlrpcpp@ewald-arnold.de
00007 
00008     $Id: ulxr_valueparse_wb.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_VALUEPARSE_WB_H
00031 #define ULXR_VALUEPARSE_WB_H
00032 
00033 #include <ulxmlrpcpp/ulxmlrpcpp.h>  // always first header
00034 
00035 #include <ulxmlrpcpp/ulxr_wbxmlparse.h>
00036 #include <ulxmlrpcpp/ulxr_valueparse_base.h>
00037 
00038 #include <stack>
00039 
00040 
00041 namespace ulxr {
00042 
00043 
00054 class ULXR_API_DECL0 ValueParserWb : public ValueParserBase,
00055                                   public WbXmlParser
00056 {
00057  public:
00058 
00061    ValueParserWb();
00062 
00065    virtual ~ValueParserWb();
00066 
00067    enum ValueWellKnownToken
00068    {
00069      //* @attention Never ever change these values or their order
00070      wbToken_Value     = wbxml_TAG_C_FIRST,   // 0x45
00071      wbToken_Array,                           // 0x46
00072      wbToken_Data,                            // 0x47
00073      wbToken_Struct,                          // 0x48
00074      wbToken_Member,                          // 0x49
00075      wbToken_Name,                            // 0x4a
00076      wbToken_Boolean,                         // 0x4b
00077      wbToken_Int,                             // 0x4c
00078      wbToken_I4,                              // 0x4d
00079      wbToken_Double,                          // 0x4e
00080      wbToken_String,                          // 0x4f
00081      wbToken_Base64,                          // 0x50
00082      wbToken_Date,                            // 0x51
00083      wbToken_ValueParserLast                  // 0x52
00084    };
00085 
00086  protected:
00087 
00094    bool testStartElement(unsigned token, const Attributes &attr);
00095 
00100    virtual void startElement(unsigned token, const Attributes &attr);
00101 
00105    bool testEndElement();
00106 
00109    virtual void endElement();
00110 
00114   class ULXR_API_DECL0 IntegerState : public ValueParserBase::ValueState
00115   {
00116    public:
00117 
00121      IntegerState(unsigned st);
00122 
00126      virtual void takeValue(Value *val);
00127 
00128    private:
00129      IntegerState(const IntegerState&); // forbid this
00130      IntegerState& operator= (const IntegerState&);
00131   };
00132 
00136   class ULXR_API_DECL0 BooleanState : public ValueParserBase::ValueState
00137   {
00138    public:
00139 
00143      BooleanState(unsigned st);
00144 
00148      virtual void takeValue(Value *val);
00149 
00150    private:
00151      BooleanState(const BooleanState&); // forbid this
00152      BooleanState& operator= (const BooleanState&);
00153   };
00154 
00155   friend class IntegerState;
00156   friend class BooleanState;
00157 
00161    ValueState *getTopValueState() const;
00162 };
00163 
00164 
00165 }  // namespace ulxr
00166 
00167 
00168 #endif // ULXR_VALUEPARSE_WB_H

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