aboutsummaryrefslogtreecommitdiff
path: root/xsde/cxx/serializer/serializer-header.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xsde/cxx/serializer/serializer-header.cxx')
-rw-r--r--xsde/cxx/serializer/serializer-header.cxx39
1 files changed, 6 insertions, 33 deletions
diff --git a/xsde/cxx/serializer/serializer-header.cxx b/xsde/cxx/serializer/serializer-header.cxx
index 550d742..9f0c1f3 100644
--- a/xsde/cxx/serializer/serializer-header.cxx
+++ b/xsde/cxx/serializer/serializer-header.cxx
@@ -275,13 +275,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
<< "{"
@@ -362,7 +364,7 @@ namespace CXX
<< name << " (" << name << "*, void*);";
}
- if (facets)
+ if (enum_facets)
{
UnsignedLong enum_count (0);
@@ -1041,6 +1043,7 @@ namespace CXX
// as in the base. We only need the serialization/validation code.
//
Boolean restriction (restriction_p (c));
+ Boolean facets (has_facets (c));
Boolean hb (c.inherits_p ());
Boolean he (has<Traversal::Element> (c));
@@ -1057,36 +1060,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> () ||
- ub.is_a<SemanticGraph::Fundamental::AnyURI> ())
- {
- 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 ";