#include <swkey.h>
Inheritance diagram for SWKey:
Public Methods | |
SWKey (const char *ikey = 0) | |
initializes instance of SWKey. More... | |
SWKey (SWKey const &k) | |
Copy Constructor. More... | |
virtual | ~SWKey () |
Destructor, cleans up this instance of SWKey. | |
virtual SWKey* | clone () const |
Returns a copy of this SWKey object. More... | |
char | Persist () const |
Gets whether this object itself persists within a module that it was used to SetKey or just a copy. More... | |
char | Persist (char ikey) |
Set/gets whether this object itself persists within a module that it was used to SetKey or just a copy. More... | |
virtual char | Error () |
Gets and clears error status. More... | |
virtual SWKey& | operator= (const char *ikey) |
Equates this SWKey to a character string. More... | |
virtual SWKey& | operator= (const SWKey & ikey) |
Equates this SWKey to another SWKey object. More... | |
virtual | operator const char * () const |
returns text key if (char *) cast is requested. | |
virtual int | compare (const SWKey & ikey) |
Compares another VerseKey object. More... | |
virtual bool | operator== (const SWKey & ikey) |
Compares another VerseKey object. More... | |
virtual bool | operator!= (const SWKey & ikey) |
Compares another VerseKey object. More... | |
virtual bool | operator > (const SWKey & ikey) |
see compare(). | |
virtual bool | operator< (const SWKey & ikey) |
see compare(). | |
virtual bool | operator >= (const SWKey & ikey) |
see compare(). | |
virtual bool | operator<= (const SWKey & ikey) |
see compare(). | |
virtual SWKey& | operator= (SW_POSITION) |
Positions this key if applicable. | |
virtual SWKey& | operator-= (int decrement) |
Decrements key a number of entries. More... | |
virtual SWKey& | operator+= (int increment) |
Increments key a number of entries. More... | |
virtual SWKey& | operator++ (int) |
Increments key by 1 entry. More... | |
virtual SWKey& | operator-- (int) |
Decrements key by 1 entry. More... | |
virtual char | Traversable () |
virtual long | Index () const |
Use this function to get te current position withing a module. More... | |
virtual long | Index (long iindex) |
Protected Attributes | |
char* | keytext |
char | persist |
char | error |
Private Methods | |
void | init () |
Private Attributes | |
long | index |
Static Private Attributes | |
SWClass | classdef |
verse, word, place, etc.)
Definition at line 59 of file swkey.h.
|
initializes instance of SWKey.
ikey | text key |
|
Copy Constructor.
The | SWKey object to copy. |
|
Gets and clears error status.
|
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 ListKey, and VerseKey.
Definition at line 253 of file swkey.h.
Referenced by ListKey::Index().
|
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
ipersist | value which to set persist; [-1] - only get |
|
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
|
Returns a copy of this SWKey object.
This is useful to get a 1:1 copy of an SWKey based object.
|
Compares another VerseKey object.
ikey | key to compare with this one |
Reimplemented in VerseKey.
Referenced by operator >(), operator >=(), operator!=(), operator<(), operator<=(), and operator==().
|
Compares another VerseKey object.
ikey | key to compare with this one |
|
|
Increments key a number of entries.
increment | Number of entries to jump forward |
|
|
Decrements key a number of entries.
decrement | Number of entries to jump backward |
|
Equates this SWKey to another SWKey object.
ikey | other swkey object |
|
Equates this SWKey to a character string.
ikey | string to set this key to |
Reimplemented in ListKey, and VerseKey.
Referenced by VerseKey::operator=().
|
Compares another VerseKey object.
ikey | key to compare with this one |