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/ace-cdr-stream-common.hxx | 26 + libxsd/xsd/cxx/tree/ace-cdr-stream-extraction.hxx | 334 ++ libxsd/xsd/cxx/tree/ace-cdr-stream-insertion.hxx | 249 ++ libxsd/xsd/cxx/tree/bits/literals.hxx | 183 + libxsd/xsd/cxx/tree/bits/literals.ixx | 606 ++++ libxsd/xsd/cxx/tree/buffer.hxx | 336 ++ libxsd/xsd/cxx/tree/buffer.txx | 153 + libxsd/xsd/cxx/tree/comparison-map.hxx | 109 + libxsd/xsd/cxx/tree/comparison-map.txx | 287 ++ libxsd/xsd/cxx/tree/containers-wildcard.hxx | 1335 +++++++ libxsd/xsd/cxx/tree/containers.hxx | 1398 ++++++++ libxsd/xsd/cxx/tree/containers.txx | 284 ++ libxsd/xsd/cxx/tree/date-time-extraction.txx | 157 + libxsd/xsd/cxx/tree/date-time-insertion.txx | 188 + libxsd/xsd/cxx/tree/date-time-ostream.txx | 324 ++ libxsd/xsd/cxx/tree/date-time.hxx | 1951 ++++++++++ libxsd/xsd/cxx/tree/date-time.ixx | 893 +++++ libxsd/xsd/cxx/tree/date-time.txx | 94 + libxsd/xsd/cxx/tree/element-map.hxx | 146 + libxsd/xsd/cxx/tree/element-map.txx | 71 + libxsd/xsd/cxx/tree/elements.hxx | 1448 ++++++++ libxsd/xsd/cxx/tree/elements.txx | 57 + libxsd/xsd/cxx/tree/error-handler.hxx | 62 + libxsd/xsd/cxx/tree/error-handler.txx | 34 + libxsd/xsd/cxx/tree/exceptions.hxx | 1036 ++++++ libxsd/xsd/cxx/tree/exceptions.ixx | 467 +++ libxsd/xsd/cxx/tree/exceptions.txx | 338 ++ libxsd/xsd/cxx/tree/facet.hxx | 43 + libxsd/xsd/cxx/tree/istream-fwd.hxx | 21 + libxsd/xsd/cxx/tree/istream.hxx | 258 ++ libxsd/xsd/cxx/tree/list.hxx | 132 + libxsd/xsd/cxx/tree/ostream.hxx | 245 ++ libxsd/xsd/cxx/tree/parsing.hxx | 12 + libxsd/xsd/cxx/tree/parsing.txx | 915 +++++ libxsd/xsd/cxx/tree/parsing/boolean.hxx | 76 + libxsd/xsd/cxx/tree/parsing/byte.hxx | 80 + libxsd/xsd/cxx/tree/parsing/date-time.txx | 702 ++++ libxsd/xsd/cxx/tree/parsing/decimal.hxx | 85 + libxsd/xsd/cxx/tree/parsing/double.hxx | 94 + libxsd/xsd/cxx/tree/parsing/element-map.txx | 42 + libxsd/xsd/cxx/tree/parsing/float.hxx | 94 + libxsd/xsd/cxx/tree/parsing/int.hxx | 80 + libxsd/xsd/cxx/tree/parsing/long.hxx | 80 + libxsd/xsd/cxx/tree/parsing/short.hxx | 80 + libxsd/xsd/cxx/tree/parsing/unsigned-byte.hxx | 80 + libxsd/xsd/cxx/tree/parsing/unsigned-int.hxx | 80 + libxsd/xsd/cxx/tree/parsing/unsigned-long.hxx | 80 + libxsd/xsd/cxx/tree/parsing/unsigned-short.hxx | 80 + libxsd/xsd/cxx/tree/serialization.hxx | 66 + libxsd/xsd/cxx/tree/serialization.txx | 762 ++++ libxsd/xsd/cxx/tree/serialization/boolean.hxx | 52 + libxsd/xsd/cxx/tree/serialization/byte.hxx | 46 + libxsd/xsd/cxx/tree/serialization/date-time.txx | 620 ++++ libxsd/xsd/cxx/tree/serialization/decimal.hxx | 126 + libxsd/xsd/cxx/tree/serialization/double.hxx | 96 + libxsd/xsd/cxx/tree/serialization/element-map.txx | 40 + libxsd/xsd/cxx/tree/serialization/float.hxx | 94 + libxsd/xsd/cxx/tree/serialization/int.hxx | 46 + libxsd/xsd/cxx/tree/serialization/long.hxx | 46 + libxsd/xsd/cxx/tree/serialization/short.hxx | 46 + .../xsd/cxx/tree/serialization/unsigned-byte.hxx | 46 + libxsd/xsd/cxx/tree/serialization/unsigned-int.hxx | 46 + .../xsd/cxx/tree/serialization/unsigned-long.hxx | 46 + .../xsd/cxx/tree/serialization/unsigned-short.hxx | 46 + libxsd/xsd/cxx/tree/std-ostream-map.hxx | 110 + libxsd/xsd/cxx/tree/std-ostream-map.txx | 279 ++ libxsd/xsd/cxx/tree/std-ostream-operators.hxx | 274 ++ libxsd/xsd/cxx/tree/stream-extraction-map.hxx | 97 + libxsd/xsd/cxx/tree/stream-extraction-map.txx | 294 ++ libxsd/xsd/cxx/tree/stream-extraction.hxx | 303 ++ libxsd/xsd/cxx/tree/stream-insertion-map.hxx | 150 + libxsd/xsd/cxx/tree/stream-insertion-map.txx | 325 ++ libxsd/xsd/cxx/tree/stream-insertion.hxx | 273 ++ libxsd/xsd/cxx/tree/text.hxx | 30 + libxsd/xsd/cxx/tree/text.txx | 77 + libxsd/xsd/cxx/tree/type-factory-map.hxx | 151 + libxsd/xsd/cxx/tree/type-factory-map.txx | 436 +++ libxsd/xsd/cxx/tree/type-serializer-map.hxx | 217 ++ libxsd/xsd/cxx/tree/type-serializer-map.txx | 539 +++ libxsd/xsd/cxx/tree/types.hxx | 3788 ++++++++++++++++++++ libxsd/xsd/cxx/tree/types.txx | 610 ++++ libxsd/xsd/cxx/tree/xdr-stream-common.hxx | 26 + libxsd/xsd/cxx/tree/xdr-stream-extraction.hxx | 295 ++ libxsd/xsd/cxx/tree/xdr-stream-insertion.hxx | 259 ++ 84 files changed, 26682 insertions(+) create mode 100644 libxsd/xsd/cxx/tree/ace-cdr-stream-common.hxx create mode 100644 libxsd/xsd/cxx/tree/ace-cdr-stream-extraction.hxx create mode 100644 libxsd/xsd/cxx/tree/ace-cdr-stream-insertion.hxx create mode 100644 libxsd/xsd/cxx/tree/bits/literals.hxx create mode 100644 libxsd/xsd/cxx/tree/bits/literals.ixx create mode 100644 libxsd/xsd/cxx/tree/buffer.hxx create mode 100644 libxsd/xsd/cxx/tree/buffer.txx create mode 100644 libxsd/xsd/cxx/tree/comparison-map.hxx create mode 100644 libxsd/xsd/cxx/tree/comparison-map.txx create mode 100644 libxsd/xsd/cxx/tree/containers-wildcard.hxx create mode 100644 libxsd/xsd/cxx/tree/containers.hxx create mode 100644 libxsd/xsd/cxx/tree/containers.txx create mode 100644 libxsd/xsd/cxx/tree/date-time-extraction.txx create mode 100644 libxsd/xsd/cxx/tree/date-time-insertion.txx create mode 100644 libxsd/xsd/cxx/tree/date-time-ostream.txx create mode 100644 libxsd/xsd/cxx/tree/date-time.hxx create mode 100644 libxsd/xsd/cxx/tree/date-time.ixx create mode 100644 libxsd/xsd/cxx/tree/date-time.txx create mode 100644 libxsd/xsd/cxx/tree/element-map.hxx create mode 100644 libxsd/xsd/cxx/tree/element-map.txx create mode 100644 libxsd/xsd/cxx/tree/elements.hxx create mode 100644 libxsd/xsd/cxx/tree/elements.txx create mode 100644 libxsd/xsd/cxx/tree/error-handler.hxx create mode 100644 libxsd/xsd/cxx/tree/error-handler.txx create mode 100644 libxsd/xsd/cxx/tree/exceptions.hxx create mode 100644 libxsd/xsd/cxx/tree/exceptions.ixx create mode 100644 libxsd/xsd/cxx/tree/exceptions.txx create mode 100644 libxsd/xsd/cxx/tree/facet.hxx create mode 100644 libxsd/xsd/cxx/tree/istream-fwd.hxx create mode 100644 libxsd/xsd/cxx/tree/istream.hxx create mode 100644 libxsd/xsd/cxx/tree/list.hxx create mode 100644 libxsd/xsd/cxx/tree/ostream.hxx create mode 100644 libxsd/xsd/cxx/tree/parsing.hxx create mode 100644 libxsd/xsd/cxx/tree/parsing.txx create mode 100644 libxsd/xsd/cxx/tree/parsing/boolean.hxx create mode 100644 libxsd/xsd/cxx/tree/parsing/byte.hxx create mode 100644 libxsd/xsd/cxx/tree/parsing/date-time.txx create mode 100644 libxsd/xsd/cxx/tree/parsing/decimal.hxx create mode 100644 libxsd/xsd/cxx/tree/parsing/double.hxx create mode 100644 libxsd/xsd/cxx/tree/parsing/element-map.txx create mode 100644 libxsd/xsd/cxx/tree/parsing/float.hxx create mode 100644 libxsd/xsd/cxx/tree/parsing/int.hxx create mode 100644 libxsd/xsd/cxx/tree/parsing/long.hxx create mode 100644 libxsd/xsd/cxx/tree/parsing/short.hxx create mode 100644 libxsd/xsd/cxx/tree/parsing/unsigned-byte.hxx create mode 100644 libxsd/xsd/cxx/tree/parsing/unsigned-int.hxx create mode 100644 libxsd/xsd/cxx/tree/parsing/unsigned-long.hxx create mode 100644 libxsd/xsd/cxx/tree/parsing/unsigned-short.hxx create mode 100644 libxsd/xsd/cxx/tree/serialization.hxx create mode 100644 libxsd/xsd/cxx/tree/serialization.txx create mode 100644 libxsd/xsd/cxx/tree/serialization/boolean.hxx create mode 100644 libxsd/xsd/cxx/tree/serialization/byte.hxx create mode 100644 libxsd/xsd/cxx/tree/serialization/date-time.txx create mode 100644 libxsd/xsd/cxx/tree/serialization/decimal.hxx create mode 100644 libxsd/xsd/cxx/tree/serialization/double.hxx create mode 100644 libxsd/xsd/cxx/tree/serialization/element-map.txx create mode 100644 libxsd/xsd/cxx/tree/serialization/float.hxx create mode 100644 libxsd/xsd/cxx/tree/serialization/int.hxx create mode 100644 libxsd/xsd/cxx/tree/serialization/long.hxx create mode 100644 libxsd/xsd/cxx/tree/serialization/short.hxx create mode 100644 libxsd/xsd/cxx/tree/serialization/unsigned-byte.hxx create mode 100644 libxsd/xsd/cxx/tree/serialization/unsigned-int.hxx create mode 100644 libxsd/xsd/cxx/tree/serialization/unsigned-long.hxx create mode 100644 libxsd/xsd/cxx/tree/serialization/unsigned-short.hxx create mode 100644 libxsd/xsd/cxx/tree/std-ostream-map.hxx create mode 100644 libxsd/xsd/cxx/tree/std-ostream-map.txx create mode 100644 libxsd/xsd/cxx/tree/std-ostream-operators.hxx create mode 100644 libxsd/xsd/cxx/tree/stream-extraction-map.hxx create mode 100644 libxsd/xsd/cxx/tree/stream-extraction-map.txx create mode 100644 libxsd/xsd/cxx/tree/stream-extraction.hxx create mode 100644 libxsd/xsd/cxx/tree/stream-insertion-map.hxx create mode 100644 libxsd/xsd/cxx/tree/stream-insertion-map.txx create mode 100644 libxsd/xsd/cxx/tree/stream-insertion.hxx create mode 100644 libxsd/xsd/cxx/tree/text.hxx create mode 100644 libxsd/xsd/cxx/tree/text.txx create mode 100644 libxsd/xsd/cxx/tree/type-factory-map.hxx create mode 100644 libxsd/xsd/cxx/tree/type-factory-map.txx create mode 100644 libxsd/xsd/cxx/tree/type-serializer-map.hxx create mode 100644 libxsd/xsd/cxx/tree/type-serializer-map.txx create mode 100644 libxsd/xsd/cxx/tree/types.hxx create mode 100644 libxsd/xsd/cxx/tree/types.txx create mode 100644 libxsd/xsd/cxx/tree/xdr-stream-common.hxx create mode 100644 libxsd/xsd/cxx/tree/xdr-stream-extraction.hxx create mode 100644 libxsd/xsd/cxx/tree/xdr-stream-insertion.hxx (limited to 'libxsd/xsd/cxx/tree') diff --git a/libxsd/xsd/cxx/tree/ace-cdr-stream-common.hxx b/libxsd/xsd/cxx/tree/ace-cdr-stream-common.hxx new file mode 100644 index 0000000..55f4547 --- /dev/null +++ b/libxsd/xsd/cxx/tree/ace-cdr-stream-common.hxx @@ -0,0 +1,26 @@ +// file : xsd/cxx/tree/ace-cdr-stream-common.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSD_CXX_TREE_ACE_CDR_STREAM_COMMON_HXX +#define XSD_CXX_TREE_ACE_CDR_STREAM_COMMON_HXX + +#include + +namespace xsd +{ + namespace cxx + { + namespace tree + { + // Base exception for ACE CDR insertion/extraction exceptions. + // + struct ace_cdr_stream_operation: xsd::cxx::exception + { + }; + } + } +} + +#endif // XSD_CXX_TREE_ACE_CDR_STREAM_COMMON_HXX diff --git a/libxsd/xsd/cxx/tree/ace-cdr-stream-extraction.hxx b/libxsd/xsd/cxx/tree/ace-cdr-stream-extraction.hxx new file mode 100644 index 0000000..8151507 --- /dev/null +++ b/libxsd/xsd/cxx/tree/ace-cdr-stream-extraction.hxx @@ -0,0 +1,334 @@ +// file : xsd/cxx/tree/ace-cdr-stream-extraction.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSD_CXX_TREE_ACE_CDR_STREAM_EXTRACTION_HXX +#define XSD_CXX_TREE_ACE_CDR_STREAM_EXTRACTION_HXX + +#include // std::size_t +#include + +#include // ACE::strdelete +#include + +#include + +#include +#include +#include + +namespace xsd +{ + namespace cxx + { + namespace tree + { + struct ace_cdr_stream_extraction: ace_cdr_stream_operation + { + virtual const char* + what () const throw () + { + return "ACE CDR stream extraction operation failed"; + } + }; + + + // as_size + // + +#ifdef XSD_CXX_TREE_USE_64_BIT_SIZE + template + inline istream& + operator>> (istream& s, + istream::as_size& x) + { + ACE_CDR::ULongLong r; + + if (!s.impl ().read_ulonglong (r) || + r > ~(T (0))) + throw ace_cdr_stream_extraction (); + + x.x_ = static_cast (r); + + return s; + } +#else + template + inline istream& + operator>> (istream& s, + istream::as_size& x) + { + ACE_CDR::ULong r; + + if (!s.impl ().read_ulong (r)) + throw ace_cdr_stream_extraction (); + + x.x_ = static_cast (r); + + return s; + } +#endif + + + // 8-bit + // + template + inline istream& + operator>> (istream& s, + istream::as_int8& x) + { + ACE_CDR::Octet r; + + if (!s.impl ().read_octet (r)) + throw ace_cdr_stream_extraction (); + + x.x_ = static_cast (r); + + return s; + } + + template + inline istream& + operator>> (istream& s, + istream::as_uint8& x) + { + ACE_CDR::Octet r; + + if (!s.impl ().read_octet (r)) + throw ace_cdr_stream_extraction (); + + x.x_ = static_cast (r); + + return s; + } + + + // 16-bit + // + template + inline istream& + operator>> (istream& s, + istream::as_int16& x) + { + ACE_CDR::Short r; + + if (!s.impl ().read_short (r)) + throw ace_cdr_stream_extraction (); + + x.x_ = static_cast (r); + + return s; + } + + template + inline istream& + operator>> (istream& s, + istream::as_uint16& x) + { + ACE_CDR::UShort r; + + if (!s.impl ().read_ushort (r)) + throw ace_cdr_stream_extraction (); + + x.x_ = static_cast (r); + + return s; + } + + + // 32-bit + // + template + inline istream& + operator>> (istream& s, + istream::as_int32& x) + { + ACE_CDR::Long r; + + if (!s.impl ().read_long (r)) + throw ace_cdr_stream_extraction (); + + x.x_ = static_cast (r); + + return s; + } + + template + inline istream& + operator>> (istream& s, + istream::as_uint32& x) + { + ACE_CDR::ULong r; + + if (!s.impl ().read_ulong (r)) + throw ace_cdr_stream_extraction (); + + x.x_ = static_cast (r); + + return s; + } + + + // 64-bit + // + template + inline istream& + operator>> (istream& s, + istream::as_int64& x) + { + ACE_CDR::LongLong r; + + if (!s.impl ().read_longlong (r)) + throw ace_cdr_stream_extraction (); + + x.x_ = static_cast (r); + + return s; + } + + template + inline istream& + operator>> (istream& s, + istream::as_uint64& x) + { + ACE_CDR::ULongLong r; + + if (!s.impl ().read_ulonglong (r)) + throw ace_cdr_stream_extraction (); + + x.x_ = static_cast (r); + + return s; + } + + + // Boolean + // + template + inline istream& + operator>> (istream& s, + istream::as_bool& x) + { + ACE_CDR::Boolean r; + + if (!s.impl ().read_boolean (r)) + throw ace_cdr_stream_extraction (); + + x.x_ = static_cast (r); + + return s; + } + + + // Floating-point + // + template + inline istream& + operator>> (istream& s, + istream::as_float32& x) + { + ACE_CDR::Float r; + + if (!s.impl ().read_float (r)) + throw ace_cdr_stream_extraction (); + + x.x_ = static_cast (r); + + return s; + } + + template + inline istream& + operator>> (istream& s, + istream::as_float64& x) + { + ACE_CDR::Double r; + + if (!s.impl ().read_double (r)) + throw ace_cdr_stream_extraction (); + + x.x_ = static_cast (r); + + return s; + } + + // Extraction of std::basic_string. + // + + namespace bits + { + template + struct ace_str_deallocator + { + void + deallocate (C* s) + { + ACE::strdelete (s); + } + }; + } + + inline istream& + operator>> (istream& s, std::basic_string& x) + { + typedef bits::ace_str_deallocator deallocator; + + deallocator d; + char* r; + + if (!s.impl ().read_string (r)) + throw ace_cdr_stream_extraction (); + + auto_array ar (r, d); + + x = r; + + return s; + } + +#ifdef ACE_HAS_WCHAR + inline istream& + operator>> (istream& s, std::basic_string& x) + { + typedef bits::ace_str_deallocator deallocator; + + deallocator d; + wchar_t* r; + + if (!s.impl ().read_wstring (r)) + throw ace_cdr_stream_extraction (); + + auto_array ar (r, d); + + x = r; + + return s; + } +#endif + + + // Extraction of a binary buffer. + // + template + istream& + operator>> (istream& s, buffer& x) + { + ACE_CDR::ULong size; + + if (!s.impl ().read_ulong (size)) + throw ace_cdr_stream_extraction (); + + x.size (size); + + if (!s.impl ().read_octet_array ( + reinterpret_cast (x.data ()), size)) + throw ace_cdr_stream_extraction (); + + return s; + } + } + } +} + +#endif // XSD_CXX_TREE_ACE_CDR_STREAM_EXTRACTION_HXX diff --git a/libxsd/xsd/cxx/tree/ace-cdr-stream-insertion.hxx b/libxsd/xsd/cxx/tree/ace-cdr-stream-insertion.hxx new file mode 100644 index 0000000..d9c4187 --- /dev/null +++ b/libxsd/xsd/cxx/tree/ace-cdr-stream-insertion.hxx @@ -0,0 +1,249 @@ +// file : xsd/cxx/tree/ace-cdr-stream-insertion.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSD_CXX_TREE_ACE_CDR_STREAM_INSERTION_HXX +#define XSD_CXX_TREE_ACE_CDR_STREAM_INSERTION_HXX + +#include // std::size_t +#include + +#include + +#include +#include +#include + +namespace xsd +{ + namespace cxx + { + namespace tree + { + struct ace_cdr_stream_insertion: ace_cdr_stream_operation + { + virtual const char* + what () const throw () + { + return "ACE CDR stream insertion operation failed"; + } + }; + + + // as_size + // + +#ifdef XSD_CXX_TREE_USE_64_BIT_SIZE + template + inline ostream& + operator<< (ostream& s, + ostream::as_size x) + { + if (!s.impl ().write_ulonglong ( + static_cast (x.x_))) + throw ace_cdr_stream_insertion (); + return s; + } +#else + template + inline ostream& + operator<< (ostream& s, + ostream::as_size x) + { + if (x.x_ > ~(ACE_CDR::ULong (0)) || + !s.impl ().write_ulong (static_cast (x.x_))) + throw ace_cdr_stream_insertion (); + + return s; + } +#endif + + + // 8-bit + // + template + inline ostream& + operator<< (ostream& s, + ostream::as_int8 x) + { + ACE_CDR::Octet r (static_cast (x.x_)); + + if (!s.impl ().write_octet (r)) + throw ace_cdr_stream_insertion (); + + return s; + } + + template + inline ostream& + operator<< (ostream& s, + ostream::as_uint8 x) + { + ACE_CDR::Octet r (static_cast (x.x_)); + + if (!s.impl ().write_octet (r)) + throw ace_cdr_stream_insertion (); + + return s; + } + + + // 16-bit + // + template + inline ostream& + operator<< (ostream& s, + ostream::as_int16 x) + { + if (!s.impl ().write_short (static_cast (x.x_))) + throw ace_cdr_stream_insertion (); + return s; + } + + template + inline ostream& + operator<< (ostream& s, + ostream::as_uint16 x) + { + if (!s.impl ().write_ushort (static_cast (x.x_))) + throw ace_cdr_stream_insertion (); + return s; + } + + + // 32-bit + // + template + inline ostream& + operator<< (ostream& s, + ostream::as_int32 x) + { + if (!s.impl ().write_long (static_cast (x.x_))) + throw ace_cdr_stream_insertion (); + return s; + } + + template + inline ostream& + operator<< (ostream& s, + ostream::as_uint32 x) + { + if (!s.impl ().write_ulong (static_cast (x.x_))) + throw ace_cdr_stream_insertion (); + return s; + } + + + // 64-bit + // + template + inline ostream& + operator<< (ostream& s, + ostream::as_int64 x) + { + if (!s.impl ().write_longlong (static_cast (x.x_))) + throw ace_cdr_stream_insertion (); + return s; + } + + template + inline ostream& + operator<< (ostream& s, + ostream::as_uint64 x) + { + if (!s.impl ().write_ulonglong ( + static_cast (x.x_))) + throw ace_cdr_stream_insertion (); + return s; + } + + + // Boolean + // + template + inline ostream& + operator<< (ostream& s, + ostream::as_bool x) + { + if (!s.impl ().write_boolean (static_cast (x.x_))) + throw ace_cdr_stream_insertion (); + return s; + } + + + // Floating-point + // + template + inline ostream& + operator<< (ostream& s, + ostream::as_float32 x) + { + if (!s.impl ().write_float (static_cast (x.x_))) + throw ace_cdr_stream_insertion (); + return s; + } + + template + inline ostream& + operator<< (ostream& s, + ostream::as_float64 x) + { + if (!s.impl ().write_double (static_cast (x.x_))) + throw ace_cdr_stream_insertion (); + return s; + } + + // Insertion of std::basic_string. + // + + inline ostream& + operator<< (ostream& s, const std::basic_string& x) + { + // ACE CDR strings are hard-wired with a 32 bit length. + // + if (x.length () > ~(ACE_CDR::ULong (0)) || + !s.impl ().write_string ( + static_cast (x.length ()), x.c_str ())) + throw ace_cdr_stream_insertion (); + return s; + } + +#ifdef ACE_HAS_WCHAR + inline ostream& + operator<< (ostream& s, + const std::basic_string& x) + { + // ACE CDR strings are hard-wired with a 32 bit length. + // + if (x.length () > ~(ACE_CDR::ULong (0)) || + !s.impl ().write_wstring ( + static_cast (x.length ()), x.c_str ())) + throw ace_cdr_stream_insertion (); + return s; + } +#endif + + // Insertion of a binary buffer. + // + template + ostream& + operator<< (ostream& s, const buffer& x) + { + std::size_t size (x.size ()); + + // It is not possible to write an array with a 64-bit size. + // + if (size > ~(ACE_CDR::ULong (0)) || + !s.impl ().write_ulong (static_cast (size)) || + !s.impl ().write_octet_array ( + reinterpret_cast (x.data ()), size)) + throw ace_cdr_stream_insertion (); + + return s; + } + } + } +} + +#endif // XSD_CXX_TREE_ACE_CDR_STREAM_INSERTION_HXX diff --git a/libxsd/xsd/cxx/tree/bits/literals.hxx b/libxsd/xsd/cxx/tree/bits/literals.hxx new file mode 100644 index 0000000..186e0dc --- /dev/null +++ b/libxsd/xsd/cxx/tree/bits/literals.hxx @@ -0,0 +1,183 @@ +// file : xsd/cxx/tree/bits/literals.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSD_CXX_TREE_BITS_LITERALS_HXX +#define XSD_CXX_TREE_BITS_LITERALS_HXX + +namespace xsd +{ + namespace cxx + { + namespace tree + { + namespace bits + { + // Boolean literals + // + template + const C* + true_ (); + + template + const C* + one (); + + // Float literals: INF -INF NaN. + // + template + const C* + positive_inf (); + + template + const C* + negative_inf (); + + template + const C* + nan (); + + // Optional "not present" literal. + // + template + const C* + not_present (); + + // XML Schema namespace + // + template + const C* + xml_schema (); + + // Built-in XML Schema type names. + // + template + const C* + any_type (); + + template + const C* + any_simple_type (); + + template + const C* + string (); + + template + const C* + normalized_string (); + + template + const C* + token (); + + template + const C* + name (); + + template + const C* + nmtoken (); + + template + const C* + nmtokens (); + + template + const C* + ncname (); + + template + const C* + language (); + + template + const C* + id (); + + template + const C* + idref (); + + template + const C* + idrefs (); + + template + const C* + any_uri (); + + template + const C* + qname (); + + template + const C* + base64_binary (); + + template + const C* + hex_binary (); + + template + const C* + date (); + + template + const C* + date_time (); + + template + const C* + duration (); + + template + const C* + gday (); + + template + const C* + gmonth (); + + template + const C* + gmonth_day (); + + template + const C* + gyear (); + + template + const C* + gyear_month (); + + template + const C* + time (); + + template + const C* + entity (); + + template + const C* + entities (); + + // gday ("---") and gmonth ("--") prefixes. + // + template + const C* + gday_prefix (); + + template + const C* + gmonth_prefix (); + } + } + } +} + +#endif // XSD_CXX_TREE_BITS_LITERALS_HXX + +#include diff --git a/libxsd/xsd/cxx/tree/bits/literals.ixx b/libxsd/xsd/cxx/tree/bits/literals.ixx new file mode 100644 index 0000000..d2620e6 --- /dev/null +++ b/libxsd/xsd/cxx/tree/bits/literals.ixx @@ -0,0 +1,606 @@ +// file : xsd/cxx/tree/bits/literals.ixx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSD_CXX_TREE_BITS_LITERALS_IXX +#define XSD_CXX_TREE_BITS_LITERALS_IXX + +// The char versions of the following literals are required even +// if we are using wchar_t as the character type. +// +namespace xsd +{ + namespace cxx + { + namespace tree + { + namespace bits + { + // + // + template<> + inline const char* + positive_inf () + { + return "INF"; + } + + template<> + inline const char* + negative_inf () + { + return "-INF"; + } + + template<> + inline const char* + nan () + { + return "NaN"; + } + } + } + } +} + +#endif // XSD_CXX_TREE_BITS_LITERALS_IXX + + +#if defined(XSD_CXX_TREE_USE_CHAR) || !defined(XSD_CXX_TREE_USE_WCHAR) + +#ifndef XSD_CXX_TREE_BITS_LITERALS_IXX_CHAR +#define XSD_CXX_TREE_BITS_LITERALS_IXX_CHAR + +namespace xsd +{ + namespace cxx + { + namespace tree + { + namespace bits + { + // + // + template<> + inline const char* + true_ () + { + return "true"; + } + + template<> + inline const char* + one () + { + return "1"; + } + + // + // + template<> + inline const char* + not_present () + { + return ""; + } + + // + // + template <> + inline const char* + xml_schema () + { + return "http://www.w3.org/2001/XMLSchema"; + } + + // + // + template <> + inline const char* + any_type () + { + return "anyType"; + } + + template <> + inline const char* + any_simple_type () + { + return "anySimpleType"; + } + + template <> + inline const char* + string () + { + return "string"; + } + + template <> + inline const char* + normalized_string () + { + return "normalizedString"; + } + + template <> + inline const char* + token () + { + return "token"; + } + + template <> + inline const char* + name () + { + return "Name"; + } + + template <> + inline const char* + nmtoken () + { + return "NMTOKEN"; + } + + template <> + inline const char* + nmtokens () + { + return "NMTOKENS"; + } + + template <> + inline const char* + ncname () + { + return "NCName"; + } + + template <> + inline const char* + language () + { + return "language"; + } + + + template <> + inline const char* + id () + { + return "ID"; + } + + template <> + inline const char* + idref () + { + return "IDREF"; + } + + template <> + inline const char* + idrefs () + { + return "IDREFS"; + } + + template <> + inline const char* + any_uri () + { + return "anyURI"; + } + + template <> + inline const char* + qname () + { + return "QName"; + } + + template <> + inline const char* + base64_binary () + { + return "base64Binary"; + } + + template <> + inline const char* + hex_binary () + { + return "hexBinary"; + } + + template <> + inline const char* + date () + { + return "date"; + } + + template <> + inline const char* + date_time () + { + return "dateTime"; + } + + template <> + inline const char* + duration () + { + return "duration"; + } + + template <> + inline const char* + gday () + { + return "gDay"; + } + + template <> + inline const char* + gmonth () + { + return "gMonth"; + } + + template <> + inline const char* + gmonth_day () + { + return "gMonthDay"; + } + + template <> + inline const char* + gyear () + { + return "gYear"; + } + + template <> + inline const char* + gyear_month () + { + return "gYearMonth"; + } + + template <> + inline const char* + time () + { + return "time"; + } + + template <> + inline const char* + entity () + { + return "ENTITY"; + } + + template <> + inline const char* + entities () + { + return "ENTITIES"; + } + + template <> + inline const char* + gday_prefix () + { + return "---"; + } + + template <> + inline const char* + gmonth_prefix () + { + return "--"; + } + } + } + } +} + +#endif // XSD_CXX_TREE_BITS_LITERALS_IXX_CHAR +#endif // XSD_CXX_TREE_USE_CHAR + + +#if defined(XSD_CXX_TREE_USE_WCHAR) || !defined(XSD_CXX_TREE_USE_CHAR) + +#ifndef XSD_CXX_TREE_BITS_LITERALS_IXX_WCHAR +#define XSD_CXX_TREE_BITS_LITERALS_IXX_WCHAR + +namespace xsd +{ + namespace cxx + { + namespace tree + { + namespace bits + { + // + // + template<> + inline const wchar_t* + true_ () + { + return L"true"; + } + + template<> + inline const wchar_t* + one () + { + return L"1"; + } + + // + // + template<> + inline const wchar_t* + positive_inf () + { + return L"INF"; + } + + template<> + inline const wchar_t* + negative_inf () + { + return L"-INF"; + } + + template<> + inline const wchar_t* + nan () + { + return L"NaN"; + } + + // + // + template<> + inline const wchar_t* + not_present () + { + return L""; + } + + // + // + template <> + inline const wchar_t* + xml_schema () + { + return L"http://www.w3.org/2001/XMLSchema"; + } + + // + // + template <> + inline const wchar_t* + any_type () + { + return L"anyType"; + } + + template <> + inline const wchar_t* + any_simple_type () + { + return L"anySimpleType"; + } + + template <> + inline const wchar_t* + string () + { + return L"string"; + } + + template <> + inline const wchar_t* + normalized_string () + { + return L"normalizedString"; + } + + template <> + inline const wchar_t* + token () + { + return L"token"; + } + + template <> + inline const wchar_t* + name () + { + return L"Name"; + } + + template <> + inline const wchar_t* + nmtoken () + { + return L"NMTOKEN"; + } + + template <> + inline const wchar_t* + nmtokens () + { + return L"NMTOKENS"; + } + + template <> + inline const wchar_t* + ncname () + { + return L"NCName"; + } + + template <> + inline const wchar_t* + language () + { + return L"language"; + } + + + template <> + inline const wchar_t* + id () + { + return L"ID"; + } + + template <> + inline const wchar_t* + idref () + { + return L"IDREF"; + } + + template <> + inline const wchar_t* + idrefs () + { + return L"IDREFS"; + } + + template <> + inline const wchar_t* + any_uri () + { + return L"anyURI"; + } + + template <> + inline const wchar_t* + qname () + { + return L"QName"; + } + + template <> + inline const wchar_t* + base64_binary () + { + return L"base64Binary"; + } + + template <> + inline const wchar_t* + hex_binary () + { + return L"hexBinary"; + } + + template <> + inline const wchar_t* + date () + { + return L"date"; + } + + template <> + inline const wchar_t* + date_time () + { + return L"dateTime"; + } + + template <> + inline const wchar_t* + duration () + { + return L"duration"; + } + + template <> + inline const wchar_t* + gday () + { + return L"gDay"; + } + + template <> + inline const wchar_t* + gmonth () + { + return L"gMonth"; + } + + template <> + inline const wchar_t* + gmonth_day () + { + return L"gMonthDay"; + } + + template <> + inline const wchar_t* + gyear () + { + return L"gYear"; + } + + template <> + inline const wchar_t* + gyear_month () + { + return L"gYearMonth"; + } + + template <> + inline const wchar_t* + time () + { + return L"time"; + } + + template <> + inline const wchar_t* + entity () + { + return L"ENTITY"; + } + + template <> + inline const wchar_t* + entities () + { + return L"ENTITIES"; + } + + template <> + inline const wchar_t* + gday_prefix () + { + return L"---"; + } + + template <> + inline const wchar_t* + gmonth_prefix () + { + return L"--"; + } + } + } + } +} + +#endif // XSD_CXX_TREE_BITS_LITERALS_IXX_WCHAR +#endif // XSD_CXX_TREE_USE_WCHAR diff --git a/libxsd/xsd/cxx/tree/buffer.hxx b/libxsd/xsd/cxx/tree/buffer.hxx new file mode 100644 index 0000000..f611fe6 --- /dev/null +++ b/libxsd/xsd/cxx/tree/buffer.hxx @@ -0,0 +1,336 @@ +// file : xsd/cxx/tree/buffer.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +/** + * @file + * + * @brief Contains a simple binary buffer abstraction that is used to + * implement the base64Binary and hexBinary XML Schema built-in types. + * + * This is an internal header and is included by the generated code. You + * normally should not include it directly. + * + */ + +#ifndef XSD_CXX_TREE_BUFFER_HXX +#define XSD_CXX_TREE_BUFFER_HXX + +#include // operator new/delete +#include // std::size_t +#include // std::memcpy, std::memcmp + +#include + +namespace xsd +{ + namespace cxx + { + /** + * @brief C++/Tree mapping runtime namespace. + * + * This is an internal namespace and normally should not be referenced + * directly. Instead you should use the aliases for types in this + * namespaces that are created in the generated code. + * + */ + namespace tree + { + //@cond + + class buffer_base + { + protected: + virtual + ~buffer_base () + { + if (data_) + operator delete (data_); + } + + buffer_base () + : data_ (0), size_ (0), capacity_ (0) + { + } + + protected: + char* data_; + size_t size_; + size_t capacity_; + }; + + //@endcond + + /** + * @brief Simple binary %buffer abstraction + * + * The %buffer class manages a continuous binary %buffer. The base + * concepts are data (actual memory region), size (the portion of + * the %buffer that contains useful information), and capacity (the + * actual size of the underlying memory region). The bounds + * %exception is thrown from the constructors and modifier functions + * if the (size <= capacity) constraint is violated. + * + * Note that the template parameter is only used to instantiate + * %exception types. The underlying %buffer type is always @c char. + * + * @nosubgrouping + */ + template + class buffer: protected buffer_base + { + public: + /** + * @brief Size type + */ + typedef std::size_t size_t; + + public: + /** + * @name Constructors + */ + //@{ + + /** + * @brief Allocate a %buffer of the specified size. + * + * The resulting %buffer has the same size and capacity. + * + * @param size A %buffer size in bytes. + */ + explicit + buffer (size_t size = 0); + + /** + * @brief Allocate a %buffer of the specified size and capacity. + * + * @param size A %buffer size in bytes. + * @param capacity A %buffer capacity in bytes. + * @throw bounds If @a size exceeds @a capacity + */ + buffer (size_t size, size_t capacity); + + /** + * @brief Allocate a %buffer of the specified size and copy + * the data. + * + * The resulting %buffer has the same size and capacity with + * @a size bytes copied from @a data. + * + * @param data A %buffer to copy the data from. + * @param size A %buffer size in bytes. + */ + buffer (const void* data, size_t size); + + /** + * @brief Allocate a %buffer of the specified size and capacity + * and copy the data. + * + * @a size bytes are copied from @a data to the resulting + * %buffer. + * + * @param data A %buffer to copy the data from. + * @param size A %buffer size in bytes. + * @param capacity A %buffer capacity in bytes. + * @throw bounds If @a size exceeds @a capacity + */ + buffer (const void* data, size_t size, size_t capacity); + + /** + * @brief Assume ownership of the specified %buffer. + * + * If the @a assume_ownership argument is true, the %buffer will + * assume ownership of @a data and will release the memory + * by calling @c operator @c delete(). + * + * @param data A %buffer to assume ownership of. + * @param size A %buffer size in bytes. + * @param capacity A %buffer capacity in bytes. + * @param assume_ownership A boolean value indication whether to + * assume ownership. + * @throw bounds If @a size exceeds @a capacity + */ + buffer (void* data, + size_t size, + size_t capacity, + bool assume_ownership); + + /** + * @brief Copy constructor. + * + * The copy constructor performs a deep copy of the underlying + * memory %buffer. + * + * @param x An instance to make a copy of. + */ + buffer (const buffer& x); + + //@} + + public: + /** + * @brief Copy assignment operator. + * + * The copy assignment operator changes the buffer's capacity + * to @c x.capacity() and copies @c x.size() bytes from @a x. + * + * @param x An instance to assign. + * @return A reference to the instance. + */ + buffer& + operator= (const buffer& x); + + public: + /** + * @brief Get buffer's capacity. + * + * @return A number of bytes that the %buffer can hold without + * reallocation. + */ + size_t + capacity () const + { + return capacity_; + } + + /** + * @brief Set buffer's capacity. + * + * @param c The new capacity in bytes. + * @return True if the underlying %buffer has moved, false otherwise. + */ + bool + capacity (size_t c) + { + return this->capacity (c, true); + } + + public: + /** + * @brief Get buffer's size. + * + * @return A number of bytes that the %buffer holds. + */ + size_t + size () const {return size_;} + + /** + * @brief Set buffer's size. + * + * @param s The new size in bytes. + * @return True if the underlying %buffer has moved, false otherwise. + */ + bool + size (size_t s) + { + bool r (false); + + if (s > capacity_) + r = capacity (s); + + size_ = s; + + return r; + } + + public: + /** + * @brief Get the underlying memory region. + * + * @return A constant pointer to the underlying memory region. + */ + const char* + data () const {return data_;} + + /** + * @brief Get the underlying memory region. + * + * @return A pointer to the underlying memory region. + */ + char* + data () {return data_;} + + /** + * @brief Get the beginning of the underlying memory region. + * + * @return A constant pointer to the first byte of the underlying + * memory region. + */ + const char* + begin () const {return data_;} + + /** + * @brief Get the beginning of the underlying memory region. + * + * @return A pointer to the first byte of the underlying memory + * region. + */ + char* + begin () {return data_;} + + /** + * @brief Get the end of the underlying memory region. + * + * @return A constant pointer to the one past last byte of the + * underlying memory region (that is @c %begin() @c + @c %size() ). + */ + const char* + end () const {return data_ + size_;} + + /** + * @brief Get the end of the underlying memory region. + * + * @return A pointer to the one past last byte of the underlying + * memory region (that is @c %begin() @c + @c %size() ). + */ + char* + end () {return data_ + size_;} + + public: + /** + * @brief Swap data with another %buffer. + * + * @param x A %buffer to swap with. + */ + void + swap (buffer& x); + + private: + bool + capacity (size_t capacity, bool copy); + }; + + /** + * @brief %buffer comparison operator. + * + * @return True if the buffers have the same sizes and the same + * data. + */ + template + inline bool + operator== (const buffer& a, const buffer& b) + { + return a.size () == b.size () && + std::memcmp (a.data (), b.data (), a.size ()) == 0; + } + + /** + * @brief %buffer comparison operator. + * + * @return True if the buffers have different sizes or different + * data. + */ + template + inline bool + operator!= (const buffer& a, const buffer& b) + { + return !(a == b); + } + } + } +} + +#include + +#endif // XSD_CXX_TREE_BUFFER_HXX diff --git a/libxsd/xsd/cxx/tree/buffer.txx b/libxsd/xsd/cxx/tree/buffer.txx new file mode 100644 index 0000000..6212e20 --- /dev/null +++ b/libxsd/xsd/cxx/tree/buffer.txx @@ -0,0 +1,153 @@ +// file : xsd/cxx/tree/buffer.txx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +namespace xsd +{ + namespace cxx + { + namespace tree + { + template + buffer:: + buffer (size_t size) + { + capacity (size); + size_ = size; + } + + template + buffer:: + buffer (size_t size, size_t capacity) + { + if (size > capacity) + throw bounds (); + + this->capacity (capacity); + size_ = size; + } + + template + buffer:: + buffer (const void* data, size_t size) + { + capacity (size); + size_ = size; + + if (size_) + std::memcpy (data_, data, size_); + } + + template + buffer:: + buffer (const void* data, size_t size, size_t capacity) + { + if (size > capacity) + throw bounds (); + + this->capacity (capacity); + size_ = size; + + if (size_) + std::memcpy (data_, data, size_); + } + + template + buffer:: + buffer (void* data, size_t size, size_t capacity, bool own) + { + if (size > capacity) + throw bounds (); + + if (own) + { + data_ = reinterpret_cast (data); + size_ = size; + capacity_ = capacity; + } + else + { + this->capacity (capacity); + size_ = size; + + if (size_) + std::memcpy (data_, data, size_); + } + } + + template + buffer:: + buffer (const buffer& other) + : buffer_base () + { + capacity (other.capacity_); + size_ = other.size_; + + if (size_) + std::memcpy (data_, other.data_, size_); + } + + template + buffer& buffer:: + operator= (const buffer& other) + { + if (this != &other) + { + capacity (other.capacity_, false); + size_ = other.size_; + + if (size_) + std::memcpy (data_, other.data_, size_); + } + + return *this; + } + + template + void buffer:: + swap (buffer& other) + { + char* tmp_data (data_); + size_t tmp_size (size_); + size_t tmp_capacity (capacity_); + + data_ = other.data_; + size_ = other.size_; + capacity_ = other.capacity_; + + other.data_ = tmp_data; + other.size_ = tmp_size; + other.capacity_ = tmp_capacity; + } + + template + bool buffer:: + capacity (size_t capacity, bool copy) + { + if (size_ > capacity) + throw bounds (); + + if (capacity <= capacity_) + { + return false; // Do nothing if shrinking is requested. + } + else + { + char* data (reinterpret_cast (operator new (capacity))); + + if (copy && size_ > 0) + std::memcpy (data, data_, size_); + + if (data_) + operator delete (data_); + + data_ = data; + capacity_ = capacity; + + return true; + } + } + } + } +} diff --git a/libxsd/xsd/cxx/tree/comparison-map.hxx b/libxsd/xsd/cxx/tree/comparison-map.hxx new file mode 100644 index 0000000..f8461a0 --- /dev/null +++ b/libxsd/xsd/cxx/tree/comparison-map.hxx @@ -0,0 +1,109 @@ +// file : xsd/cxx/tree/comparison-map.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSD_CXX_TREE_COMPARISON_MAP_HXX +#define XSD_CXX_TREE_COMPARISON_MAP_HXX + +#include +#include // std::size_t +#include + +#include + +namespace xsd +{ + namespace cxx + { + namespace tree + { + template + struct comparison_map + { + typedef std::type_info type_id; + typedef bool (*comparator) (const type&, const type&); + + comparison_map (); + + void + register_type (const type_id&, comparator, bool override = true); + + bool + compare (const type&, const type&); + + public: + comparator + find (const type_id&) const; + + private: + struct type_id_comparator + { + bool + operator() (const type_id* x, const type_id* y) const + { + // XL C++ on AIX has buggy type_info::before() in that + // it returns true for two different type_info objects + // that happened to be for the same type. + // +#if defined(__xlC__) && defined(_AIX) + return *x != *y && x->before (*y); +#else + return x->before (*y); +#endif + } + }; + + typedef + std::map + type_map; + + type_map type_map_; + }; + + // + // + template + struct comparison_plate + { + static comparison_map* map; + static std::size_t count; + + comparison_plate (); + ~comparison_plate (); + }; + + template + comparison_map* comparison_plate::map = 0; + + template + std::size_t comparison_plate::count = 0; + + + // + // + template + inline comparison_map& + comparison_map_instance () + { + return *comparison_plate::map; + } + + // + // + template + bool + comparator_impl (const type&, const type&); + + template + struct comparison_initializer + { + comparison_initializer (); + }; + } + } +} + +#include + +#endif // XSD_CXX_TREE_COMPARISON_MAP_HXX diff --git a/libxsd/xsd/cxx/tree/comparison-map.txx b/libxsd/xsd/cxx/tree/comparison-map.txx new file mode 100644 index 0000000..38f215f --- /dev/null +++ b/libxsd/xsd/cxx/tree/comparison-map.txx @@ -0,0 +1,287 @@ +// file : xsd/cxx/tree/comparison-map.txx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include + +namespace xsd +{ + namespace cxx + { + namespace tree + { + // comparison_map + // + template + comparison_map:: + comparison_map () + { + // anyType and anySimpleType. + // + + //register_type ( + // typeid (type), + // &comparator_impl, + // false); + + typedef simple_type simple_type; + + //register_type ( + // typeid (simple_type), + // &comparator_impl, + // false); + + + // Strings + // + typedef string string; + register_type ( + typeid (string), + &comparator_impl, + false); + + typedef normalized_string normalized_string; + register_type ( + typeid (normalized_string), + &comparator_impl, + false); + + typedef token token; + register_type ( + typeid (token), + &comparator_impl, + false); + + typedef name name; + register_type ( + typeid (name), + &comparator_impl, + false); + + typedef nmtoken nmtoken; + register_type ( + typeid (nmtoken), + &comparator_impl, + false); + + typedef nmtokens nmtokens; + register_type ( + typeid (nmtokens), + &comparator_impl, + false); + + typedef ncname ncname; + register_type ( + typeid (ncname), + &comparator_impl, + false); + + typedef language language; + register_type ( + typeid (language), + &comparator_impl, + false); + + + // ID/IDREF. + // + typedef id id; + register_type ( + typeid (id), + &comparator_impl, + false); + + typedef idref idref; + register_type ( + typeid (idref), + &comparator_impl, + false); + + typedef idrefs idrefs; + register_type ( + typeid (idrefs), + &comparator_impl, + false); + + + // URI. + // + typedef uri uri; + register_type ( + typeid (uri), + &comparator_impl, + false); + + + // Qualified name. + // + typedef qname qname; + register_type ( + typeid (qname), + &comparator_impl, + false); + + + // Binary. + // + typedef base64_binary base64_binary; + register_type ( + typeid (base64_binary), + &comparator_impl, + false); + + typedef hex_binary hex_binary; + register_type ( + typeid (hex_binary), + &comparator_impl, + false); + + + // Date/time. + // + typedef gday gday; + register_type ( + typeid (gday), + &comparator_impl, + false); + + typedef gmonth gmonth; + register_type ( + typeid (gmonth), + &comparator_impl, + false); + + typedef gyear gyear; + register_type ( + typeid (gyear), + &comparator_impl, + false); + + typedef gmonth_day gmonth_day; + register_type ( + typeid (gmonth_day), + &comparator_impl, + false); + + typedef gyear_month gyear_month; + register_type ( + typeid (gyear_month), + &comparator_impl, + false); + + typedef date date; + register_type ( + typeid (date), + &comparator_impl, + false); + + typedef time time; + register_type ( + typeid (time), + &comparator_impl