--- /dev/null
+/*
+ * File automatically generated by
+ * gengen 1.4.1 by Lorenzo Bettini
+ * http://www.gnu.org/software/gengen
+ */
+
+#ifndef C_SOURCE_GEN_CLASS_H
+#define C_SOURCE_GEN_CLASS_H
+
+#include <string>
+#include <iostream>
+
+using std::string;
+using std::ostream;
+
+class c_source_gen_class
+{
+ protected:
+ string args_info;
+ string check_modes;
+ bool check_possible_values;
+ bool check_required_options;
+ string clear_arg;
+ bool cmd_list;
+ string command_line;
+ bool conf_parser;
+ string custom_getopt;
+ string description;
+ string detailed_help_option_print;
+ bool do_generate_strdup;
+ string file_save_loop;
+ string final_exit;
+ string free;
+ string full_help_option_print;
+ bool generate_string_parser;
+ string generator_version;
+ string getopt_string;
+ string given_init;
+ string handle_dependencies;
+ string handle_group;
+ string handle_no_short_option;
+ string handle_option;
+ bool handle_question_mark;
+ 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;
+ string header_file_ext;
+ string help_option_print;
+ string help_string_num;
+ bool include_getopt;
+ string init_args_info;
+ string list_def;
+ string list_free;
+ string long_option_struct;
+ 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;
+ string option_values;
+ string package_var_name;
+ string parser_name;
+ string purpose;
+ string reset_groups;
+ string source_name;
+ string update_multiple_given;
+ string usage_string;
+ string version_var_name;
+
+ public:
+ c_source_gen_class() :
+ 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)
+ {
+ }
+
+ 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) :
+ 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)
+ {
+ }
+
+ virtual ~c_source_gen_class()
+ {
+ }
+
+ static void
+ generate_string(const string &s, ostream &stream, unsigned int indent)
+ {
+ if (!indent || s.find('\n') == string::npos)
+ {
+ stream << s;
+ return;
+ }
+
+ string::size_type pos;
+ string::size_type start = 0;
+ string ind (indent, ' ');
+ while ( (pos=s.find('\n', start)) != string::npos)
+ {
+ stream << s.substr (start, (pos+1)-start);
+ start = pos+1;
+ if (start+1 <= s.size ())
+ stream << ind;
+ }
+ if (start+1 <= s.size ())
+ stream << s.substr (start);
+ }
+
+ void set_args_info(const string &_args_info)
+ {
+ args_info = _args_info;
+ }
+
+ virtual void generate_check_modes(ostream &stream, unsigned int indent) = 0;
+
+ void set_check_modes(const string &_check_modes)
+ {
+ check_modes = _check_modes;
+ }
+
+ void set_check_possible_values(bool _check_possible_values)
+ {
+ check_possible_values = _check_possible_values;
+ }
+
+ void set_check_required_options(bool _check_required_options)
+ {
+ check_required_options = _check_required_options;
+ }
+
+ virtual void generate_clear_arg(ostream &stream, unsigned int indent) = 0;
+
+ void set_clear_arg(const string &_clear_arg)
+ {
+ clear_arg = _clear_arg;
+ }
+
+ void set_cmd_list(bool _cmd_list)
+ {
+ cmd_list = _cmd_list;
+ }
+
+ void set_command_line(const string &_command_line)
+ {
+ command_line = _command_line;
+ }
+
+ void set_conf_parser(bool _conf_parser)
+ {
+ conf_parser = _conf_parser;
+ }
+
+ virtual void generate_custom_getopt(ostream &stream, unsigned int indent) = 0;
+
+ void set_custom_getopt(const string &_custom_getopt)
+ {
+ custom_getopt = _custom_getopt;
+ }
+
+ void set_description(const string &_description)
+ {
+ description = _description;
+ }
+
+ virtual void generate_detailed_help_option_print(ostream &stream, unsigned int indent) = 0;
+
+ void set_detailed_help_option_print(const string &_detailed_help_option_print)
+ {
+ detailed_help_option_print = _detailed_help_option_print;
+ }
+
+ void set_do_generate_strdup(bool _do_generate_strdup)
+ {
+ do_generate_strdup = _do_generate_strdup;
+ }
+
+ virtual void generate_file_save_loop(ostream &stream, unsigned int indent) = 0;
+
+ void set_file_save_loop(const string &_file_save_loop)
+ {
+ file_save_loop = _file_save_loop;
+ }
+
+ void set_final_exit(const string &_final_exit)
+ {
+ final_exit = _final_exit;
+ }
+
+ virtual void generate_free(ostream &stream, unsigned int indent) = 0;
+
+ void set_free(const string &_free)
+ {
+ free = _free;
+ }
+
+ virtual void generate_full_help_option_print(ostream &stream, unsigned int indent) = 0;
+
+ void set_full_help_option_print(const string &_full_help_option_print)
+ {
+ full_help_option_print = _full_help_option_print;
+ }
+
+ void set_generate_string_parser(bool _generate_string_parser)
+ {
+ generate_string_parser = _generate_string_parser;
+ }
+
+ void set_generator_version(const string &_generator_version)
+ {
+ generator_version = _generator_version;
+ }
+
+ void set_getopt_string(const string &_getopt_string)
+ {
+ getopt_string = _getopt_string;
+ }
+
+ virtual void generate_given_init(ostream &stream, unsigned int indent) = 0;
+
+ void set_given_init(const string &_given_init)
+ {
+ given_init = _given_init;
+ }
+
+ virtual void generate_handle_dependencies(ostream &stream, unsigned int indent) = 0;
+
+ void set_handle_dependencies(const string &_handle_dependencies)
+ {
+ handle_dependencies = _handle_dependencies;
+ }
+
+ virtual void generate_handle_group(ostream &stream, unsigned int indent) = 0;
+
+ void set_handle_group(const string &_handle_group)
+ {
+ handle_group = _handle_group;
+ }
+
+ virtual void generate_handle_no_short_option(ostream &stream, unsigned int indent) = 0;
+
+ void set_handle_no_short_option(const string &_handle_no_short_option)
+ {
+ handle_no_short_option = _handle_no_short_option;
+ }
+
+ virtual void generate_handle_option(ostream &stream, unsigned int indent) = 0;
+
+ void set_handle_option(const string &_handle_option)
+ {
+ handle_option = _handle_option;
+ }
+
+ void set_handle_question_mark(bool _handle_question_mark)
+ {
+ handle_question_mark = _handle_question_mark;
+ }
+
+ virtual void generate_handle_required(ostream &stream, unsigned int indent) = 0;
+
+ void set_handle_required(const string &_handle_required)
+ {
+ handle_required = _handle_required;
+ }
+
+ void set_handle_unamed(bool _handle_unamed)
+ {
+ handle_unamed = _handle_unamed;
+ }
+
+ void set_has_arg_double(bool _has_arg_double)
+ {
+ has_arg_double = _has_arg_double;
+ }
+
+ void set_has_arg_enum(bool _has_arg_enum)
+ {
+ has_arg_enum = _has_arg_enum;
+ }
+
+ void set_has_arg_flag(bool _has_arg_flag)
+ {
+ has_arg_flag = _has_arg_flag;
+ }
+
+ void set_has_arg_float(bool _has_arg_float)
+ {
+ has_arg_float = _has_arg_float;
+ }
+
+ void set_has_arg_int(bool _has_arg_int)
+ {
+ has_arg_int = _has_arg_int;
+ }
+
+ void set_has_arg_long(bool _has_arg_long)
+ {
+ has_arg_long = _has_arg_long;
+ }
+
+ void set_has_arg_longdouble(bool _has_arg_longdouble)
+ {
+ has_arg_longdouble = _has_arg_longdouble;
+ }
+
+ void set_has_arg_longlong(bool _has_arg_longlong)
+ {
+ has_arg_longlong = _has_arg_longlong;
+ }
+
+ void set_has_arg_short(bool _has_arg_short)
+ {
+ has_arg_short = _has_arg_short;
+ }
+
+ void set_has_arg_string(bool _has_arg_string)
+ {
+ has_arg_string = _has_arg_string;
+ }
+
+ void set_has_details(bool _has_details)
+ {
+ has_details = _has_details;
+ }
+
+ void set_has_hidden(bool _has_hidden)
+ {
+ has_hidden = _has_hidden;
+ }
+
+ void set_has_modes(bool _has_modes)
+ {
+ has_modes = _has_modes;
+ }
+
+ void set_has_typed_options(bool _has_typed_options)
+ {
+ has_typed_options = _has_typed_options;
+ }
+
+ void set_header_file_ext(const string &_header_file_ext)
+ {
+ header_file_ext = _header_file_ext;
+ }
+
+ virtual void generate_help_option_print(ostream &stream, unsigned int indent) = 0;
+
+ void set_help_option_print(const string &_help_option_print)
+ {
+ help_option_print = _help_option_print;
+ }
+
+ void set_help_string_num(const string &_help_string_num)
+ {
+ help_string_num = _help_string_num;
+ }
+
+ void set_include_getopt(bool _include_getopt)
+ {
+ include_getopt = _include_getopt;
+ }
+
+ virtual void generate_init_args_info(ostream &stream, unsigned int indent) = 0;
+
+ void set_init_args_info(const string &_init_args_info)
+ {
+ init_args_info = _init_args_info;
+ }
+
+ virtual void generate_list_def(ostream &stream, unsigned int indent) = 0;
+
+ void set_list_def(const string &_list_def)
+ {
+ list_def = _list_def;
+ }
+
+ virtual void generate_list_free(ostream &stream, unsigned int indent) = 0;
+
+ void set_list_free(const string &_list_free)
+ {
+ list_free = _list_free;
+ }
+
+ virtual void generate_long_option_struct(ostream &stream, unsigned int indent) = 0;
+
+ void set_long_option_struct(const string &_long_option_struct)
+ {
+ long_option_struct = _long_option_struct;
+ }
+
+ virtual void generate_multiple_fill_array(ostream &stream, unsigned int indent) = 0;
+
+ void set_multiple_fill_array(const string &_multiple_fill_array)
+ {
+ multiple_fill_array = _multiple_fill_array;
+ }
+
+ void set_multiple_options(bool _multiple_options)
+ {
+ multiple_options = _multiple_options;
+ }
+
+ void set_multiple_options_all_string(bool _multiple_options_all_string)
+ {
+ multiple_options_all_string = _multiple_options_all_string;
+ }
+
+ void set_multiple_options_string(bool _multiple_options_string)
+ {
+ multiple_options_string = _multiple_options_string;
+ }
+
+ void set_multiple_options_with_default(bool _multiple_options_with_default)
+ {
+ multiple_options_with_default = _multiple_options_with_default;
+ }
+
+ void set_multiple_token_functions(bool _multiple_token_functions)
+ {
+ multiple_token_functions = _multiple_token_functions;
+ }
+
+ void set_no_options(bool _no_options)
+ {
+ no_options = _no_options;
+ }
+
+ void set_no_package(bool _no_package)
+ {
+ no_package = _no_package;
+ }
+
+ virtual void generate_option_values(ostream &stream, unsigned int indent) = 0;
+
+ void set_option_values(const string &_option_values)
+ {
+ option_values = _option_values;
+ }
+
+ void set_package_var_name(const string &_package_var_name)
+ {
+ package_var_name = _package_var_name;
+ }
+
+ void set_parser_name(const string &_parser_name)
+ {
+ parser_name = _parser_name;
+ }
+
+ void set_purpose(const string &_purpose)
+ {
+ purpose = _purpose;
+ }
+
+ virtual void generate_reset_groups(ostream &stream, unsigned int indent) = 0;
+
+ void set_reset_groups(const string &_reset_groups)
+ {
+ reset_groups = _reset_groups;
+ }
+
+ void set_source_name(const string &_source_name)
+ {
+ source_name = _source_name;
+ }
+
+ virtual void generate_update_multiple_given(ostream &stream, unsigned int indent) = 0;
+
+ void set_update_multiple_given(const string &_update_multiple_given)
+ {
+ update_multiple_given = _update_multiple_given;
+ }
+
+ void set_usage_string(const string &_usage_string)
+ {
+ usage_string = _usage_string;
+ }
+
+ void set_version_var_name(const string &_version_var_name)
+ {
+ version_var_name = _version_var_name;
+ }
+
+ void generate_c_source(ostream &stream, unsigned int indent = 0);
+
+};
+
+#endif // C_SOURCE_GEN_CLASS_H