diff options
Diffstat (limited to 'xsde/cxx/hybrid/serializer-source.cxx')
-rw-r--r-- | xsde/cxx/hybrid/serializer-source.cxx | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/xsde/cxx/hybrid/serializer-source.cxx b/xsde/cxx/hybrid/serializer-source.cxx index 540d742..b0c194e 100644 --- a/xsde/cxx/hybrid/serializer-source.cxx +++ b/xsde/cxx/hybrid/serializer-source.cxx @@ -886,9 +886,26 @@ namespace CXX { os << "bool " << s << "::" << endl << espresent (a) << " ()" - << "{" - << "return " << access << epresent (a) << " ();" - << "}"; + << "{"; + + if (a.default_ ()) + { + Boolean omit (options.value<CLI::omit_default_attributes> ()); + + if (a.fixed ()) + os << "return " << (omit ? "false" : "true") << ";"; + else + { + if (omit) + os << "return !" << access << edefault (a) << " ();"; + else + os << "return true;"; + } + } + else + os << "return " << access << epresent (a) << " ();"; + + os << "}"; } SemanticGraph::Type& t (a.type ()); |