diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-03-28 16:53:35 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-03-28 16:53:35 +0200 |
commit | 4332a60585a14ff51bc54d29a4a81d37b3b1df81 (patch) | |
tree | fd3b807e3f5b3841371d509505a50498d21a2f99 /libxsde/xsde/cxx/parser/validating/string-stl.cxx | |
parent | c2d201480002a24c05f1f4bc934036555b79cad6 (diff) |
Validate enumerations in the xsd:string parser/serializer
Diffstat (limited to 'libxsde/xsde/cxx/parser/validating/string-stl.cxx')
-rw-r--r-- | libxsde/xsde/cxx/parser/validating/string-stl.cxx | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/libxsde/xsde/cxx/parser/validating/string-stl.cxx b/libxsde/xsde/cxx/parser/validating/string-stl.cxx index d0d0e14..9e1ad13 100644 --- a/libxsde/xsde/cxx/parser/validating/string-stl.cxx +++ b/libxsde/xsde/cxx/parser/validating/string-stl.cxx @@ -4,6 +4,7 @@ // license : GNU GPL v2 + exceptions; see accompanying LICENSE file #include <xsde/cxx/parser/validating/string-stl.hxx> +#include <xsde/cxx/parser/validating/string-common.hxx> namespace xsde { @@ -28,27 +29,8 @@ namespace xsde void string_pimpl:: _post () { - // Check facets. - // - const facets& f = _facets (); - - if (f.length_set_ && str_.size () != f.length_) - { - _schema_error (schema_error::length_not_equal_prescribed); - return; - } - - if (f.min_length_set_ && str_.size () < f.min_length_) - { - _schema_error (schema_error::length_less_than_min); - return; - } - - if (f.max_length_set_ && str_.size () > f.max_length_) - { - _schema_error (schema_error::length_greater_than_max); - return; - } + string_common::validate_facets ( + str_.c_str (), str_.size (), _facets (), _context ()); } std::string string_pimpl:: |