]> Creatis software - clitk.git/blob - cmake/gengetopt/skels/clear_given.h
auto generate dicom file UIDs when new series/study is specified
[clitk.git] / cmake / gengetopt / skels / clear_given.h
1 /*
2  * File automatically generated by
3  * gengen 1.4.1 by Lorenzo Bettini 
4  * http://www.gnu.org/software/gengen
5  */
6
7 #ifndef CLEAR_GIVEN_GEN_CLASS_H
8 #define CLEAR_GIVEN_GEN_CLASS_H
9
10 #include <string>
11 #include <iostream>
12
13 using std::string;
14 using std::ostream;
15
16 class clear_given_gen_class
17 {
18  protected:
19   string arg_struct;
20   bool group;
21   string var_arg;
22
23  public:
24   clear_given_gen_class() :
25     group (false)
26   {
27   }
28   
29   clear_given_gen_class(const string &_arg_struct, bool _group, const string &_var_arg) :
30     arg_struct (_arg_struct), group (_group), var_arg (_var_arg)
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_struct(const string &_arg_struct)
58   {
59     arg_struct = _arg_struct;
60   }
61
62   void set_group(bool _group)
63   {
64     group = _group;
65   }
66
67   void set_var_arg(const string &_var_arg)
68   {
69     var_arg = _var_arg;
70   }
71
72   void generate_clear_given(ostream &stream, unsigned int indent = 0);
73   
74 };
75
76 #endif // CLEAR_GIVEN_GEN_CLASS_H