#ifndef CPP_UTILITY_TAGITEM_H
#define CPP_UTILITY_TAGITEM_H

// TagItem Klasse
//
// Autor: Jochen Becher
//
// Historie:
// Version 1.0 am 25. Juni 94

#ifndef UTILITY_TAGITEM_H
#include <utility/tagitem.h>
#endif

#ifndef CPP_EXCEPTIONS_EXCEPTIONS_H
#include <classes/exceptions/exceptions.h>
#endif

class TagItemC {
public:
	TagItemC() throw (MemoryX);
	TagItemC(Tag tag1Type, ...) throw (MemoryX);
	TagItemC(struct TagItem *tags) throw (MemoryX);
	TagItemC(const TagItemC &tc) throw (MemoryX);
	// Eine Zuweisung kopiert die Tags
	TagItemC &operator = (const TagItemC &tc) throw (MemoryX);
	~TagItemC();
	struct TagItem *tags() const { return taglist };
	// Tags an die Tags anhängen
	VOID append(const TagItemC *tags) throw (MemoryX);
	VOID append(Tag tag1Type, ...) throw (MemoryX);
	VOID append(const struct TagItem *tags) throw (MemoryX);
	// Tagswerte in der Liste setzen, bzw. an die Liste anhängen
	VOID set(const TagItemC *tags) throw (MemoryX);
	VOID set(Tag tag1Type, ...) throw (MemoryX);
	VOID set(const struct TagItem *tags) throw (MemoryX);
	// Ein Tag suchen
	struct TagItem *find(Tag tagType) const;
	// Einen Tagwert mit Defaultwert lesen
	ULONG getData(Tag tagType, ULONG defaultData) const;
	// Tags ausfiltern
	ULONG filter(LONG logic, Tag tagTypes[]);
	ULONG filter(LONG logic, Tag tag1, ... );
private:
	struct TagItem *taglist;
};

class TagItemCursorC {
public:
	TagItemCursorC(TagItemC &tc);
	TagItemCursorC(struct TagItem *tags);
	BOOL isDone();
	VOID first();
	VOID next();
	struct TagItem *item() const;
	Tag itemTag() const;
	ULONG itemData() const;
private:
	struct TagItem *taglist;
	struct TagItem *cursor;
	struct TagItem *pos;
};

#endif
