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

skRValue.h

00001 /*
00002   Copyright 1996-2003
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: skRValue_8h-source.html,v 1.17 2004/12/17 21:31:14 sdw Exp $
00020 */
00021 #ifndef skRVALUE_H
00022 #define skRVALUE_H
00023 
00024 #include "skString.h"
00025 
00026 class CLASSEXPORT skiExecutable;
00027 class CLASSEXPORT skObjectRef;
00028 
00032 class CLASSEXPORT  skRValue     
00033 #ifdef __SYMBIAN32__
00034 : public CBase
00035 #endif
00036 { 
00037  public:
00041   enum RType { T_Object,T_String,T_Int,
00042 #ifdef USE_FLOATING_POINT
00043                T_Float,
00044 #endif
00045                T_Char,T_Bool, NUM_RTYPES };
00046    
00050   inline skRValue();
00054   IMPORT_C skRValue(const skRValue&);
00055 #ifndef __SYMBIAN32__
00056 
00062   skRValue(skiExecutable * object,bool created=false);
00063 #endif
00064 
00070   inline void assignObject(skiExecutable * object,bool created=false);
00074   inline skRValue(const skString& s);
00078   inline skRValue(Char c);
00082   inline skRValue(int n);
00086   inline skRValue(unsigned int n);
00087 #ifdef USE_FLOATING_POINT
00088 
00091   inline skRValue(float f);
00092 #endif
00093 #ifndef __SYMBIAN32__
00094 
00098   inline skRValue(bool b);
00099 #endif
00100 
00103   virtual inline ~skRValue();
00107   IMPORT_C skRValue& operator=(const skRValue& v);
00111   IMPORT_C skRValue& operator=(bool value);
00115   IMPORT_C skRValue& operator=(const skString& value);
00119   IMPORT_C skRValue& operator=(int value);
00120 #ifdef USE_FLOATING_POINT
00121 
00124   IMPORT_C skRValue& operator=(float value);
00125 #endif
00126 
00129   IMPORT_C skRValue& operator=(Char value);
00133   IMPORT_C bool operator==(const skRValue&);
00137   IMPORT_C Char charValue()  const;             
00141   IMPORT_C bool boolValue()  const;             
00145   IMPORT_C int intValue()  const;               
00146 #ifdef USE_FLOATING_POINT
00147 
00150   IMPORT_C float floatValue()  const;           
00151 #endif
00152 
00155   IMPORT_C skString str() const;
00159   inline skiExecutable * obj()  const;
00163   inline RType  type()  const;
00164 #ifdef __SYMBIAN32__
00165 
00170   inline operator TCleanupItem();
00175   static inline void Cleanup(TAny * s);
00176 #endif
00177  private:       
00179   void deRef();
00183   unsigned char m_Type;
00187   skString m_String;
00188   
00192   union {
00193     skObjectRef * m_ObjectRef;  
00194     Char m_Char;
00195     int m_Int;
00196 #ifdef USE_FLOATING_POINT
00197     float m_Float;
00198 #endif
00199     bool m_Bool;
00200   }m_Value;
00201 };                              
00202 #include "skRValue.inl"
00203 #endif
00204 
00205 

Generated on Fri Dec 17 20:27:34 2004 for Simkin by doxygen1.3