]> Creatis software - clitk.git/blob - cmake/gengetopt/skels/multiple_fill_array.h
Added FindGengetopt.cmake which compiles gengetopt if not installed.
[clitk.git] / cmake / gengetopt / skels / multiple_fill_array.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 MULTIPLE_FILL_ARRAY_GEN_CLASS_H
8 #define MULTIPLE_FILL_ARRAY_GEN_CLASS_H
9
10 #include <string>
11 #include <iostream>
12
13 using std::string;
14 using std::ostream;
15
16 class multiple_fill_array_gen_class
17 {
18  protected:
19   string arg_type;
20   string default_value;
21   string option_var_name;
22   string type;
23
24  public:
25   multiple_fill_array_gen_class()
26   {
27   }
28   
29   multiple_fill_array_gen_class(const string &_arg_type, const string &_default_value, const string &_option_var_name, const string &_type) :
30     arg_type (_arg_type), default_value (_default_value), option_var_name (_option_var_name), type (_type)
31   {
32   }
33
34   static void
35   generate_string(const string &s, ostream &stream, unsigned int indent)
36   {
37     if (!indent || s.find('\n') == string::npos)
38       {
39         stream << s;
40         return;
41       }
42
43     string::size_type pos;
44     string::size_type start = 0;
45     string ind (indent, ' ');
46     while ( (pos=s.find('\n', start)) != string::npos)
47       {
48         stream << s.substr (start, (pos+1)-start);
49         start = pos+1;
50         if (start+1 <= s.size ())
51           stream << ind;
52       }
53     if (start+1 <= s.size ())
54       stream << s.substr (start);
55   }
56
57   void set_arg_type(const string &_arg_type)
58   {
59     arg_type = _arg_type;
60   }
61
62   void set_default_value(const string &_default_value)
63   {
64     default_value = _default_value;
65   }
66
67   void set_option_var_name(const string &_option_var_name)
68   {
69     option_var_name = _option_var_name;
70   }
71
72   void set_type(const string &_type)
73   {
74     type = _type;
75   }
76
77   void generate_multiple_fill_array(ostream &stream, unsigned int indent = 0);
78   
79 };
80
81 #endif // MULTIPLE_FILL_ARRAY_GEN_CLASS_H