]> Creatis software - clitk.git/blob - utilities/gengetopt/skels/init_args_info.h
auto generate dicom file UIDs when new series/study is specified
[clitk.git] / utilities / gengetopt / skels / init_args_info.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 INIT_ARGS_INFO_GEN_CLASS_H
8 #define INIT_ARGS_INFO_GEN_CLASS_H
9
10 #include <string>
11 #include <iostream>
12
13 using std::string;
14 using std::ostream;
15
16 class init_args_info_gen_class
17 {
18  protected:
19   string help_strings;
20   string max;
21   string min;
22   bool multiple;
23   string num;
24   string var_arg;
25
26  public:
27   init_args_info_gen_class() :
28     multiple (false)
29   {
30   }
31   
32   init_args_info_gen_class(const string &_help_strings, const string &_max, const string &_min, bool _multiple, const string &_num, const string &_var_arg) :
33     help_strings (_help_strings), max (_max), min (_min), multiple (_multiple), num (_num), var_arg (_var_arg)
34   {
35   }
36
37   static void
38   generate_string(const string &s, ostream &stream, unsigned int indent)
39   {
40     if (!indent || s.find('\n') == string::npos)
41       {
42         stream << s;
43         return;
44       }
45
46     string::size_type pos;
47     string::size_type start = 0;
48     string ind (indent, ' ');
49     while ( (pos=s.find('\n', start)) != string::npos)
50       {
51         stream << s.substr (start, (pos+1)-start);
52         start = pos+1;
53         if (start+1 <= s.size ())
54           stream << ind;
55       }
56     if (start+1 <= s.size ())
57       stream << s.substr (start);
58   }
59
60   void set_help_strings(const string &_help_strings)
61   {
62     help_strings = _help_strings;
63   }
64
65   void set_max(const string &_max)
66   {
67     max = _max;
68   }
69
70   void set_min(const string &_min)
71   {
72     min = _min;
73   }
74
75   void set_multiple(bool _multiple)
76   {
77     multiple = _multiple;
78   }
79
80   void set_num(const string &_num)
81   {
82     num = _num;
83   }
84
85   void set_var_arg(const string &_var_arg)
86   {
87     var_arg = _var_arg;
88   }
89
90   void generate_init_args_info(ostream &stream, unsigned int indent = 0);
91   
92 };
93
94 #endif // INIT_ARGS_INFO_GEN_CLASS_H