From 2615896faa646e5830abf2c269150e1165c66515 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 18 Dec 2020 18:48:46 +0300 Subject: Switch to build2 --- libxsd/xsd/cxx/tree/stream-insertion-map.txx | 355 --------------------------- 1 file changed, 355 deletions(-) delete mode 100644 libxsd/xsd/cxx/tree/stream-insertion-map.txx (limited to 'libxsd/xsd/cxx/tree/stream-insertion-map.txx') diff --git a/libxsd/xsd/cxx/tree/stream-insertion-map.txx b/libxsd/xsd/cxx/tree/stream-insertion-map.txx deleted file mode 100644 index 3fb4b6a..0000000 --- a/libxsd/xsd/cxx/tree/stream-insertion-map.txx +++ /dev/null @@ -1,355 +0,0 @@ -// file : xsd/cxx/tree/stream-insertion-map.txx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include -#include -#include - -namespace xsd -{ - namespace cxx - { - namespace tree - { - // stream_insertion_map - // - template - stream_insertion_map:: - stream_insertion_map () - { - // Register inserters for built-in non-fundamental types. - // - std::basic_string xsd (bits::xml_schema ()); - - - // anyType and anySimpleType. - // - register_type ( - typeid (type), - qualified_name (bits::any_type (), xsd), - &inserter_impl, - false); - - typedef simple_type simple_type; - register_type ( - typeid (simple_type), - qualified_name (bits::any_simple_type (), xsd), - &inserter_impl, - false); - - - // Strings - // - typedef string string; - register_type ( - typeid (string), - qualified_name (bits::string (), xsd), - &inserter_impl, - false); - - typedef normalized_string normalized_string; - register_type ( - typeid (normalized_string), - qualified_name (bits::normalized_string (), xsd), - &inserter_impl, - false); - - typedef token token; - register_type ( - typeid (token), - qualified_name (bits::token (), xsd), - &inserter_impl, - false); - - typedef name name; - register_type ( - typeid (name), - qualified_name (bits::name (), xsd), - &inserter_impl, - false); - - typedef nmtoken nmtoken; - register_type ( - typeid (nmtoken), - qualified_name (bits::nmtoken (), xsd), - &inserter_impl, - false); - - typedef nmtokens nmtokens; - register_type ( - typeid (nmtokens), - qualified_name (bits::nmtokens (), xsd), - &inserter_impl, - false); - - typedef ncname ncname; - register_type ( - typeid (ncname), - qualified_name (bits::ncname (), xsd), - &inserter_impl, - false); - - typedef language language; - register_type ( - typeid (language), - qualified_name (bits::language (), xsd), - &inserter_impl, - false); - - - // ID/IDREF. - // - typedef id id; - register_type ( - typeid (id), - qualified_name (bits::id (), xsd), - &inserter_impl, - false); - - typedef idref idref; - register_type ( - typeid (idref), - qualified_name (bits::idref (), xsd), - &inserter_impl, - false); - - typedef idrefs idrefs; - register_type ( - typeid (idrefs), - qualified_name (bits::idrefs (), xsd), - &inserter_impl, - false); - - - // URI. - // - typedef uri uri; - register_type ( - typeid (uri), - qualified_name (bits::any_uri (), xsd), - &inserter_impl, - false); - - - // Qualified name. - // - typedef qname qname; - register_type ( - typeid (qname), - qualified_name (bits::qname (), xsd), - &inserter_impl, - false); - - - // Binary. - // - typedef base64_binary base64_binary; - register_type ( - typeid (base64_binary), - qualified_name (bits::base64_binary (), xsd), - &inserter_impl, - false); - - typedef hex_binary hex_binary; - register_type ( - typeid (hex_binary), - qualified_name (bits::hex_binary (), xsd), - &inserter_impl, - false); - - - // Date/time. - // - typedef gday gday; - register_type ( - typeid (gday), - qualified_name (bits::gday (), xsd), - &inserter_impl, - false); - - typedef gmonth gmonth; - register_type ( - typeid (gmonth), - qualified_name (bits::gmonth (), xsd), - &inserter_impl, - false); - - typedef gyear gyear; - register_type ( - typeid (gyear), - qualified_name (bits::gyear (), xsd), - &inserter_impl, - false); - - typedef gmonth_day gmonth_day; - register_type ( - typeid (gmonth_day), - qualified_name (bits::gmonth_day (), xsd), - &inserter_impl, - false); - - typedef gyear_month gyear_month; - register_type ( - typeid (gyear_month), - qualified_name (bits::gyear_month (), xsd), - &inserter_impl, - false); - - typedef date date; - register_type ( - typeid (date), - qualified_name (bits::date (), xsd), - &inserter_impl, - false); - - typedef time time; - register_type ( - typeid (time), - qualified_name (bits::time (), xsd), - &inserter_impl, - false); - - typedef date_time date_time; - register_type ( - typeid (date_time), - qualified_name (bits::date_time (), xsd), - &inserter_impl, - false); - - typedef duration duration; - register_type ( - typeid (duration), - qualified_name (bits::duration (), xsd), - &inserter_impl, - false); - - - // Entity. - // - typedef entity entity; - register_type ( - typeid (entity), - qualified_name (bits::entity (), xsd), - &inserter_impl, - false); - - typedef entities entities; - register_type ( - typeid (entities), - qualified_name (bits::entities (), xsd), - &inserter_impl, - false); - } - - template - void stream_insertion_map:: - register_type (const type_id& tid, - const qualified_name& name, - inserter i, - bool replace) - { - if (replace || type_map_.find (&tid) == type_map_.end ()) - type_map_[&tid] = type_info (name, i); - } - - template - void stream_insertion_map:: - unregister_type (const type_id& tid) - { - type_map_.erase (&tid); - } - - template - void stream_insertion_map:: - insert (ostream& s, const type& x) - { - if (const type_info* ti = find (typeid (x))) - { - const qualified_name& qn (ti->name ()); - - // Pool the namespace and name strings. - // - const std::basic_string& ns (qn.namespace_ ()); - const std::basic_string& n (qn.name ()); - - std::size_t ns_id (s.pool_string (ns)); - std::size_t n_id (s.pool_string (n)); - - s << ostream_common::as_size (ns_id); - - if (ns_id == 0) - s << ns; - - s << ostream_common::as_size (n_id); - - if (n_id == 0) - s << n; - - ti->inserter () (s, x); - } - else - throw no_type_info (std::basic_string (), - std::basic_string ()); // @@ TODO - } - - template - const typename stream_insertion_map::type_info* - stream_insertion_map:: - find (const type_id& tid) const - { - typename type_map::const_iterator i (type_map_.find (&tid)); - return i == type_map_.end () ? 0 : &i->second; - } - - - // stream_insertion_plate - // - template - stream_insertion_plate:: - stream_insertion_plate () - { - if (count == 0) - map = new stream_insertion_map; - - ++count; - } - - template - stream_insertion_plate:: - ~stream_insertion_plate () - { - if (--count == 0) - delete map; - } - - // - // - template - void - inserter_impl (ostream& s, const type& x) - { - s << static_cast (x); - } - - // stream_insertion_initializer - // - template - stream_insertion_initializer:: - stream_insertion_initializer (const C* name, const C* ns) - { - stream_insertion_map_instance ().register_type ( - typeid (T), - xml::qualified_name (name, ns), - &inserter_impl); - } - - template - stream_insertion_initializer:: - ~stream_insertion_initializer () - { - stream_insertion_map_instance ().unregister_type ( - typeid (T)); - } - } - } -} -- cgit v1.1