2 * File automatically generated by
3 * gengen 1.2 by Lorenzo Bettini
4 * http://www.gnu.org/software/gengen
7 #ifndef GENERIC_OPTION_GEN_CLASS_H
8 #define GENERIC_OPTION_GEN_CLASS_H
16 class generic_option_gen_class
21 string final_instructions;
23 string group_var_name;
24 bool has_short_option;
27 string option_comment;
28 bool option_has_group;
31 string option_var_name;
32 string possible_values;
37 generic_option_gen_class() :
38 has_short_option (false), multiple (false), option_has_group (false), option_has_mode (false), option_has_type (false)
42 generic_option_gen_class(const string &_arg_type, const string &_default_value, const string &_final_instructions, const string &_gen_else, const string &_group_var_name, bool _has_short_option, const string &_long_option, bool _multiple, const string &_option_comment, bool _option_has_group, bool _option_has_mode, bool _option_has_type, const string &_option_var_name, const string &_possible_values, const string &_short_option, const string &_structure) :
43 arg_type (_arg_type), default_value (_default_value), final_instructions (_final_instructions), gen_else (_gen_else), group_var_name (_group_var_name), has_short_option (_has_short_option), long_option (_long_option), multiple (_multiple), option_comment (_option_comment), option_has_group (_option_has_group), option_has_mode (_option_has_mode), option_has_type (_option_has_type), option_var_name (_option_var_name), possible_values (_possible_values), short_option (_short_option), structure (_structure)
48 generate_string(const string &s, ostream &stream, unsigned int indent)
50 if (!indent || s.find('\n') == string::npos)
56 string::size_type pos;
57 string::size_type start = 0;
58 string ind (indent, ' ');
59 while ( (pos=s.find('\n', start)) != string::npos)
61 stream << s.substr (start, (pos+1)-start);
63 if (start+1 <= s.size ())
66 if (start+1 <= s.size ())
67 stream << s.substr (start);
70 void set_arg_type(const string &_arg_type)
75 void set_default_value(const string &_default_value)
77 default_value = _default_value;
80 void set_final_instructions(const string &_final_instructions)
82 final_instructions = _final_instructions;
85 void set_gen_else(const string &_gen_else)
90 void set_group_var_name(const string &_group_var_name)
92 group_var_name = _group_var_name;
95 void set_has_short_option(bool _has_short_option)
97 has_short_option = _has_short_option;
100 void set_long_option(const string &_long_option)
102 long_option = _long_option;
105 void set_multiple(bool _multiple)
107 multiple = _multiple;
110 void set_option_comment(const string &_option_comment)
112 option_comment = _option_comment;
115 void set_option_has_group(bool _option_has_group)
117 option_has_group = _option_has_group;
120 void set_option_has_mode(bool _option_has_mode)
122 option_has_mode = _option_has_mode;
125 void set_option_has_type(bool _option_has_type)
127 option_has_type = _option_has_type;
130 void set_option_var_name(const string &_option_var_name)
132 option_var_name = _option_var_name;
135 void set_possible_values(const string &_possible_values)
137 possible_values = _possible_values;
140 void set_short_option(const string &_short_option)
142 short_option = _short_option;
145 void set_structure(const string &_structure)
147 structure = _structure;
150 void generate_generic_option(ostream &stream, unsigned int indent = 0);
154 #endif // GENERIC_OPTION_GEN_CLASS_H