diff options
Diffstat (limited to 'xsde/cxx/serializer/elements.cxx')
-rw-r--r-- | xsde/cxx/serializer/elements.cxx | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/xsde/cxx/serializer/elements.cxx b/xsde/cxx/serializer/elements.cxx index 5395953..62fd32d 100644 --- a/xsde/cxx/serializer/elements.cxx +++ b/xsde/cxx/serializer/elements.cxx @@ -213,6 +213,42 @@ namespace CXX return t.context ().get<String> ("s:impl"); } + Boolean Context:: + has_facets (SemanticGraph::Complex& c) + { + if (validation && restriction_p (c)) + { + using SemanticGraph::Restricts; + Restricts& r (dynamic_cast<Restricts&> (c.inherits ())); + + if (r.facet_empty ()) + return false; + + SemanticGraph::Type& ub (ultimate_base (c)); + + if (ub.is_a<SemanticGraph::Fundamental::Short> () || + ub.is_a<SemanticGraph::Fundamental::UnsignedByte> () || + ub.is_a<SemanticGraph::Fundamental::UnsignedShort> () || + ub.is_a<SemanticGraph::Fundamental::UnsignedInt> () || + ub.is_a<SemanticGraph::Fundamental::String> () || + ub.is_a<SemanticGraph::Fundamental::AnyURI> ()) + { + Restricts::FacetIterator end (r.facet_end ()); + + if (r.facet_find (L"length") != end || + r.facet_find (L"minLength") != end || + r.facet_find (L"maxLength") != end || + r.facet_find (L"minInclusive") != end || + r.facet_find (L"minExclusive") != end || + r.facet_find (L"maxInclusive") != end || + r.facet_find (L"maxExclusive") != end) + return true; + } + } + + return false; + } + // Includes // Void TypeForward:: |