]> Creatis software - clitk.git/blob - utilities/gengetopt/skels/file_save_multiple.h
Sync gengetopt cmake files with rtk
[clitk.git] / utilities / gengetopt / skels / file_save_multiple.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 FILE_SAVE_MULTIPLE_GEN_CLASS_H
8 #define FILE_SAVE_MULTIPLE_GEN_CLASS_H
9
10 #include <string>
11 #include <iostream>
12
13 using std::string;
14 using std::ostream;
15
16 class file_save_multiple_gen_class
17 {
18  protected:
19   bool has_arg;
20   string opt_name;
21   string opt_var;
22   string values;
23
24  public:
25   file_save_multiple_gen_class() :
26     has_arg (false)
27   {
28   }
29   
30   file_save_multiple_gen_class(bool _has_arg, const string &_opt_name, const string &_opt_var, const string &_values) :
31     has_arg (_has_arg), opt_name (_opt_name), opt_var (_opt_var), values (_values)
32   {
33   }
34
35   static void
36   generate_string(const string &s, ostream &stream, unsigned int indent)
37   {
38     if (!indent || s.find('\n') == string::npos)
39       {
40         stream << s;
41         return;
42       }
43
44     string::size_type pos;
45     string::size_type start = 0;
46     string ind (indent, ' ');
47     while ( (pos=s.find('\n', start)) != string::npos)
48       {
49         stream << s.substr (start, (pos+1)-start);
50         start = pos+1;
51         if (start+1 <= s.size ())
52           stream << ind;
53       }
54     if (start+1 <= s.size ())
55       stream << s.substr (start);
56   }
57
58   void set_has_arg(bool _has_arg)
59   {
60     has_arg = _has_arg;
61   }
62
63   void set_opt_name(const string &_opt_name)
64   {
65     opt_name = _opt_name;
66   }
67
68   void set_opt_var(const string &_opt_var)
69   {
70     opt_var = _opt_var;
71   }
72
73   void set_values(const string &_values)
74   {
75     values = _values;
76   }
77
78   void generate_file_save_multiple(ostream &stream, unsigned int indent = 0);
79   
80 };
81
82 #endif // FILE_SAVE_MULTIPLE_GEN_CLASS_H