From ed60746355044dd39acd82b8f42c4d9886914567 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 2 Jun 2010 17:22:12 +0200 Subject: Implement generation of specifier functions (--generate-specifier) These functions determine whether the option was specified on the command line. New test: specifier. --- cli/source.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'cli/source.cxx') diff --git a/cli/source.cxx b/cli/source.cxx index 70a7fc9..c9273f4 100644 --- a/cli/source.cxx +++ b/cli/source.cxx @@ -58,6 +58,10 @@ namespace } else os << " ()"; + + if (specifier && o.type ().name () != "bool") + os << "," << endl + << " " << especifier_member (o) << " (false)"; } private: @@ -86,7 +90,13 @@ namespace { os << "_cli_" << scope << "_map_[\"" << *i << "\"] = " << endl << "&::cli::thunk< " << scope << ", " << type << ", " << - "&" << scope << "::" << member << " >;"; + "&" << scope << "::" << member; + + if (specifier && type != "bool") + os << "," << endl + << " &" << scope << "::" << especifier_member (o); + + os << " >;"; } } }; -- cgit v1.1