aboutsummaryrefslogtreecommitdiff
path: root/xsde/cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-10-08 16:37:24 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-10-08 16:37:24 +0200
commit0dd6d623af5dfe3590d0c269f76a2fa322e75e58 (patch)
tree8053aae8744c070dc4c1fae1ccbbf21ff0a60e35 /xsde/cxx
parent209f07b8e9b8705814df22012e22856ec07f1592 (diff)
Don't override post() in non-validating case
Diffstat (limited to 'xsde/cxx')
-rw-r--r--xsde/cxx/hybrid/parser-header.cxx12
-rw-r--r--xsde/cxx/hybrid/parser-source.cxx41
2 files changed, 30 insertions, 23 deletions
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<CLI::suppress_validation> () &&
+ !options.value<CLI::suppress_parser_val> ());
+
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<CLI::suppress_validation> () &&
+ !options.value<CLI::suppress_parser_val> ());
+
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<CLI::suppress_validation> () &&
- !options.value<CLI::suppress_parser_val> ())
+ 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<String> ("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;