

#ifndef AFC_STRINGNODE_H
#define AFC_STRINGNODE_H


/*  StringNode.h  $ 19/05/97 FR MT $  */
/*																		*/
/*  $VER: StringNode 3.10						  */


#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif

#ifndef EXEC_LISTS_H
#include <exec/lists.h>
#endif

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


/* Version and revision */

#define STRINGNODE_VERSION  3
#define STRINGNODE_REVISION 10

/* Error codes */

#define STRINGNODE_BASE 0x00020000
#define STERR_NOMEMORY  (STRINGNODE_BASE + 0)

/* Tag IDs */

#define TAGSTR_Dummy    0x00001000
#define TAGSTR_MaxChars (TAGSTR_Dummy + 0)


/* Class prototype */

class stringnode
{
   public:

   stringnode(void);
   ~stringnode(void);
   ULONG error(void);
   STRPTR add(STRPTR s, ULONG mode = NM_ADD_TAIL);
   STRPTR insert(STRPTR s);
   STRPTR obj(void);
   BOOL empty(void);
   STRPTR first(void);
   STRPTR succ(void);
   STRPTR prev(void);
   Node *get(void);
   List *addr(void);
   BOOL push(void);
   STRPTR pop(BOOL autopos = TRUE);
   STRPTR del(void);
   void clearstack(void);
   STRPTR last(void);
   BOOL clear(void);
   ULONG numitems(void);
   STRPTR item(ULONG n);
   STRPTR change(STRPTR s);
   LONG pos(void);
   STRPTR search(STRPTR str, ULONG fromhere = FALSE);
   void setattrs(struct TagItem *tags);
   void sort(ULONG nocase = FALSE, ULONG inverted = FALSE);
   ULONG version(BOOL rev=FALSE);
};


#endif


