From 7db026e8056914d113ac0bbfd9bdc4908a9e7874 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 8 Oct 2010 15:35:23 +0200 Subject: Add support for the whiteSpace facet Use the same mechanism to handle whitespace processing for build-in types and enumerations. --- .../cxx/parser/non-validating/xml-schema-pskel.ixx | 187 +++++++++++++++++++-- 1 file changed, 169 insertions(+), 18 deletions(-) (limited to 'libxsde/xsde/cxx/parser/non-validating/xml-schema-pskel.ixx') diff --git a/libxsde/xsde/cxx/parser/non-validating/xml-schema-pskel.ixx b/libxsde/xsde/cxx/parser/non-validating/xml-schema-pskel.ixx index 95e3258..2be6cbf 100644 --- a/libxsde/xsde/cxx/parser/non-validating/xml-schema-pskel.ixx +++ b/libxsde/xsde/cxx/parser/non-validating/xml-schema-pskel.ixx @@ -315,6 +315,20 @@ namespace xsde } #endif + // string_facets + // + inline string_facets:: + string_facets () + { + facets_.whitespace_ = 0; + } + + inline void string_facets:: + _whitespace_facet (unsigned int v) + { + facets_.whitespace_ = v; + } + // string_pskel // #ifdef XSDE_REUSE_STYLE_TIEIN @@ -330,70 +344,137 @@ namespace xsde { } #endif + inline const string_facets::facets& string_pskel:: + _facets () const + { +#ifdef XSDE_REUSE_STYLE_TIEIN + if (parent_ != 0) + return static_cast (*parent_).facets_; + else +#endif + return facets_; + } // normalized_string_pskel // -#ifdef XSDE_REUSE_STYLE_TIEIN inline normalized_string_pskel:: normalized_string_pskel () - : normalized_string_impl_ (0) { +#ifdef XSDE_REUSE_STYLE_TIEIN + normalized_string_impl_ = 0; +#endif + _whitespace_facet (1); // replace } +#ifdef XSDE_REUSE_STYLE_TIEIN inline normalized_string_pskel:: normalized_string_pskel (normalized_string_pskel* impl, void*) : simple_content (impl, 0), normalized_string_impl_ (impl) { + _whitespace_facet (1); // replace } #endif + inline const string_facets::facets& normalized_string_pskel:: + _facets () const + { +#ifdef XSDE_REUSE_STYLE_TIEIN + if (parent_ != 0) + return static_cast ( + *parent_).facets_; + else +#endif + return facets_; + } // token_pskel // -#ifdef XSDE_REUSE_STYLE_TIEIN inline token_pskel:: token_pskel () - : token_impl_ (0) { +#ifdef XSDE_REUSE_STYLE_TIEIN + token_impl_ = 0; +#endif + _whitespace_facet (2); // collapse } +#ifdef XSDE_REUSE_STYLE_TIEIN inline token_pskel:: token_pskel (token_pskel* impl, void*) : simple_content (impl, 0), token_impl_ (impl) { + _whitespace_facet (2); // collapse } #endif + inline const string_facets::facets& token_pskel:: + _facets () const + { +#ifdef XSDE_REUSE_STYLE_TIEIN + if (parent_ != 0) + return static_cast (*parent_).facets_; + else +#endif + return facets_; + } // name_pskel // -#ifdef XSDE_REUSE_STYLE_TIEIN inline name_pskel:: name_pskel () - : name_impl_ (0) { +#ifdef XSDE_REUSE_STYLE_TIEIN + name_impl_ = 0; +#endif + _whitespace_facet (2); // collapse } +#ifdef XSDE_REUSE_STYLE_TIEIN inline name_pskel:: name_pskel (name_pskel* impl, void*) : simple_content (impl, 0), name_impl_ (impl) { + _whitespace_facet (2); // collapse } #endif + inline const string_facets::facets& name_pskel:: + _facets () const + { +#ifdef XSDE_REUSE_STYLE_TIEIN + if (parent_ != 0) + return static_cast (*parent_).facets_; + else +#endif + return facets_; + } // nmtoken_pskel // -#ifdef XSDE_REUSE_STYLE_TIEIN inline nmtoken_pskel:: nmtoken_pskel () - : nmtoken_impl_ (0) { +#ifdef XSDE_REUSE_STYLE_TIEIN + nmtoken_impl_ = 0; +#endif + _whitespace_facet (2); // collapse } +#ifdef XSDE_REUSE_STYLE_TIEIN inline nmtoken_pskel:: nmtoken_pskel (nmtoken_pskel* impl, void*) : simple_content (impl, 0), nmtoken_impl_ (impl) { + _whitespace_facet (2); // collapse } #endif + inline const string_facets::facets& nmtoken_pskel:: + _facets () const + { +#ifdef XSDE_REUSE_STYLE_TIEIN + if (parent_ != 0) + return static_cast (*parent_).facets_; + else +#endif + return facets_; + } // nmtokens_pskel // @@ -413,51 +494,93 @@ namespace xsde // ncname_pskel // -#ifdef XSDE_REUSE_STYLE_TIEIN inline ncname_pskel:: ncname_pskel () - : ncname_impl_ (0) { +#ifdef XSDE_REUSE_STYLE_TIEIN + ncname_impl_ = 0; +#endif + _whitespace_facet (2); // collapse } +#ifdef XSDE_REUSE_STYLE_TIEIN inline ncname_pskel:: ncname_pskel (ncname_pskel* impl, void*) : simple_content (impl, 0), ncname_impl_ (impl) { + _whitespace_facet (2); // collapse } #endif + inline const string_facets::facets& ncname_pskel:: + _facets () const + { +#ifdef XSDE_REUSE_STYLE_TIEIN + if (parent_ != 0) + return static_cast (*parent_).facets_; + else +#endif + return facets_; + } // id_pskel // -#ifdef XSDE_REUSE_STYLE_TIEIN inline id_pskel:: id_pskel () - : id_impl_ (0) { +#ifdef XSDE_REUSE_STYLE_TIEIN + id_impl_ = 0; +#endif + _whitespace_facet (2); // collapse } +#ifdef XSDE_REUSE_STYLE_TIEIN inline id_pskel:: id_pskel (id_pskel* impl, void*) : simple_content (impl, 0), id_impl_ (impl) { + _whitespace_facet (2); // collapse } #endif + inline const string_facets::facets& id_pskel:: + _facets () const + { +#ifdef XSDE_REUSE_STYLE_TIEIN + if (parent_ != 0) + return static_cast (*parent_).facets_; + else +#endif + return facets_; + } // idref_pskel // -#ifdef XSDE_REUSE_STYLE_TIEIN inline idref_pskel:: idref_pskel () - : idref_impl_ (0) { +#ifdef XSDE_REUSE_STYLE_TIEIN + idref_impl_ = 0; +#endif + _whitespace_facet (2); // collapse } +#ifdef XSDE_REUSE_STYLE_TIEIN inline idref_pskel:: idref_pskel (idref_pskel* impl, void*) : simple_content (impl, 0), idref_impl_ (impl) { + _whitespace_facet (2); // collapse } #endif + inline const string_facets::facets& idref_pskel:: + _facets () const + { +#ifdef XSDE_REUSE_STYLE_TIEIN + if (parent_ != 0) + return static_cast (*parent_).facets_; + else +#endif + return facets_; + } // idrefs_pskel // @@ -477,35 +600,63 @@ namespace xsde // language_pskel // -#ifdef XSDE_REUSE_STYLE_TIEIN inline language_pskel:: language_pskel () - : language_impl_ (0) { +#ifdef XSDE_REUSE_STYLE_TIEIN + language_impl_ = 0; +#endif + _whitespace_facet (2); // collapse } +#ifdef XSDE_REUSE_STYLE_TIEIN inline language_pskel:: language_pskel (language_pskel* impl, void*) : simple_content (impl, 0), language_impl_ (impl) { + _whitespace_facet (2); // collapse } #endif + inline const string_facets::facets& language_pskel:: + _facets () const + { +#ifdef XSDE_REUSE_STYLE_TIEIN + if (parent_ != 0) + return static_cast (*parent_).facets_; + else +#endif + return facets_; + } // uri_pskel // -#ifdef XSDE_REUSE_STYLE_TIEIN inline uri_pskel:: uri_pskel () - : uri_impl_ (0) { +#ifdef XSDE_REUSE_STYLE_TIEIN + uri_impl_ = 0; +#endif + _whitespace_facet (2); // collapse } +#ifdef XSDE_REUSE_STYLE_TIEIN inline uri_pskel:: uri_pskel (uri_pskel* impl, void*) : simple_content (impl, 0), uri_impl_ (impl) { + _whitespace_facet (2); // collapse } #endif + inline const string_facets::facets& uri_pskel:: + _facets () const + { +#ifdef XSDE_REUSE_STYLE_TIEIN + if (parent_ != 0) + return static_cast (*parent_).facets_; + else +#endif + return facets_; + } // qname_pskel // -- cgit v1.1