diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-04-26 15:54:19 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-04-26 15:54:19 +0200 |
commit | 84cb9f184bc24ef7151ab9931b46311b03219b14 (patch) | |
tree | db976c22d0dfacdf7ceae4e0d27f4f1615bf5cb0 /odb/semantics | |
parent | 436031d026eb004865faaa21af5213a6f89a6a85 (diff) |
Add support for table options in changelog, use to handle MySQL engine
Diffstat (limited to 'odb/semantics')
-rw-r--r-- | odb/semantics/relational/table.cxx | 17 | ||||
-rw-r--r-- | odb/semantics/relational/table.hxx | 14 |
2 files changed, 28 insertions, 3 deletions
diff --git a/odb/semantics/relational/table.cxx b/odb/semantics/relational/table.cxx index 17265bd..80add9f 100644 --- a/odb/semantics/relational/table.cxx +++ b/odb/semantics/relational/table.cxx @@ -15,7 +15,8 @@ namespace semantics table:: table (table const& t, qscope& s, graph& g, bool b) : qnameable (t, g), - uscope (t, (b ? s.lookup<table, drop_table> (t.name ()) : 0), g) + uscope (t, (b ? s.lookup<table, drop_table> (t.name ()) : 0), g), + options_ (t.options_) { } @@ -26,7 +27,8 @@ namespace semantics p, (b ? s.lookup<table, drop_table> ( p.attribute<qnameable::name_type> ("name")) : 0), - g) + g), + options_ (p.attribute ("options", string ())) { } @@ -37,10 +39,19 @@ namespace semantics } void table:: + serialize_attributes (xml::serializer& s) const + { + qnameable::serialize_attributes (s); + + if (!options_.empty ()) + s.attribute ("options", options_); + } + + void table:: serialize (xml::serializer& s) const { s.start_element (xmlns, "table"); - qnameable::serialize_attributes (s); + serialize_attributes (s); uscope::serialize_content (s); s.end_element (); } diff --git a/odb/semantics/relational/table.hxx b/odb/semantics/relational/table.hxx index ae4c96c..f46eec1 100644 --- a/odb/semantics/relational/table.hxx +++ b/odb/semantics/relational/table.hxx @@ -14,6 +14,13 @@ namespace semantics class table: public qnameable, public uscope { public: + virtual string const& + options () const {return options_;} + + virtual void + options (string const& o) {options_ = o;} + + public: table (string const& id): qnameable (id) {} table (table const&, qscope&, graph&, bool base = false); table (xml::parser&, qscope&, graph&, bool base = false); @@ -30,6 +37,13 @@ namespace semantics // Resolve ambiguity. // using qnameable::scope; + + protected: + void + serialize_attributes (xml::serializer&) const; + + protected: + string options_; }; class add_table: public table |