diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-03-28 12:04:39 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-03-28 12:04:39 +0200 |
commit | c2d201480002a24c05f1f4bc934036555b79cad6 (patch) | |
tree | 056d565a1a878eb154faa6f028072ca84c2356aa /libxsde/xsde/cxx/parser/validating/xml-schema-pskel.hxx | |
parent | 27e27f0758170fe2607e34f7d89dbd6700a9bf76 (diff) |
Avoid repetition in string-based skeleton definitions
Diffstat (limited to 'libxsde/xsde/cxx/parser/validating/xml-schema-pskel.hxx')
-rw-r--r-- | libxsde/xsde/cxx/parser/validating/xml-schema-pskel.hxx | 368 |
1 files changed, 44 insertions, 324 deletions
diff --git a/libxsde/xsde/cxx/parser/validating/xml-schema-pskel.hxx b/libxsde/xsde/cxx/parser/validating/xml-schema-pskel.hxx index 24a7759..1e05778 100644 --- a/libxsde/xsde/cxx/parser/validating/xml-schema-pskel.hxx +++ b/libxsde/xsde/cxx/parser/validating/xml-schema-pskel.hxx @@ -653,13 +653,16 @@ namespace xsde }; - // String-based types. + // String-based types. If STL is disabled you are getting a C + // string that you have to delete with delete[]. // -#ifdef XSDE_STL - struct string_pskel: simple_content { +#ifdef XSDE_STL virtual std::string +#else + virtual char* +#endif post_string () = 0; #ifdef XSDE_POLYMORPHIC @@ -711,328 +714,11 @@ namespace xsde struct normalized_string_pskel: simple_content { +#ifdef XSDE_STL virtual std::string - post_normalized_string () = 0; - -#ifdef XSDE_POLYMORPHIC - static const char* - _static_type (); - - virtual const char* - _dynamic_type () const; -#endif - -#ifdef XSDE_REUSE_STYLE_TIEIN - normalized_string_pskel (); - normalized_string_pskel (normalized_string_pskel* impl, void*); - - protected: - normalized_string_pskel* normalized_string_impl_; -#endif - }; - - struct token_pskel: simple_content - { - virtual std::string - post_token () = 0; - -#ifdef XSDE_POLYMORPHIC - static const char* - _static_type (); - - virtual const char* - _dynamic_type () const; -#endif - -#ifdef XSDE_REUSE_STYLE_TIEIN - token_pskel (); - token_pskel (token_pskel* impl, void*); - - protected: - token_pskel* token_impl_; -#endif - }; - - struct name_pskel: simple_content - { - virtual std::string - post_name () = 0; - -#ifdef XSDE_POLYMORPHIC - static const char* - _static_type (); - - virtual const char* - _dynamic_type () const; -#endif - -#ifdef XSDE_REUSE_STYLE_TIEIN - name_pskel (); - name_pskel (name_pskel* impl, void*); - - protected: - name_pskel* name_impl_; -#endif - }; - - struct nmtoken_pskel: simple_content - { - virtual std::string - post_nmtoken () = 0; - -#ifdef XSDE_POLYMORPHIC - static const char* - _static_type (); - - virtual const char* - _dynamic_type () const; -#endif - -#ifdef XSDE_REUSE_STYLE_TIEIN - nmtoken_pskel (); - nmtoken_pskel (nmtoken_pskel* impl, void*); - - protected: - nmtoken_pskel* nmtoken_impl_; -#endif - }; - - struct nmtokens_pskel: list_base - { - virtual string_sequence* - post_nmtokens () = 0; - -#ifdef XSDE_POLYMORPHIC - static const char* - _static_type (); - - virtual const char* - _dynamic_type () const; -#endif - -#ifdef XSDE_REUSE_STYLE_TIEIN - nmtokens_pskel (); - nmtokens_pskel (nmtokens_pskel* impl, void*); - - protected: - nmtokens_pskel* nmtokens_impl_; -#endif - }; - - struct ncname_pskel: simple_content - { - virtual std::string - post_ncname () = 0; - -#ifdef XSDE_POLYMORPHIC - static const char* - _static_type (); - - virtual const char* - _dynamic_type () const; -#endif - -#ifdef XSDE_REUSE_STYLE_TIEIN - ncname_pskel (); - ncname_pskel (ncname_pskel* impl, void*); - - protected: - ncname_pskel* ncname_impl_; -#endif - }; - - struct id_pskel: simple_content - { - virtual std::string - post_id () = 0; - -#ifdef XSDE_POLYMORPHIC - static const char* - _static_type (); - - virtual const char* - _dynamic_type () const; -#endif - -#ifdef XSDE_REUSE_STYLE_TIEIN - id_pskel (); - id_pskel (id_pskel* impl, void*); - - protected: - id_pskel* id_impl_; -#endif - }; - - struct idref_pskel: simple_content - { - virtual std::string - post_idref () = 0; - -#ifdef XSDE_POLYMORPHIC - static const char* - _static_type (); - - virtual const char* - _dynamic_type () const; -#endif - -#ifdef XSDE_REUSE_STYLE_TIEIN - idref_pskel (); - idref_pskel (idref_pskel* impl, void*); - - protected: - idref_pskel* idref_impl_; -#endif - }; - - struct idrefs_pskel: list_base - { - virtual string_sequence* - post_idrefs () = 0; - -#ifdef XSDE_POLYMORPHIC - static const char* - _static_type (); - - virtual const char* - _dynamic_type () const; -#endif - -#ifdef XSDE_REUSE_STYLE_TIEIN - idrefs_pskel (); - idrefs_pskel (idrefs_pskel* impl, void*); - - protected: - idrefs_pskel* idrefs_impl_; -#endif - }; - - struct language_pskel: simple_content - { - virtual std::string - post_language () = 0; - -#ifdef XSDE_POLYMORPHIC - static const char* - _static_type (); - - virtual const char* - _dynamic_type () const; -#endif - -#ifdef XSDE_REUSE_STYLE_TIEIN - language_pskel (); - language_pskel (language_pskel* impl, void*); - - protected: - language_pskel* language_impl_; -#endif - }; - - struct uri_pskel: simple_content - { - virtual std::string - post_uri () = 0; - -#ifdef XSDE_POLYMORPHIC - static const char* - _static_type (); - - virtual const char* - _dynamic_type () const; -#endif - -#ifdef XSDE_REUSE_STYLE_TIEIN - uri_pskel (); - uri_pskel (uri_pskel* impl, void*); - - protected: - uri_pskel* uri_impl_; -#endif - }; - - struct qname_pskel: simple_content - { - virtual qname - post_qname () = 0; - -#ifdef XSDE_POLYMORPHIC - static const char* - _static_type (); - - virtual const char* - _dynamic_type () const; -#endif - -#ifdef XSDE_REUSE_STYLE_TIEIN - qname_pskel (); - qname_pskel (qname_pskel* impl, void*); - - protected: - qname_pskel* qname_impl_; -#endif - }; - -#else // XSDE_STL - - // Note that in this case you are getting a C string that you - // have to delete with delete[]. - // - struct string_pskel: simple_content - { +#else virtual char* - post_string () = 0; - -#ifdef XSDE_POLYMORPHIC - static const char* - _static_type (); - - virtual const char* - _dynamic_type () const; #endif - - string_pskel (); - -#ifdef XSDE_REUSE_STYLE_TIEIN - string_pskel (string_pskel* impl, void*); - - protected: - string_pskel* string_impl_; -#endif - // Facets. - // - public: - void - _length_facet (size_t); - - void - _max_length_facet (size_t); - - void - _min_length_facet (size_t); - - protected: - struct facets - { - size_t length_; - size_t min_length_; - size_t max_length_; - - unsigned int length_set_ : 1; - unsigned int min_length_set_ : 1; - unsigned int max_length_set_ : 1; - }; - - const facets& - _facets () const; - - private: - facets facets_; - }; - - struct normalized_string_pskel: simple_content - { - virtual char* post_normalized_string () = 0; #ifdef XSDE_POLYMORPHIC @@ -1054,7 +740,11 @@ namespace xsde struct token_pskel: simple_content { +#ifdef XSDE_STL + virtual std::string +#else virtual char* +#endif post_token () = 0; #ifdef XSDE_POLYMORPHIC @@ -1076,7 +766,11 @@ namespace xsde struct name_pskel: simple_content { +#ifdef XSDE_STL + virtual std::string +#else virtual char* +#endif post_name () = 0; #ifdef XSDE_POLYMORPHIC @@ -1098,7 +792,11 @@ namespace xsde struct nmtoken_pskel: simple_content { +#ifdef XSDE_STL + virtual std::string +#else virtual char* +#endif post_nmtoken () = 0; #ifdef XSDE_POLYMORPHIC @@ -1142,7 +840,11 @@ namespace xsde struct ncname_pskel: simple_content { +#ifdef XSDE_STL + virtual std::string +#else virtual char* +#endif post_ncname () = 0; #ifdef XSDE_POLYMORPHIC @@ -1164,7 +866,11 @@ namespace xsde struct id_pskel: simple_content { +#ifdef XSDE_STL + virtual std::string +#else virtual char* +#endif post_id () = 0; #ifdef XSDE_POLYMORPHIC @@ -1186,7 +892,11 @@ namespace xsde struct idref_pskel: simple_content { +#ifdef XSDE_STL + virtual std::string +#else virtual char* +#endif post_idref () = 0; #ifdef XSDE_POLYMORPHIC @@ -1230,7 +940,11 @@ namespace xsde struct language_pskel: simple_content { +#ifdef XSDE_STL + virtual std::string +#else virtual char* +#endif post_language () = 0; #ifdef XSDE_POLYMORPHIC @@ -1252,7 +966,11 @@ namespace xsde struct uri_pskel: simple_content { +#ifdef XSDE_STL + virtual std::string +#else virtual char* +#endif post_uri () = 0; #ifdef XSDE_POLYMORPHIC @@ -1274,7 +992,11 @@ namespace xsde struct qname_pskel: simple_content { +#ifdef XSDE_STL + virtual qname +#else virtual qname* +#endif post_qname () = 0; #ifdef XSDE_POLYMORPHIC @@ -1293,8 +1015,6 @@ namespace xsde qname_pskel* qname_impl_; #endif }; -#endif // XSDE_STL - // base64Binary // |