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

#ifndef LUA_CONVERT_GEN_CLASS_H
#define LUA_CONVERT_GEN_CLASS_H

#include <string>
#include <iostream>

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

class lua_convert_gen_class
{
 protected:
  bool hasbools;
  bool hasints;

 public:
  lua_convert_gen_class() :
    hasbools (false), hasints (false)
  {
  }
  
  lua_convert_gen_class(bool _hasbools, bool _hasints) :
    hasbools (_hasbools), hasints (_hasints)
  {
  }

  void set_hasbools(bool _hasbools)
  {
    hasbools = _hasbools;
  }

  void set_hasints(bool _hasints)
  {
    hasints = _hasints;
  }

  void generate_lua_convert(ostream &stream, unsigned int indent = 0)
  {
    string indent_str (indent, ' ');
    indent = 0;
  
    stream << "\n";
    stream << indent_str;
    if (hasints)
      {
        stream << "\n";
        stream << indent_str;
        stream << "function int_to_string(i)";
        stream << "\n";
        stream << indent_str;
        stream << "  return tostring(i)";
        stream << "\n";
        stream << indent_str;
        stream << "end";
        stream << "\n";
        stream << indent_str;
        stream << "\n";
        stream << indent_str;
      }
    stream << "\n";
    stream << indent_str;
    if (hasbools)
      {
        stream << "\n";
        stream << indent_str;
        stream << "function bool_to_string(b)";
        stream << "\n";
        stream << indent_str;
        stream << "  return b";
        stream << "\n";
        stream << indent_str;
        stream << "end";
        stream << "\n";
        stream << indent_str;
        stream << "\n";
        stream << indent_str;
      }
  }
};

#endif // LUA_CONVERT_GEN_CLASS_H
