/*
 * File automatically generated by
 * gengen 1.4.3 by Lorenzo Bettini 
 * http://www.gnu.org/software/gengen
 */

#ifndef FILE_SAVE_GEN_CLASS_H
#define FILE_SAVE_GEN_CLASS_H

#include <string>
#include <iostream>

using std::string;
using std::ostream;

class file_save_gen_class
{
 protected:
  string arg;
  string given;
  string opt_name;
  string values;

 public:
  file_save_gen_class()
  {
  }
  
  file_save_gen_class(const string &_arg, const string &_given, const string &_opt_name, const string &_values) :
    arg (_arg), given (_given), opt_name (_opt_name), values (_values)
  {
  }

  static void
  generate_string(const string &s, ostream &stream, unsigned int indent)
  {
    if (!indent || s.find('\n') == string::npos)
      {
        stream << s;
        return;
      }

    string::size_type pos;
    string::size_type start = 0;
    string ind (indent, ' ');
    while ( (pos=s.find('\n', start)) != string::npos)
      {
        stream << s.substr (start, (pos+1)-start);
        start = pos+1;
        if (start+1 <= s.size ())
          stream << ind;
      }
    if (start+1 <= s.size ())
      stream << s.substr (start);
  }

  void set_arg(const string &_arg)
  {
    arg = _arg;
  }

  void set_given(const string &_given)
  {
    given = _given;
  }

  void set_opt_name(const string &_opt_name)
  {
    opt_name = _opt_name;
  }

  void set_values(const string &_values)
  {
    values = _values;
  }

  void generate_file_save(ostream &stream, unsigned int indent = 0);
  
};

#endif // FILE_SAVE_GEN_CLASS_H
