00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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