00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _compare_h
00018 #define _compare_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/IConvertable.h>
00029 #include <spl/Int32.h>
00030 #include <spl/Int64.h>
00031 #include <spl/Null.h>
00032 #include <spl/math/Math.h>
00033 #include <spl/RefCountPtr.h>
00034 #include <spl/String.h>
00035 #include <spl/UInt32.h>
00036 #include <spl/UInt64.h>
00037 #include <spl/Undefined.h>
00038
00048 class Compare
00049 {
00050 private:
00051 Compare() {}
00052 Compare(const Compare& c) {}
00053 Compare& operator =(const Compare& c) {}
00054
00055 public:
00056 inline static int32 Majic( const int16& i ) { return INT16_MAJIC; }
00057 inline static int32 Majic( const int32& i ) { return INT32_MAJIC; }
00058 inline static int32 Majic( const int64& i ) { return INT64_MAJIC; }
00059 inline static int32 Majic( const byte& i ) { return BYTE_MAJIC; }
00060 inline static int32 Majic( const uint32& i ) { return UINT32_MAJIC; }
00061 inline static int32 Majic( const uint64& i ) { return UINT64_MAJIC; }
00062 inline static int32 Majic( const float32& i ) { return FLOAT32_MAJIC; }
00063 inline static int32 Majic( const float64& i ) { return DOUBLE_MAJIC; }
00064 inline static int32 Majic( const char& i ) { return CHAR_MAJIC; }
00065 inline static int32 Majic( const bool& i ) { return BOOL_MAJIC; }
00066 inline static int32 Majic( const Decimal& i ) { return i.MajicNumber(); }
00067 inline static int32 Majic( const String& i ) { return i.MajicNumber(); }
00068 inline static int32 Majic( const StringPtr& i ) { return i->MajicNumber(); }
00069 inline static int32 Majic( const IComparable& i ) { return i.MajicNumber(); }
00070 inline static int32 Majic( const IComparable *i ) { return i->MajicNumber(); }
00071 inline static int32 Majic( const BigInteger& i ) { return i.MajicNumber(); }
00072 inline static int32 Majic( const Date& i ) { return i.MajicNumber(); }
00073 inline static int32 Majic( const DateTime& i ) { return i.MajicNumber(); }
00074 inline static int32 Majic( const Null& i ) { return i.MajicNumber(); }
00075 inline static int32 Majic( const Undefined& i ) { return i.MajicNumber(); }
00076 inline static int32 Majic( const IConvertable& i ) { return i.MajicNumber(); }
00077 inline static int32 Majic( const IConvertable* i ) { return i->MajicNumber(); }
00078
00079 inline static bool IsFloatMajic( const int32 majic ) { return majic == FLOAT32_MAJIC || majic == DOUBLE_MAJIC || majic == DECIMAL_MAJIC; }
00080 inline static bool IsIntMajic( const int32 majic ) { return majic == INT16_MAJIC || majic == INT32_MAJIC || majic == INT64_MAJIC; }
00081 inline static bool IsUnsignedMajic( const int32 majic ) { return majic == BYTE_MAJIC || majic == UINT32_MAJIC || majic == UINT64_MAJIC; }
00082 inline static bool IsCharMajic( const int32 majic ) { return majic == CHAR_MAJIC; }
00083 inline static bool IsBoolMajic( const int32 majic ) { return majic == BOOL_MAJIC; }
00084 inline static bool IsDateMajic( const int32 majic ) { return majic == DATE_MAJIC; }
00085 inline static bool IsDateTimeMajic( const int32 majic ) { return majic == DATETIME_MAJIC; }
00086 inline static bool IsStringMajic( const int32 majic ) { return majic == STRING_MAJIC; }
00087
00088 inline static bool Equals(const Null & c2, const Null& c) { return true; }
00089 inline static bool Equals(const Null & c2, const IComparable& c) { return c.Equals(c2); }
00090 inline static bool Equals(const Null & c2, const RefCountPtr<IComparable> c) { return c->Equals(c2); }
00091 inline static bool Equals(const Null & c2, char c) { return 0 == c; }
00092 inline static bool Equals(const Null & c2, bool c) { return false == c; }
00093 inline static bool Equals(const Null & c2, byte c) { return 0 == c; }
00094 inline static bool Equals(const Null & c2, int16 c) { return c == 0; }
00095 inline static bool Equals(const Null & c2, int32 c) { return c == 0; }
00096 inline static bool Equals(const Null & c2, int64 c) { return c == 0; }
00097 inline static bool Equals(const Null & c2, uint32 c) { return c == 0; }
00098 inline static bool Equals(const Null & c2, uint64 c) { return c == 0; }
00099 inline static bool Equals(const Null & c2, BigInteger& c) { return c == 0L; }
00100 inline static bool Equals(const Null & c2, float32 c) { return c == 0; }
00101 inline static bool Equals(const Null & c2, float64 c) { return c == 0; }
00102 inline static bool Equals(const Null & c2, const DateTime& c) { return false; }
00103 inline static bool Equals(const Null & c2, const Date& c) { return false; }
00104 inline static bool Equals(const Null & c2, const String& c) { return false; }
00105 inline static bool Equals(const Null & c2, const StringPtr& c) { return false; }
00106 inline static bool Equals(const Null & c2, const IConvertable& c) { return false; }
00107
00108 inline static bool Equals(const IComparable & c2, const Null& c) { return c.Equals(c2); }
00109 inline static bool Equals(const IComparable & c2, const IComparable& c) { return c2.Equals(c); }
00110 inline static bool Equals(const IComparable & c2, const RefCountPtr<IComparable>& c) { return c2.Equals(*c); }
00111 inline static bool Equals(const IComparable & c2, char c) { return false; }
00112 inline static bool Equals(const IComparable & c2, bool c) { return false; }
00113 inline static bool Equals(const IComparable & c2, byte c) { return false; }
00114 inline static bool Equals(const IComparable & c2, int16 c) { return false; }
00115 inline static bool Equals(const IComparable & c2, int32 c) { return false; }
00116 inline static bool Equals(const IComparable & c2, int64 c) { return false; }
00117 inline static bool Equals(const IComparable & c2, uint32 c) { return false; }
00118 inline static bool Equals(const IComparable & c2, uint64 c) { return false; }
00119 inline static bool Equals(const IComparable & c2, BigInteger& c) { c2.Equals(c); }
00120 inline static bool Equals(const IComparable & c2, float32 c) { return false; }
00121 inline static bool Equals(const IComparable & c2, float64 c) { return false; }
00122 inline static bool Equals(const IComparable & c2, const DateTime& c) { return c2.Equals(c); }
00123 inline static bool Equals(const IComparable & c2, const Date& c) { return c2.Equals(c); }
00124 inline static bool Equals(const IComparable & c2, const String& c) { return c2.Equals(c); }
00125 inline static bool Equals(const IComparable & c2, const StringPtr& c) { return c2.Equals(*c); }
00126 inline static bool Equals(const IComparable & c2, const IConvertable& c) { return c2.Equals(c); }
00127
00128 inline static bool Equals(char c2, const Null& c) { return false; }
00129 inline static bool Equals(char c2, const IComparable& c) { return false; }
00130 inline static bool Equals(char c2, const RefCountPtr<IComparable> c) { return false; }
00131 inline static bool Equals(char c2, char c) { return c2 == c; }
00132 inline static bool Equals(char c2, bool c) { return false; }
00133 inline static bool Equals(char c2, byte c) { return c2 == (char)c; }
00134 inline static bool Equals(char c2, int16 c) { return (int16)c2 == c; }
00135 inline static bool Equals(char c2, int32 c) { return (int32)c2 == c; }
00136 inline static bool Equals(char c2, int64 c) { return (int64)c2 == c; }
00137 inline static bool Equals(char c2, uint32 c) { return (uint32)c2 == c; }
00138 inline static bool Equals(char c2, uint64 c) { return (uint64)c2 == c; }
00139 inline static bool Equals(char c2, BigInteger& c) { return false; }
00140 inline static bool Equals(char c2, float32 c) { return false; }
00141 inline static bool Equals(char c2, float64 c) { return false; }
00142 inline static bool Equals(char c2, const DateTime& c) { return false; }
00143 inline static bool Equals(char c2, const Date& c) { return false; }
00144 inline static bool Equals(char c2, const String& c) { return c.Length() == 1 && c2 == c.CharAt(0); }
00145 inline static bool Equals(char c2, const StringPtr& c) { return c->Length() == 1 && c2 == c->CharAt(0); }
00146 inline static bool Equals(char c2, const IConvertable& c) { char ch; return c.ToChar(ch) && ch == c2; }
00147
00148 inline static bool Equals(bool c2, const Null& c) { return c2 == false; }
00149 inline static bool Equals(bool c2, const IComparable& c) { return false; }
00150 inline static bool Equals(bool c2, const RefCountPtr<IComparable> c) { return false; }
00151 inline static bool Equals(bool c2, char c) { return c2 == (c != 0); }
00152 inline static bool Equals(bool c2, bool c) { return c2 == c; }
00153 inline static bool Equals(bool c2, byte c) { return c2 == (c != 0); }
00154 inline static bool Equals(bool c2, int16 c) { return c2 == (c != 0); }
00155 inline static bool Equals(bool c2, int32 c) { return c2 == (c != 0); }
00156 inline static bool Equals(bool c2, int64 c) { return c2 == (c != 0); }
00157 inline static bool Equals(bool c2, uint32 c) { return c2 == (c != 0); }
00158 inline static bool Equals(bool c2, uint64 c) { return c2 == (c != 0); }
00159 inline static bool Equals(bool c2, BigInteger& c) { return c2 == (c != 0); }
00160 inline static bool Equals(bool c2, float32 c) { return c2 == (c != 0); }
00161 inline static bool Equals(bool c2, float64 c) { return c2 == (c != 0); }
00162 inline static bool Equals(bool c2, const DateTime& c) { return false; }
00163 inline static bool Equals(bool c2, const Date& c) { return false; }
00164 inline static bool Equals(bool c2, const String& c) { return c2 == (c.Length() != 0); }
00165 inline static bool Equals(bool c2, const StringPtr& c) { return c2 == (c->Length() != 0); }
00166 inline static bool Equals(bool c2, const IConvertable& c) { bool b; return c.ToBool(b) && b == c2; }
00167
00168 inline static bool Equals(byte c2, const Null& c) { return c2 == 0; }
00169 inline static bool Equals(byte c2, const IComparable& c) { return false; }
00170 inline static bool Equals(byte c2, const RefCountPtr<IComparable> c) { return false; }
00171 inline static bool Equals(byte c2, char c) { return (char)c2 == c; }
00172 inline static bool Equals(byte c2, bool c) { return c2 != 0; }
00173 inline static bool Equals(byte c2, byte c) { return c2 == c; }
00174 inline static bool Equals(byte c2, int16 c) { return (int16)c2 == c; }
00175 inline static bool Equals(byte c2, int32 c) { return (int32)c2 == c; }
00176 inline static bool Equals(byte c2, int64 c) { return (int64)c2 == c; }
00177 inline static bool Equals(byte c2, uint32 c) { return (uint32)c2 == c; }
00178 inline static bool Equals(byte c2, uint64 c) { return (uint64)c2 == c; }
00179 inline static bool Equals(byte c2, BigInteger& c) { return c.ToInt() == (int64)c2; }
00180 inline static bool Equals(byte c2, float32 c) { return (float32)c2 == c; }
00181 inline static bool Equals(byte c2, float64 c) { return (float64)c2 == c; }
00182 inline static bool Equals(byte c2, const DateTime& c) { return false; }
00183 inline static bool Equals(byte c2, const Date& c) { return false; }
00184 inline static bool Equals(byte c2, const String& c) { return c == *UInt32::ToString((uint32)c2); }
00185 inline static bool Equals(byte c2, const StringPtr& c) { return *c == *UInt32::ToString((uint32)c2); }
00186 inline static bool Equals(byte c2, const IConvertable& c) { byte b; return c.ToByte(b) && b == c2; }
00187
00188 inline static bool Equals(int16 c2, const Null& c) { return c2 == 0; }
00189 inline static bool Equals(int16 c2, const IComparable& c) { return false; }
00190 inline static bool Equals(int16 c2, const RefCountPtr<IComparable> c) { return false; }
00191 inline static bool Equals(int16 c2, char c) { return c2 == (int16)c; }
00192 inline static bool Equals(int16 c2, bool c) { return c2 != 0; }
00193 inline static bool Equals(int16 c2, byte c) { return c2 == (int16)c; }
00194 inline static bool Equals(int16 c2, int16 c) { return c2 == c; }
00195 inline static bool Equals(int16 c2, int32 c) { return (int32)c2 == c; }
00196 inline static bool Equals(int16 c2, int64 c) { return (int64)c2 == c; }
00197 inline static bool Equals(int16 c2, uint32 c) { return (uint32)c2 == c; }
00198 inline static bool Equals(int16 c2, uint64 c) { return (uint64)c2 == c; }
00199 inline static bool Equals(int16 c2, BigInteger& c) { return c.ToInt() == (int64)c2; }
00200 inline static bool Equals(int16 c2, float32 c) { return (float32)c2 == c; }
00201 inline static bool Equals(int16 c2, float64 c) { return (float64)c2 == c; }
00202 inline static bool Equals(int16 c2, const DateTime& c) { return false; }
00203 inline static bool Equals(int16 c2, const Date& c) { return false; }
00204 inline static bool Equals(int16 c2, const String& c) { return c == *Int32::ToString((int32)c2); }
00205 inline static bool Equals(int16 c2, const StringPtr& c) { return *c == *Int32::ToString((int32)c2); }
00206 inline static bool Equals(int16 c2, const IConvertable& c) { int16 i; return c.ToInt16(i) && i == c2; }
00207
00208 inline static bool Equals(int32 c2, const Null& c) { return c2 == 0; }
00209 inline static bool Equals(int32 c2, const IComparable& c) { return false; }
00210 inline static bool Equals(int32 c2, const RefCountPtr<IComparable> c) { return false; }
00211 inline static bool Equals(int32 c2, char c) { return c2 == (int32)c; }
00212 inline static bool Equals(int32 c2, bool c) { return c2 != 0; }
00213 inline static bool Equals(int32 c2, byte c) { return c2 == (int32)c; }
00214 inline static bool Equals(int32 c2, int16 c) { return c2 == (int32)c; }
00215 inline static bool Equals(int32 c2, int32 c) { return c2 == c; }
00216 inline static bool Equals(int32 c2, int64 c) { return (int64)c2 == c; }
00217 inline static bool Equals(int32 c2, uint32 c) { return (uint32)c2 == c; }
00218 inline static bool Equals(int32 c2, uint64 c) { return (uint64)c2 == c; }
00219 inline static bool Equals(int32 c2, BigInteger& c) { return c.ToInt() == (int64)c2; }
00220 inline static bool Equals(int32 c2, float32 c) { return (float32)c2 == c; }
00221 inline static bool Equals(int32 c2, float64 c) { return (float64)c2 == c; }
00222 inline static bool Equals(int32 c2, const DateTime& c) { return false; }
00223 inline static bool Equals(int32 c2, const Date& c) { return false; }
00224 inline static bool Equals(int32 c2, const String& c) { return c == *Int32::ToString((int32)c2); }
00225 inline static bool Equals(int32 c2, const StringPtr& c) { return *c == *Int32::ToString((int32)c2); }
00226 inline static bool Equals(int32 c2, const IConvertable& c) { int32 i; return c.ToInt32(i) && i == c2; }
00227
00228 inline static bool Equals(int64 c2, const Null& c) { return c2 == 0; }
00229 inline static bool Equals(int64 c2, const IComparable& c) { return false; }
00230 inline static bool Equals(int64 c2, const RefCountPtr<IComparable> c) { return false; }
00231 inline static bool Equals(int64 c2, char c) { return c2 == (int64)c; }
00232 inline static bool Equals(int64 c2, bool c) { return c2 != 0; }
00233 inline static bool Equals(int64 c2, byte c) { return c2 == (int64)c; }
00234 inline static bool Equals(int64 c2, int16 c) { return c2 == (int64)c; }
00235 inline static bool Equals(int64 c2, int32 c) { return c2 == (int64)c; }
00236 inline static bool Equals(int64 c2, int64 c) { return c2 == c; }
00237 inline static bool Equals(int64 c2, uint32 c) { return c2 == (int64)c; }
00238 inline static bool Equals(int64 c2, uint64 c) { return (uint64)c2 == c; }
00239 inline static bool Equals(int64 c2, BigInteger& c) { return c.ToInt() == (int64)c2; }
00240 inline static bool Equals(int64 c2, float32 c) { return (float64)c2 == (float64)c; }
00241 inline static bool Equals(int64 c2, float64 c) { return (float64)c2 == c; }
00242 inline static bool Equals(int64 c2, const DateTime& c) { return false; }
00243 inline static bool Equals(int64 c2, const Date& c) { return false; }
00244 inline static bool Equals(int64 c2, const String& c) { return c == *Int64::ToString((int64)c2); }
00245 inline static bool Equals(int64 c2, const StringPtr& c) { return *c == *Int64::ToString((int64)c2); }
00246 inline static bool Equals(int64 c2, const IConvertable& c) { int64 i; return c.ToInt64(i) && i == c2; }
00247
00248 inline static bool Equals(uint32 c2, const Null& c) { return c2 == 0; }
00249 inline static bool Equals(uint32 c2, const IComparable& c) { return false; }
00250 inline static bool Equals(uint32 c2, const RefCountPtr<IComparable> c) { return false; }
00251 inline static bool Equals(uint32 c2, char c) { return c2 == (uint32)c; }
00252 inline static bool Equals(uint32 c2, bool c) { return c2 != 0; }
00253 inline static bool Equals(uint32 c2, byte c) { return c2 == (uint32)c; }
00254 inline static bool Equals(uint32 c2, int16 c) { return c2 == (uint32)c; }
00255 inline static bool Equals(uint32 c2, int32 c) { return c2 == (uint32)c; }
00256 inline static bool Equals(uint32 c2, int64 c) { return (int64)c2 == c; }
00257 inline static bool Equals(uint32 c2, uint32 c) { return c2 == c; }
00258 inline static bool Equals(uint32 c2, uint64 c) { return (uint64)c2 == c; }
00259 inline static bool Equals(uint32 c2, BigInteger& c) { return c.ToInt() == (int64)c2; }
00260 inline static bool Equals(uint32 c2, float32 c) { return (float32)c2 == c; }
00261 inline static bool Equals(uint32 c2, float64 c) { return (float64)c2 == c; }
00262 inline static bool Equals(uint32 c2, const DateTime& c) { return false; }
00263 inline static bool Equals(uint32 c2, const Date& c) { return false; }
00264 inline static bool Equals(uint32 c2, const String& c) { return c == *UInt32::ToString((uint32)c2); }
00265 inline static bool Equals(uint32 c2, const StringPtr& c) { return *c == *UInt32::ToString((uint32)c2); }
00266 inline static bool Equals(uint32 c2, const IConvertable& c) { uint32 i; return c.ToUInt32(i) && i == c2; }
00267
00268 inline static bool Equals(uint64 c2, const Null& c) { return c2 == 0; }
00269 inline static bool Equals(uint64 c2, const IComparable& c) { return false; }
00270 inline static bool Equals(uint64 c2, const RefCountPtr<IComparable> c) { return false; }
00271 inline static bool Equals(uint64 c2, char c) { return c2 == (uint64)c; }
00272 inline static bool Equals(uint64 c2, bool c) { return c2 != 0; }
00273 inline static bool Equals(uint64 c2, byte c) { return c2 == (uint64)c; }
00274 inline static bool Equals(uint64 c2, int16 c) { return c2 == (uint64)c; }
00275 inline static bool Equals(uint64 c2, int32 c) { return c2 == (uint64)c; }
00276 inline static bool Equals(uint64 c2, int64 c) { return c2 == (uint64)c; }
00277 inline static bool Equals(uint64 c2, uint32 c) { return c2 == (uint64)c; }
00278 inline static bool Equals(uint64 c2, uint64 c) { return c2 == c; }
00279 inline static bool Equals(uint64 c2, BigInteger& c) { return c.ToInt() == (int64)c2; }
00280 inline static bool Equals(uint64 c2, float32 c) { return (float64)c2 == (float64)c; }
00281 inline static bool Equals(uint64 c2, float64 c) { return (float64)c2 == c; }
00282 inline static bool Equals(uint64 c2, const DateTime& c) { return false; }
00283 inline static bool Equals(uint64 c2, const Date& c) { return false; }
00284 inline static bool Equals(uint64 c2, const String& c) { return c == *UInt64::ToString((uint64)c2); }
00285 inline static bool Equals(uint64 c2, const StringPtr& c) { return *c == *UInt64::ToString((uint64)c2); }
00286 inline static bool Equals(uint64 c2, const IConvertable& c) { uint64 i; return c.ToUInt64(i) && i == c2; }
00287
00288 inline static bool Equals(float32 c2, const Null& c) { return false; }
00289 inline static bool Equals(float32 c2, const IComparable& c) { return false; }
00290 inline static bool Equals(float32 c2, const RefCountPtr<IComparable> c) { return false; }
00291 inline static bool Equals(float32 c2, char c) { return c2 == (float32)c; }
00292 inline static bool Equals(float32 c2, bool c) { return c2 != 0; }
00293 inline static bool Equals(float32 c2, byte c) { return c2 == (float32)c; }
00294 inline static bool Equals(float32 c2, int16 c) { return c2 == (float32)c; }
00295 inline static bool Equals(float32 c2, int32 c) { return c2 == (float32)c; }
00296 inline static bool Equals(float32 c2, int64 c) { return c2 == (float32)c; }
00297 inline static bool Equals(float32 c2, uint32 c) { return c2 == (float32)c; }
00298 inline static bool Equals(float32 c2, uint64 c) { return c2 == c; }
00299 inline static bool Equals(float32 c2, BigInteger& c) { return (float64)c.ToInt() == (float64)c2; }
00300 inline static bool Equals(float32 c2, float32 c) { return (float64)c2 == (float64)c; }
00301 inline static bool Equals(float32 c2, float64 c) { return (float64)c2 == c; }
00302 inline static bool Equals(float32 c2, const DateTime& c) { return false; }
00303 inline static bool Equals(float32 c2, const Date& c) { return false; }
00304 inline static bool Equals(float32 c2, const String& c) { return false; }
00305 inline static bool Equals(float32 c2, const StringPtr& c) { return false; }
00306 inline static bool Equals(float32 c2, const IConvertable& c) { float32 i; return c.ToFloat32(i) && i == c2; }
00307
00308 inline static bool Equals(float64 c2, const Null& c) { return false; }
00309 inline static bool Equals(float64 c2, const IComparable& c) { return false; }
00310 inline static bool Equals(float64 c2, const RefCountPtr<IComparable> c) { return false; }
00311 inline static bool Equals(float64 c2, char c) { return c2 == (float64)c; }
00312 inline static bool Equals(float64 c2, bool c) { return c2 != 0; }
00313 inline static bool Equals(float64 c2, byte c) { return c2 == (float64)c; }
00314 inline static bool Equals(float64 c2, int16 c) { return c2 == (float64)c; }
00315 inline static bool Equals(float64 c2, int32 c) { return c2 == (float64)c; }
00316 inline static bool Equals(float64 c2, int64 c) { return c2 == (float64)c; }
00317 inline static bool Equals(float64 c2, uint32 c) { return c2 == (float64)c; }
00318 inline static bool Equals(float64 c2, uint64 c) { return c2 == c; }
00319 inline static bool Equals(float64 c2, BigInteger& c) { return (float64)c.ToInt() == (float64)c2; }
00320 inline static bool Equals(float64 c2, float32 c) { return (float64)c2 == (float64)c; }
00321 inline static bool Equals(float64 c2, float64 c) { return (float64)c2 == c; }
00322 inline static bool Equals(float64 c2, const DateTime& c) { return false; }
00323 inline static bool Equals(float64 c2, const Date& c) { return false; }
00324 inline static bool Equals(float64 c2, const String& c) { return false; }
00325 inline static bool Equals(float64 c2, const StringPtr& c) { return false; }
00326 inline static bool Equals(float64 c2, const IConvertable& c) { float64 i; return c.ToFloat64(i) && i == c2; }
00327
00328 inline static bool Equals(const DateTime& c2, const Null& c) { return false; }
00329 inline static bool Equals(const DateTime& c2, const IComparable& c) { return c.Equals(c2); }
00330 inline static bool Equals(const DateTime& c2, const RefCountPtr<IComparable> c) { return c->Equals(c2); }
00331 inline static bool Equals(const DateTime& c2, char c) { return false; }
00332 inline static bool Equals(const DateTime& c2, bool c) { return false; }
00333 inline static bool Equals(const DateTime& c2, byte c) { return false; }
00334 inline static bool Equals(const DateTime& c2, int16 c) { return false; }
00335 inline static bool Equals(const DateTime& c2, int32 c) { return false; }
00336 inline static bool Equals(const DateTime& c2, int64 c) { return false; }
00337 inline static bool Equals(const DateTime& c2, uint32 c) { return false; }
00338 inline static bool Equals(const DateTime& c2, uint64 c) { return false; }
00339 inline static bool Equals(const DateTime& c2, BigInteger& c) { return false; }
00340 inline static bool Equals(const DateTime& c2, float32 c) { return false; }
00341 inline static bool Equals(const DateTime& c2, float64 c) { return false; }
00342 inline static bool Equals(const DateTime& c2, const DateTime& c) { return c2 == c; }
00343 inline static bool Equals(const DateTime& c2, const Date& c) { return false; }
00344 inline static bool Equals(const DateTime& c2, const String& c) { return false; }
00345 inline static bool Equals(const DateTime& c2, const StringPtr& c) { return false; }
00346 inline static bool Equals(const DateTime& c2, const IConvertable& c) { DateTime i; return c.ToDateTime(i) && i == c2; }
00347
00348 inline static bool Equals(const Date& c2, const Null& c) { return false; }
00349 inline static bool Equals(const Date& c2, const IComparable& c) { return c.Equals(c2); }
00350 inline static bool Equals(const Date& c2, const RefCountPtr<IComparable> c) { return c->Equals(c2); }
00351 inline static bool Equals(const Date& c2, char c) { return false; }
00352 inline static bool Equals(const Date& c2, bool c) { return false; }
00353 inline static bool Equals(const Date& c2, byte c) { return false; }
00354 inline static bool Equals(const Date& c2, int16 c) { return false; }
00355 inline static bool Equals(const Date& c2, int32 c) { return false; }
00356 inline static bool Equals(const Date& c2, int64 c) { return false; }
00357 inline static bool Equals(const Date& c2, uint32 c) { return false; }
00358 inline static bool Equals(const Date& c2, uint64 c) { return false; }
00359 inline static bool Equals(const Date& c2, BigInteger& c) { return false; }
00360 inline static bool Equals(const Date& c2, float32 c) { return false; }
00361 inline static bool Equals(const Date& c2, float64 c) { return false; }
00362 inline static bool Equals(const Date& c2, const DateTime& c) { return false; }
00363 inline static bool Equals(const Date& c2, const Date& c) { return c2 == c; }
00364 inline static bool Equals(const Date& c2, const String& c) { return false; }
00365 inline static bool Equals(const Date& c2, const StringPtr& c) { return false; }
00366 inline static bool Equals(const Date& c2, const IConvertable& c) { Date i; return c.ToDate(i) && i == c2; }
00367
00368 inline static bool Equals(const String& c2, const Null& c) { return false; }
00369 inline static bool Equals(const String& c2, const IComparable& c) { return c.Equals(c2); }
00370 inline static bool Equals(const String& c2, const RefCountPtr<IComparable> c) { return c->Equals(c2); }
00371 inline static bool Equals(const String& c2, char c) { return false; }
00372 inline static bool Equals(const String& c2, bool c) { return false; }
00373 inline static bool Equals(const String& c2, byte c) { return false; }
00374 inline static bool Equals(const String& c2, int16 c) { return false; }
00375 inline static bool Equals(const String& c2, int32 c) { return false; }
00376 inline static bool Equals(const String& c2, int64 c) { return false; }
00377 inline static bool Equals(const String& c2, uint32 c) { return false; }
00378 inline static bool Equals(const String& c2, uint64 c) { return false; }
00379 inline static bool Equals(const String& c2, BigInteger& c) { return false; }
00380 inline static bool Equals(const String& c2, float32 c) { return false; }
00381 inline static bool Equals(const String& c2, float64 c) { return false; }
00382 inline static bool Equals(const String& c2, const DateTime& c) { return false; }
00383 inline static bool Equals(const String& c2, const Date& c) { return false; }
00384 inline static bool Equals(const String& c2, const String& c) { return c2 == c; }
00385 inline static bool Equals(const String& c2, const StringPtr& c) { return c2 == *c; }
00386 inline static bool Equals(const String& c2, const IConvertable& c) { String i; return c.ToString(i) && i == c2; }
00387
00388 inline static bool Equals(const StringPtr& c2, const Null& c) { return false; }
00389 inline static bool Equals(const StringPtr& c2, const IComparable& c) { return c.Equals(c2); }
00390 inline static bool Equals(const StringPtr& c2, const RefCountPtr<IComparable> c) { return c->Equals(*c2); }
00391 inline static bool Equals(const StringPtr& c2, char c) { return false; }
00392 inline static bool Equals(const StringPtr& c2, bool c) { return false; }
00393 inline static bool Equals(const StringPtr& c2, byte c) { return false; }
00394 inline static bool Equals(const StringPtr& c2, int16 c) { return false; }
00395 inline static bool Equals(const StringPtr& c2, int32 c) { return false; }
00396 inline static bool Equals(const StringPtr& c2, int64 c) { return false; }
00397 inline static bool Equals(const StringPtr& c2, uint32 c) { return false; }
00398 inline static bool Equals(const StringPtr& c2, uint64 c) { return false; }
00399 inline static bool Equals(const StringPtr& c2, BigInteger& c) { return false; }
00400 inline static bool Equals(const StringPtr& c2, float32 c) { return false; }
00401 inline static bool Equals(const StringPtr& c2, float64 c) { return false; }
00402 inline static bool Equals(const StringPtr& c2, const DateTime& c) { return false; }
00403 inline static bool Equals(const StringPtr& c2, const Date& c) { return false; }
00404 inline static bool Equals(const StringPtr& c2, const String& c) { return *c2 == c; }
00405 inline static bool Equals(const StringPtr& c2, const StringPtr& c) { return *c2 == *c; }
00406 inline static bool Equals(const StringPtr& c2, const IConvertable& c) { String i; return c.ToString(i) && i == *c2; }
00407
00408 inline static bool Equals(const IConvertable & c2, const Null& c) { return false; }
00409 inline static bool Equals(const IConvertable & c2, const IComparable& c) { return false; }
00410 inline static bool Equals(const IConvertable & c2, const RefCountPtr<IComparable> c) { return false; }
00411 inline static bool Equals(const IConvertable & c2, char c) { char ch; return c2.ToChar(ch) && ch == c; }
00412 inline static bool Equals(const IConvertable & c2, bool c) { bool b; return c2.ToBool(b) && b == c; }
00413 inline static bool Equals(const IConvertable & c2, byte c) { byte b; return c2.ToByte(b) && b == c; }
00414 inline static bool Equals(const IConvertable & c2, int16 c) { int16 i; return c2.ToInt16(i) && i == c; }
00415 inline static bool Equals(const IConvertable & c2, int32 c) { int32 i; return c2.ToInt32(i) && i == c; }
00416 inline static bool Equals(const IConvertable & c2, int64 c) { int64 i; return c2.ToInt64(i) && i == c; }
00417 inline static bool Equals(const IConvertable & c2, uint32 c) { uint32 i; return c2.ToUInt32(i) && i == c; }
00418 inline static bool Equals(const IConvertable & c2, uint64 c) { uint64 i; return c2.ToUInt64(i) && i == c; }
00419 inline static bool Equals(const IConvertable & c2, BigInteger& c) { return false; }
00420 inline static bool Equals(const IConvertable & c2, float32 c) { float32 d; return c2.ToFloat32(d) && d == c; }
00421 inline static bool Equals(const IConvertable & c2, float64 c) { float64 d; return c2.ToFloat64(d) && d == c; }
00422 inline static bool Equals(const IConvertable & c2, const DateTime& c) { DateTime dtm; return c2.ToDateTime(dtm) && dtm == c; }
00423 inline static bool Equals(const IConvertable & c2, const Date& c) { Date dt; return c2.ToDate(dt) && dt == c; }
00424 inline static bool Equals(const IConvertable & c2, const String& c) { String s; return c2.ToString(s) && s == c; }
00425 inline static bool Equals(const IConvertable & c2, const StringPtr& c) { String s; return c2.ToString(s) && s == *c; }
00426 inline static bool Equals(const IConvertable & c2, const IConvertable& c) { return c2.Equals(c); }
00427
00428 inline static int64 Cmp(const Null & c2, const Null& c) { return 0; }
00429 inline static int64 Cmp(const Null & c2, const IComparable& c) { return c2.Compare(c); }
00430 inline static int64 Cmp(const Null & c2, const RefCountPtr<IComparable> c) { return c2.Compare(*c); }
00431 inline static int64 Cmp(const Null & c2, char c) { return -(int)c; }
00432 inline static int64 Cmp(const Null & c2, bool c) { return -1; }
00433 inline static int64 Cmp(const Null & c2, byte c) { return -(int)c; }
00434 inline static int64 Cmp(const Null & c2, int16 c) { return -c; }
00435 inline static int64 Cmp(const Null & c2, int32 c) { return -c; }
00436 inline static int64 Cmp(const Null & c2, int64 c) { return -1; }
00437 inline static int64 Cmp(const Null & c2, uint32 c) { return -1; }
00438 inline static int64 Cmp(const Null & c2, uint64 c) { return -1; }
00439 inline static int64 Cmp(const Null & c2, BigInteger& c) { return -1; }
00440 inline static int64 Cmp(const Null & c2, float32 c) { return -1; }
00441 inline static int64 Cmp(const Null & c2, float64 c) { return -1; }
00442 inline static int64 Cmp(const Null & c2, const DateTime& c) { return -1; }
00443 inline static int64 Cmp(const Null & c2, const Date& c) { return -1; }
00444 inline static int64 Cmp(const Null & c2, const String& c) { return -1; }
00445 inline static int64 Cmp(const Null & c2, const StringPtr& c) { return -1; }
00446 inline static int64 Cmp(const Null & c2, const IConvertable& c) { return -1; }
00447
00448 inline static int64 Cmp(const IComparable & c2, const Null& c) { return c2.Compare(c); }
00449 inline static int64 Cmp(const IComparable & c2, const IComparable& c) { return c2.Compare(c); }
00450 inline static int64 Cmp(const IComparable & c2, const RefCountPtr<IComparable> c) { return c2.Compare(*c); }
00451 inline static int64 Cmp(const IComparable & c2, char c) { return -1; }
00452 inline static int64 Cmp(const IComparable & c2, bool c) { return -1; }
00453 inline static int64 Cmp(const IComparable & c2, byte c) { return -1; }
00454 inline static int64 Cmp(const IComparable & c2, int16 c) { return -1; }
00455 inline static int64 Cmp(const IComparable & c2, int32 c) { return -1; }
00456 inline static int64 Cmp(const IComparable & c2, int64 c) { return -1; }
00457 inline static int64 Cmp(const IComparable & c2, uint32 c) { return -1; }
00458 inline static int64 Cmp(const IComparable & c2, uint64 c) { return -1; }
00459 inline static int64 Cmp(const IComparable & c2, BigInteger& c) { c2.Compare(c); }
00460 inline static int64 Cmp(const IComparable & c2, float32 c) { return -1; }
00461 inline static int64 Cmp(const IComparable & c2, float64 c) { return -1; }
00462 inline static int64 Cmp(const IComparable & c2, const DateTime& c) { return c2.Compare(c); }
00463 inline static int64 Cmp(const IComparable & c2, const Date& c) { return c2.Compare(c); }
00464 inline static int64 Cmp(const IComparable & c2, const String& c) { return c2.Compare(c); }
00465 inline static int64 Cmp(const IComparable & c2, const StringPtr& c) { return c2.Compare(c); }
00466 inline static int64 Cmp(const IComparable & c2, const IConvertable& c) { return c2.Compare(c); }
00467
00468 inline static int64 Cmp(char c2, const Null& c) { return 1; }
00469 inline static int64 Cmp(char c2, const IComparable& c) { return 1; }
00470 inline static int64 Cmp(char c2, const RefCountPtr<IComparable> c) { return 1; }
00471 inline static int64 Cmp(char c2, char c) { return (int64)(c2 - c); }
00472 inline static int64 Cmp(char c2, bool c) { return 1; }
00473 inline static int64 Cmp(char c2, byte c) { return (int64)(c2 - (char)c); }
00474 inline static int64 Cmp(char c2, int16 c) { return (int16)c2 - c; }
00475 inline static int64 Cmp(char c2, int32 c) { return (int32)c2 - c; }
00476 inline static int64 Cmp(char c2, int64 c) { return (int64)c2 - c; }
00477 inline static int64 Cmp(char c2, uint32 c) { return (uint32)c2 - c; }
00478 inline static int64 Cmp(char c2, uint64 c) { return (uint64)c2 - c; }
00479 inline static int64 Cmp(char c2, BigInteger& c) { return false; }
00480 inline static int64 Cmp(char c2, float32 c) { return -1; }
00481 inline static int64 Cmp(char c2, float64 c) { return -1; }
00482 inline static int64 Cmp(char c2, const DateTime& c) { return -1; }
00483 inline static int64 Cmp(char c2, const Date& c) { return -1; }
00484 inline static int64 Cmp(char c2, const String& c) { return c.Length() == 1 && c2 == c.CharAt(0) ? 0 : c2 - c.CharAt(0); }
00485 inline static int64 Cmp(char c2, const StringPtr& c) { return c->Length() == 1 && c2 == c->CharAt(0) ? 0 : c2 - c->CharAt(0); }
00486 inline static int64 Cmp(char c2, const IConvertable& c) { char ch; return c.ToChar(ch) ? c2 - ch : -1; }
00487
00488 inline static int64 Cmp(bool c2, const Null& c) { return 1; }
00489 inline static int64 Cmp(bool c2, const IComparable& c) { return -1; }
00490 inline static int64 Cmp(bool c2, const RefCountPtr<IComparable> c) { return -1; }
00491 inline static int64 Cmp(bool c2, char c) { return -1; }
00492 inline static int64 Cmp(bool c2, bool c) { return -1; }
00493 inline static int64 Cmp(bool c2, byte c) { return -1; }
00494 inline static int64 Cmp(bool c2, int16 c) { return -1; }
00495 inline static int64 Cmp(bool c2, int32 c) { return -1; }
00496 inline static int64 Cmp(bool c2, int64 c) { return -1; }
00497 inline static int64 Cmp(bool c2, uint32 c) { return -1; }
00498 inline static int64 Cmp(bool c2, uint64 c) { return -1; }
00499 inline static int64 Cmp(bool c2, BigInteger& c) { return -1; }
00500 inline static int64 Cmp(bool c2, float32 c) { return -1; }
00501 inline static int64 Cmp(bool c2, float64 c) { return -1; }
00502 inline static int64 Cmp(bool c2, const DateTime& c) { return -1; }
00503 inline static int64 Cmp(bool c2, const Date& c) { return -1; }
00504 inline static int64 Cmp(bool c2, const String& c) { return -1; }
00505 inline static int64 Cmp(bool c2, const StringPtr& c) { return -1; }
00506 inline static int64 Cmp(bool c2, const IConvertable& c) { bool b; return c.ToBool(b) ? (b == c2 ? 0 : (b ? -1 : 1)) : -1; }
00507
00508 inline static int64 Cmp(byte c2, const Null& c) { return 1; }
00509 inline static int64 Cmp(byte c2, const IComparable& c) { return -1; }
00510 inline static int64 Cmp(byte c2, const RefCountPtr<IComparable> c) { return -1; }
00511 inline static int64 Cmp(byte c2, char c) { return (char)c2 - c; }
00512 inline static int64 Cmp(byte c2, bool c) { return 1; }
00513 inline static int64 Cmp(byte c2, byte c) { return (int64)(c2 - c); }
00514 inline static int64 Cmp(byte c2, int16 c) { return (int16)c2 - c; }
00515 inline static int64 Cmp(byte c2, int32 c) { return (int32)c2 - c; }
00516 inline static int64 Cmp(byte c2, int64 c) { return (int64)c2 - c; }
00517 inline static int64 Cmp(byte c2, uint32 c) { return (uint32)c2 - c; }
00518 inline static int64 Cmp(byte c2, uint64 c) { return (uint64)c2 - c; }
00519 inline static int64 Cmp(byte c2, BigInteger& c) { return c.ToInt() - (int64)c2; }
00520 inline static int64 Cmp(byte c2, float32 c) { return -1; }
00521 inline static int64 Cmp(byte c2, float64 c) { return -1; }
00522 inline static int64 Cmp(byte c2, const DateTime& c) { return -1; }
00523 inline static int64 Cmp(byte c2, const Date& c) { return -1; }
00524 inline static int64 Cmp(byte c2, const String& c) { return -1; }
00525 inline static int64 Cmp(byte c2, const StringPtr& c) { return -1; }
00526 inline static int64 Cmp(byte c2, const IConvertable& c) { byte b; return c.ToByte(b) ? c2 - b : -1; }
00527
00528 inline static int64 Cmp(int16 c2, const Null& c) { return 1; }
00529 inline static int64 Cmp(int16 c2, const IComparable& c) { return -1; }
00530 inline static int64 Cmp(int16 c2, const RefCountPtr<IComparable> c) { return -1; }
00531 inline static int64 Cmp(int16 c2, char c) { return c2 - (int16)c; }
00532 inline static int64 Cmp(int16 c2, bool c) { return 1; }
00533 inline static int64 Cmp(int16 c2, byte c) { return c2 - (int16)c; }
00534 inline static int64 Cmp(int16 c2, int16 c) { return c2 - c; }
00535 inline static int64 Cmp(int16 c2, int32 c) { return (int32)c2 - c; }
00536 inline static int64 Cmp(int16 c2, int64 c) { return (int64)((int64)c2 - c); }
00537 inline static int64 Cmp(int16 c2, uint32 c) { return (int64)((uint32)c2 - c); }
00538 inline static int64 Cmp(int16 c2, uint64 c) { return (int64)((uint64)c2 - c); }
00539 inline static int64 Cmp(int16 c2, BigInteger& c) { return (int64)(c.ToInt() - (int64)c2); }
00540 inline static int64 Cmp(int16 c2, float32 c) { return -1; }
00541 inline static int64 Cmp(int16 c2, float64 c) { return -1; }
00542 inline static int64 Cmp(int16 c2, const DateTime& c) { return -1; }
00543 inline static int64 Cmp(int16 c2, const Date& c) { return -1; }
00544 inline static int64 Cmp(int16 c2, const String& c) { return -1; }
00545 inline static int64 Cmp(int16 c2, const StringPtr& c) { return -1; }
00546 inline static int64 Cmp(int16 c2, const IConvertable& c) { int16 i; return c.ToInt16(i) ? c2 - i : -1; }
00547
00548 inline static int64 Cmp(int32 c2, const Null& c) { return 1; }
00549 inline static int64 Cmp(int32 c2, const IComparable& c) { return -1; }
00550 inline static int64 Cmp(int32 c2, const RefCountPtr<IComparable> c) { return -1; }
00551 inline static int64 Cmp(int32 c2, char c) { return c2 - (int32)c; }
00552 inline static int64 Cmp(int32 c2, bool c) { return 1; }
00553 inline static int64 Cmp(int32 c2, byte c) { return c2 - (int32)c; }
00554 inline static int64 Cmp(int32 c2, int16 c) { return c2 - (int32)c; }
00555 inline static int64 Cmp(int32 c2, int32 c) { return c2 - c; }
00556 inline static int64 Cmp(int32 c2, int64 c) { return (int64)((int64)c2 - c); }
00557 inline static int64 Cmp(int32 c2, uint32 c) { return (int64)((uint32)c2 - c); }
00558 inline static int64 Cmp(int32 c2, uint64 c) { return (int64)((uint64)c2 - c); }
00559 inline static int64 Cmp(int32 c2, BigInteger& c) { return (int64)(c.ToInt() - (int64)c2); }
00560 inline static int64 Cmp(int32 c2, float32 c) { return -1; }
00561 inline static int64 Cmp(int32 c2, float64 c) { return -1; }
00562 inline static int64 Cmp(int32 c2, const DateTime& c) { return -1; }
00563 inline static int64 Cmp(int32 c2, const Date& c) { return -1; }
00564 inline static int64 Cmp(int32 c2, const String& c) { return -1; }
00565 inline static int64 Cmp(int32 c2, const StringPtr& c) { return -1; }
00566 inline static int64 Cmp(int32 c2, const IConvertable& c) { int32 i; return c.ToInt32(i) ? c2 - i : -1; }
00567
00568 inline static int64 Cmp(int64 c2, const Null& c) { return 1; }
00569 inline static int64 Cmp(int64 c2, const IComparable& c) { return -1; }
00570 inline static int64 Cmp(int64 c2, const RefCountPtr<IComparable> c) { return -1; }
00571 inline static int64 Cmp(int64 c2, char c) { return (int64)(c2 - (int64)c); }
00572 inline static int64 Cmp(int64 c2, bool c) { return 1; }
00573 inline static int64 Cmp(int64 c2, byte c) { return (int64)(c2 - (int64)c); }
00574 inline static int64 Cmp(int64 c2, int16 c) { return (int64)(c2 - (int64)c); }
00575 inline static int64 Cmp(int64 c2, int32 c) { return (int64)(c2 - (int64)c); }
00576 inline static int64 Cmp(int64 c2, int64 c) { return (int64)(c2 - c); }
00577 inline static int64 Cmp(int64 c2, uint32 c) { return (int64)(c2 - (int64)c); }
00578 inline static int64 Cmp(int64 c2, uint64 c) { return (int64)((uint64)c2 - c); }
00579 inline static int64 Cmp(int64 c2, BigInteger& c) { return (int64)(c.ToInt() - (int64)c2); }
00580 inline static int64 Cmp(int64 c2, float32 c) { return -1; }
00581 inline static int64 Cmp(int64 c2, float64 c) { return -1; }
00582 inline static int64 Cmp(int64 c2, const DateTime& c) { return -1; }
00583 inline static int64 Cmp(int64 c2, const Date& c) { return -1; }
00584 inline static int64 Cmp(int64 c2, const String& c) { return -1; }
00585 inline static int64 Cmp(int64 c2, const StringPtr& c) { return -1; }
00586 inline static int64 Cmp(int64 c2, const IConvertable& c) { int64 i; return c.ToInt64(i) ? c2 - i : -1; }
00587
00588 inline static int64 Cmp(uint32 c2, const Null& c) { return 1; }
00589 inline static int64 Cmp(uint32 c2, const IComparable& c) { return -1; }
00590 inline static int64 Cmp(uint32 c2, const RefCountPtr<IComparable> c) { return -1; }
00591 inline static int64 Cmp(uint32 c2, char c) { return (int64)(c2 - (uint32)c); }
00592 inline static int64 Cmp(uint32 c2, bool c) { return 1; }
00593 inline static int64 Cmp(uint32 c2, byte c) { return (int64)(c2 - (uint32)c); }
00594 inline static int64 Cmp(uint32 c2, int16 c) { return (int64)(c2 - (uint32)c); }
00595 inline static int64 Cmp(uint32 c2, int32 c) { return (int64)(c2 - (uint32)c); }
00596 inline static int64 Cmp(uint32 c2, int64 c) { return (int64)((int64)c2 - c); }
00597 inline static int64 Cmp(uint32 c2, uint32 c) { return (int64)(c2 - c); }
00598 inline static int64 Cmp(uint32 c2, uint64 c) { return (int64)((uint64)c2 - c); }
00599 inline static int64 Cmp(uint32 c2, BigInteger& c) { return (int64)(c.ToInt() - (int64)c2); }
00600 inline static int64 Cmp(uint32 c2, float32 c) { return -1; }
00601 inline static int64 Cmp(uint32 c2, float64 c) { return -1; }
00602 inline static int64 Cmp(uint32 c2, const DateTime& c) { return -1; }
00603 inline static int64 Cmp(uint32 c2, const Date& c) { return -1; }
00604 inline static int64 Cmp(uint32 c2, const String& c) { return -1; }
00605 inline static int64 Cmp(uint32 c2, const StringPtr& c) { return -1; }
00606 inline static int64 Cmp(uint32 c2, const IConvertable& c) { uint32 i; return c.ToUInt32(i) ? (int64)c2 - (int64)i : -1; }
00607
00608 inline static int64 Cmp(uint64 c2, const Null& c) { return 1; }
00609 inline static int64 Cmp(uint64 c2, const IComparable& c) { return -1; }
00610 inline static int64 Cmp(uint64 c2, const RefCountPtr<IComparable> c) { return -1; }
00611 inline static int64 Cmp(uint64 c2, char c) { return (int64)(c2 - (uint64)c); }
00612 inline static int64 Cmp(uint64 c2, bool c) { return 1; }
00613 inline static int64 Cmp(uint64 c2, byte c) { return (int64)(c2 - (uint64)c); }
00614 inline static int64 Cmp(uint64 c2, int16 c) { return (int64)(c2 - (uint64)c); }
00615 inline static int64 Cmp(uint64 c2, int32 c) { return (int64)(c2 - (uint64)c); }
00616 inline static int64 Cmp(uint64 c2, int64 c) { return (int64)(c2 - (uint64)c); }
00617 inline static int64 Cmp(uint64 c2, uint32 c) { return (int64)(c2 - (uint64)c); }
00618 inline static int64 Cmp(uint64 c2, uint64 c) { return (int64)(c2 - c); }
00619 inline static int64 Cmp(uint64 c2, BigInteger& c) { return (int64)(c.ToInt() - (int64)c2); }
00620 inline static int64 Cmp(uint64 c2, float32 c) { return -1; }
00621 inline static int64 Cmp(uint64 c2, float64 c) { return -1; }
00622 inline static int64 Cmp(uint64 c2, const DateTime& c) { return -1; }
00623 inline static int64 Cmp(uint64 c2, const Date& c) { return -1; }
00624 inline static int64 Cmp(uint64 c2, const String& c) { return -1; }
00625 inline static int64 Cmp(uint64 c2, const StringPtr& c) { return -1; }
00626 inline static int64 Cmp(uint64 c2, const IConvertable& c) { uint64 i; return c.ToUInt64(i) ? (int64)c2 - (int64)i : -1; }
00627
00628 inline static int64 Cmp(float32 c2, const Null& c) { return 1; }
00629 inline static int64 Cmp(float32 c2, const IComparable& c) { return -1; }
00630 inline static int64 Cmp(float32 c2, const RefCountPtr<IComparable> c) { return -1; }
00631 inline static int64 Cmp(float32 c2, char c) { return 1; }
00632 inline static int64 Cmp(float32 c2, bool c) { return 1; }
00633 inline static int64 Cmp(float32 c2, byte c) { return 1; }
00634 inline static int64 Cmp(float32 c2, int16 c) { return c2 > c ? 1 : (c2 == c ? 0 : -1); }
00635 inline static int64 Cmp(float32 c2, int32 c) { return c2 > c ? 1 : (c2 == c ? 0 : -1); }
00636 inline static int64 Cmp(float32 c2, int64 c) { return c2 > c ? 1 : (c2 == c ? 0 : -1); }
00637 inline static int64 Cmp(float32 c2, uint32 c) { return c2 > c ? 1 : (c2 == c ? 0 : -1); }
00638 inline static int64 Cmp(float32 c2, uint64 c) { return c2 > c ? 1 : (c2 == c ? 0 : -1); }
00639 inline static int64 Cmp(float32 c2, BigInteger& c) { return 1; }
00640 inline static int64 Cmp(float32 c2, float32 c) { return c2 > c ? 1 : (c2 == c ? 0 : -1); }
00641 inline static int64 Cmp(float32 c2, float64 c) { return c2 > c ? 1 : (c2 == c ? 0 : -1); }
00642 inline static int64 Cmp(float32 c2, const DateTime& c) { return -1; }
00643 inline static int64 Cmp(float32 c2, const Date& c) { return -1; }
00644 inline static int64 Cmp(float32 c2, const String& c) { return -1; }
00645 inline static int64 Cmp(float32 c2, const StringPtr& c) { return -1; }
00646 inline static int64 Cmp(float32 c2, const IConvertable& c) { float32 i; return c.ToFloat32(i) ? (int64)(c2 - i) : -1; }
00647
00648 inline static int64 Cmp(float64 c2, const Null& c) { return 1; }
00649 inline static int64 Cmp(float64 c2, const IComparable& c) { return -1; }
00650 inline static int64 Cmp(float64 c2, const RefCountPtr<IComparable> c) { return -1; }
00651 inline static int64 Cmp(float64 c2, char c) { return 1; }
00652 inline static int64 Cmp(float64 c2, bool c) { return 1; }
00653 inline static int64 Cmp(float64 c2, byte c) { return 1; }
00654 inline static int64 Cmp(float64 c2, int16 c) { return c2 > c ? 1 : (c2 == c ? 0 : -1); }
00655 inline static int64 Cmp(float64 c2, int32 c) { return c2 > c ? 1 : (c2 == c ? 0 : -1); }
00656 inline static int64 Cmp(float64 c2, int64 c) { return c2 > c ? 1 : (c2 == c ? 0 : -1); }
00657 inline static int64 Cmp(float64 c2, uint32 c) { return c2 > c ? 1 : (c2 == c ? 0 : -1); }
00658 inline static int64 Cmp(float64 c2, uint64 c) { return c2 > c ? 1 : (c2 == c ? 0 : -1); }
00659 inline static int64 Cmp(float64 c2, BigInteger& c) { return 1; }
00660 inline static int64 Cmp(float64 c2, float32 c) { return c2 > c ? 1 : (c2 == c ? 0 : -1); }
00661 inline static int64 Cmp(float64 c2, float64 c) { return c2 > c ? 1 : (c2 == c ? 0 : -1); }
00662 inline static int64 Cmp(float64 c2, const DateTime& c) { return false; }
00663 inline static int64 Cmp(float64 c2, const Date& c) { return false; }
00664 inline static int64 Cmp(float64 c2, const String& c) { return false; }
00665 inline static int64 Cmp(float64 c2, const StringPtr& c) { return false; }
00666 inline static int64 Cmp(float64 c2, const IConvertable& c) { float64 i; return c.ToFloat64(i) ? (int64)(c2 - i) : -1; }
00667
00668 inline static int64 Cmp(const DateTime& c2, const Null& c) { return 1; }
00669 inline static int64 Cmp(const DateTime& c2, const IComparable& c) { return c2.Compare(c); }
00670 inline static int64 Cmp(const DateTime& c2, const RefCountPtr<IComparable> c) { return c2.Compare(*c); }
00671 inline static int64 Cmp(const DateTime& c2, char c) { return 1; }
00672 inline static int64 Cmp(const DateTime& c2, bool c) { return 1; }
00673 inline static int64 Cmp(const DateTime& c2, byte c) { return 1; }
00674 inline static int64 Cmp(const DateTime& c2, int16 c) { return 1; }
00675 inline static int64 Cmp(const DateTime& c2, int32 c) { return 1; }
00676 inline static int64 Cmp(const DateTime& c2, int64 c) { return 1; }
00677 inline static int64 Cmp(const DateTime& c2, uint32 c) { return 1; }
00678 inline static int64 Cmp(const DateTime& c2, uint64 c) { return 1; }
00679 inline static int64 Cmp(const DateTime& c2, BigInteger& c) { return 1; }
00680 inline static int64 Cmp(const DateTime& c2, float32 c) { return 1; }
00681 inline static int64 Cmp(const DateTime& c2, float64 c) { return 1; }
00682 inline static int64 Cmp(const DateTime& c2, const DateTime& c) { return c2.Compare(c); }
00683 inline static int64 Cmp(const DateTime& c2, const Date& c) { return c2.Compare(c); }
00684 inline static int64 Cmp(const DateTime& c2, const String& c) { return -1; }
00685 inline static int64 Cmp(const DateTime& c2, const StringPtr& c) { return -1; }
00686 inline static int64 Cmp(const DateTime& c2, const IConvertable& c) { DateTime i; return c.ToDateTime(i) ? c2.DiffInSeconds(i) : -1; }
00687
00688 inline static int64 Cmp(const Date& c2, const Null& c) { return 1; }
00689 inline static int64 Cmp(const Date& c2, const IComparable& c) { return c2.Compare(c); }
00690 inline static int64 Cmp(const Date& c2, const RefCountPtr<IComparable> c) { return c2.Compare(*c); }
00691 inline static int64 Cmp(const Date& c2, char c) { return 1; }
00692 inline static int64 Cmp(const Date& c2, bool c) { return 1; }
00693 inline static int64 Cmp(const Date& c2, byte c) { return 1; }
00694 inline static int64 Cmp(const Date& c2, int16 c) { return 1; }
00695 inline static int64 Cmp(const Date& c2, int32 c) { return 1; }
00696 inline static int64 Cmp(const Date& c2, int64 c) { return 1; }
00697 inline static int64 Cmp(const Date& c2, uint32 c) { return 1; }
00698 inline static int64 Cmp(const Date& c2, uint64 c) { return 1; }
00699 inline static int64 Cmp(const Date& c2, BigInteger& c) { return 1; }
00700 inline static int64 Cmp(const Date& c2, float32 c) { return 1; }
00701 inline static int64 Cmp(const Date& c2, float64 c) { return 1; }
00702 inline static int64 Cmp(const Date& c2, const DateTime& c) { return c2.Compare(c); }
00703 inline static int64 Cmp(const Date& c2, const Date& c) { return c2.Compare(c); }
00704 inline static int64 Cmp(const Date& c2, const String& c) { return -1; }
00705 inline static int64 Cmp(const Date& c2, const StringPtr& c) { return -1; }
00706 inline static int64 Cmp(const Date& c2, const IConvertable& c) { Date i; return c.ToDate(i) ? c2.DiffInDays(i) : -1; }
00707
00708 inline static int64 Cmp(const String& c2, const Null& c) { return 1; }
00709 inline static int64 Cmp(const String& c2, const IComparable& c) { return c2.Compare(c); }
00710 inline static int64 Cmp(const String& c2, const RefCountPtr<IComparable> c) { return c2.Compare(*c); }
00711 inline static int64 Cmp(const String& c2, char c) { return 1; }
00712 inline static int64 Cmp(const String& c2, bool c) { return 1; }
00713 inline static int64 Cmp(const String& c2, byte c) { return 1; }
00714 inline static int64 Cmp(const String& c2, int16 c) { return 1; }
00715 inline static int64 Cmp(const String& c2, int32 c) { return 1; }
00716 inline static int64 Cmp(const String& c2, int64 c) { return 1; }
00717 inline static int64 Cmp(const String& c2, uint32 c) { return 1; }
00718 inline static int64 Cmp(const String& c2, uint64 c) { return 1; }
00719 inline static int64 Cmp(const String& c2, BigInteger& c) { return 1; }
00720 inline static int64 Cmp(const String& c2, float32 c) { return 1; }
00721 inline static int64 Cmp(const String& c2, float64 c) { return 1; }
00722 inline static int64 Cmp(const String& c2, const DateTime& c) { return 1; }
00723 inline static int64 Cmp(const String& c2, const Date& c) { return 1; }
00724 inline static int64 Cmp(const String& c2, const String& c) { return c2.Compare(c); }
00725 inline static int64 Cmp(const String& c2, const StringPtr& c) { return c2.Compare(*c); }
00726 inline static int64 Cmp(const String& c2, const IConvertable& c) { String i; return c.ToString(i) ? c2.Compare(i) : -1; }
00727
00728 inline static int64 Cmp(const StringPtr& c2, const Null& c) { return 1; }
00729 inline static int64 Cmp(const StringPtr& c2, const IComparable& c) { return c2->Compare(c); }
00730 inline static int64 Cmp(const StringPtr& c2, const RefCountPtr<IComparable> c) { return c2->Compare(*c); }
00731 inline static int64 Cmp(const StringPtr& c2, char c) { return 1; }
00732 inline static int64 Cmp(const StringPtr& c2, bool c) { return 1; }
00733 inline static int64 Cmp(const StringPtr& c2, byte c) { return 1; }
00734 inline static int64 Cmp(const StringPtr& c2, int16 c) { return 1; }
00735 inline static int64 Cmp(const StringPtr& c2, int32 c) { return 1; }
00736 inline static int64 Cmp(const StringPtr& c2, int64 c) { return 1; }
00737 inline static int64 Cmp(const StringPtr& c2, uint32 c) { return 1; }
00738 inline static int64 Cmp(const StringPtr& c2, uint64 c) { return 1; }
00739 inline static int64 Cmp(const StringPtr& c2, BigInteger& c) { return 1; }
00740 inline static int64 Cmp(const StringPtr& c2, float32 c) { return 1; }
00741 inline static int64 Cmp(const StringPtr& c2, float64 c) { return 1; }
00742 inline static int64 Cmp(const StringPtr& c2, const DateTime& c) { return 1; }
00743 inline static int64 Cmp(const StringPtr& c2, const Date& c) { return 1; }
00744 inline static int64 Cmp(const StringPtr& c2, const String& c) { return c2->Compare(c); }
00745 inline static int64 Cmp(const StringPtr& c2, const StringPtr& c) { return c2->Compare(*c); }
00746 inline static int64 Cmp(const StringPtr& c2, const IConvertable& c) { String i; return c.ToString(i) ? c2->Compare(i) : -1; }
00747
00748 inline static int64 Cmp(const IConvertable & c2, const Null& c) { return 1; }
00749 inline static int64 Cmp(const IConvertable & c2, const IComparable& c) { return 1; }
00750 inline static int64 Cmp(const IConvertable & c2, const RefCountPtr<IComparable> c) { return 1; }
00751 inline static int64 Cmp(const IConvertable & c2, char c) { char ch; return c2.ToChar(ch) ? ch - c : 1; }
00752 inline static int64 Cmp(const IConvertable & c2, bool c) { bool b; return c2.ToBool(b) ? (b == c ? 0 : (b ? 1 : -1)) : 1; }
00753 inline static int64 Cmp(const IConvertable & c2, byte c) { byte b; return c2.ToByte(b) ? b - c : 1; }
00754 inline static int64 Cmp(const IConvertable & c2, int16 c) { int16 i; return c2.ToInt16(i) ? i - c : 1; }
00755 inline static int64 Cmp(const IConvertable & c2, int32 c) { int32 i; return c2.ToInt32(i) ? i - c : 1; }
00756 inline static int64 Cmp(const IConvertable & c2, int64 c) { int64 i; return c2.ToInt64(i) ? i - c : 1; }
00757 inline static int64 Cmp(const IConvertable & c2, uint32 c) { uint32 i; return c2.ToUInt32(i) ? (i == c ? 0 : (i > c ? 1 : -1)) : 1; }
00758 inline static int64 Cmp(const IConvertable & c2, uint64 c) { uint64 i; return c2.ToUInt64(i) ? (i == c ? 0 : (i > c ? 1 : -1)) : 1; ; }
00759 inline static int64 Cmp(const IConvertable & c2, BigInteger& c) { return 1; }
00760 inline static int64 Cmp(const IConvertable & c2, float32 c) { float32 d; return c2.ToFloat32(d) ? (int64)(d - c) : 1; }
00761 inline static int64 Cmp(const IConvertable & c2, float64 c) { float64 d; return c2.ToFloat64(d) ? (int64)(d - c) : 1; }
00762 inline static int64 Cmp(const IConvertable & c2, const DateTime& c) { DateTime dtm; return c2.ToDateTime(dtm) ? dtm.DiffInSeconds(c) : 1; }
00763 inline static int64 Cmp(const IConvertable & c2, const Date& c) { Date dt; return c2.ToDate(dt) ? dt.DiffInDays(c) : 1; }
00764 inline static int64 Cmp(const IConvertable & c2, const String& c) { String s; return c2.ToString(s) ? s.Compare(c) : 1; }
00765 inline static int64 Cmp(const IConvertable & c2, const StringPtr& c) { String s; return c2.ToString(s) ? s.Compare(*c) : 1; }
00766 inline static int64 Cmp(const IConvertable & c2, const IConvertable& c) { return c2.Compare(c); }
00767 };
00768
00771 #endif