/*-----------------------------------------------------------------------
 * Xclasses code file
 * ($Id: html_stack.h,v 1.2 1998/08/07 19:11:29 schmitzj Exp $)
 * 
 * Copyright (C) 1998 Jürgen Schmitz
 *
 * HTML Parser system
 * (c) 1998 by Jürgen Schmitz - all rights reserved
 * THIS IS NOT GPL OR SOMETHING OTHER FREE LICENSE!!
 * it may only be used together with Xclasses!
 *-----------------------------------------------------------------------
 */

#ifndef HTML_STACK_H
#define HTML_STACK_H

class html_stack
{
	struct items
	{
		struct items *next;
		char *key;
	};

	struct items	*stack;
	struct items	*last;

	char			*keybuffer;
public:
	html_stack(void);
	~html_stack();

	void Push(char *key);
	char *Pull(void);
	char *Read(void);
	int  Exists(char *key,char *stop=NULL);
	int  Count(char *key,char *stop=NULL);
	void PullUntil(char *key);
	void PullBefore(char *key);
};

class html_valuestack
{
	struct items
	{
		struct items *next;
		unsigned int key;
	};

	struct items	*stack;
	struct items	*last;

public:
	html_valuestack(void);
	~html_valuestack();

	void Push(unsigned int key);
	unsigned int Pull(void);
	unsigned int Read(void);
};

#endif
