ulxr_valueparse_base.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                ulxr_valueparse_base.h  -  parse 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_base.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_BASE_H
00031 #define ULXR_VALUEPARSE_BASE_H
00032 
00033 #include <ulxmlrpcpp/ulxmlrpcpp.h>  // always first header
00034 
00035 #include <ulxmlrpcpp/ulxr_value.h>
00036 #include <ulxmlrpcpp/ulxr_xmlparse_base.h>
00037 
00038 
00039 namespace ulxr {
00040 
00041 
00052 class ULXR_API_DECL0 ValueParserBase
00053 {
00054  public:
00055 
00058    virtual ~ValueParserBase();
00059 
00063    Value getValue() const;
00064 
00065    enum State
00066    {
00067      eValue  = XmlParserBase::eXmlParserLast,
00068      eArray,   eData,
00069      eStruct,  eMember, eName,
00070      eBoolean, eInt,    eI4,   eDouble,
00071      eString,  eBase64, eDate,
00072      eValueParserLast
00073    };
00074 
00077   class ULXR_API_DECL0 ValueState : public XmlParserBase::ParserState
00078   {
00079    public:
00080 
00084      ValueState (unsigned st);
00085 
00089      virtual void takeValue(Value *val);
00090 
00095      virtual void takeName(const CppString &name);
00096 
00101      virtual CppString getStateName() const;
00102 
00107      CppString getName() const;
00108 
00113      void setName(const CppString &name);
00114 
00118      Value* getValue() const;
00119 
00120    protected:
00121 
00122      Value     *value;
00123 
00124    private:
00125 
00126      CppString  name;
00127 
00128      ValueState(const ValueState&); // forbid this
00129      ValueState& operator= (const ValueState&);
00130   };
00131 
00132  protected:
00133 
00137   class ULXR_API_DECL0 MemberState : public ValueState
00138   {
00139    public:
00140 
00145      MemberState(unsigned st, Value *val);
00146 
00150      virtual void takeValue(Value *val);
00151 
00155      virtual void takeName(const CppString &name);
00156 
00157    protected:
00158 
00159      Value  *mem_val;
00160 
00161    private:
00162      MemberState(const MemberState&); // forbid this
00163      MemberState& operator= (const MemberState&);
00164   };
00165 
00166 
00170   class ULXR_API_DECL0 ArrayState : public ValueState
00171   {
00172    public:
00173 
00177      ArrayState(unsigned st);
00178 
00182      virtual void takeValue(Value *val);
00183 
00184    private:
00185      ArrayState(const ArrayState&); // forbid this
00186      ArrayState& operator= (const ArrayState&);
00187   };
00188 
00189    friend class ValueState;
00190 
00191  protected:
00192 
00196    virtual ValueState *getTopValueState() const = 0;
00197 };
00198 
00199 
00200 }  // namespace ulxr
00201 
00202 
00203 #endif // ULXR_VALUEPARSE_BASE_H

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