]> Creatis software - clitk.git/blob - cmake/gengetopt/skels/update_given.h
Added FindGengetopt.cmake which compiles gengetopt if not installed.
[clitk.git] / cmake / gengetopt / skels / update_given.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 UPDATE_GIVEN_GEN_CLASS_H
8 #define UPDATE_GIVEN_GEN_CLASS_H
9
10 #include <string>
11 #include <iostream>
12
13 using std::string;
14 using std::ostream;
15
16 class update_given_gen_class
17 {
18  protected:
19   string option_var_name;
20
21  public:
22   update_given_gen_class()
23   {
24   }
25   
26   update_given_gen_class(const string &_option_var_name) :
27     option_var_name (_option_var_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_option_var_name(const string &_option_var_name)
55   {
56     option_var_name = _option_var_name;
57   }
58
59   void generate_update_given(ostream &stream, unsigned int indent = 0);
60   
61 };
62
63 #endif // UPDATE_GIVEN_GEN_CLASS_H