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/header.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'cli/header.cxx') diff --git a/cli/header.cxx b/cli/header.cxx index ad11aa7..e43c0af 100644 --- a/cli/header.cxx +++ b/cli/header.cxx @@ -27,6 +27,20 @@ namespace os << "void" << endl << name << " (const " << type << "&);" << endl; + + if (specifier && type != "bool") + { + string spec (especifier (o)); + + os << "bool" << endl + << spec << " () const;" + << endl; + + if (modifier) + os << "void" << endl + << spec << " (bool);" + << endl; + } } }; @@ -43,6 +57,9 @@ namespace string type (o.type ().name ()); os << type << " " << member << ";"; + + if (specifier && type != "bool") + os << "bool " << especifier_member (o) << ";"; } }; -- cgit v1.1