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 {
00034 public:
00038 enum RType { T_Object,T_String,T_Int,T_Float,T_Char,T_Bool, NUM_RTYPES };
00039
00043 skRValue();
00047 skRValue(const skRValue&);
00053 skRValue(skiExecutable * obj,bool created=false);
00057 skRValue(skString s);
00061 skRValue(Char c);
00065 skRValue(int n);
00069 skRValue(unsigned int n);
00073 skRValue(float f);
00077 skRValue(bool b);
00081 ~skRValue();
00085 skRValue& operator=(const skRValue& v);
00089 bool operator==(const skRValue&);
00093 Char charValue() const;
00097 bool boolValue() const;
00101 int intValue() const;
00105 float floatValue() const;
00109 skString str() const;
00113 skiExecutable * obj() const;
00117 RType type() const;
00118 private:
00122 unsigned char m_Type;
00126 skString m_String;
00127
00131 union {
00132 skObjectRef * m_ObjectRef;
00133 Char m_Char;
00134 int m_Int;
00135 float m_Float;
00136 bool m_Bool;
00137 }m_Value;
00138 };
00139 #include "skRValue.inl"
00140 #endif
00141
00142