diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-03-17 13:10:42 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-03-17 13:10:42 +0200 |
commit | 2fc01f7a270d76177e8653e2b74f8ca1b7711cc3 (patch) | |
tree | 93fe46eb145bf8ec8654c28b7a261c01f2eba1b0 /libxsde/xsde/cxx/parser/validating/xml-schema-pskel.hxx | |
parent | 3ac8660a6e084014d047e1c121305094eace9bfa (diff) |
Partial support for simple type facet validation
For now only certain types and facets are supported.
Diffstat (limited to 'libxsde/xsde/cxx/parser/validating/xml-schema-pskel.hxx')
-rw-r--r-- | libxsde/xsde/cxx/parser/validating/xml-schema-pskel.hxx | 180 |
1 files changed, 174 insertions, 6 deletions
diff --git a/libxsde/xsde/cxx/parser/validating/xml-schema-pskel.hxx b/libxsde/xsde/cxx/parser/validating/xml-schema-pskel.hxx index 1c82e00..24a7759 100644 --- a/libxsde/xsde/cxx/parser/validating/xml-schema-pskel.hxx +++ b/libxsde/xsde/cxx/parser/validating/xml-schema-pskel.hxx @@ -159,13 +159,40 @@ namespace xsde _dynamic_type () const; #endif -#ifdef XSDE_REUSE_STYLE_TIEIN unsigned_byte_pskel (); + +#ifdef XSDE_REUSE_STYLE_TIEIN unsigned_byte_pskel (unsigned_byte_pskel* impl, void*); protected: unsigned_byte_pskel* unsigned_byte_impl_; #endif + // Facets. + // + public: + void + _max_facet (unsigned char, bool inclusive); + + void + _min_facet (unsigned char, bool inclusive); + + protected: + struct facets + { + unsigned char min_; + unsigned char max_; + + unsigned int min_set_ : 1; + unsigned int min_inc_ : 1; + unsigned int max_set_ : 1; + unsigned int max_inc_ : 1; + }; + + const facets& + _facets () const; + + private: + facets facets_; }; @@ -185,13 +212,40 @@ namespace xsde _dynamic_type () const; #endif -#ifdef XSDE_REUSE_STYLE_TIEIN short_pskel (); + +#ifdef XSDE_REUSE_STYLE_TIEIN short_pskel (short_pskel* impl, void*); protected: short_pskel* short_impl_; #endif + // Facets. + // + public: + void + _max_facet (short, bool inclusive); + + void + _min_facet (short, bool inclusive); + + protected: + struct facets + { + short min_; + short max_; + + unsigned int min_set_ : 1; + unsigned int min_inc_ : 1; + unsigned int max_set_ : 1; + unsigned int max_inc_ : 1; + }; + + const facets& + _facets () const; + + private: + facets facets_; }; struct unsigned_short_pskel: simple_content @@ -207,13 +261,40 @@ namespace xsde _dynamic_type () const; #endif -#ifdef XSDE_REUSE_STYLE_TIEIN unsigned_short_pskel (); + +#ifdef XSDE_REUSE_STYLE_TIEIN unsigned_short_pskel (unsigned_short_pskel* impl, void*); protected: unsigned_short_pskel* unsigned_short_impl_; #endif + // Facets. + // + public: + void + _max_facet (unsigned short, bool inclusive); + + void + _min_facet (unsigned short, bool inclusive); + + protected: + struct facets + { + unsigned short min_; + unsigned short max_; + + unsigned int min_set_ : 1; + unsigned int min_inc_ : 1; + unsigned int max_set_ : 1; + unsigned int max_inc_ : 1; + }; + + const facets& + _facets () const; + + private: + facets facets_; }; @@ -255,13 +336,40 @@ namespace xsde _dynamic_type () const; #endif -#ifdef XSDE_REUSE_STYLE_TIEIN unsigned_int_pskel (); + +#ifdef XSDE_REUSE_STYLE_TIEIN unsigned_int_pskel (unsigned_int_pskel* impl, void*); protected: unsigned_int_pskel* unsigned_int_impl_; #endif + // Facets. + // + public: + void + _max_facet (unsigned int, bool inclusive); + + void + _min_facet (unsigned int, bool inclusive); + + protected: + struct facets + { + unsigned int min_; + unsigned int max_; + + unsigned int min_set_ : 1; + unsigned int min_inc_ : 1; + unsigned int max_set_ : 1; + unsigned int max_inc_ : 1; + }; + + const facets& + _facets () const; + + private: + facets facets_; }; @@ -562,13 +670,43 @@ namespace xsde _dynamic_type () const; #endif -#ifdef XSDE_REUSE_STYLE_TIEIN 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 @@ -853,13 +991,43 @@ namespace xsde _dynamic_type () const; #endif -#ifdef XSDE_REUSE_STYLE_TIEIN 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 |