git-svn-id: svn://svn.code.sf.net/p/bitchx/code/tags/ircii-pana-1.1-final@1 13b04d17-f746-0410-82c6-800466cd88b0
54 lines
1.1 KiB
C++
54 lines
1.1 KiB
C++
#ifndef _LIST_H_
|
|
#define _LIST_H_
|
|
|
|
#include "gnode.h"
|
|
|
|
struct listNode;
|
|
typedef struct listNode {
|
|
char *item;
|
|
List *itemList;
|
|
genericNode *itemNode;
|
|
|
|
listNode *nextPtr; // pointer to next option
|
|
listNode *prevPtr;
|
|
};
|
|
|
|
class List {
|
|
public:
|
|
List();
|
|
~List();
|
|
void InsertBefore(char *item);
|
|
void InsertBefore(List *item);
|
|
void InsertBefore(genericNode *item);
|
|
void InsertAfter(char *item);
|
|
void InsertAfter(List *item);
|
|
void InsertAfter(genericNode *item);
|
|
|
|
// returns true if everything is good, false if operation failed
|
|
bool GoTop(void); // GOOD
|
|
bool GoNext(void); // GOOD
|
|
bool GoPrev(void);
|
|
bool GoItem(int n);
|
|
bool empty(void); // GOOD
|
|
int length(void); // GOOD
|
|
|
|
char *currItem(void);
|
|
List *currItemList(void);
|
|
genericNode *currItemNode(void);
|
|
void Print(void);
|
|
|
|
friend List *MakeFeatList(char *text);
|
|
|
|
friend List *makeFeatureList(char *text); // GOOD
|
|
friend ostream &operator<<(ostream &out_file, const List &l); // GOOD
|
|
friend List *substitute(List *old, List *assign);
|
|
|
|
private:
|
|
listNode *rootPtr;
|
|
listNode *currPtr;
|
|
};
|
|
|
|
List *MakeList(char *text);
|
|
|
|
#endif
|