2 * File automatically generated by
3 * gengen 1.4.1 by Lorenzo Bettini
4 * http://www.gnu.org/software/gengen
7 #ifndef C_SOURCE_GEN_CLASS_H
8 #define C_SOURCE_GEN_CLASS_H
16 class c_source_gen_class
21 bool check_possible_values;
22 bool check_required_options;
29 string detailed_help_option_print;
30 bool do_generate_strdup;
31 string file_save_loop;
34 string full_help_option_print;
35 bool generate_string_parser;
36 string generator_version;
39 string handle_dependencies;
41 string handle_no_short_option;
43 bool handle_question_mark;
44 string handle_required;
52 bool has_arg_longdouble;
53 bool has_arg_longlong;
59 bool has_typed_options;
60 string header_file_ext;
61 string help_option_print;
62 string help_string_num;
64 string init_args_info;
67 string long_option_struct;
68 string multiple_fill_array;
69 bool multiple_options;
70 bool multiple_options_all_string;
71 bool multiple_options_string;
72 bool multiple_options_with_default;
73 bool multiple_token_functions;
77 string package_var_name;
82 string update_multiple_given;
84 string version_var_name;
87 c_source_gen_class() :
88 check_possible_values (false), check_required_options (false), cmd_list (false), conf_parser (false), do_generate_strdup (false), generate_string_parser (false), handle_question_mark (false), handle_unamed (false), has_arg_double (false), has_arg_enum (false), has_arg_flag (false), has_arg_float (false), has_arg_int (false), has_arg_long (false), has_arg_longdouble (false), has_arg_longlong (false), has_arg_short (false), has_arg_string (false), has_details (false), has_hidden (false), has_modes (false), has_typed_options (false), include_getopt (false), multiple_options (false), multiple_options_all_string (false), multiple_options_string (false), multiple_options_with_default (false), multiple_token_functions (false), no_options (false), no_package (false)
92 c_source_gen_class(const string &_args_info, const string &_check_modes, bool _check_possible_values, bool _check_required_options, const string &_clear_arg, bool _cmd_list, const string &_command_line, bool _conf_parser, const string &_custom_getopt, const string &_description, const string &_detailed_help_option_print, bool _do_generate_strdup, const string &_file_save_loop, const string &_final_exit, const string &_free, const string &_full_help_option_print, bool _generate_string_parser, const string &_generator_version, const string &_getopt_string, const string &_given_init, const string &_handle_dependencies, const string &_handle_group, const string &_handle_no_short_option, const string &_handle_option, bool _handle_question_mark, const string &_handle_required, bool _handle_unamed, bool _has_arg_double, bool _has_arg_enum, bool _has_arg_flag, bool _has_arg_float, bool _has_arg_int, bool _has_arg_long, bool _has_arg_longdouble, bool _has_arg_longlong, bool _has_arg_short, bool _has_arg_string, bool _has_details, bool _has_hidden, bool _has_modes, bool _has_typed_options, const string &_header_file_ext, const string &_help_option_print, const string &_help_string_num, bool _include_getopt, const string &_init_args_info, const string &_list_def, const string &_list_free, const string &_long_option_struct, const string &_multiple_fill_array, bool _multiple_options, bool _multiple_options_all_string, bool _multiple_options_string, bool _multiple_options_with_default, bool _multiple_token_functions, bool _no_options, bool _no_package, const string &_option_values, const string &_package_var_name, const string &_parser_name, const string &_purpose, const string &_reset_groups, const string &_source_name, const string &_update_multiple_given, const string &_usage_string, const string &_version_var_name) :
93 args_info (_args_info), check_modes (_check_modes), check_possible_values (_check_possible_values), check_required_options (_check_required_options), clear_arg (_clear_arg), cmd_list (_cmd_list), command_line (_command_line), conf_parser (_conf_parser), custom_getopt (_custom_getopt), description (_description), detailed_help_option_print (_detailed_help_option_print), do_generate_strdup (_do_generate_strdup), file_save_loop (_file_save_loop), final_exit (_final_exit), free (_free), full_help_option_print (_full_help_option_print), generate_string_parser (_generate_string_parser), generator_version (_generator_version), getopt_string (_getopt_string), given_init (_given_init), handle_dependencies (_handle_dependencies), handle_group (_handle_group), handle_no_short_option (_handle_no_short_option), handle_option (_handle_option), handle_question_mark (_handle_question_mark), handle_required (_handle_required), handle_unamed (_handle_unamed), has_arg_double (_has_arg_double), has_arg_enum (_has_arg_enum), has_arg_flag (_has_arg_flag), has_arg_float (_has_arg_float), has_arg_int (_has_arg_int), has_arg_long (_has_arg_long), has_arg_longdouble (_has_arg_longdouble), has_arg_longlong (_has_arg_longlong), has_arg_short (_has_arg_short), has_arg_string (_has_arg_string), has_details (_has_details), has_hidden (_has_hidden), has_modes (_has_modes), has_typed_options (_has_typed_options), header_file_ext (_header_file_ext), help_option_print (_help_option_print), help_string_num (_help_string_num), include_getopt (_include_getopt), init_args_info (_init_args_info), list_def (_list_def), list_free (_list_free), long_option_struct (_long_option_struct), multiple_fill_array (_multiple_fill_array), multiple_options (_multiple_options), multiple_options_all_string (_multiple_options_all_string), multiple_options_string (_multiple_options_string), multiple_options_with_default (_multiple_options_with_default), multiple_token_functions (_multiple_token_functions), no_options (_no_options), no_package (_no_package), option_values (_option_values), package_var_name (_package_var_name), parser_name (_parser_name), purpose (_purpose), reset_groups (_reset_groups), source_name (_source_name), update_multiple_given (_update_multiple_given), usage_string (_usage_string), version_var_name (_version_var_name)
97 virtual ~c_source_gen_class()
102 generate_string(const string &s, ostream &stream, unsigned int indent)
104 if (!indent || s.find('\n') == string::npos)
110 string::size_type pos;
111 string::size_type start = 0;
112 string ind (indent, ' ');
113 while ( (pos=s.find('\n', start)) != string::npos)
115 stream << s.substr (start, (pos+1)-start);
117 if (start+1 <= s.size ())
120 if (start+1 <= s.size ())
121 stream << s.substr (start);
124 void set_args_info(const string &_args_info)
126 args_info = _args_info;
129 virtual void generate_check_modes(ostream &stream, unsigned int indent) = 0;
131 void set_check_modes(const string &_check_modes)
133 check_modes = _check_modes;
136 void set_check_possible_values(bool _check_possible_values)
138 check_possible_values = _check_possible_values;
141 void set_check_required_options(bool _check_required_options)
143 check_required_options = _check_required_options;
146 virtual void generate_clear_arg(ostream &stream, unsigned int indent) = 0;
148 void set_clear_arg(const string &_clear_arg)
150 clear_arg = _clear_arg;
153 void set_cmd_list(bool _cmd_list)
155 cmd_list = _cmd_list;
158 void set_command_line(const string &_command_line)
160 command_line = _command_line;
163 void set_conf_parser(bool _conf_parser)
165 conf_parser = _conf_parser;
168 virtual void generate_custom_getopt(ostream &stream, unsigned int indent) = 0;
170 void set_custom_getopt(const string &_custom_getopt)
172 custom_getopt = _custom_getopt;
175 void set_description(const string &_description)
177 description = _description;
180 virtual void generate_detailed_help_option_print(ostream &stream, unsigned int indent) = 0;
182 void set_detailed_help_option_print(const string &_detailed_help_option_print)
184 detailed_help_option_print = _detailed_help_option_print;
187 void set_do_generate_strdup(bool _do_generate_strdup)
189 do_generate_strdup = _do_generate_strdup;
192 virtual void generate_file_save_loop(ostream &stream, unsigned int indent) = 0;
194 void set_file_save_loop(const string &_file_save_loop)
196 file_save_loop = _file_save_loop;
199 void set_final_exit(const string &_final_exit)
201 final_exit = _final_exit;
204 virtual void generate_free(ostream &stream, unsigned int indent) = 0;
206 void set_free(const string &_free)
211 virtual void generate_full_help_option_print(ostream &stream, unsigned int indent) = 0;
213 void set_full_help_option_print(const string &_full_help_option_print)
215 full_help_option_print = _full_help_option_print;
218 void set_generate_string_parser(bool _generate_string_parser)
220 generate_string_parser = _generate_string_parser;
223 void set_generator_version(const string &_generator_version)
225 generator_version = _generator_version;
228 void set_getopt_string(const string &_getopt_string)
230 getopt_string = _getopt_string;
233 virtual void generate_given_init(ostream &stream, unsigned int indent) = 0;
235 void set_given_init(const string &_given_init)
237 given_init = _given_init;
240 virtual void generate_handle_dependencies(ostream &stream, unsigned int indent) = 0;
242 void set_handle_dependencies(const string &_handle_dependencies)
244 handle_dependencies = _handle_dependencies;
247 virtual void generate_handle_group(ostream &stream, unsigned int indent) = 0;
249 void set_handle_group(const string &_handle_group)
251 handle_group = _handle_group;
254 virtual void generate_handle_no_short_option(ostream &stream, unsigned int indent) = 0;
256 void set_handle_no_short_option(const string &_handle_no_short_option)
258 handle_no_short_option = _handle_no_short_option;
261 virtual void generate_handle_option(ostream &stream, unsigned int indent) = 0;
263 void set_handle_option(const string &_handle_option)
265 handle_option = _handle_option;
268 void set_handle_question_mark(bool _handle_question_mark)
270 handle_question_mark = _handle_question_mark;
273 virtual void generate_handle_required(ostream &stream, unsigned int indent) = 0;
275 void set_handle_required(const string &_handle_required)
277 handle_required = _handle_required;
280 void set_handle_unamed(bool _handle_unamed)
282 handle_unamed = _handle_unamed;
285 void set_has_arg_double(bool _has_arg_double)
287 has_arg_double = _has_arg_double;
290 void set_has_arg_enum(bool _has_arg_enum)
292 has_arg_enum = _has_arg_enum;
295 void set_has_arg_flag(bool _has_arg_flag)
297 has_arg_flag = _has_arg_flag;
300 void set_has_arg_float(bool _has_arg_float)
302 has_arg_float = _has_arg_float;
305 void set_has_arg_int(bool _has_arg_int)
307 has_arg_int = _has_arg_int;
310 void set_has_arg_long(bool _has_arg_long)
312 has_arg_long = _has_arg_long;
315 void set_has_arg_longdouble(bool _has_arg_longdouble)
317 has_arg_longdouble = _has_arg_longdouble;
320 void set_has_arg_longlong(bool _has_arg_longlong)
322 has_arg_longlong = _has_arg_longlong;
325 void set_has_arg_short(bool _has_arg_short)
327 has_arg_short = _has_arg_short;
330 void set_has_arg_string(bool _has_arg_string)
332 has_arg_string = _has_arg_string;
335 void set_has_details(bool _has_details)
337 has_details = _has_details;
340 void set_has_hidden(bool _has_hidden)
342 has_hidden = _has_hidden;
345 void set_has_modes(bool _has_modes)
347 has_modes = _has_modes;
350 void set_has_typed_options(bool _has_typed_options)
352 has_typed_options = _has_typed_options;
355 void set_header_file_ext(const string &_header_file_ext)
357 header_file_ext = _header_file_ext;
360 virtual void generate_help_option_print(ostream &stream, unsigned int indent) = 0;
362 void set_help_option_print(const string &_help_option_print)
364 help_option_print = _help_option_print;
367 void set_help_string_num(const string &_help_string_num)
369 help_string_num = _help_string_num;
372 void set_include_getopt(bool _include_getopt)
374 include_getopt = _include_getopt;
377 virtual void generate_init_args_info(ostream &stream, unsigned int indent) = 0;
379 void set_init_args_info(const string &_init_args_info)
381 init_args_info = _init_args_info;
384 virtual void generate_list_def(ostream &stream, unsigned int indent) = 0;
386 void set_list_def(const string &_list_def)
388 list_def = _list_def;
391 virtual void generate_list_free(ostream &stream, unsigned int indent) = 0;
393 void set_list_free(const string &_list_free)
395 list_free = _list_free;
398 virtual void generate_long_option_struct(ostream &stream, unsigned int indent) = 0;
400 void set_long_option_struct(const string &_long_option_struct)
402 long_option_struct = _long_option_struct;
405 virtual void generate_multiple_fill_array(ostream &stream, unsigned int indent) = 0;
407 void set_multiple_fill_array(const string &_multiple_fill_array)
409 multiple_fill_array = _multiple_fill_array;
412 void set_multiple_options(bool _multiple_options)
414 multiple_options = _multiple_options;
417 void set_multiple_options_all_string(bool _multiple_options_all_string)
419 multiple_options_all_string = _multiple_options_all_string;
422 void set_multiple_options_string(bool _multiple_options_string)
424 multiple_options_string = _multiple_options_string;
427 void set_multiple_options_with_default(bool _multiple_options_with_default)
429 multiple_options_with_default = _multiple_options_with_default;
432 void set_multiple_token_functions(bool _multiple_token_functions)
434 multiple_token_functions = _multiple_token_functions;
437 void set_no_options(bool _no_options)
439 no_options = _no_options;
442 void set_no_package(bool _no_package)
444 no_package = _no_package;
447 virtual void generate_option_values(ostream &stream, unsigned int indent) = 0;
449 void set_option_values(const string &_option_values)
451 option_values = _option_values;
454 void set_package_var_name(const string &_package_var_name)
456 package_var_name = _package_var_name;
459 void set_parser_name(const string &_parser_name)
461 parser_name = _parser_name;
464 void set_purpose(const string &_purpose)
469 virtual void generate_reset_groups(ostream &stream, unsigned int indent) = 0;
471 void set_reset_groups(const string &_reset_groups)
473 reset_groups = _reset_groups;
476 void set_source_name(const string &_source_name)
478 source_name = _source_name;
481 virtual void generate_update_multiple_given(ostream &stream, unsigned int indent) = 0;
483 void set_update_multiple_given(const string &_update_multiple_given)
485 update_multiple_given = _update_multiple_given;
488 void set_usage_string(const string &_usage_string)
490 usage_string = _usage_string;
493 void set_version_var_name(const string &_version_var_name)
495 version_var_name = _version_var_name;
498 void generate_c_source(ostream &stream, unsigned int indent = 0);
502 #endif // C_SOURCE_GEN_CLASS_H