#ifndef _RUDATASTORE_BASE_
#define _RUDATASTORE_BASE_

// Base types
#include "../../Core/Type/RuType_Object.h"
#include "../../Core/Stream/RuStreamIO.h"

#pragma unmanaged

// ************************************************************************************************************************************************************

class CRuDataStore_Base : public IRuObject
{
	ruRTTI_DECLARE
	ruHEAP_DECLARE
	ruCLASSGUID_DECLARE

public:
	virtual										~CRuDataStore_Base();

	virtual INT32								CreateTable(const char *tableName, INT32 keyLength) = 0;
	virtual BOOL								DeleteTable(const char *tableName) = 0;
	virtual INT32								GetTableHandle(const char *tableName) = 0;
	virtual INT32								GetTableKeyLength(INT32 tableHandle) = 0;

	virtual INT32								GetNumRecords(INT32 tableHandle) = 0;
	virtual IRuStream*							Retrieve(INT32 tableHandle, const BYTE *key) = 0;
	virtual IRuStream*							RetrieveByIndex(INT32 tableHandle, INT32 index) = 0;
	virtual BOOL								RetrieveKeyByIndex(INT32 tableHandle, INT32 index, BYTE *keyOut) = 0;
	virtual BOOL								Store(INT32 tableHandle, const BYTE *key, IRuStream *stream) = 0;
	virtual BOOL								Delete(INT32 tableHandle, const BYTE *key) = 0;
	virtual BOOL								DeleteAllRecords(INT32 tableHandle) = 0;
};

// ************************************************************************************************************************************************************

#pragma managed

#endif
