]> Creatis software - clitk.git/blob - cmake/gengetopt/skels/multiple_opt_list.h
auto generate dicom file UIDs when new series/study is specified
[clitk.git] / cmake / gengetopt / skels / multiple_opt_list.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_OPT_LIST_GEN_CLASS_H
8 #define MULTIPLE_OPT_LIST_GEN_CLASS_H
9
10 #include <string>
11 #include <iostream>
12
13 using std::string;
14 using std::ostream;
15
16 class multiple_opt_list_gen_class
17 {
18  protected:
19   string arg_name;
20
21  public:
22   multiple_opt_list_gen_class()
23   {
24   }
25   
26   multiple_opt_list_gen_class(const string &_arg_name) :
27     arg_name (_arg_name)
28   {
29   }
30
31   static void
32   generate_string(const string &s, ostream &stream, unsigned int indent)
33   {
34     if (!indent || s.find('\n') == string::npos)
35       {
36         stream << s;
37         return;
38       }
39
40     string::size_type pos;
41     string::size_type start = 0;
42     string ind (indent, ' ');
43     while ( (pos=s.find('\n', start)) != string::npos)
44       {
45         stream << s.substr (start, (pos+1)-start);
46         start = pos+1;
47         if (start+1 <= s.size ())
48           stream << ind;
49       }
50     if (start+1 <= s.size ())
51       stream << s.substr (start);
52   }
53
54   void set_arg_name(const string &_arg_name)
55   {
56     arg_name = _arg_name;
57   }
58
59   void generate_multiple_opt_list(ostream &stream, unsigned int indent = 0);
60   
61 };
62
63 #endif // MULTIPLE_OPT_LIST_GEN_CLASS_H