From 4332a60585a14ff51bc54d29a4a81d37b3b1df81 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 28 Mar 2010 16:53:35 +0200 Subject: Validate enumerations in the xsd:string parser/serializer --- libxsde/xsde/cxx/parser/validating/string-stl.cxx | 24 +++-------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'libxsde/xsde/cxx/parser/validating/string-stl.cxx') 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 +#include 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:: -- cgit v1.1