#ifndef _GTAG_H
#define _GTAG_H

#include "LVariant.h"
#include "GMap.h"
#include "LXmlTree.h"

class GNamedVariant : public LVariant, public GObj
{
public:
	GNamedVariant(char *s = 0)
	{
		if (s) Name(s);
	}
};

class LTag : public List<GNamedVariant>, public GDom
{
protected:
	char *Element;
	bool ObscurePasswords;

	LVariantType TypeOf(char *Name);

public:
	LTag(char *e);
	~LTag();

	bool IsNumber(char *s);
	bool operator ==(char *s);
	LTag &operator =(LTag &t);
	GNamedVariant *GetNamed(char *Name);
	void Empty();
	bool Read(LXmlTag *t);
	void Write(LFile &f);
	bool GetVariant(const char *Name, LVariant &Value, char *Array = 0);
	bool SetVariant(const char *Name, LVariant &Value, char *Array = 0);
	void SerializeUI(LView *Dlg, GMap<char*,int> &Fields, bool To);
};

#endif
