Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

listkey.h

00001 /******************************************************************************
00002  * listkey.h    - code for base class 'listkey'.  listkey is the basis for all
00003  *                              types of keys for indexing into modules
00004  *                              (e.g. verse, word,
00005  *                              place, etc.)
00006  *
00007  * $Id: listkey.h-source.html,v 1.10 2001/05/25 10:44:21 jansorg Exp $
00008  *
00009  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
00010  *      CrossWire Bible Society
00011  *      P. O. Box 2528
00012  *      Tempe, AZ  85280-2528
00013  *
00014  * This program is free software; you can redistribute it and/or modify it
00015  * under the terms of the GNU General Public License as published by the
00016  * Free Software Foundation version 2.
00017  *
00018  * This program is distributed in the hope that it will be useful, but
00019  * WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00021  * General Public License for more details.
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   virtual ListKey & operator << (const SWKey &ikey);
00087   virtual ListKey & operator = (const ListKey & ikey);
00088   virtual SWKey & operator = (const char *ikey) { return SWKey::operator =
00089       (ikey);}
00090   virtual SWKey & operator = (const SWKey & ikey) { return SWKey::operator =
00091       (ikey);}
00097   virtual SWKey & operator = (SW_POSITION);
00100   virtual SWKey & operator -= (int decrement);
00103   virtual SWKey & operator += (int increment);
00104   virtual char Traversable ()
00105   {
00106     return 1;
00107   }
00108   virtual long Index () const
00109   {
00110     return arraypos;
00111   }
00116   virtual long Index (long index)
00117   {
00118     SetToElement (index);
00119     return Index ();
00120   }
00121 };
00122 
00123 
00124 #endif

Generated at Thu May 24 19:50:25 2001 for The Sword Project by doxygen1.1.5 written by Dimitri van Heesch, © 1997-2000