<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>SWKey class Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.2.15 --> <center> <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </center> <hr><h1>SWKey Class Reference</h1>SWKey is the basis for all types of keys for indexing into modules (e.g. <a href="#_details">More...</a> <p> <code>#include <<a class="el" href="swkey_8h-source.html">swkey.h</a>></code> <p> Inheritance diagram for SWKey:<p><center><img src="class_s_w_key__inherit__graph.png" border="0" usemap="#_s_w_key__inherit__map" alt="Inheritance graph"></center> <map name="_s_w_key__inherit__map"> <area href="class_list_key.html" shape="rect" coords="14,154,67,173" alt=""> <area href="class_str_key.html" shape="rect" coords="91,154,142,173" alt=""> <area href="class_tree_key.html" shape="rect" coords="166,154,227,173" alt=""> <area href="class_verse_key.html" shape="rect" coords="251,154,321,173" alt=""> <area href="class_s_w_object.html" shape="rect" coords="121,15,193,34" alt=""> <area href="class_tree_key_idx.html" shape="rect" coords="158,223,235,242" alt=""> </map> <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for SWKey:<p><center><img src="class_s_w_key__coll__graph.png" border="0" usemap="#_s_w_key__coll__map" alt="Collaboration graph"></center> <map name="_s_w_key__coll__map"> <area href="class_s_w_object.html" shape="rect" coords="122,105,194,124" alt=""> <area href="class_s_w_class.html" shape="rect" coords="51,15,115,33" alt=""> </map> <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="class_s_w_key-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> <tr><td colspan=2><br><h2>Public Methods</h2></td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="class_s_w_key.html#a0">SWKey</a> (const char *ikey=0)</td></tr> <tr><td> </td><td><font size=-1><em>initializes instance of SWKey.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="class_s_w_key.html#a1">SWKey</a> (SWKey const &k)</td></tr> <tr><td> </td><td><font size=-1><em>Copy Constructor.</em> <a href="#a1">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a2" doxytag="SWKey::~SWKey"></a> virtual </td><td valign=bottom><a class="el" href="class_s_w_key.html#a2">~SWKey</a> ()</td></tr> <tr><td> </td><td><font size=-1><em>Destructor, cleans up this instance of SWKey.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>virtual SWKey * </td><td valign=bottom><a class="el" href="class_s_w_key.html#a3">clone</a> () const</td></tr> <tr><td> </td><td><font size=-1><em>Returns a copy of this SWKey object.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="class_s_w_key.html#a4">Persist</a> () const</td></tr> <tr><td> </td><td><font size=-1><em>Gets whether this object itself persists within a module that it was used to SetKey or just a copy.</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>char </td><td valign=bottom><a class="el" href="class_s_w_key.html#a5">Persist</a> (signed char ikey)</td></tr> <tr><td> </td><td><font size=-1><em>Set/gets whether this object itself persists within a module that it was used to SetKey or just a copy.</em> <a href="#a5">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>virtual char </td><td valign=bottom><a class="el" href="class_s_w_key.html#a6">Error</a> ()</td></tr> <tr><td> </td><td><font size=-1><em>Gets and clears error status.</em> <a href="#a6">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="class_s_w_key.html#a7">setText</a> (const char *ikey)</td></tr> <tr><td> </td><td><font size=-1><em>Equates this SWKey to a character string.</em> <a href="#a7">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="class_s_w_key.html#a8">copyFrom</a> (const SWKey &ikey)</td></tr> <tr><td> </td><td><font size=-1><em>Equates this SWKey to another SWKey object.</em> <a href="#a8">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a9" doxytag="SWKey::getText"></a> virtual const char * </td><td valign=bottom><a class="el" href="class_s_w_key.html#a9">getText</a> () const</td></tr> <tr><td> </td><td><font size=-1><em>returns text key if (char *) cast is requested.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a10" doxytag="SWKey::getShortText"></a> virtual const char * </td><td valign=bottom><b>getShortText</b> () const</td></tr> <tr><td nowrap align=right valign=top>virtual int </td><td valign=bottom><a class="el" href="class_s_w_key.html#a11">compare</a> (const SWKey &ikey)</td></tr> <tr><td> </td><td><font size=-1><em>Compares another <a class="el" href="class_verse_key.html">VerseKey</a> object.</em> <a href="#a11">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>virtual bool </td><td valign=bottom><a class="el" href="class_s_w_key.html#a12">equals</a> (const SWKey &ikey)</td></tr> <tr><td> </td><td><font size=-1><em>Compares another <a class="el" href="class_verse_key.html">VerseKey</a> object.</em> <a href="#a12">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a13" doxytag="SWKey::setPosition"></a> virtual void </td><td valign=bottom><b>setPosition</b> (SW_POSITION)</td></tr> <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="class_s_w_key.html#a14">decrement</a> (int steps=1)</td></tr> <tr><td> </td><td><font size=-1><em>Decrements key a number of entries.</em> <a href="#a14">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="class_s_w_key.html#a15">increment</a> (int steps=1)</td></tr> <tr><td> </td><td><font size=-1><em>Increments key a number of entries.</em> <a href="#a15">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a16" doxytag="SWKey::Traversable"></a> virtual char </td><td valign=bottom><b>Traversable</b> ()</td></tr> <tr><td nowrap align=right valign=top>virtual long </td><td valign=bottom><a class="el" href="class_s_w_key.html#a17">Index</a> () const</td></tr> <tr><td> </td><td><font size=-1><em>Use this function to get te current position withing a module.</em> <a href="#a17">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a18" doxytag="SWKey::Index"></a> virtual long </td><td valign=bottom><b>Index</b> (long iindex)</td></tr> <tr><td colspan=2><br><h2>Public Attributes</h2></td></tr> <tr><td nowrap align=right valign=top><a name="m0" doxytag="SWKey::userData"></a> void * </td><td valign=bottom><b>userData</b></td></tr> <tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr> <tr><td nowrap align=right valign=top><a name="n0" doxytag="SWKey::keytext"></a> char * </td><td valign=bottom><b>keytext</b></td></tr> <tr><td nowrap align=right valign=top><a name="n1" doxytag="SWKey::persist"></a> char </td><td valign=bottom><b>persist</b></td></tr> <tr><td nowrap align=right valign=top><a name="n2" doxytag="SWKey::error"></a> char </td><td valign=bottom><b>error</b></td></tr> <tr><td colspan=2><br><h2>Private Methods</h2></td></tr> <tr><td nowrap align=right valign=top><a name="c0" doxytag="SWKey::init"></a> void </td><td valign=bottom><b>init</b> ()</td></tr> <tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> <tr><td nowrap align=right valign=top><a name="o0" doxytag="SWKey::index"></a> long </td><td valign=bottom><b>index</b></td></tr> <tr><td colspan=2><br><h2>Static Private Attributes</h2></td></tr> <tr><td nowrap align=right valign=top><a name="r0" doxytag="SWKey::classdef"></a> <a class="el" href="class_s_w_class.html">SWClass</a> </td><td valign=bottom><b>classdef</b></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> SWKey is the basis for all types of keys for indexing into modules (e.g. <p> verse, word, place, etc.) <p> <p> Definition at line <a class="el" href="swkey_8h-source.html#l00076">76</a> of file <a class="el" href="swkey_8h-source.html">swkey.h</a>.<hr><h2>Constructor & Destructor Documentation</h2> <a name="a0" doxytag="SWKey::SWKey"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> SWKey::SWKey </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const char * </td> <td class="mdname1" valign="top" nowrap> <em>ikey</em> = 0 </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> initializes instance of SWKey. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>ikey</em> </td><td> text key </td></tr> </table> </dl> <p> Definition at line <a class="el" href="swkey_8cpp-source.html#l00020">20</a> of file <a class="el" href="swkey_8cpp-source.html">swkey.cpp</a>. <p> Referenced by <a class="el" href="swkey_8cpp-source.html#l00045">clone</a>(). <p> <div class="fragment"><pre>00021 { 00022 index = 0; 00023 persist = 0; 00024 keytext = 0; 00025 error = 0; 00026 stdstr(&keytext, ikey); 00027 init(); 00028 } </pre></div> </td> </tr> </table> <a name="a1" doxytag="SWKey::SWKey"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> SWKey::SWKey </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">SWKey const & </td> <td class="mdname1" valign="top" nowrap> <em>k</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Copy Constructor. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>The</em> </td><td> SWKey object to copy. </td></tr> </table> </dl> <p> Definition at line <a class="el" href="swkey_8cpp-source.html#l00030">30</a> of file <a class="el" href="swkey_8cpp-source.html">swkey.cpp</a>. <p> References <a class="el" href="swkey_8h-source.html#l00084">error</a>, <a class="el" href="swkey_8h-source.html#l00077">index</a>, <a class="el" href="swkey_8h-source.html#l00082">keytext</a>, <a class="el" href="swkey_8h-source.html#l00083">persist</a>, and <a class="el" href="swkey_8h-source.html#l00089">userData</a>. <p> <div class="fragment"><pre>00031 { 00032 index = k.index; 00033 persist = k.persist; 00034 userData = k.userData; 00035 keytext = 0; 00036 error = k.error; 00037 stdstr(&keytext, k.keytext); 00038 init(); 00039 } </pre></div> </td> </tr> </table> <hr><h2>Member Function Documentation</h2> <a name="a3" doxytag="SWKey::clone"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> SWKey * SWKey::clone </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const<code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns a copy of this SWKey object. <p> This is useful to get a 1:1 copy of an SWKey based object. <dl compact><dt><b> Returns: </b><dd> SWKey </dl> <p> Reimplemented in <a class="el" href="class_list_key.html#a3">ListKey</a>, and <a class="el" href="class_verse_key.html#a10">VerseKey</a>. <p> Definition at line <a class="el" href="swkey_8cpp-source.html#l00045">45</a> of file <a class="el" href="swkey_8cpp-source.html">swkey.cpp</a>. <p> References <a class="el" href="swkey_8cpp-source.html#l00020">SWKey</a>(). <p> Referenced by <a class="el" href="listkey_8cpp-source.html#l00087">ListKey::copyFrom</a>(), and <a class="el" href="swmodule_8cpp-source.html#l00391">SWModule::Search</a>(). <p> <div class="fragment"><pre>00046 { 00047 <font class="keywordflow">return</font> <font class="keyword">new</font> <a class="code" href="class_s_w_key.html#a0">SWKey</a>(*<font class="keyword">this</font>); 00048 } </pre></div> </td> </tr> </table> <a name="a11" doxytag="SWKey::compare"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int SWKey::compare </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const SWKey & </td> <td class="mdname1" valign="top" nowrap> <em>ikey</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Compares another <a class="el" href="class_verse_key.html">VerseKey</a> object. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>ikey</em> </td><td> key to compare with this one </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> >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 </dl> <p> Reimplemented in <a class="el" href="class_tree_key.html#a22">TreeKey</a>, <a class="el" href="class_tree_key_idx.html#a28">TreeKeyIdx</a>, and <a class="el" href="class_verse_key.html#a38">VerseKey</a>. <p> Definition at line <a class="el" href="swkey_8cpp-source.html#l00151">151</a> of file <a class="el" href="swkey_8cpp-source.html">swkey.cpp</a>. <p> Referenced by <a class="el" href="treekeyidx_8cpp-source.html#l00520">TreeKeyIdx::compare</a>(). <p> <div class="fragment"><pre>00152 { 00153 <font class="keywordflow">return</font> strcmp((<font class="keyword">const</font> <font class="keywordtype">char</font> *)*<font class="keyword">this</font>, (<font class="keyword">const</font> <font class="keywordtype">char</font> *)ikey); 00154 } </pre></div> </td> </tr> </table> <a name="a8" doxytag="SWKey::copyFrom"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void SWKey::copyFrom </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const SWKey & </td> <td class="mdname1" valign="top" nowrap> <em>ikey</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Equates this SWKey to another SWKey object. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>ikey</em> </td><td> other swkey object </td></tr> </table> </dl> <p> Reimplemented in <a class="el" href="class_list_key.html#a12">ListKey</a>, <a class="el" href="class_tree_key_idx.html#a20">TreeKeyIdx</a>, and <a class="el" href="class_verse_key.html#a14">VerseKey</a>. <p> Definition at line <a class="el" href="swkey_8cpp-source.html#l00126">126</a> of file <a class="el" href="swkey_8cpp-source.html">swkey.cpp</a>. <p> References <a class="el" href="swkey_8cpp-source.html#l00115">setText</a>(). <p> Referenced by <a class="el" href="versekey_8cpp-source.html#l00822">VerseKey::copyFrom</a>(), <a class="el" href="treekeyidx_8cpp-source.html#l00494">TreeKeyIdx::copyFrom</a>(), and <a class="el" href="listkey_8h-source.html#l00090">ListKey::copyFrom</a>(). <p> <div class="fragment"><pre>00126 { 00127 <font class="comment">// not desirable Persist(ikey.Persist());</font> 00128 <a class="code" href="class_s_w_key.html#a7">setText</a>((<font class="keyword">const</font> <font class="keywordtype">char</font> *)ikey); 00129 } </pre></div> </td> </tr> </table> <a name="a14" doxytag="SWKey::decrement"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void SWKey::decrement </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">int </td> <td class="mdname1" valign="top" nowrap> <em>steps</em> = 1 </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Decrements key a number of entries. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>steps</em> </td><td> Number of entries to jump backward </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> *this </dl> <p> Reimplemented in <a class="el" href="class_list_key.html#a14">ListKey</a>, <a class="el" href="class_tree_key.html#a23">TreeKey</a>, <a class="el" href="class_tree_key_idx.html#a29">TreeKeyIdx</a>, and <a class="el" href="class_verse_key.html#a17">VerseKey</a>. <p> Definition at line <a class="el" href="swkey_8cpp-source.html#l00194">194</a> of file <a class="el" href="swkey_8cpp-source.html">swkey.cpp</a>. <p> <div class="fragment"><pre>00194 { 00195 error = KEYERR_OUTOFBOUNDS; 00196 } </pre></div> </td> </tr> </table> <a name="a12" doxytag="SWKey::equals"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual bool SWKey::equals </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const SWKey & </td> <td class="mdname1" valign="top" nowrap> <em>ikey</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [inline, virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Compares another <a class="el" href="class_verse_key.html">VerseKey</a> object. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>ikey</em> </td><td> key to compare with this one </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> true if the keys are the same </dl> <p> Definition at line <a class="el" href="swkey_8h-source.html#l00167">167</a> of file <a class="el" href="swkey_8h-source.html">swkey.h</a>. <p> <div class="fragment"><pre>00167 { <font class="keywordflow">return</font> !<a class="code" href="class_s_w_key.html#a11">compare</a>(ikey); } </pre></div> </td> </tr> </table> <a name="a6" doxytag="SWKey::Error"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> char SWKey::Error </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Gets and clears error status. <p> <dl compact><dt><b> Returns: </b><dd> error status </dl> <p> Definition at line <a class="el" href="swkey_8cpp-source.html#l00100">100</a> of file <a class="el" href="swkey_8cpp-source.html">swkey.cpp</a>. <p> Referenced by <a class="el" href="versekey_8cpp-source.html#l00941">VerseKey::decrement</a>(), <a class="el" href="listkey_8cpp-source.html#l00163">ListKey::decrement</a>(), <a class="el" href="versekey_8cpp-source.html#l00921">VerseKey::increment</a>(), <a class="el" href="listkey_8cpp-source.html#l00140">ListKey::increment</a>(), <a class="el" href="swmodule_8cpp-source.html#l00350">SWModule::operator+=</a>(), <a class="el" href="swmodule_8cpp-source.html#l00367">SWModule::operator-=</a>(), <a class="el" href="swmodule_8cpp-source.html#l00320">SWModule::operator=</a>(), <a class="el" href="versekey_8cpp-source.html#l00884">VerseKey::setPosition</a>(), and <a class="el" href="treekeyidx_8cpp-source.html#l00466">TreeKeyIdx::setText</a>(). <p> <div class="fragment"><pre>00101 { 00102 <font class="keywordtype">char</font> retval = error; 00103 00104 error = 0; 00105 <font class="keywordflow">return</font> retval; 00106 } </pre></div> </td> </tr> </table> <a name="a15" doxytag="SWKey::increment"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void SWKey::increment </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">int </td> <td class="mdname1" valign="top" nowrap> <em>steps</em> = 1 </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Increments key a number of entries. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>increment</em> </td><td> Number of entries to jump forward </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> *this </dl> <p> Reimplemented in <a class="el" href="class_list_key.html#a15">ListKey</a>, <a class="el" href="class_tree_key.html#a24">TreeKey</a>, <a class="el" href="class_tree_key_idx.html#a30">TreeKeyIdx</a>, and <a class="el" href="class_verse_key.html#a18">VerseKey</a>. <p> Definition at line <a class="el" href="swkey_8cpp-source.html#l00181">181</a> of file <a class="el" href="swkey_8cpp-source.html">swkey.cpp</a>. <p> <div class="fragment"><pre>00181 { 00182 error = KEYERR_OUTOFBOUNDS; 00183 } </pre></div> </td> </tr> </table> <a name="a17" doxytag="SWKey::Index"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual long SWKey::Index </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const<code> [inline, virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Use this function to get te current position withing a module. <p> 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. <div class="fragment"><pre> <font class="keyword">const</font> <font class="keywordtype">char</font>* randomVerse() { <a class="code" href="class_verse_key.html">VerseKey</a> vk; <a class="code" href="class_s_w_mgr.html">SWMgr</a> mgr; <a class="code" href="class_locale_mgr.html#p0">LocaleMgr::systemLocaleMgr</a>.<a class="code" href="class_locale_mgr.html#a6">setDefaultLocaleName</a>(<font class="stringliteral">"de"</font>); <a class="code" href="class_s_w_module.html">SWModule</a>* module = mgr-><a class="code" href="class_s_w_mgr.html#m2">Modules</a>(<font class="stringliteral">"GerLut"</font>); srand( time(0) ); <font class="keyword">const</font> <font class="keywordtype">double</font> newIndex = (double(rand())/RAND_MAX)*(24108+8224); vk.<a class="code" href="class_verse_key.html#a34">Index</a>(newIndex); module-><a class="code" href="class_s_w_module.html#a8">SetKey</a>(vk); <font class="keywordtype">char</font>* text; sprintf(text, <font class="stringliteral">"%s: %s"</font>,(<font class="keyword">const</font> <font class="keywordtype">char</font>*)vk ,module-><a class="code" href="class_s_w_module.html#a56">StripText</a>(&vk)); <font class="keywordflow">return</font> text; </pre></div> <p> Reimplemented in <a class="el" href="class_list_key.html#a17">ListKey</a>, <a class="el" href="class_tree_key.html#a26">TreeKey</a>, and <a class="el" href="class_verse_key.html#a34">VerseKey</a>. <p> Definition at line <a class="el" href="swkey_8h-source.html#l00208">208</a> of file <a class="el" href="swkey_8h-source.html">swkey.h</a>. <p> Referenced by <a class="el" href="listkey_8h-source.html#l00112">ListKey::Index</a>(), and <a class="el" href="swmodule_8cpp-source.html#l00391">SWModule::Search</a>(). <p> <div class="fragment"><pre>00208 { <font class="keywordflow">return</font> index; } </pre></div> </td> </tr> </table> <a name="a5" doxytag="SWKey::Persist"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> char SWKey::Persist </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">signed char </td> <td class="mdname1" valign="top" nowrap> <em>ikey</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Set/gets whether this object itself persists within a module that it was used to SetKey or just a copy. <p> (1 - persists in module; 0 - a copy is attempted<dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>ipersist</em> </td><td> value which to set persist; [-1] - only get </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> value of persist </dl> <p> Definition at line <a class="el" href="swkey_8cpp-source.html#l00085">85</a> of file <a class="el" href="swkey_8cpp-source.html">swkey.cpp</a>. <p> <div class="fragment"><pre>00086 { 00087 <font class="keywordflow">if</font> (ipersist != -1) 00088 persist = ipersist; 00089 00090 <font class="keywordflow">return</font> persist; 00091 } </pre></div> </td> </tr> </table> <a name="a4" doxytag="SWKey::Persist"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> char SWKey::Persist </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const</td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Gets whether this object itself persists within a module that it was used to SetKey or just a copy. <p> (1 - persists in module; 0 - a copy is attempted <p> <dl compact><dt><b> Returns: </b><dd> value of persist </dl> <p> Definition at line <a class="el" href="swkey_8cpp-source.html#l00068">68</a> of file <a class="el" href="swkey_8cpp-source.html">swkey.cpp</a>. <p> Referenced by <a class="el" href="swld_8cpp-source.html#l00047">SWLD::KeyText</a>(), <a class="el" href="swmodule_8cpp-source.html#l00606">SWModule::RenderText</a>(), <a class="el" href="swmodule_8cpp-source.html#l00391">SWModule::Search</a>(), <a class="el" href="swmodule_8cpp-source.html#l00272">SWModule::SetKey</a>(), <a class="el" href="swmodule_8cpp-source.html#l00638">SWModule::StripText</a>(), and <a class="el" href="swmodule_8cpp-source.html#l00066">SWModule::~SWModule</a>(). <p> <div class="fragment"><pre>00069 { 00070 <font class="keywordflow">return</font> persist; 00071 } </pre></div> </td> </tr> </table> <a name="a7" doxytag="SWKey::setText"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void SWKey::setText </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const char * </td> <td class="mdname1" valign="top" nowrap> <em>ikey</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Equates this SWKey to a character string. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>ikey</em> </td><td> string to set this key to </td></tr> </table> </dl> <p> Reimplemented in <a class="el" href="class_tree_key.html#a19">TreeKey</a>, <a class="el" href="class_tree_key_idx.html#a24">TreeKeyIdx</a>, and <a class="el" href="class_verse_key.html#a13">VerseKey</a>. <p> Definition at line <a class="el" href="swkey_8cpp-source.html#l00115">115</a> of file <a class="el" href="swkey_8cpp-source.html">swkey.cpp</a>. <p> Referenced by <a class="el" href="swkey_8cpp-source.html#l00126">copyFrom</a>(), <a class="el" href="versekey_8cpp-source.html#l00231">VerseKey::parse</a>(), and <a class="el" href="versekey_8h-source.html#l00236">VerseKey::setText</a>(). <p> <div class="fragment"><pre>00115 { 00116 stdstr(&keytext, ikey); 00117 } </pre></div> </td> </tr> </table> <hr>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="swkey_8h-source.html">swkey.h</a><li><a class="el" href="swkey_8cpp-source.html">swkey.cpp</a></ul> <hr><address align="right"><small>Generated on Thu Jun 20 22:13:03 2002 for The Sword Project by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.15 </small></address> </body> </html>