OODataBase.h

From Giona

Revision as of 10:43, 18 December 2007 by Rmarino (Talk | contribs)
(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)
#ifndef OODATABASE_H_
#define OODATABASE_H_

#include "gionaTypes.h"
#include "Debug.h"
#include "SqliteDb.h"
#include "SqliteDBResultSet.h"

#include "GenericObject.h"
#include "GenericAttribute.h"

class OODataBase
{
public:
	
	static const int NO_ERROR 				= 0;
	static const int ERROR_SQLITEDB 			= 1;
	static const int ERROR_NULL_PARAMETER			= 2;
	static const int ERROR_OBJECT_EXISTS_YET		= 3;
	static const int ERROR_EMPTY_STRING 			= 4;
	static const int ERROR_OBJECT_NOT_FOUND 		= 5;

	
	OODataBase();
	virtual ~OODataBase();

	bool setDatabaseName(STRING databaseName);
	STRING getDatabaseName();
	int getLastError();
	
	bool connect();
	bool disconnect();
	bool storeNewObject(GenericObject* object);
	bool updateObject(GenericObject* object);
	bool deleteObject(STRING name);
	GenericObject* getObjectByName(STRING name);
	STRING* getObjectNameList();
	
	
private: 
	SqliteDb* db;
	int lastError;
	bool init();
};

#endif /*OODATABASE_H_*/

BACK

Personal tools