aboutsummaryrefslogtreecommitdiffstats
path: root/doc/api-documentation/html/class_tree_key.html
blob: 5bf14166520b3e1ef087669b774ed86356184c69 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
<!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>TreeKey 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> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </center>
<hr><h1>TreeKey  Class Reference</h1>Class <a class="el" href="class_verse_key.html">VerseKey</a> The <a class="el" href="class_s_w_key.html">SWKey</a> implementation used for verse based modules like Bibles or commentaries. 
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="treekey_8h-source.html">treekey.h</a>&gt;</code>
<p>
Inheritance diagram for TreeKey:<p><center><img src="class_tree_key__inherit__graph.png" border="0" usemap="#_tree_key__inherit__map" alt="Inheritance graph"></center>
<map name="_tree_key__inherit__map">
<area href="class_tree_key_idx.html" shape="rect" coords="14,223,91,242" alt="">
<area href="class_s_w_key.html" shape="rect" coords="25,85,81,103" alt="">
<area href="class_s_w_object.html" shape="rect" coords="17,15,89,34" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for TreeKey:<p><center><img src="class_tree_key__coll__graph.png" border="0" usemap="#_tree_key__coll__map" alt="Collaboration graph"></center>
<map name="_tree_key__coll__map">
<area href="class_s_w_key.html" shape="rect" coords="107,196,163,215" alt="">
<area href="class_s_w_object.html" shape="rect" coords="219,106,291,124" alt="">
<area href="class_s_w_class.html" shape="rect" coords="103,15,167,34" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="class_tree_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><a name="a0" doxytag="TreeKey::TreeKey"></a>
&nbsp;</td><td valign=bottom><b>TreeKey</b> ()</td></tr>
<tr><td nowrap align=right valign=top><a name="a1" doxytag="TreeKey::~TreeKey"></a>
&nbsp;</td><td valign=bottom><b>~TreeKey</b> ()</td></tr>
<tr><td nowrap align=right valign=top><a name="a2" doxytag="TreeKey::getLocalName"></a>
virtual const char *&nbsp;</td><td valign=bottom><b>getLocalName</b> ()=0</td></tr>
<tr><td nowrap align=right valign=top><a name="a3" doxytag="TreeKey::setLocalName"></a>
virtual const char *&nbsp;</td><td valign=bottom><b>setLocalName</b> (const char *)=0</td></tr>
<tr><td nowrap align=right valign=top><a name="a4" doxytag="TreeKey::getUserData"></a>
virtual const char *&nbsp;</td><td valign=bottom><b>getUserData</b> (int *size=0)=0</td></tr>
<tr><td nowrap align=right valign=top><a name="a5" doxytag="TreeKey::setUserData"></a>
virtual void&nbsp;</td><td valign=bottom><b>setUserData</b> (const char *userData, int size=0)=0</td></tr>
<tr><td nowrap align=right valign=top><a name="a6" doxytag="TreeKey::getFullName"></a>
virtual const char *&nbsp;</td><td valign=bottom><b>getFullName</b> () const=0</td></tr>
<tr><td nowrap align=right valign=top><a name="a7" doxytag="TreeKey::root"></a>
virtual void&nbsp;</td><td valign=bottom><b>root</b> ()=0</td></tr>
<tr><td nowrap align=right valign=top><a name="a8" doxytag="TreeKey::parent"></a>
virtual bool&nbsp;</td><td valign=bottom><b>parent</b> ()=0</td></tr>
<tr><td nowrap align=right valign=top><a name="a9" doxytag="TreeKey::firstChild"></a>
virtual bool&nbsp;</td><td valign=bottom><b>firstChild</b> ()=0</td></tr>
<tr><td nowrap align=right valign=top><a name="a10" doxytag="TreeKey::nextSibling"></a>
virtual bool&nbsp;</td><td valign=bottom><b>nextSibling</b> ()=0</td></tr>
<tr><td nowrap align=right valign=top><a name="a11" doxytag="TreeKey::previousSibling"></a>
virtual bool&nbsp;</td><td valign=bottom><b>previousSibling</b> ()=0</td></tr>
<tr><td nowrap align=right valign=top><a name="a12" doxytag="TreeKey::hasChildren"></a>
virtual bool&nbsp;</td><td valign=bottom><b>hasChildren</b> ()=0</td></tr>
<tr><td nowrap align=right valign=top><a name="a13" doxytag="TreeKey::append"></a>
virtual void&nbsp;</td><td valign=bottom><b>append</b> ()=0</td></tr>
<tr><td nowrap align=right valign=top><a name="a14" doxytag="TreeKey::appendChild"></a>
virtual void&nbsp;</td><td valign=bottom><b>appendChild</b> ()=0</td></tr>
<tr><td nowrap align=right valign=top><a name="a15" doxytag="TreeKey::insertBefore"></a>
virtual void&nbsp;</td><td valign=bottom><b>insertBefore</b> ()=0</td></tr>
<tr><td nowrap align=right valign=top><a name="a16" doxytag="TreeKey::remove"></a>
virtual void&nbsp;</td><td valign=bottom><b>remove</b> ()=0</td></tr>
<tr><td nowrap align=right valign=top><a name="a17" doxytag="TreeKey::setOffset"></a>
virtual void&nbsp;</td><td valign=bottom><b>setOffset</b> (unsigned long offset)=0</td></tr>
<tr><td nowrap align=right valign=top><a name="a18" doxytag="TreeKey::getOffset"></a>
virtual unsigned long&nbsp;</td><td valign=bottom><b>getOffset</b> () const=0</td></tr>
<tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="class_tree_key.html#a19">setText</a> (const char *ikey)=0</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Equates this <a class="el" href="class_s_w_key.html">SWKey</a> to a character string.</em> <a href="#a19">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a name="a20" doxytag="TreeKey::setPosition"></a>
virtual void&nbsp;</td><td valign=bottom><b>setPosition</b> (SW_POSITION p)=0</td></tr>
<tr><td nowrap align=right valign=top><a name="a21" doxytag="TreeKey::getText"></a>
virtual const char *&nbsp;</td><td valign=bottom><a class="el" href="class_tree_key.html#a21">getText</a> () const=0</td></tr>
<tr><td>&nbsp;</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>virtual int&nbsp;</td><td valign=bottom><a class="el" href="class_tree_key.html#a22">compare</a> (const <a class="el" href="class_s_w_key.html">SWKey</a> &amp;ikey)=0</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Compares another <a class="el" href="class_verse_key.html">VerseKey</a> object.</em> <a href="#a22">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="class_tree_key.html#a23">decrement</a> (int steps=1)=0</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Decrements key a number of entries.</em> <a href="#a23">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="class_tree_key.html#a24">increment</a> (int steps=1)=0</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Increments key a number of entries.</em> <a href="#a24">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a name="a25" doxytag="TreeKey::Traversable"></a>
virtual char&nbsp;</td><td valign=bottom><b>Traversable</b> ()</td></tr>
<tr><td nowrap align=right valign=top>virtual long&nbsp;</td><td valign=bottom><a class="el" href="class_tree_key.html#a26">Index</a> () const</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Use this function to get te current position withing a module.</em> <a href="#a26">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a name="a27" doxytag="TreeKey::Index"></a>
virtual long&nbsp;</td><td valign=bottom><b>Index</b> (long iindex)</td></tr>
<tr><td colspan=2><br><h2>Private Methods</h2></td></tr>
<tr><td nowrap align=right valign=top><a name="c0" doxytag="TreeKey::init"></a>
void&nbsp;</td><td valign=bottom><b>init</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="TreeKey::classdef"></a>
<a class="el" href="class_s_w_class.html">SWClass</a>&nbsp;</td><td valign=bottom><b>classdef</b></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Class <a class="el" href="class_verse_key.html">VerseKey</a> The <a class="el" href="class_s_w_key.html">SWKey</a> implementation used for verse based modules like Bibles or commentaries.
<p>

<p>
Definition at line <a class="el" href="treekey_8h-source.html#l00036">36</a> of file <a class="el" href="treekey_8h-source.html">treekey.h</a>.<hr><h2>Member Function Documentation</h2>
<a name="a22" doxytag="TreeKey::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"> virtual int TreeKey::compare </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="class_s_w_key.html">SWKey</a> &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp; <em>ikey</em>          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap><code> [pure virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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>&nbsp;</td><td>
key to compare with this one </td></tr>
</table>
</dl><dl compact><dt><b>
Returns: </b><dd>
&gt;0 if this key is greater than compare key; &lt;0 if this key is smaller than compare key; 0 if the keys are the same </dl>
<p>
Reimplemented from <a class="el" href="class_s_w_key.html#a11">SWKey</a>.
<p>
Implemented in <a class="el" href="class_tree_key_idx.html#a28">TreeKeyIdx</a>.    </td>
  </tr>
</table>
<a name="a23" doxytag="TreeKey::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"> virtual void TreeKey::decrement </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">int&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp; <em>steps</em> = 1          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap><code> [pure virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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>&nbsp;</td><td>
Number of entries to jump backward </td></tr>
</table>
</dl><dl compact><dt><b>
Returns: </b><dd>
*this </dl>
<p>
Reimplemented from <a class="el" href="class_s_w_key.html#a14">SWKey</a>.
<p>
Implemented in <a class="el" href="class_tree_key_idx.html#a29">TreeKeyIdx</a>.    </td>
  </tr>
</table>
<a name="a24" doxytag="TreeKey::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"> virtual void TreeKey::increment </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">int&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp; <em>steps</em> = 1          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap><code> [pure virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </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>&nbsp;</td><td>
Number of entries to jump forward </td></tr>
</table>
</dl><dl compact><dt><b>
Returns: </b><dd>
*this </dl>
<p>
Reimplemented from <a class="el" href="class_s_w_key.html#a15">SWKey</a>.
<p>
Implemented in <a class="el" href="class_tree_key_idx.html#a30">TreeKeyIdx</a>.    </td>
  </tr>
</table>
<a name="a26" doxytag="TreeKey::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 TreeKey::Index </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
          <td class="md" valign="top">)&nbsp;</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>
      &nbsp;
    </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-&gt;<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-&gt;<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-&gt;<a class="code" href="class_s_w_module.html#a56">StripText</a>(&amp;vk));
   <font class="keywordflow">return</font> text;
</pre></div> 
<p>
Reimplemented from <a class="el" href="class_s_w_key.html#a17">SWKey</a>.
<p>
Definition at line <a class="el" href="treekey_8h-source.html#l00081">81</a> of file <a class="el" href="treekey_8h-source.html">treekey.h</a>.
<p>
<div class="fragment"><pre>00081 { <font class="keywordflow">return</font> getOffset(); }
</pre></div>    </td>
  </tr>
</table>
<a name="a19" doxytag="TreeKey::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"> virtual void TreeKey::setText </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const char *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp; <em>ikey</em>          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap><code> [pure virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Equates this <a class="el" href="class_s_w_key.html">SWKey</a> 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>&nbsp;</td><td>
string to set this key to </td></tr>
</table>
</dl>
<p>
Reimplemented from <a class="el" href="class_s_w_key.html#a7">SWKey</a>.
<p>
Implemented in <a class="el" href="class_tree_key_idx.html#a24">TreeKeyIdx</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="treekey_8h-source.html">treekey.h</a><li><a class="el" href="treekey_8cpp-source.html">treekey.cpp</a></ul>
<hr><address align="right"><small>Generated on Thu Jun 20 22:13:04 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>