aboutsummaryrefslogtreecommitdiff
path: root/libxsde/xsde/cxx/hybrid/base.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-04-02 12:22:38 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-04-02 12:22:38 +0200
commit8336dd4c16d4885989a6d8f0c83a4b401f5cb63b (patch)
tree26ca613e7f3a3fe9fb75bf5bb3b65503661e0ebf /libxsde/xsde/cxx/hybrid/base.hxx
parente4c22d3686da0e973e21eae0561c1169c0eeff36 (diff)
Add support for attributes with default and fixed values.
tests/cxx/hybrid/default: new test tests/cxx/hybrid/binary: update to test default and fixed values
Diffstat (limited to 'libxsde/xsde/cxx/hybrid/base.hxx')
-rw-r--r--libxsde/xsde/cxx/hybrid/base.hxx230
1 files changed, 230 insertions, 0 deletions
diff --git a/libxsde/xsde/cxx/hybrid/base.hxx b/libxsde/xsde/cxx/hybrid/base.hxx
index ba5090d..fdfdeac 100644
--- a/libxsde/xsde/cxx/hybrid/base.hxx
+++ b/libxsde/xsde/cxx/hybrid/base.hxx
@@ -8,6 +8,10 @@
#include <xsde/cxx/config.hxx>
+#ifndef XSDE_STL
+# include <string.h> // strcmp
+#endif
+
namespace xsde
{
namespace cxx
@@ -31,6 +35,18 @@ namespace xsde
bool x_;
};
+ inline bool
+ operator== (const boolean_base& x, const boolean_base& y)
+ {
+ return x.base_value () == y.base_value ();
+ }
+
+ inline bool
+ operator!= (const boolean_base& x, const boolean_base& y)
+ {
+ return !(x == y);
+ }
+
// byte
//
struct byte_base
@@ -48,6 +64,18 @@ namespace xsde
signed char x_;
};
+ inline bool
+ operator== (const byte_base& x, const byte_base& y)
+ {
+ return x.base_value () == y.base_value ();
+ }
+
+ inline bool
+ operator!= (const byte_base& x, const byte_base& y)
+ {
+ return !(x == y);
+ }
+
// unsigned_byte
//
struct unsigned_byte_base
@@ -66,6 +94,18 @@ namespace xsde
unsigned char x_;
};
+ inline bool
+ operator== (const unsigned_byte_base& x, const unsigned_byte_base& y)
+ {
+ return x.base_value () == y.base_value ();
+ }
+
+ inline bool
+ operator!= (const unsigned_byte_base& x, const unsigned_byte_base& y)
+ {
+ return !(x == y);
+ }
+
// short
//
struct short_base
@@ -83,6 +123,18 @@ namespace xsde
short x_;
};
+ inline bool
+ operator== (const short_base& x, const short_base& y)
+ {
+ return x.base_value () == y.base_value ();
+ }
+
+ inline bool
+ operator!= (const short_base& x, const short_base& y)
+ {
+ return !(x == y);
+ }
+
// unsigned_short
//
struct unsigned_short_base
@@ -101,6 +153,18 @@ namespace xsde
unsigned short x_;
};
+ inline bool
+ operator== (const unsigned_short_base& x, const unsigned_short_base& y)
+ {
+ return x.base_value () == y.base_value ();
+ }
+
+ inline bool
+ operator!= (const unsigned_short_base& x, const unsigned_short_base& y)
+ {
+ return !(x == y);
+ }
+
// int
//
struct int_base
@@ -118,6 +182,18 @@ namespace xsde
int x_;
};
+ inline bool
+ operator== (const int_base& x, const int_base& y)
+ {
+ return x.base_value () == y.base_value ();
+ }
+
+ inline bool
+ operator!= (const int_base& x, const int_base& y)
+ {
+ return !(x == y);
+ }
+
// unsigned_int
//
struct unsigned_int_base
@@ -135,6 +211,18 @@ namespace xsde
unsigned int x_;
};
+ inline bool
+ operator== (const unsigned_int_base& x, const unsigned_int_base& y)
+ {
+ return x.base_value () == y.base_value ();
+ }
+
+ inline bool
+ operator!= (const unsigned_int_base& x, const unsigned_int_base& y)
+ {
+ return !(x == y);
+ }
+
// long
//
#ifdef XSDE_LONGLONG
@@ -169,6 +257,18 @@ namespace xsde
};
#endif
+ inline bool
+ operator== (const long_base& x, const long_base& y)
+ {
+ return x.base_value () == y.base_value ();
+ }
+
+ inline bool
+ operator!= (const long_base& x, const long_base& y)
+ {
+ return !(x == y);
+ }
+
// unsigned_long
//
@@ -206,6 +306,18 @@ namespace xsde
};
#endif
+ inline bool
+ operator== (const unsigned_long_base& x, const unsigned_long_base& y)
+ {
+ return x.base_value () == y.base_value ();
+ }
+
+ inline bool
+ operator!= (const unsigned_long_base& x, const unsigned_long_base& y)
+ {
+ return !(x == y);
+ }
+
// integer
//
struct integer_base
@@ -223,6 +335,18 @@ namespace xsde
long x_;
};
+ inline bool
+ operator== (const integer_base& x, const integer_base& y)
+ {
+ return x.base_value () == y.base_value ();
+ }
+
+ inline bool
+ operator!= (const integer_base& x, const integer_base& y)
+ {
+ return !(x == y);
+ }
+
// negative_integer
//
struct negative_integer_base
@@ -240,6 +364,20 @@ namespace xsde
long x_;
};
+ inline bool
+ operator== (const negative_integer_base& x,
+ const negative_integer_base& y)
+ {
+ return x.base_value () == y.base_value ();
+ }
+
+ inline bool
+ operator!= (const negative_integer_base& x,
+ const negative_integer_base& y)
+ {
+ return !(x == y);
+ }
+
// non_positive_integer
//
struct non_positive_integer_base
@@ -257,6 +395,20 @@ namespace xsde
long x_;
};
+ inline bool
+ operator== (const non_positive_integer_base& x,
+ const non_positive_integer_base& y)
+ {
+ return x.base_value () == y.base_value ();
+ }
+
+ inline bool
+ operator!= (const non_positive_integer_base& x,
+ const non_positive_integer_base& y)
+ {
+ return !(x == y);
+ }
+
// positive_integer
//
struct positive_integer_base
@@ -275,6 +427,20 @@ namespace xsde
unsigned long x_;
};
+ inline bool
+ operator== (const positive_integer_base& x,
+ const positive_integer_base& y)
+ {
+ return x.base_value () == y.base_value ();
+ }
+
+ inline bool
+ operator!= (const positive_integer_base& x,
+ const positive_integer_base& y)
+ {
+ return !(x == y);
+ }
+
// non_negative_integer
//
struct non_negative_integer_base
@@ -293,6 +459,20 @@ namespace xsde
unsigned long x_;
};
+ inline bool
+ operator== (const non_negative_integer_base& x,
+ const non_negative_integer_base& y)
+ {
+ return x.base_value () == y.base_value ();
+ }
+
+ inline bool
+ operator!= (const non_negative_integer_base& x,
+ const non_negative_integer_base& y)
+ {
+ return !(x == y);
+ }
+
// float
//
struct float_base
@@ -310,6 +490,18 @@ namespace xsde
float x_;
};
+ inline bool
+ operator== (const float_base& x, const float_base& y)
+ {
+ return x.base_value () == y.base_value ();
+ }
+
+ inline bool
+ operator!= (const float_base& x, const float_base& y)
+ {
+ return !(x == y);
+ }
+
// double
//
struct double_base
@@ -327,6 +519,18 @@ namespace xsde
double x_;
};
+ inline bool
+ operator== (const double_base& x, const double_base& y)
+ {
+ return x.base_value () == y.base_value ();
+ }
+
+ inline bool
+ operator!= (const double_base& x, const double_base& y)
+ {
+ return !(x == y);
+ }
+
// decimal
//
struct decimal_base
@@ -344,6 +548,19 @@ namespace xsde
double x_;
};
+ inline bool
+ operator== (const decimal_base& x, const decimal_base& y)
+ {
+ return x.base_value () == y.base_value ();
+ }
+
+ inline bool
+ operator!= (const decimal_base& x, const decimal_base& y)
+ {
+ return !(x == y);
+ }
+
+#ifndef XSDE_STL
// string
//
struct string_base
@@ -364,6 +581,19 @@ namespace xsde
protected:
char* x_;
};
+
+ inline bool
+ operator== (const string_base& x, const string_base& y)
+ {
+ return strcmp (x.base_value (), y.base_value ()) == 0;
+ }
+
+ inline bool
+ operator!= (const string_base& x, const string_base& y)
+ {
+ return !(x == y);
+ }
+#endif
}
}
}