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.hxx | 90 +++++++++++++++++----- 1 file changed, 71 insertions(+), 19 deletions(-) (limited to 'libxsde/xsde/cxx/parser/non-validating/xml-schema-pskel.hxx') diff --git a/libxsde/xsde/cxx/parser/non-validating/xml-schema-pskel.hxx b/libxsde/xsde/cxx/parser/non-validating/xml-schema-pskel.hxx index 59469c6..6b98277 100644 --- a/libxsde/xsde/cxx/parser/non-validating/xml-schema-pskel.hxx +++ b/libxsde/xsde/cxx/parser/non-validating/xml-schema-pskel.hxx @@ -551,7 +551,29 @@ namespace xsde // string that you have to delete with delete[] (or custom // deallocator if enabled). // - struct string_pskel: simple_content + + struct string_facets + { + string_facets (); + + void + _whitespace_facet (unsigned int); + + public: + struct facets + { + // 0 - preserve + // 1 - replace + // 2 - collapse + // + unsigned int whitespace_: 2; + }; + + protected: + facets facets_; + }; + + struct string_pskel: simple_content, string_facets { #ifdef XSDE_STL virtual std::string @@ -575,9 +597,12 @@ namespace xsde protected: string_pskel* string_impl_; #endif + protected: + const string_facets::facets& + _facets () const; }; - struct normalized_string_pskel: simple_content + struct normalized_string_pskel: simple_content, string_facets { #ifdef XSDE_STL virtual std::string @@ -593,17 +618,20 @@ namespace xsde virtual const char* _dynamic_type () const; #endif + normalized_string_pskel (); #ifdef XSDE_REUSE_STYLE_TIEIN - normalized_string_pskel (); normalized_string_pskel (normalized_string_pskel* impl, void*); protected: normalized_string_pskel* normalized_string_impl_; #endif + protected: + const string_facets::facets& + _facets () const; }; - struct token_pskel: simple_content + struct token_pskel: simple_content, string_facets { #ifdef XSDE_STL virtual std::string @@ -619,17 +647,20 @@ namespace xsde virtual const char* _dynamic_type () const; #endif + token_pskel (); #ifdef XSDE_REUSE_STYLE_TIEIN - token_pskel (); token_pskel (token_pskel* impl, void*); protected: token_pskel* token_impl_; #endif + protected: + const string_facets::facets& + _facets () const; }; - struct name_pskel: simple_content + struct name_pskel: simple_content, string_facets { #ifdef XSDE_STL virtual std::string @@ -645,17 +676,20 @@ namespace xsde virtual const char* _dynamic_type () const; #endif + name_pskel (); #ifdef XSDE_REUSE_STYLE_TIEIN - name_pskel (); name_pskel (name_pskel* impl, void*); protected: name_pskel* name_impl_; #endif + protected: + const string_facets::facets& + _facets () const; }; - struct nmtoken_pskel: simple_content + struct nmtoken_pskel: simple_content, string_facets { #ifdef XSDE_STL virtual std::string @@ -671,14 +705,17 @@ namespace xsde virtual const char* _dynamic_type () const; #endif + nmtoken_pskel (); #ifdef XSDE_REUSE_STYLE_TIEIN - nmtoken_pskel (); nmtoken_pskel (nmtoken_pskel* impl, void*); protected: nmtoken_pskel* nmtoken_impl_; #endif + protected: + const string_facets::facets& + _facets () const; }; struct nmtokens_pskel: list_base @@ -703,7 +740,7 @@ namespace xsde #endif }; - struct ncname_pskel: simple_content + struct ncname_pskel: simple_content, string_facets { #ifdef XSDE_STL virtual std::string @@ -719,17 +756,20 @@ namespace xsde virtual const char* _dynamic_type () const; #endif + ncname_pskel (); #ifdef XSDE_REUSE_STYLE_TIEIN - ncname_pskel (); ncname_pskel (ncname_pskel* impl, void*); protected: ncname_pskel* ncname_impl_; #endif + protected: + const string_facets::facets& + _facets () const; }; - struct id_pskel: simple_content + struct id_pskel: simple_content, string_facets { #ifdef XSDE_STL virtual std::string @@ -745,17 +785,20 @@ namespace xsde virtual const char* _dynamic_type () const; #endif + id_pskel (); #ifdef XSDE_REUSE_STYLE_TIEIN - id_pskel (); id_pskel (id_pskel* impl, void*); protected: id_pskel* id_impl_; #endif + protected: + const string_facets::facets& + _facets () const; }; - struct idref_pskel: simple_content + struct idref_pskel: simple_content, string_facets { #ifdef XSDE_STL virtual std::string @@ -771,14 +814,17 @@ namespace xsde virtual const char* _dynamic_type () const; #endif + idref_pskel (); #ifdef XSDE_REUSE_STYLE_TIEIN - idref_pskel (); idref_pskel (idref_pskel* impl, void*); protected: idref_pskel* idref_impl_; #endif + protected: + const string_facets::facets& + _facets () const; }; struct idrefs_pskel: list_base @@ -803,7 +849,7 @@ namespace xsde #endif }; - struct language_pskel: simple_content + struct language_pskel: simple_content, string_facets { #ifdef XSDE_STL virtual std::string @@ -819,17 +865,20 @@ namespace xsde virtual const char* _dynamic_type () const; #endif + language_pskel (); #ifdef XSDE_REUSE_STYLE_TIEIN - language_pskel (); language_pskel (language_pskel* impl, void*); protected: language_pskel* language_impl_; #endif + protected: + const string_facets::facets& + _facets () const; }; - struct uri_pskel: simple_content + struct uri_pskel: simple_content, string_facets { #ifdef XSDE_STL virtual std::string @@ -845,14 +894,17 @@ namespace xsde virtual const char* _dynamic_type () const; #endif + uri_pskel (); #ifdef XSDE_REUSE_STYLE_TIEIN - uri_pskel (); uri_pskel (uri_pskel* impl, void*); protected: uri_pskel* uri_impl_; #endif + protected: + const string_facets::facets& + _facets () const; }; struct qname_pskel: simple_content -- cgit v1.1