]> Creatis software - clitk.git/blob - utilities/gengetopt/skels/header.h
auto generate dicom file UIDs when new series/study is specified
[clitk.git] / utilities / gengetopt / skels / header.h
1 /*
2  * File automatically generated by
3  * gengen 1.4 by Lorenzo Bettini 
4  * http://www.gnu.org/software/gengen
5  */
6
7 #ifndef HEADER_GEN_CLASS_H
8 #define HEADER_GEN_CLASS_H
9
10 #include <string>
11 #include <iostream>
12
13 using std::string;
14 using std::ostream;
15
16 class header_gen_class
17 {
18  protected:
19   string args_info;
20   string enum_types;
21   bool generate_config_parser;
22   bool generate_string_parser;
23   string generator_version;
24   string group_counters;
25   bool has_details;
26   bool has_hidden;
27   string header_file_ext;
28   string header_file_name;
29   string ifndefname;
30   string mode_counters;
31   string option_arg;
32   string option_given;
33   string option_values_decl;
34   string package_var_name;
35   string package_var_val;
36   string parser_name;
37   string version_var_name;
38   string version_var_val;
39
40  public:
41   header_gen_class() :
42     generate_config_parser (false), generate_string_parser (false), has_details (false), has_hidden (false)
43   {
44   }
45   
46   header_gen_class(const string &_args_info, const string &_enum_types, bool _generate_config_parser, bool _generate_string_parser, const string &_generator_version, const string &_group_counters, bool _has_details, bool _has_hidden, const string &_header_file_ext, const string &_header_file_name, const string &_ifndefname, const string &_mode_counters, const string &_option_arg, const string &_option_given, const string &_option_values_decl, const string &_package_var_name, const string &_package_var_val, const string &_parser_name, const string &_version_var_name, const string &_version_var_val) :
47     args_info (_args_info), enum_types (_enum_types), generate_config_parser (_generate_config_parser), generate_string_parser (_generate_string_parser), generator_version (_generator_version), group_counters (_group_counters), has_details (_has_details), has_hidden (_has_hidden), header_file_ext (_header_file_ext), header_file_name (_header_file_name), ifndefname (_ifndefname), mode_counters (_mode_counters), option_arg (_option_arg), option_given (_option_given), option_values_decl (_option_values_decl), package_var_name (_package_var_name), package_var_val (_package_var_val), parser_name (_parser_name), version_var_name (_version_var_name), version_var_val (_version_var_val)
48   {
49   }
50
51   virtual ~header_gen_class()
52   {
53   }
54
55   static void
56   generate_string(const string &s, ostream &stream, unsigned int indent)
57   {
58     if (!indent || s.find('\n') == string::npos)
59       {
60         stream << s;
61         return;
62       }
63
64     string::size_type pos;
65     string::size_type start = 0;
66     string ind (indent, ' ');
67     while ( (pos=s.find('\n', start)) != string::npos)
68       {
69         stream << s.substr (start, (pos+1)-start);
70         start = pos+1;
71         if (start+1 <= s.size ())
72           stream << ind;
73       }
74     if (start+1 <= s.size ())
75       stream << s.substr (start);
76   }
77
78   void set_args_info(const string &_args_info)
79   {
80     args_info = _args_info;
81   }
82
83   virtual void generate_enum_types(ostream &stream, unsigned int indent) = 0;
84
85   void set_enum_types(const string &_enum_types)
86   {
87     enum_types = _enum_types;
88   }
89
90   void set_generate_config_parser(bool _generate_config_parser)
91   {
92     generate_config_parser = _generate_config_parser;
93   }
94
95   void set_generate_string_parser(bool _generate_string_parser)
96   {
97     generate_string_parser = _generate_string_parser;
98   }
99
100   void set_generator_version(const string &_generator_version)
101   {
102     generator_version = _generator_version;
103   }
104
105   virtual void generate_group_counters(ostream &stream, unsigned int indent) = 0;
106
107   void set_group_counters(const string &_group_counters)
108   {
109     group_counters = _group_counters;
110   }
111
112   void set_has_details(bool _has_details)
113   {
114     has_details = _has_details;
115   }
116
117   void set_has_hidden(bool _has_hidden)
118   {
119     has_hidden = _has_hidden;
120   }
121
122   void set_header_file_ext(const string &_header_file_ext)
123   {
124     header_file_ext = _header_file_ext;
125   }
126
127   void set_header_file_name(const string &_header_file_name)
128   {
129     header_file_name = _header_file_name;
130   }
131
132   void set_ifndefname(const string &_ifndefname)
133   {
134     ifndefname = _ifndefname;
135   }
136
137   virtual void generate_mode_counters(ostream &stream, unsigned int indent) = 0;
138
139   void set_mode_counters(const string &_mode_counters)
140   {
141     mode_counters = _mode_counters;
142   }
143
144   virtual void generate_option_arg(ostream &stream, unsigned int indent) = 0;
145
146   void set_option_arg(const string &_option_arg)
147   {
148     option_arg = _option_arg;
149   }
150
151   virtual void generate_option_given(ostream &stream, unsigned int indent) = 0;
152
153   void set_option_given(const string &_option_given)
154   {
155     option_given = _option_given;
156   }
157
158   virtual void generate_option_values_decl(ostream &stream, unsigned int indent) = 0;
159
160   void set_option_values_decl(const string &_option_values_decl)
161   {
162     option_values_decl = _option_values_decl;
163   }
164
165   void set_package_var_name(const string &_package_var_name)
166   {
167     package_var_name = _package_var_name;
168   }
169
170   void set_package_var_val(const string &_package_var_val)
171   {
172     package_var_val = _package_var_val;
173   }
174
175   void set_parser_name(const string &_parser_name)
176   {
177     parser_name = _parser_name;
178   }
179
180   void set_version_var_name(const string &_version_var_name)
181   {
182     version_var_name = _version_var_name;
183   }
184
185   void set_version_var_val(const string &_version_var_val)
186   {
187     version_var_val = _version_var_val;
188   }
189
190   void generate_header(ostream &stream, unsigned int indent = 0);
191   
192 };
193
194 #endif // HEADER_GEN_CLASS_H