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/inline.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'cli/inline.cxx') diff --git a/cli/inline.cxx b/cli/inline.cxx index 0d1393d..702bd6c 100644 --- a/cli/inline.cxx +++ b/cli/inline.cxx @@ -32,6 +32,24 @@ namespace << "{" << "this->" << emember (o) << " = x;" << "}"; + + if (specifier && type != "bool") + { + string spec (especifier (o)); + + os << inl << "bool " << scope << "::" << endl + << spec << " () const" + << "{" + << "return this->" << especifier_member (o) << ";" + << "}"; + + if (modifier) + os << inl << "void " << scope << "::" << endl + << spec << "(bool x)" + << "{" + << "this->" << especifier_member (o) << " = x;" + << "}"; + } } }; -- cgit v1.1