diff options
Diffstat (limited to 'include/swkey.h')
-rw-r--r-- | include/swkey.h | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/include/swkey.h b/include/swkey.h index eea2135..89786f0 100644 --- a/include/swkey.h +++ b/include/swkey.h @@ -1,11 +1,12 @@ /****************************************************************************** - * swkey.h - code for base class 'swkey'. swkey is the basis for all - * types of keys for indexing into modules (e.g. verse, word, - * place, etc.) * - * $Id: swkey.h 2324 2009-04-20 18:40:15Z scribe $ + * swkey.h - code for base class 'swkey'. swkey is the basis for all + * types of keys for indexing into modules (e.g. verse, word, + * place, etc.) * - * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org) + * $Id: swkey.h 2926 2013-07-31 02:06:33Z scribe $ + * + * Copyright 1998-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -27,6 +28,7 @@ #include <swobject.h> #include <defs.h> +#include <sysdata.h> #include <utilstr.h> SWORD_NAMESPACE_START @@ -102,8 +104,8 @@ protected: char *keytext; mutable char *rangeText; mutable bool boundSet; - char persist; - char error; + bool persist; + mutable char error; char *localeName; SWLocale *getPrivateLocale() const; @@ -111,8 +113,8 @@ protected: public: - // misc pointer for whatever - void *userData; + // misc storage for whatever + __u64 userData; /** initializes instance of SWKey from a string * All keys can be reduced to a string representation which should be able @@ -124,7 +126,7 @@ public: /** Copy Constructor * @param k The SWKey object to copy. */ - SWKey(SWKey const &k); + SWKey(const SWKey &k); /** Destructor, cleans up this instance of SWKey */ @@ -136,23 +138,27 @@ public: */ virtual SWKey *clone() const; + /** Gets whether this key should persist in any module to which it is set * otherwise just a copy will be used in the module. * @return 1 - persists in module; 0 - a copy is attempted */ - char Persist() const; + bool isPersist() const; + SWDEPRECATED char Persist() const { return isPersist(); } /** Sets whether this key should persist in any module to which it is set * otherwise just a copy will be used in the module. * @param ipersist value which to set persist; * @return 1 - persists in module; 0 - a copy is attempted */ - char Persist(signed char ipersist); + SWDEPRECATED char Persist(signed char ipersist) { setPersist(ipersist!=0); return isPersist(); } + void setPersist(bool ipersist); /** Gets and clears error status * @return error status */ - virtual char Error(); + SWDEPRECATED char Error() { return popError(); } + virtual char popError(); virtual void setError(char err) { error = err; } /** Sets this SWKey with a character string @@ -203,10 +209,6 @@ public: */ virtual void increment(int steps = 1); - /** deprecated, use isTraversible - */ - char Traversable() { return (isTraversable()) ? 1:0; } - /** Whether or not this key can be ++ -- incremented */ virtual bool isTraversable() const { return false; } @@ -216,11 +218,11 @@ public: /** Use this function to get an index position within a module. */ - virtual long Index() const { return index; } + virtual long getIndex() const { return index; } /** See documentation for @ref Index() */ - virtual long Index(long iindex) { index = iindex; return index; } + virtual void setIndex(long iindex) { index = iindex; } SWKEY_OPERATORS |