diff options
Diffstat (limited to 'xsde/cxx/parser/parser-header.cxx')
-rw-r--r-- | xsde/cxx/parser/parser-header.cxx | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/xsde/cxx/parser/parser-header.cxx b/xsde/cxx/parser/parser-header.cxx index f03d588..11176f9 100644 --- a/xsde/cxx/parser/parser-header.cxx +++ b/xsde/cxx/parser/parser-header.cxx @@ -28,13 +28,15 @@ namespace CXX SemanticGraph::Type& base (e.inherits ().base ()); String fq_base (fq_name (base)); - Boolean facets (false); // Whether we need to set facets. + Boolean enum_facets (false); // Whether we need to set enum facets. if (validation) { - StringBasedType t (facets); + StringBasedType t (enum_facets); t.dispatch (e); } + Boolean facets (enum_facets || has_facets (e)); + os << "class " << name << ": public " << (mixin ? "virtual " : "") << fq_base << "{" @@ -101,7 +103,7 @@ namespace CXX << name << " (" << name << "*, void*);"; } - if (facets) + if (enum_facets) { UnsignedLong enum_count (0); @@ -737,6 +739,7 @@ namespace CXX // Boolean hb (c.inherits_p ()); Boolean restriction (restriction_p (c)); + Boolean facets (has_facets (c)); Boolean he (has<Traversal::Element> (c)); Boolean ha (has<Traversal::Attribute> (c)); @@ -752,35 +755,6 @@ namespace CXX names (c, names_test); } - Boolean facets (false); // Defines facets. - if (validation && restriction) - { - 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> ()) - { - using SemanticGraph::Restricts; - Restricts& r (dynamic_cast<Restricts&> (c.inherits ())); - - if (!r.facet_empty ()) - { - Restricts::FacetIterator end (r.facet_end ()); - facets = - 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; - } - } - } - // // os << "class " << name << ": public "; |