]> Creatis software - clitk.git/blob - cmake/gengetopt/skels/enum_decl.h
Added FindGengetopt.cmake which compiles gengetopt if not installed.
[clitk.git] / cmake / gengetopt / skels / enum_decl.h
1 /*
2  * File automatically generated by
3  * gengen 1.4.2 by Lorenzo Bettini 
4  * http://www.gnu.org/software/gengen
5  */
6
7 #ifndef ENUM_DECL_GEN_CLASS_H
8 #define ENUM_DECL_GEN_CLASS_H
9
10 #include <string>
11 #include <iostream>
12
13 using std::string;
14 using std::ostream;
15
16 class enum_decl_gen_class
17 {
18  protected:
19   string enum_values;
20   string var_arg;
21
22  public:
23   enum_decl_gen_class()
24   {
25   }
26   
27   enum_decl_gen_class(const string &_enum_values, const string &_var_arg) :
28     enum_values (_enum_values), var_arg (_var_arg)
29   {
30   }
31
32   static void
33   generate_string(const string &s, ostream &stream, unsigned int indent)
34   {
35     if (!indent || s.find('\n') == string::npos)
36       {
37         stream << s;
38         return;
39       }
40
41     string::size_type pos;
42     string::size_type start = 0;
43     string ind (indent, ' ');
44     while ( (pos=s.find('\n', start)) != string::npos)
45       {
46         stream << s.substr (start, (pos+1)-start);
47         start = pos+1;
48         if (start+1 <= s.size ())
49           stream << ind;
50       }
51     if (start+1 <= s.size ())
52       stream << s.substr (start);
53   }
54
55   void set_enum_values(const string &_enum_values)
56   {
57     enum_values = _enum_values;
58   }
59
60   void set_var_arg(const string &_var_arg)
61   {
62     var_arg = _var_arg;
63   }
64
65   void generate_enum_decl(ostream &stream, unsigned int indent = 0);
66   
67 };
68
69 #endif // ENUM_DECL_GEN_CLASS_H