aboutsummaryrefslogtreecommitdiff
path: root/xsd/cxx/tree/tree-inline.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-07-03 09:57:09 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-07-03 09:57:09 +0200
commit1a4099b78717b16f632b0e7e0980a27811221e52 (patch)
tree87a63393fc207082b7418987309581a9a79e49a4 /xsd/cxx/tree/tree-inline.cxx
parent06258b8eae3d5af9a1af0206bb5a8e5c80dde455 (diff)
Implement anyType and anySimpleType content representation
anyType as a DOM fragment, similar to wildcards. anySimpleType as a text string.
Diffstat (limited to 'xsd/cxx/tree/tree-inline.cxx')
-rw-r--r--xsd/cxx/tree/tree-inline.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/xsd/cxx/tree/tree-inline.cxx b/xsd/cxx/tree/tree-inline.cxx
index e6ed756..500ee73 100644
--- a/xsd/cxx/tree/tree-inline.cxx
+++ b/xsd/cxx/tree/tree-inline.cxx
@@ -82,6 +82,28 @@ namespace CXX
<< " " << base_type << " (o, f, this)"
<< "{"
<< "}";
+
+ // Comparison operators.
+ //
+ if (options.generate_comparison ())
+ {
+ os << inl
+ << "bool" << endl
+ << "operator== (const " << name << "& x, " <<
+ "const " << name << "& y)"
+ << "{"
+ << "const " << base_type << "& bx (x);"
+ << "return bx == y;"
+ << "}";
+
+ os << inl
+ << "bool" << endl
+ << "operator!= (const " << name << "& x, " <<
+ "const " << name << "& y)"
+ << "{"
+ << "return !(x == y);"
+ << "}";
+ }
}
private: