#ifndef COLUMN_H
#define COLUMN_H

#include "global.h"

#include <vector>
using namespace std;

/**
* This class represents the Column <TD> in a Table.  
* 
* Column contains data in the primitive form. 
*
*
*/
//Date created - 03 May 2002

class Column {

	public:

		/**
		* Default Constructor
		*/
		Column();

		// not used
		Column(char * data);

		/**
		* Destructor
		*/
		~Column();

		/**
		* Assignment operator overloaded.
		*/
		Column operator=(const Column &c);

		/**
		* Copy Constructor
		*/
		Column(const Column &c);

		int setData(char * data, int *status);
		int setRef(char * ref, int *status);

		/**
		* Gets data in boolean array.
		*/
		int getLogicalArray(bool *&b , int &numOfElements, int *status) ;

		/**
		* Gets bit array.
		*/
		int getBitArray(char *&c, int &numOfElements, int *status) ;

		/**
		* Gets byte array.
		*/
		int getByteArray(unsigned char *&c, int &numOfElements, int *status) ;

		/**
		* Gets short array.
		*/
		int getShortArray(short *&array,int &numOfElements, int *status) ;

		/**
		* Gets integer array.
		*/
		int getIntArray(int *&array,int &numOfElements, int *status) ;

		/**
		* Gets long array.
		*/
		int getLongArray(long *&array,int &numOfElements, int *status) ;

		/**
		* Gets character array.
		*/
		int getCharArray(char *&array,int &numOfElements, int *status) ;
		
		/**
		* Gets float array.
		*/
		int getFloatArray(float *&array, int &numOfElements, int *status) ;

		/**
		* Gets double array.
		*/
		int getDoubleArray(double *&array, int &numOfElements, int *status) ;

		/**
		* Gets float complex array.
		*/
		int getFloatComplexArray(float *&array, int &numOfElements, int *status) ;

		/**
		* Gets double complex array.
		*/
		int getDoubleComplexArray(double *&array,int &numOfElements, int *status) ;

		/**
		* Gets attribute 'ref' of <TD>.
		*/
		int getRef(char * ref, int * status);
	
	
	private: 
		char * data;
		char * ref;		

		vector <char *> getArrayOfStrings(char *data, int &numberOfElets);
		int getData(char *&c, int &len, int *status);
		void cleanup();
		void makecopy(const Column &c);
		void init(void);
		void trim(char *&str);


};

#endif