2 * File automatically generated by
3 * gengen 1.4 by Lorenzo Bettini
4 * http://www.gnu.org/software/gengen
7 #ifndef HEADER_GEN_CLASS_H
8 #define HEADER_GEN_CLASS_H
16 class header_gen_class
21 bool generate_config_parser;
22 bool generate_string_parser;
23 string generator_version;
24 string group_counters;
27 string header_file_ext;
28 string header_file_name;
33 string option_values_decl;
34 string package_var_name;
35 string package_var_val;
37 string version_var_name;
38 string version_var_val;
42 generate_config_parser (false), generate_string_parser (false), has_details (false), has_hidden (false)
46 header_gen_class(const string &_args_info, const string &_enum_types, bool _generate_config_parser, bool _generate_string_parser, const string &_generator_version, const string &_group_counters, bool _has_details, bool _has_hidden, const string &_header_file_ext, const string &_header_file_name, const string &_ifndefname, const string &_mode_counters, const string &_option_arg, const string &_option_given, const string &_option_values_decl, const string &_package_var_name, const string &_package_var_val, const string &_parser_name, const string &_version_var_name, const string &_version_var_val) :
47 args_info (_args_info), enum_types (_enum_types), generate_config_parser (_generate_config_parser), generate_string_parser (_generate_string_parser), generator_version (_generator_version), group_counters (_group_counters), has_details (_has_details), has_hidden (_has_hidden), header_file_ext (_header_file_ext), header_file_name (_header_file_name), ifndefname (_ifndefname), mode_counters (_mode_counters), option_arg (_option_arg), option_given (_option_given), option_values_decl (_option_values_decl), package_var_name (_package_var_name), package_var_val (_package_var_val), parser_name (_parser_name), version_var_name (_version_var_name), version_var_val (_version_var_val)
51 virtual ~header_gen_class()
56 generate_string(const string &s, ostream &stream, unsigned int indent)
58 if (!indent || s.find('\n') == string::npos)
64 string::size_type pos;
65 string::size_type start = 0;
66 string ind (indent, ' ');
67 while ( (pos=s.find('\n', start)) != string::npos)
69 stream << s.substr (start, (pos+1)-start);
71 if (start+1 <= s.size ())
74 if (start+1 <= s.size ())
75 stream << s.substr (start);
78 void set_args_info(const string &_args_info)
80 args_info = _args_info;
83 virtual void generate_enum_types(ostream &stream, unsigned int indent) = 0;
85 void set_enum_types(const string &_enum_types)
87 enum_types = _enum_types;
90 void set_generate_config_parser(bool _generate_config_parser)
92 generate_config_parser = _generate_config_parser;
95 void set_generate_string_parser(bool _generate_string_parser)
97 generate_string_parser = _generate_string_parser;
100 void set_generator_version(const string &_generator_version)
102 generator_version = _generator_version;
105 virtual void generate_group_counters(ostream &stream, unsigned int indent) = 0;
107 void set_group_counters(const string &_group_counters)
109 group_counters = _group_counters;
112 void set_has_details(bool _has_details)
114 has_details = _has_details;
117 void set_has_hidden(bool _has_hidden)
119 has_hidden = _has_hidden;
122 void set_header_file_ext(const string &_header_file_ext)
124 header_file_ext = _header_file_ext;
127 void set_header_file_name(const string &_header_file_name)
129 header_file_name = _header_file_name;
132 void set_ifndefname(const string &_ifndefname)
134 ifndefname = _ifndefname;
137 virtual void generate_mode_counters(ostream &stream, unsigned int indent) = 0;
139 void set_mode_counters(const string &_mode_counters)
141 mode_counters = _mode_counters;
144 virtual void generate_option_arg(ostream &stream, unsigned int indent) = 0;
146 void set_option_arg(const string &_option_arg)
148 option_arg = _option_arg;
151 virtual void generate_option_given(ostream &stream, unsigned int indent) = 0;
153 void set_option_given(const string &_option_given)
155 option_given = _option_given;
158 virtual void generate_option_values_decl(ostream &stream, unsigned int indent) = 0;
160 void set_option_values_decl(const string &_option_values_decl)
162 option_values_decl = _option_values_decl;
165 void set_package_var_name(const string &_package_var_name)
167 package_var_name = _package_var_name;
170 void set_package_var_val(const string &_package_var_val)
172 package_var_val = _package_var_val;
175 void set_parser_name(const string &_parser_name)
177 parser_name = _parser_name;
180 void set_version_var_name(const string &_version_var_name)
182 version_var_name = _version_var_name;
185 void set_version_var_val(const string &_version_var_val)
187 version_var_val = _version_var_val;
190 void generate_header(ostream &stream, unsigned int indent = 0);
194 #endif // HEADER_GEN_CLASS_H