From 720c5a33b6a49cf328fdd7611f49153cf8f60247 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 8 Apr 2020 14:51:57 +0300 Subject: Separate tests and examples into individual packages Also make cli module to be explicitly enabled via the config.cli configuration variable. --- cli/inline.cxx | 108 --------------------------------------------------------- 1 file changed, 108 deletions(-) delete mode 100644 cli/inline.cxx (limited to 'cli/inline.cxx') diff --git a/cli/inline.cxx b/cli/inline.cxx deleted file mode 100644 index 05b83db..0000000 --- a/cli/inline.cxx +++ /dev/null @@ -1,108 +0,0 @@ -// file : cli/inline.cxx -// author : Boris Kolpackov -// license : MIT; see accompanying LICENSE file - -#include - -namespace -{ - // - // - struct option: traversal::option, context - { - option (context& c) : context (c) {} - - virtual void - traverse (type& o) - { - string name (ename (o)); - string type (o.type ().name ()); - string scope (escape (o.scope ().name ())); - - os << inl << "const " << type << "& " << scope << "::" << endl - << name << " () const" - << "{" - << "return this->" << emember (o) << ";" - << "}"; - - if (gen_modifier) - { - os << inl << type << "& " << scope << "::" << endl - << name << " ()" - << "{" - << "return this->" << emember (o) << ";" - << "}"; - - os << inl << "void " << scope << "::" << endl - << name << "(const " << type << "& x)" - << "{" - << "this->" << emember (o) << " = x;" - << "}"; - } - - if (gen_specifier && type != "bool") - { - string spec (especifier (o)); - - os << inl << "bool " << scope << "::" << endl - << spec << " () const" - << "{" - << "return this->" << especifier_member (o) << ";" - << "}"; - - if (gen_modifier) - os << inl << "void " << scope << "::" << endl - << spec << "(bool x)" - << "{" - << "this->" << especifier_member (o) << " = x;" - << "}"; - } - } - }; - - // - // - struct class_: traversal::class_, context - { - class_ (context& c) - : context (c), option_ (c) - { - names_option_ >> option_; - } - - virtual void - traverse (type& c) - { - string name (escape (c.name ())); - - os << "// " << name << endl - << "//" << endl - << endl; - - names (c, names_option_); - } - - private: - option option_; - traversal::names names_option_; - }; -} - -void -generate_inline (context& ctx) -{ - traversal::cli_unit unit; - traversal::names unit_names; - namespace_ ns (ctx); - class_ cl (ctx); - - unit >> unit_names >> ns; - unit_names >> cl; - - traversal::names ns_names; - - ns >> ns_names >> ns; - ns_names >> cl; - - unit.dispatch (ctx.unit); -} -- cgit v1.1