X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=utilities%2Fgengetopt%2Fskels%2Fclear_arg.h;fp=utilities%2Fgengetopt%2Fskels%2Fclear_arg.h;h=bf4bb14555e5de45fac3dfc6e6865ae8b27cfdd3;hb=79381bc54b9e0c85156460daa211fe5ac83da0a7;hp=0000000000000000000000000000000000000000;hpb=4454c06e212fb6af58d206f2d6f9b76778858967;p=clitk.git diff --git a/utilities/gengetopt/skels/clear_arg.h b/utilities/gengetopt/skels/clear_arg.h new file mode 100644 index 0000000..bf4bb14 --- /dev/null +++ b/utilities/gengetopt/skels/clear_arg.h @@ -0,0 +1,88 @@ +/* + * File automatically generated by + * gengen 1.2 by Lorenzo Bettini + * http://www.gnu.org/software/gengen + */ + +#ifndef CLEAR_ARG_GEN_CLASS_H +#define CLEAR_ARG_GEN_CLASS_H + +#include +#include + +using std::string; +using std::ostream; + +class clear_arg_gen_class +{ + protected: + bool has_arg; + bool has_orig; + string name; + string suffix; + string value; + + public: + clear_arg_gen_class() : + has_arg (false), has_orig (false) + { + } + + clear_arg_gen_class(bool _has_arg, bool _has_orig, const string &_name, const string &_suffix, const string &_value) : + has_arg (_has_arg), has_orig (_has_orig), name (_name), suffix (_suffix), value (_value) + { + } + + 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_has_arg(bool _has_arg) + { + has_arg = _has_arg; + } + + void set_has_orig(bool _has_orig) + { + has_orig = _has_orig; + } + + void set_name(const string &_name) + { + name = _name; + } + + void set_suffix(const string &_suffix) + { + suffix = _suffix; + } + + void set_value(const string &_value) + { + value = _value; + } + + void generate_clear_arg(ostream &stream, unsigned int indent = 0); + +}; + +#endif // CLEAR_ARG_GEN_CLASS_H