00001
00002
00003
00004
00005
00006
00007 #ifndef skRVALUE_H
00008 #define skRVALUE_H
00009
00010 #include "skString.h"
00011
00012 class CLASSEXPORT skiExecutable;
00013 class CLASSEXPORT skObjectRef;
00014
00018 class CLASSEXPORT skRValue
00019 {
00020 public:
00024 enum RType { T_Object,T_String,T_Int,T_Float,T_Char,T_Bool };
00025
00029 skRValue();
00033 skRValue(const skRValue&);
00039 skRValue(skiExecutable * obj,bool created=false);
00043 skRValue(skString s);
00047 skRValue(Char c);
00051 skRValue(int n);
00055 skRValue(unsigned int n);
00059 skRValue(float f);
00063 skRValue(bool b);
00067 ~skRValue();
00071 skRValue& operator=(const skRValue& v);
00075 bool operator==(const skRValue&);
00079 Char charValue() const;
00083 bool boolValue() const;
00087 int intValue() const;
00091 float floatValue() const;
00095 skString str() const;
00099 skiExecutable * obj() const;
00103 RType type() const;
00104 private:
00108 unsigned char m_Type;
00112 skString m_String;
00113
00117 union {
00118 skObjectRef * m_ObjectRef;
00119 Char m_Char;
00120 int m_Int;
00121 float m_Float;
00122 bool m_Bool;
00123 }m_Value;
00124 };
00125 #include "skRValue.inl"
00126 #endif
00127
00128