diff options
Diffstat (limited to 'doc/api-documentation/man/man3/SWKey.3')
-rw-r--r-- | doc/api-documentation/man/man3/SWKey.3 | 318 |
1 files changed, 318 insertions, 0 deletions
diff --git a/doc/api-documentation/man/man3/SWKey.3 b/doc/api-documentation/man/man3/SWKey.3 new file mode 100644 index 0000000..b8bb5a6 --- /dev/null +++ b/doc/api-documentation/man/man3/SWKey.3 @@ -0,0 +1,318 @@ +.TH "SWKey" 3 "22 Jan 2002" "The Sword Project" \" -*- nroff -*- +.ad l +.nh +.SH NAME +SWKey \- SWKey is the basis for all types of keys for indexing into modules (e.g. +.SH SYNOPSIS +.br +.PP +\fC#include <swkey.h>\fP +.PP +Inherits \fBSWObject\fP. +.PP +Inherited by \fBListKey\fP, \fBStrKey\fP, and \fBVerseKey\fP. +.PP +.SS "Public Methods" + +.in +1c +.ti -1c +.RI "\fBSWKey\fP (const char *ikey=0)" +.br +.RI "\fIinitializes instance of SWKey.\fP" +.ti -1c +.RI "\fBSWKey\fP (SWKey const &k)" +.br +.RI "\fICopy Constructor.\fP" +.ti -1c +.RI "virtual \fB~SWKey\fP ()" +.br +.RI "\fIDestructor, cleans up this instance of SWKey.\fP" +.ti -1c +.RI "virtual SWKey * \fBclone\fP () const" +.br +.RI "\fIReturns a copy of this SWKey object.\fP" +.ti -1c +.RI "char \fBPersist\fP () const" +.br +.RI "\fIGets whether this object itself persists within a module that it was used to SetKey or just a copy.\fP" +.ti -1c +.RI "char \fBPersist\fP (char ikey)" +.br +.RI "\fISet/gets whether this object itself persists within a module that it was used to SetKey or just a copy.\fP" +.ti -1c +.RI "virtual char \fBError\fP ()" +.br +.RI "\fIGets and clears error status.\fP" +.ti -1c +.RI "virtual void \fBsetText\fP (const char *ikey)" +.br +.RI "\fIEquates this SWKey to a character string.\fP" +.ti -1c +.RI "virtual void \fBcopyFrom\fP (const SWKey &ikey)" +.br +.RI "\fIEquates this SWKey to another SWKey object.\fP" +.ti -1c +.RI "virtual const char * \fBgetText\fP () const" +.br +.RI "\fIreturns text key if (char *) cast is requested.\fP" +.ti -1c +.RI "virtual int \fBcompare\fP (const SWKey &ikey)" +.br +.RI "\fICompares another \fBVerseKey\fP object.\fP" +.ti -1c +.RI "virtual bool \fBequals\fP (const SWKey &ikey)" +.br +.RI "\fICompares another \fBVerseKey\fP object.\fP" +.ti -1c +.RI "virtual void \fBsetPosition\fP (SW_POSITION)" +.br +.ti -1c +.RI "virtual void \fBdecrement\fP (int steps=1)" +.br +.RI "\fIDecrements key a number of entries.\fP" +.ti -1c +.RI "virtual void \fBincrement\fP (int steps=1)" +.br +.RI "\fIIncrements key a number of entries.\fP" +.ti -1c +.RI "virtual char \fBTraversable\fP ()" +.br +.ti -1c +.RI "virtual long \fBIndex\fP () const" +.br +.RI "\fIUse this function to get te current position withing a module.\fP" +.ti -1c +.RI "virtual long \fBIndex\fP (long iindex)" +.br +.in -1c +.SS "Protected Attributes" + +.in +1c +.ti -1c +.RI "char * \fBkeytext\fP" +.br +.ti -1c +.RI "char \fBpersist\fP" +.br +.ti -1c +.RI "char \fBerror\fP" +.br +.in -1c +.SS "Private Methods" + +.in +1c +.ti -1c +.RI "void \fBinit\fP ()" +.br +.in -1c +.SS "Private Attributes" + +.in +1c +.ti -1c +.RI "long \fBindex\fP" +.br +.in -1c +.SS "Static Private Attributes" + +.in +1c +.ti -1c +.RI "\fBSWClass\fP \fBclassdef\fP" +.br +.in -1c +.SH "DETAILED DESCRIPTION" +.PP +SWKey is the basis for all types of keys for indexing into modules (e.g. +.PP +verse, word, place, etc.) +.PP +Definition at line 76 of file swkey.h. +.SH "CONSTRUCTOR & DESTRUCTOR DOCUMENTATION" +.PP +.SS "SWKey::SWKey (const char * ikey = 0)" +.PP +initializes instance of SWKey. +.PP +Parameters: +.in +1c +.TP +\fB\fIikey\fP\fP +text key +.SS "SWKey::SWKey (SWKey const & k)" +.PP +Copy Constructor. +.PP +Parameters: +.in +1c +.TP +\fB\fIThe\fP\fP +SWKey object to copy. +.SH "MEMBER FUNCTION DOCUMENTATION" +.PP +.SS "virtual char SWKey::Error ()\fC [virtual]\fP" +.PP +Gets and clears error status. +.PP +\fBReturns: \fP +.in +1c +error status +.SS "virtual long SWKey::Index () const\fC [inline, virtual]\fP" +.PP +Use this function to get te current position withing a module. +.PP +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. +.PP +.nf + 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; +.fi + +.PP +Reimplemented in \fBListKey\fP, and \fBVerseKey\fP. +.PP +Definition at line 204 of file swkey.h. +.PP +Referenced by ListKey::Index(). +.PP +.SS "char SWKey::Persist (char ikey)" +.PP +Set/gets whether this object itself persists within a module that it was used to SetKey or just a copy. +.PP +(1 - persists in module; 0 - a copy is attempted +.PP +Parameters: +.in +1c +.TP +\fB\fIipersist\fP\fP +value which to set persist; [-1] - only get +.PP +\fBReturns: \fP +.in +1c +value of persist +.SS "char SWKey::Persist () const" +.PP +Gets whether this object itself persists within a module that it was used to SetKey or just a copy. +.PP +(1 - persists in module; 0 - a copy is attempted +.PP +\fBReturns: \fP +.in +1c +value of persist +.SS "virtual SWKey* SWKey::clone () const\fC [virtual]\fP" +.PP +Returns a copy of this SWKey object. +.PP +This is useful to get a 1:1 copy of an SWKey based object. +.PP +\fBReturns: \fP +.in +1c +SWKey +.PP +Reimplemented in \fBListKey\fP, and \fBVerseKey\fP. +.SS "virtual int SWKey::compare (const SWKey & ikey)\fC [virtual]\fP" +.PP +Compares another \fBVerseKey\fP object. +.PP +Parameters: +.in +1c +.TP +\fB\fIikey\fP\fP +key to compare with this one +.PP +\fBReturns: \fP +.in +1c +>0 if this key is greater than compare key; <0 if this key is smaller than compare key; 0 if the keys are the same +.PP +Reimplemented in \fBVerseKey\fP. +.PP +Referenced by equals(). +.PP +.SS "virtual void SWKey::copyFrom (const SWKey & ikey)\fC [virtual]\fP" +.PP +Equates this SWKey to another SWKey object. +.PP +Parameters: +.in +1c +.TP +\fB\fIikey\fP\fP +other swkey object +.PP +Reimplemented in \fBListKey\fP, and \fBVerseKey\fP. +.PP +Referenced by ListKey::copyFrom(). +.PP +.SS "virtual void SWKey::decrement (int step = 1)\fC [virtual]\fP" +.PP +Decrements key a number of entries. +.PP +Parameters: +.in +1c +.TP +\fB\fIsteps\fP\fP +Number of entries to jump backward +.PP +\fBReturns: \fP +.in +1c +*this +.PP +Reimplemented in \fBListKey\fP, and \fBVerseKey\fP. +.SS "virtual bool SWKey::equals (const SWKey & ikey)\fC [inline, virtual]\fP" +.PP +Compares another \fBVerseKey\fP object. +.PP +Parameters: +.in +1c +.TP +\fB\fIikey\fP\fP +key to compare with this one +.PP +\fBReturns: \fP +.in +1c +true if the keys are the same +.PP +Definition at line 163 of file swkey.h. +.SS "virtual void SWKey::increment (int step = 1)\fC [virtual]\fP" +.PP +Increments key a number of entries. +.PP +Parameters: +.in +1c +.TP +\fB\fIincrement\fP\fP +Number of entries to jump forward +.PP +\fBReturns: \fP +.in +1c +*this +.PP +Reimplemented in \fBListKey\fP, and \fBVerseKey\fP. +.SS "virtual void SWKey::setText (const char * ikey)\fC [virtual]\fP" +.PP +Equates this SWKey to a character string. +.PP +Parameters: +.in +1c +.TP +\fB\fIikey\fP\fP +string to set this key to +.PP +Reimplemented in \fBVerseKey\fP. +.PP +Referenced by VerseKey::setText(). +.PP + + +.SH "AUTHOR" +.PP +Generated automatically by Doxygen for The Sword Project from the source code.
\ No newline at end of file |