/*
 * Copyright (c) 2004-2008 Darron M Broad
 * All rights reserved.
 *
 * Licensed under the terms of the GPL3 license, see file COPYING for details.
 */

#ifndef _SQLITE_H
#define _SQLITE_H

/* Choose 3 for SQLITE3 API */
#define SQLITEAPI (3)

using namespace std;
#include <string>
#include <vector>
#include <iostream>
#include <iomanip>
#include <fstream>

extern "C" {
#include <stdlib.h>
#if SQLITEAPI == 3
#include <sqlite3.h>
#else
#include <sqlite.h>
#endif
};

#include "util.h"


class Sqlite
{
private:
#if SQLITEAPI == 3
	sqlite3 *db;
#else
	sqlite *db;
#endif
	bool init;

protected:

public:
	Sqlite(const char *);
	Sqlite(const char *, const char *);
	~Sqlite(void);

	bool getinit(void) { return init; }

        void SQLcommand(const char *);
	int SQLcount(const char *);
	int SQLquery(const char *, Matrix<string> *);
	string SQLescape(string);
	
	void SQLfile(const char *);
};

#endif /* !_SQLITE_H */
