#ifndef DBNODE_H
#define DBNODE_H

//	--------
//  Settings
//	--------

enum{
	MAX_DB_STRING = 240,
	MAXDROP = 20
};

//	-------------
//  Storage types
//	-------------

enum{
	DB_RAM,
	DB_FLASH
};

//	------------
//  Format types
//	------------

enum{
	FM_INT,
	FM_HEX
};

//	----------
//  Data types
//	----------

enum{
	D_int8_t,
	D_int16_t,
	D_int32_t,
	D_int64_t,
	D_uint8_t,
	D_uint16_t,
	D_uint32_t,
	D_uint64_t,
	D_float,
	D_double,
	D_float3,
	D_double3,
	D_string,
	D_LAST
};

class dbNode
{
public:
	dbNode();
public:
	int index;
	int iT;
	int iR;
	int iC;
	int iE;
	int type;
	int precision;
	const char *name;
	const char *desc;
	const char **list;
	int listMax;
	void *ptr;
	char vstring[MAX_DB_STRING];

public:
	int init(
			int _index,
			int _iT,
			int _iR,
			int _iC,
			int _iE,
			int _type,
			const char *_name,
			const char *_desc,
			void *_ptr,
			const char **_list,
			int _precision
			);
	int nodeToStr(char *strPtr);
	float nodeToFloat();
	int nodeToInt();

	char *nodeToStr();
	int isInteger();
	int isList();
	int listString(char *strPtr,int v);
};


#endif // DBNODE_H
