From f0510d2f90467de8e8f260b47d79a9baaf9bef17 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 17 Sep 2009 07:15:29 +0200 Subject: Start tracking XSD with git --- libxsd/xsd/cxx/tree/type-factory-map.txx | 436 +++++++++++++++++++++++++++++++ 1 file changed, 436 insertions(+) create mode 100644 libxsd/xsd/cxx/tree/type-factory-map.txx (limited to 'libxsd/xsd/cxx/tree/type-factory-map.txx') diff --git a/libxsd/xsd/cxx/tree/type-factory-map.txx b/libxsd/xsd/cxx/tree/type-factory-map.txx new file mode 100644 index 0000000..215f033 --- /dev/null +++ b/libxsd/xsd/cxx/tree/type-factory-map.txx @@ -0,0 +1,436 @@ +// file : xsd/cxx/tree/type-factory-map.txx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include + +#include // xml::{string, transcode} +#include // xml::{prefix, uq_name} +#include // xml::bits::{xml_namespace, etc} + +#include +#include + +namespace xsd +{ + namespace cxx + { + namespace tree + { + // type_factory_map + // + template + type_factory_map:: + type_factory_map () + { + // Register factories for default instantiations of built-in, + // non-fundamental types. + // + + std::basic_string xsd (bits::xml_schema ()); + + + // anyType and anySimpleType. + // + register_type ( + qualified_name (bits::any_type (), xsd), + &factory_impl, + false); + + typedef simple_type simple_type; + register_type ( + qualified_name (bits::any_simple_type (), xsd), + &factory_impl, + false); + + + // Strings + // + typedef string string; + register_type ( + qualified_name (bits::string (), xsd), + &factory_impl, + false); + + typedef normalized_string normalized_string; + register_type ( + qualified_name (bits::normalized_string (), xsd), + &factory_impl, + false); + + typedef token token; + register_type ( + qualified_name (bits::token (), xsd), + &factory_impl, + false); + + typedef name name; + register_type ( + qualified_name (bits::name (), xsd), + &factory_impl, + false); + + typedef nmtoken nmtoken; + register_type ( + qualified_name (bits::nmtoken (), xsd), + &factory_impl, + false); + + typedef nmtokens nmtokens; + register_type ( + qualified_name (bits::nmtokens (), xsd), + &factory_impl, + false); + + typedef ncname ncname; + register_type ( + qualified_name (bits::ncname (), xsd), + &factory_impl, + false); + + typedef language language; + register_type ( + qualified_name (bits::language (), xsd), + &factory_impl, + false); + + + // ID/IDREF. + // + typedef id id; + register_type ( + qualified_name (bits::id (), xsd), + &factory_impl, + false); + + typedef idref idref; + register_type ( + qualified_name (bits::idref (), xsd), + &factory_impl, + false); + + typedef idrefs idrefs; + register_type ( + qualified_name (bits::idrefs (), xsd), + &factory_impl, + false); + + + // URI. + // + typedef uri uri; + register_type ( + qualified_name (bits::any_uri (), xsd), + &factory_impl, + false); + + + // Qualified name. + // + typedef qname qname; + register_type ( + qualified_name (bits::qname (), xsd), + &factory_impl, + false); + + + // Binary. + // + typedef base64_binary base64_binary; + register_type ( + qualified_name (bits::base64_binary (), xsd), + &factory_impl, + false); + + typedef hex_binary hex_binary; + register_type ( + qualified_name (bits::hex_binary (), xsd), + &factory_impl, + false); + + + // Date/time. + // + typedef gday gday; + register_type ( + qualified_name (bits::gday (), xsd), + &factory_impl, + false); + + typedef gmonth gmonth; + register_type ( + qualified_name (bits::gmonth (), xsd), + &factory_impl, + false); + + typedef gyear gyear; + register_type ( + qualified_name (bits::gyear (), xsd), + &factory_impl, + false); + + typedef gmonth_day gmonth_day; + register_type ( + qualified_name (bits::gmonth_day (), xsd), + &factory_impl, + false); + + typedef gyear_month gyear_month; + register_type ( + qualified_name (bits::gyear_month (), xsd), + &factory_impl, + false); + + typedef date date; + register_type ( + qualified_name (bits::date (), xsd), + &factory_impl, + false); + + typedef time time; + register_type ( + qualified_name (bits::time (), xsd), + &factory_impl