#pragma once
#include "base_head.h"
#include "Fdbf.h"
#include "CartoBase.h"

//clase helper para imporacion de un dbf a  informacion asociada de cartobase 
class UTILES_EXPORT CartoBaseDBFManager: public ListenerDbf_W, public ListenerDbf_R
{
	CartoBase *cb;
	int _oldRef;
	int _icol;
	int _nncol;
	int _nnrow;
	CartoBaseInfoEntity e;
	int rowE;
	SetEntities *setEnt;
	DataIaCartoBase* ia;
public:
	
	CartoBaseDBFManager(void);
	~CartoBaseDBFManager(void);
	virtual bool leer(char *path, CartoBase*cartb);
	virtual bool grabar(char *path, DataIaCartoBase* iawx, SetEntities* s);


	//funciones auxiliares-----------------------------------
	//funciones de lectura de shp--------------------------
	virtual bool DbfSet( int nrow, int ncolm );
	virtual bool DbfSetColm( char* name, BYTE type, int size );
	virtual bool DbfaddVal( int icol, int v );
	virtual bool DbfaddVal( int icol, double v );
	virtual bool DbfaddVal( int icol, __int64 v );
	virtual bool DbfaddVal( int icol, char* v );
	virtual bool DbfaddVal( int icol, void* v );
	virtual bool DbfFinRow();
	virtual bool DbfFinR();

	//funciones de escritura de dbf-----------------------
	virtual bool DbfGet( int *nrow, int *ncolm);
	virtual bool DbfGetColm( int icol, char* name, BYTE *type, int *size, int*ndecimal );
	virtual bool DbfGetVal( int irow, int icol, int* v );
	virtual bool DbfGetVal( int irow, int icol, double* v );
	virtual bool DbfGetVal( int irow, int icol, __int64* v );
	virtual bool DbfGetVal( int irow, int icol, char** v );
	virtual bool DbfGetVal( int irow, int icol, void** v );
	virtual bool DbfFinW();

	
};
