]> Creatis software - clitk.git/blob - cmake/gengetopt/skels/group_option.h
Added FindGengetopt.cmake which compiles gengetopt if not installed.
[clitk.git] / cmake / gengetopt / skels / group_option.h
1 /*
2  * File automatically generated by
3  * gengen 1.2 by Lorenzo Bettini 
4  * http://www.gnu.org/software/gengen
5  */
6
7 #ifndef GROUP_OPTION_GEN_CLASS_H
8 #define GROUP_OPTION_GEN_CLASS_H
9
10 #include <string>
11 #include <iostream>
12
13 using std::string;
14 using std::ostream;
15
16 class group_option_gen_class
17 {
18  protected:
19   string Comparison_rule;
20   string group_name;
21   string group_var_name;
22   string number_required;
23   string package_var_name;
24
25  public:
26   group_option_gen_class()
27   {
28   }
29   
30   group_option_gen_class(const string &_Comparison_rule, const string &_group_name, const string &_group_var_name, const string &_number_required, const string &_package_var_name) :
31     Comparison_rule (_Comparison_rule), group_name (_group_name), group_var_name (_group_var_name), number_required (_number_required), package_var_name (_package_var_name)
32   {
33   }
34
35   static void
36   generate_string(const string &s, ostream &stream, unsigned int indent)
37   {
38     if (!indent || s.find('\n') == string::npos)
39       {
40         stream << s;
41         return;
42       }
43
44     string::size_type pos;
45     string::size_type start = 0;
46     string ind (indent, ' ');
47     while ( (pos=s.find('\n', start)) != string::npos)
48       {
49         stream << s.substr (start, (pos+1)-start);
50         start = pos+1;
51         if (start+1 <= s.size ())
52           stream << ind;
53       }
54     if (start+1 <= s.size ())
55       stream << s.substr (start);
56   }
57
58   void set_Comparison_rule(const string &_Comparison_rule)
59   {
60     Comparison_rule = _Comparison_rule;
61   }
62
63   void set_group_name(const string &_group_name)
64   {
65     group_name = _group_name;
66   }
67
68   void set_group_var_name(const string &_group_var_name)
69   {
70     group_var_name = _group_var_name;
71   }
72
73   void set_number_required(const string &_number_required)
74   {
75     number_required = _number_required;
76   }
77
78   void set_package_var_name(const string &_package_var_name)
79   {
80     package_var_name = _package_var_name;
81   }
82
83   void generate_group_option(ostream &stream, unsigned int indent = 0);
84   
85 };
86
87 #endif // GROUP_OPTION_GEN_CLASS_H