00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef SWLSTKEY_H
00026 #define SWLSTKEY_H
00027
00028 #include <swkey.h>
00029
00030 #include <defs.h>
00031
00036 class SWDLLEXPORT ListKey : public SWKey {
00037
00038 static SWClass classdef;
00039 void init ();
00040 protected:
00041 int arraypos;
00042 int arraymax;
00043 int arraycnt;
00044 SWKey **array;
00045 public:
00050 ListKey (const char *ikey = 0);
00051 ListKey (ListKey const &k);
00054 virtual ~ ListKey ();
00055
00056 virtual SWKey *clone () const;
00059 virtual void ClearList ();
00063 virtual int Count ();
00066 virtual void Remove ();
00072 virtual char SetToElement (int ielement, SW_POSITION = TOP);
00078 virtual SWKey *GetElement (int pos = -1);
00082 ListKey & operator << (const SWKey &ikey) { add(ikey); return *this; }
00083 virtual void add(const SWKey &ikey);
00084
00089 virtual void copyFrom(const ListKey & ikey);
00090 virtual void copyFrom(const SWKey & ikey) { SWKey::copyFrom(ikey); }
00091
00097 virtual void setPosition(SW_POSITION);
00100 virtual void decrement(int step);
00103 virtual void increment(int step);
00104
00105 virtual char Traversable () { return 1; }
00106 virtual long Index () const { return arraypos; }
00107
00112 virtual long Index (long index) { SetToElement (index); return Index (); }
00113
00114 SWKEY_OPERATORS
00115 ListKey & operator =(const ListKey &key) { copyFrom(key); return *this; }
00116 };
00117
00118
00119 #endif