/*
 *	 /home/fx/workspace/gitted/cmake/sql/include/sqlJobs.h
 *	 Generated by sql2class v1.9.3 by (C) AH 2000-2006
 *	  using command line
 *	  $ sql2class -sqlite -build -global -prefix /home/fx/workspace/gitted/cmake/sql -lib sqlJobs -namespace db -overwrite dump
 *	 Date: Sat Nov 20 09:19:55 2010
 */

/*
Copyright (C) 2001-2006  Anders Hedstrom (grymse@alhem.net)

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

#ifndef _SQLJOBS_H
#define _SQLJOBS_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <map>

#include <vector>
#include <string>

#include <sqlite3.h>
#include "libsqlitewrapped.h"

#ifdef _WIN32
#define strncasecmp strnicmp
#define strcasecmp stricmp
#endif // _WIN32

/**
 **  Class 'Version' and 'cVersion'
 **/

namespace db
{
class Version {
public:
	Version(Database *);
	Version(Database *,const std::string& );
	Version(Database *,Query *,int = 0 /* offset */);
	~Version();
	Database& GetDatabase() { return *database; }

	unsigned long long int insert();
	void save();
	std::string xml();
	std::string xml(const std::string& ,const std::string& );
	size_t num_cols();

	long GetValue() { return this -> value; }
	void SetValue(long x) { this -> value = x; }

	// table columns
private:
	long                     value; // integer
	//
	void clear();
	void spawn(const std::string& );
	void spawn(Query *,int = 0 /* offset */);
	void select(const std::string& );
	//
	Database *database;
	short new_object;
}; // End of class 'Version'

} // end of namespace

/**
 **  Class 'Jobs' and 'cJobs'
 **/

namespace db
{
class Jobs {
public:
	Jobs(Database *);
	Jobs(Database *,const std::string& );
	Jobs(Database *,Query *,int = 0 /* offset */);
	Jobs(Database&,long id);
	~Jobs();
	Database& GetDatabase() { return *database; }

	unsigned long long int insert();
	void update();
	void save();
	void erase();
	std::string xml();
	std::string xml(const std::string& ,const std::string& );
	size_t num_cols();

	long GetId() { return this -> id; }
	void SetId(long x) { this -> id = x; }
	const char *GetJscript() { return this -> jscript.c_str(); }
	void SetJscript(const std::string&  x) { this -> jscript = x; }
	const char *GetJobname() { return this -> jobname.c_str(); }
	void SetJobname(const std::string&  x) { this -> jobname = x; }
	const char *GetOutputfile() { return this -> outputfile.c_str(); }
	void SetOutputfile(const std::string&  x) { this -> outputfile = x; }
	long GetStatus() { return this -> status; }
	void SetStatus(long x) { this -> status = x; }
	long GetStarttime() { return this -> starttime; }
	void SetStarttime(long x) { this -> starttime = x; }
	long GetEndtime() { return this -> endtime; }
	void SetEndtime(long x) { this -> endtime = x; }

	// table columns
private:
	long                     id; // integer
	std::string              jscript; // varchar(100)
	std::string              jobname; // varchar(100)
	std::string              outputfile; // varchar(256)
	long                     status; // integer
	long                     starttime; // integer
	long                     endtime; // integer
	//
	void clear();
	void spawn(const std::string& );
	void spawn(Query *,int = 0 /* offset */);
	void select(const std::string& );
	void update(long id);
	//
	Database *database;
	short new_object;
}; // End of class 'Jobs'

} // end of namespace
#endif // _SQLJOBS_H
