00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _iconvertable_h
00018 #define _iconvertable_h
00019
00020 #include <spl/types.h>
00021 #include <spl/Debug.h>
00022 #include <spl/BigInteger.h>
00023 #include <spl/Char.h>
00024 #include <spl/Date.h>
00025 #include <spl/DateTime.h>
00026 #include <spl/Decimal.h>
00027 #include <spl/Double.h>
00028 #include <spl/Int32.h>
00029 #include <spl/Int64.h>
00030 #include <spl/math/Math.h>
00031 #include <spl/Memory.h>
00032 #include <spl/String.h>
00033 #include <spl/UInt32.h>
00034 #include <spl/UInt64.h>
00035
00045 class IConvertable : public IComparable, public IMemoryValidate
00046 {
00047 public:
00048 IConvertable();
00049 virtual ~IConvertable();
00050
00051 virtual bool ToChar(char& c2) const = 0;
00052
00053 virtual bool ToBool(bool& c2) const = 0;
00054
00055 virtual bool ToByte(byte& c2) const = 0;
00056
00057 virtual bool ToInt16(int16& c2) const = 0;
00058
00059 virtual bool ToInt32(int32& c2) const = 0;
00060
00061 virtual bool ToInt64(int64& c2) const = 0;
00062
00063 virtual bool ToUInt32(uint32& c2) const = 0;
00064
00065 virtual bool ToUInt64(uint64& c2) const = 0;
00066
00067
00068
00069 virtual bool ToFloat32(float32& c2) const = 0;
00070
00071 virtual bool ToFloat64(float64& c2) const = 0;
00072
00073 virtual bool ToDateTime(DateTime& c2) const = 0;
00074
00075 virtual bool ToDate(Date& c2) const = 0;
00076
00077 virtual bool ToDecimal(Decimal& c2) const = 0;
00078
00079 virtual bool ToString(String& c2) const = 0;
00080
00081 virtual String TypeName() const = 0;
00082
00083 virtual bool Equals( const IComparable& a ) const = 0;
00084 virtual int Compare( const IComparable& a ) const = 0;
00085
00088 virtual int32 MajicNumber() const = 0;
00089
00090 #ifdef DEBUG
00091 virtual void ValidateMem() const = 0;
00092 virtual void CheckMem() const = 0;
00093 #endif
00094 };
00095
00098 #endif