diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-03-16 07:44:43 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-04-10 18:46:43 +0200 |
commit | 08b159e18527c2d6844e569b1309b5033b4d47c9 (patch) | |
tree | 224a1d6e7c989740e9be806c0f3cc7fc20266eb2 /odb/semantics/relational/index.cxx | |
parent | 9fe60de16cf9411a548c020cae5ac7b9e7938e82 (diff) |
Add initial support for database model serialization to XML
Diffstat (limited to 'odb/semantics/relational/index.cxx')
-rw-r--r-- | odb/semantics/relational/index.cxx | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/odb/semantics/relational/index.cxx b/odb/semantics/relational/index.cxx index 11cce8d..0e62f98 100644 --- a/odb/semantics/relational/index.cxx +++ b/odb/semantics/relational/index.cxx @@ -3,13 +3,40 @@ // license : GNU GPL v3; see accompanying LICENSE file #include <cutl/compiler/type-info.hxx> - -#include <odb/semantics/relational/index.hxx> +#include <odb/semantics/relational.hxx> namespace semantics { namespace relational { + index:: + index (xml::parser& p, uscope& s, graph& g) + : key (p, s, g), + type_ (p.attribute ("type", string ())), + method_ (p.attribute ("method", string ())), + options_ (p.attribute ("options", string ())) + { + } + + void index:: + serialize (xml::serializer& s) const + { + s.start_element (xmlns, "index"); + key::serialize_attributes (s); + + if (!type ().empty ()) + s.attribute ("type", type ()); + + if (!method ().empty ()) + s.attribute ("method", method ()); + + if (!options ().empty ()) + s.attribute ("options", options ()); + + key::serialize_content (s); + s.end_element (); + } + // type info // namespace @@ -18,10 +45,10 @@ namespace semantics { init () { + unameable::parser_map_["index"] = &unameable::parser_impl<index>; + using compiler::type_info; - // index - // { type_info ti (typeid (index)); ti.add_base (typeid (qnameable)); |