#include <swkey.h>
Inheritance diagram for sword::SWKey:
Public Member Functions | |
SWKey (const char *ikey=0) | |
initializes instance of SWKey | |
SWKey (SWKey const &k) | |
Copy Constructor. | |
virtual | ~SWKey () |
Destructor, cleans up this instance of SWKey. | |
virtual SWKey * | clone () const |
Returns a copy of this SWKey object. | |
char | Persist () const |
Gets whether this object itself persists within a module that it was used to setKey or just a copy. | |
char | Persist (signed char ipersist) |
Set/gets whether this object itself persists within a module that it was used to setKey or just a copy. | |
virtual char | Error () |
Gets and clears error status. | |
virtual void | setText (const char *ikey) |
Equates this SWKey to a character string. | |
virtual void | copyFrom (const SWKey &ikey) |
Equates this SWKey to another SWKey object. | |
virtual const char * | getText () const |
returns text key if (char *) cast is requested | |
virtual const char * | getShortText () const |
virtual const char * | getRangeText () const |
virtual bool | isBoundSet () const |
virtual int | compare (const SWKey &ikey) |
Compares another VerseKey object. | |
virtual bool | equals (const SWKey &ikey) |
Compares another VerseKey object. | |
virtual void | setPosition (SW_POSITION) |
virtual void | decrement (int steps=1) |
Decrements key a number of entries. | |
virtual void | increment (int steps=1) |
Increments key a number of entries. | |
virtual char | Traversable () |
virtual long | Index () const |
Use this function to get te current position withing a module. | |
virtual long | Index (long iindex) |
SWKey & | operator= (const char *ikey) |
SWKey & | operator= (const SWKey &ikey) |
SWKey & | operator= (SW_POSITION pos) |
operator const char * () const | |
bool | operator== (const SWKey &ikey) |
bool | operator!= (const SWKey &ikey) |
virtual bool | operator> (const SWKey &ikey) |
virtual bool | operator< (const SWKey &ikey) |
virtual bool | operator>= (const SWKey &ikey) |
virtual bool | operator<= (const SWKey &ikey) |
SWKey & | operator-= (int steps) |
SWKey & | operator+= (int steps) |
SWKey & | operator++ (int) |
SWKey & | operator-- (int) |
Public Attributes | |
void * | userData |
Protected Attributes | |
char * | keytext |
char * | rangeText |
bool | boundSet |
char | persist |
char | error |
Private Member Functions | |
void | init () |
Private Attributes | |
long | index |
Static Private Attributes | |
SWClass | classdef |
verse, word, place, etc.)
|
initializes instance of SWKey
|
|
Copy Constructor.
|
|
Returns a copy of this SWKey object. This is useful to get a 1:1 copy of an SWKey based object.
Reimplemented in sword::ListKey, sword::TreeKeyIdx, and sword::VerseKey. |
|
Compares another VerseKey object.
Reimplemented in sword::TreeKey, sword::TreeKeyIdx, and sword::VerseKey. |
|
Equates this SWKey to another SWKey object.
Reimplemented in sword::ListKey, sword::TreeKeyIdx, and sword::VerseKey. |
|
Decrements key a number of entries.
Reimplemented in sword::ListKey, sword::TreeKey, sword::TreeKeyIdx, and sword::VerseKey. |
|
Compares another VerseKey object.
|
|
Gets and clears error status.
|
|
Increments key a number of entries.
Reimplemented in sword::ListKey, sword::TreeKey, sword::TreeKeyIdx, and sword::VerseKey. |
|
Use this function to get te current position withing a module. Here's a small example how to use this function and Index (long). This function uses the GerLut module and chooses a random verse from the Bible and returns it. const char* randomVerse() { VerseKey vk; SWMgr mgr; LocaleMgr::systemLocaleMgr.setDefaultLocaleName("de"); SWModule* module = mgr->Modules("GerLut"); srand( time(0) ); const double newIndex = (double(rand())/RAND_MAX)*(24108+8224); vk.Index(newIndex); module->setKey(vk); char* text; sprintf(text, "%s: %s",(const char*)vk ,module->StripText(&vk)); return text; Reimplemented in sword::ListKey, sword::TreeKey, and sword::VerseKey. |
|
Set/gets whether this object itself persists within a module that it was used to setKey or just a copy. (1 - persists in module; 0 - a copy is attempted
|
|
Gets whether this object itself persists within a module that it was used to setKey or just a copy. (1 - persists in module; 0 - a copy is attempted
|
|
Equates this SWKey to a character string.
Reimplemented in sword::ListKey, sword::TreeKey, sword::TreeKeyIdx, and sword::VerseKey. |