2 * File automatically generated by
3 * gengen 1.2 by Lorenzo Bettini
4 * http://www.gnu.org/software/gengen
7 #ifndef REQUIRED_OPTION_GEN_CLASS_H
8 #define REQUIRED_OPTION_GEN_CLASS_H
16 class required_option_gen_class
20 string mode_condition;
22 string option_var_name;
23 string package_var_name;
26 required_option_gen_class() :
31 required_option_gen_class(bool _checkrange, const string &_mode_condition, const string &_option_descr, const string &_option_var_name, const string &_package_var_name) :
32 checkrange (_checkrange), mode_condition (_mode_condition), option_descr (_option_descr), option_var_name (_option_var_name), package_var_name (_package_var_name)
37 generate_string(const string &s, ostream &stream, unsigned int indent)
39 if (!indent || s.find('\n') == string::npos)
45 string::size_type pos;
46 string::size_type start = 0;
47 string ind (indent, ' ');
48 while ( (pos=s.find('\n', start)) != string::npos)
50 stream << s.substr (start, (pos+1)-start);
52 if (start+1 <= s.size ())
55 if (start+1 <= s.size ())
56 stream << s.substr (start);
59 void set_checkrange(bool _checkrange)
61 checkrange = _checkrange;
64 void set_mode_condition(const string &_mode_condition)
66 mode_condition = _mode_condition;
69 void set_option_descr(const string &_option_descr)
71 option_descr = _option_descr;
74 void set_option_var_name(const string &_option_var_name)
76 option_var_name = _option_var_name;
79 void set_package_var_name(const string &_package_var_name)
81 package_var_name = _package_var_name;
84 void generate_required_option(ostream &stream, unsigned int indent = 0);
88 #endif // REQUIRED_OPTION_GEN_CLASS_H