From 0dd6d623af5dfe3590d0c269f76a2fa322e75e58 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 8 Oct 2010 16:37:24 +0200 Subject: Don't override post() in non-validating case --- xsde/cxx/hybrid/parser-header.cxx | 12 +++++++++--- xsde/cxx/hybrid/parser-source.cxx | 41 ++++++++++++++++++++------------------- 2 files changed, 30 insertions(+), 23 deletions(-) (limited to 'xsde/cxx') diff --git a/xsde/cxx/hybrid/parser-header.cxx b/xsde/cxx/hybrid/parser-header.cxx index e64ac63..fd5f253 100644 --- a/xsde/cxx/hybrid/parser-header.cxx +++ b/xsde/cxx/hybrid/parser-header.cxx @@ -74,6 +74,9 @@ namespace CXX if (name) { Boolean fl (fixed_length (e)); + Boolean val (!options.value () && + !options.value ()); + SemanticGraph::Type& b (e.inherits ().base ()); os << "class " << name << ": public " << @@ -135,9 +138,12 @@ namespace CXX // _post // - os << "virtual void" << endl - << "_post ();" - << endl; + if (val) + { + os << "virtual void" << endl + << "_post ();" + << endl; + } } diff --git a/xsde/cxx/hybrid/parser-source.cxx b/xsde/cxx/hybrid/parser-source.cxx index 64d12d6..99a350a 100644 --- a/xsde/cxx/hybrid/parser-source.cxx +++ b/xsde/cxx/hybrid/parser-source.cxx @@ -121,6 +121,9 @@ namespace CXX Boolean fl (fixed_length (e)); + Boolean val (!options.value () && + !options.value ()); + SemanticGraph::Context& ec (e.context ()); SemanticGraph::Type& b (e.inherits ().base ()); @@ -383,29 +386,18 @@ namespace CXX // _post // - os << "void " << name << "::" << endl - << "_post ()" - << "{"; - - if (!options.value () && - !options.value ()) + if (val) { - os << "::xsde::cxx::parser::validating::string_common::" << + os << "void " << name << "::" << endl + << "_post ()" + << "{" + << "::xsde::cxx::parser::validating::string_common::" << "validate_facets (" << endl << "this->" << state << ".str_," << endl << "this->_facets ()," << endl - << "this->_context ());"; - } - else - { - - os << "::xsde::cxx::parser::non_validating::string_common::" << - "process_facets (" << endl - << "this->" << state << ".str_," << endl - << "this->_facets ());"; + << "this->_context ());" << endl + << "}"; } - - os << "}"; } // post @@ -461,10 +453,19 @@ namespace CXX } else { + if (!val) + { + os << "::xsde::cxx::parser::non_validating::string_common::" << + "process_facets (" << endl + << "this->" << state << ".str_," << endl + << "this->_facets ());" + << endl; + } + String const& vt (ec.get ("value-type")); - os << type << "::" << vt << " v = static_cast< " << type << - "::" << vt << " > (0);" + os << type << "::" << vt << " v =" << endl + << "static_cast< " << type << "::" << vt << " > (0);" << "const char* s = this->" << state << ".str_." << (stl ? "c_str" : "data") << " ();" << endl; -- cgit v1.1