#ifndef HEADER_INCLUDED__sqltable_H
#define HEADER_INCLUDED__sqltable_H

//---------------------------------------------------------
#include <iostream>
#include <string>
#include <vector>
using std::vector;
using std::string;
using std::cout;
using std::endl;

typedef vector<string> vector_str;
typedef vector<int> vector_int;
typedef vector< vector<string> > array;

#include "PGSQL/type_conversion.h" // Double2String, Int2String...
//---------------------------------------------------------

class Csqltable
{
	friend class CSimpleFeature;

public:
	Csqltable::Csqltable(string TableName);

	Csqltable::Csqltable(int ncols, int nrows);
	
	Csqltable::Csqltable(string TableName,
						 int ncols,
						 int nrows);

	Csqltable::~Csqltable(void);

	//-------------------------------------------
	// GET FUNCTIONS
	//-------------------------------------------
	string			GetTableName();
	int				Get_ncols();
	int				Get_nrows();
	string			GetFieldName(int index);
	string			GetFieldType(int index);
	int				GetFieldTypeInt(int index);
	string			GetConstraints(int index);
	string			GetValue(int col, int row);
	//array			GetMatrix();
	//-------------------------------------------
	// SET FUNCTIONS
	//-------------------------------------------
	void			SetTableName(string name);
	void			Set_ncols(int n);
	void			Set_nrows(int n);
	void			SetFieldName(string name, int n);
	void			SetFieldType(string type, int n);
	void			SetFieldTypeInt(int type, int n);
	void			SetConstraints(string constraint, int n);
	void			SetValue(int value, int col, int row);
	void			SetValue(float value, int col, int row);
	void			SetValue(double value, int col, int row);
	void			SetValue(string value, int col, int row);


protected:
	// Table Attributes
	string			TableName;
	int				ncols;
	int				nrows;
	vector_str		fieldname;
	vector_str		fieldtype;
	vector_int		fieldtypeInt;
	vector_str		constraints;
	array			matrix;

	void			resize_matrix(int ncols, int nrows);

	CTypeConversion	convert;

private:


};

#endif /* #ifndef HEADER_INCLUDED__sqltable */