/* * File automatically generated by * gengen 1.0 by Lorenzo Bettini * http://www.gnu.org/software/gengen */ #ifndef MULTIPLE_OPTION_GEN_CLASS_H #define MULTIPLE_OPTION_GEN_CLASS_H #include #include using std::string; using std::ostream; class multiple_option_gen_class { protected: string defaultval; string gen_else; string group_var_name; bool has_short_option; string long_option; string option_comment; bool option_has_group; bool option_has_type; bool option_has_values; string option_values; string option_var_name; string package_var_name; string short_option; string type; string update_arg; public: multiple_option_gen_class() : has_short_option (false), option_has_group (false), option_has_type (false), option_has_values (false) { } multiple_option_gen_class(const string &_defaultval, const string &_gen_else, const string &_group_var_name, bool _has_short_option, const string &_long_option, const string &_option_comment, bool _option_has_group, bool _option_has_type, bool _option_has_values, const string &_option_values, const string &_option_var_name, const string &_package_var_name, const string &_short_option, const string &_type, const string &_update_arg) : defaultval (_defaultval), gen_else (_gen_else), group_var_name (_group_var_name), has_short_option (_has_short_option), long_option (_long_option), option_comment (_option_comment), option_has_group (_option_has_group), option_has_type (_option_has_type), option_has_values (_option_has_values), option_values (_option_values), option_var_name (_option_var_name), package_var_name (_package_var_name), short_option (_short_option), type (_type), update_arg (_update_arg) { } 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_defaultval(const string &_defaultval) { defaultval = _defaultval; } void set_gen_else(const string &_gen_else) { gen_else = _gen_else; } void set_group_var_name(const string &_group_var_name) { group_var_name = _group_var_name; } void set_has_short_option(bool _has_short_option) { has_short_option = _has_short_option; } void set_long_option(const string &_long_option) { long_option = _long_option; } void set_option_comment(const string &_option_comment) { option_comment = _option_comment; } void set_option_has_group(bool _option_has_group) { option_has_group = _option_has_group; } void set_option_has_type(bool _option_has_type) { option_has_type = _option_has_type; } void set_option_has_values(bool _option_has_values) { option_has_values = _option_has_values; } void set_option_values(const string &_option_values) { option_values = _option_values; } void set_option_var_name(const string &_option_var_name) { option_var_name = _option_var_name; } void set_package_var_name(const string &_package_var_name) { package_var_name = _package_var_name; } void set_short_option(const string &_short_option) { short_option = _short_option; } void set_type(const string &_type) { type = _type; } void set_update_arg(const string &_update_arg) { update_arg = _update_arg; } void generate_multiple_option(ostream &stream, unsigned int indent = 0); }; #endif // MULTIPLE_OPTION_GEN_CLASS_H