2 * File automatically generated by
3 * gengen 1.2 by Lorenzo Bettini
4 * http://www.gnu.org/software/gengen
7 #ifndef FREE_STRING_GEN_CLASS_H
8 #define FREE_STRING_GEN_CLASS_H
16 class free_string_gen_class
24 free_string_gen_class() :
25 has_string_type (false)
29 free_string_gen_class(bool _has_string_type, const string &_opt_var, const string &_structure) :
30 has_string_type (_has_string_type), opt_var (_opt_var), structure (_structure)
35 generate_string(const string &s, ostream &stream, unsigned int indent)
37 if (!indent || s.find('\n') == string::npos)
43 string::size_type pos;
44 string::size_type start = 0;
45 string ind (indent, ' ');
46 while ( (pos=s.find('\n', start)) != string::npos)
48 stream << s.substr (start, (pos+1)-start);
50 if (start+1 <= s.size ())
53 if (start+1 <= s.size ())
54 stream << s.substr (start);
57 void set_has_string_type(bool _has_string_type)
59 has_string_type = _has_string_type;
62 void set_opt_var(const string &_opt_var)
67 void set_structure(const string &_structure)
69 structure = _structure;
72 void generate_free_string(ostream &stream, unsigned int indent = 0);
76 #endif // FREE_STRING_GEN_CLASS_H