#include "node.h"
#include "String.h"	// Added by ClassView

#ifndef LIST_H
#define LIST_H

const String emptyString = "***EMPTY***";

class list  
{
	node * listHead;  //points to the head of the list.
	node * currentPos;  //pointer to the current position.
public:

	int isAtTail(); //returns 1 if currentPos points to tail, 0 otherwise
	int isAtHead(); //returns 1 if currentPos points to head, 0 otherwise

	const list & operator--(int); // the int is a dummy argument
			// increase currentPos to the next one, If at end, stays there.

	const list & operator++(int); // the int is a dummy arg. 
				//It declares the operator as postfix.
				//It decreases currentPos to point to previos. 
				//If at head, stay there.

	String getCurrent(); // returns the name of the currentPos.
				//If list is empty it returns emptyString (defined above)

	int find(const String name);   
			//sets currentPos to match name, returns 1 if found, 0 otherwise

	int eliminate(); //eliminates node at currentPos
	int eliminate(const String name); 
			//eliminates the node with name IF there is one.
	
	void print() const;  // prints the list

	virtual void insert(String newName);  
			//inserts new name just AFTER the currentPos.
			//set currentPos to point to new node.
	virtual void insertAtHead(String newName); 
			//inserts a new name at the head (listHead).
			//set currentPos to point to new node.

	list(); //constructor
	virtual ~list(); //destructor

};


#endif
