aboutsummaryrefslogblamecommitdiffstats
path: root/doc/api-documentation/html/class_list_key.html
blob: 375ff10742766ee5f5b5530157b880b188f22e31 (plain) (tree)
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
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658

















































































































































































































































































































































































































































































































































































































































































                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
<!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>ListKey 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>ListKey  Class Reference</h1>ListKey is the basis for all types of keys that have lists of specified indexes (e.g. 
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="listkey_8h-source.html">listkey.h</a>&gt;</code>
<p>
Inheritance diagram for ListKey:<p><center><img src="class_list_key__inherit__graph.png" border="0" usemap="#_list_key__inherit__map" alt="Inheritance graph"></center>
<map name="_list_key__inherit__map">
<area href="class_s_w_key.html" shape="rect" coords="22,84,78,103" alt="">
<area href="class_s_w_object.html" shape="rect" coords="14,15,86,33" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for ListKey:<p><center><img src="class_list_key__coll__graph.png" border="0" usemap="#_list_key__coll__map" alt="Collaboration graph"></center>
<map name="_list_key__coll__map">
<area href="class_s_w_key.html" shape="rect" coords="114,197,170,215" alt="">
<area href="class_s_w_object.html" shape="rect" coords="219,106,291,125" 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_list_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>&nbsp;</td><td valign=bottom><a class="el" href="class_list_key.html#a0">ListKey</a> (const char *ikey=0)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>initializes instance of ListKey.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a name="a1" doxytag="ListKey::ListKey"></a>
&nbsp;</td><td valign=bottom><b>ListKey</b> (ListKey const &amp;k)</td></tr>
<tr><td nowrap align=right valign=top><a name="a2" doxytag="ListKey::~ListKey"></a>
virtual&nbsp;</td><td valign=bottom><a class="el" href="class_list_key.html#a2">~ListKey</a> ()</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>cleans up instance of ListKey.</em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual <a class="el" href="class_s_w_key.html">SWKey</a> *&nbsp;</td><td valign=bottom><a class="el" href="class_list_key.html#a3">clone</a> () const</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Returns a copy of this <a class="el" href="class_s_w_key.html">SWKey</a> object.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a name="a4" doxytag="ListKey::ClearList"></a>
virtual void&nbsp;</td><td valign=bottom><a class="el" href="class_list_key.html#a4">ClearList</a> ()</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Clears out elements of list.</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_list_key.html#a5">Count</a> ()</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Returns number of elements in list.</em> <a href="#a5">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a name="a6" doxytag="ListKey::Remove"></a>
virtual void&nbsp;</td><td valign=bottom><a class="el" href="class_list_key.html#a6">Remove</a> ()</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Removes current element from list.</em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual char&nbsp;</td><td valign=bottom><a class="el" href="class_list_key.html#a7">SetToElement</a> (int ielement, SW_POSITION=TOP)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Sets key to element number.</em> <a href="#a7">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual <a class="el" href="class_s_w_key.html">SWKey</a> *&nbsp;</td><td valign=bottom><a class="el" href="class_list_key.html#a8">GetElement</a> (int pos=-1)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Gets a key element number.</em> <a href="#a8">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>ListKey &amp;&nbsp;</td><td valign=bottom><a class="el" href="class_list_key.html#a9">operator&lt;&lt;</a> (const <a class="el" href="class_s_w_key.html">SWKey</a> &amp;ikey)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Adds an element to the list.</em> <a href="#a9">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a name="a10" doxytag="ListKey::add"></a>
virtual void&nbsp;</td><td valign=bottom><b>add</b> (const <a class="el" href="class_s_w_key.html">SWKey</a> &amp;ikey)</td></tr>
<tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="class_list_key.html#a11">copyFrom</a> (const ListKey &amp;ikey)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Equates this ListKey to another ListKey object.</em> <a href="#a11">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_list_key.html#a12">copyFrom</a> (const <a class="el" href="class_s_w_key.html">SWKey</a> &amp;ikey)</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 another <a class="el" href="class_s_w_key.html">SWKey</a> object.</em> <a href="#a12">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_list_key.html#a13">setPosition</a> (SW_POSITION)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Positions this key.</em> <a href="#a13">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a name="a14" doxytag="ListKey::decrement"></a>
virtual void&nbsp;</td><td valign=bottom><a class="el" href="class_list_key.html#a14">decrement</a> (int step)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Decrements a number of elements.</em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a name="a15" doxytag="ListKey::increment"></a>
virtual void&nbsp;</td><td valign=bottom><a class="el" href="class_list_key.html#a15">increment</a> (int step)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Increments a number of elements.</em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a name="a16" doxytag="ListKey::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_list_key.html#a17">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="#a17">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual long&nbsp;</td><td valign=bottom><a class="el" href="class_list_key.html#a18">Index</a> (long index)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Returns the index for the new one given as as parameter.</em> <a href="#a18">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a name="a19" doxytag="ListKey::operator="></a>
SWKEY_OPERATORS ListKey &amp;&nbsp;</td><td valign=bottom><b>operator=</b> (const ListKey &amp;key)</td></tr>
<tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr>
<tr><td nowrap align=right valign=top><a name="n0" doxytag="ListKey::arraypos"></a>
int&nbsp;</td><td valign=bottom><b>arraypos</b></td></tr>
<tr><td nowrap align=right valign=top><a name="n1" doxytag="ListKey::arraymax"></a>
int&nbsp;</td><td valign=bottom><b>arraymax</b></td></tr>
<tr><td nowrap align=right valign=top><a name="n2" doxytag="ListKey::arraycnt"></a>
int&nbsp;</td><td valign=bottom><b>arraycnt</b></td></tr>
<tr><td nowrap align=right valign=top><a name="n3" doxytag="ListKey::array"></a>
<a class="el" href="class_s_w_key.html">SWKey</a> **&nbsp;</td><td valign=bottom><b>array</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="ListKey::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="ListKey::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>
ListKey is the basis for all types of keys that have lists of specified indexes (e.g.
<p>
a list of verses, place, etc.) 
<p>

<p>
Definition at line <a class="el" href="listkey_8h-source.html#l00036">36</a> of file <a class="el" href="listkey_8h-source.html">listkey.h</a>.<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a name="a0" doxytag="ListKey::ListKey"></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"> ListKey::ListKey </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> = 0          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

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

<p>
initializes instance of ListKey.
<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>
text key </td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="listkey_8cpp-source.html#l00022">22</a> of file <a class="el" href="listkey_8cpp-source.html">listkey.cpp</a>.
<p>
References <a class="el" href="listkey_8cpp-source.html#l00064">ClearList</a>().
<p>
Referenced by <a class="el" href="listkey_8cpp-source.html#l00045">clone</a>().
<p>
<div class="fragment"><pre>00022                                 : <a class="code" href="class_s_w_key.html#a0">SWKey</a>(ikey) {
00023         arraymax = 0;
00024         <a class="code" href="class_list_key.html#a4">ClearList</a>();
00025         init();
00026 }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a name="a3" doxytag="ListKey::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"> <a class="el" href="class_s_w_key.html">SWKey</a> * ListKey::clone </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> [virtual]</code></td>
        </tr>

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

<p>
Returns a copy of this <a class="el" href="class_s_w_key.html">SWKey</a> object.
<p>
This is useful to get a 1:1 copy of an <a class="el" href="class_s_w_key.html">SWKey</a> based object. <dl compact><dt><b>
Returns: </b><dd>
<a class="el" href="class_s_w_key.html">SWKey</a> </dl>
<p>
Reimplemented from <a class="el" href="class_s_w_key.html#a3">SWKey</a>.
<p>
Definition at line <a class="el" href="listkey_8cpp-source.html#l00045">45</a> of file <a class="el" href="listkey_8cpp-source.html">listkey.cpp</a>.
<p>
References <a class="el" href="listkey_8cpp-source.html#l00022">ListKey</a>().
<p>
<div class="fragment"><pre>00046 {
00047         <font class="keywordflow">return</font> <font class="keyword">new</font> <a class="code" href="class_list_key.html#a0">ListKey</a>(*<font class="keyword">this</font>);
00048 }
</pre></div>    </td>
  </tr>
</table>
<a name="a12" doxytag="ListKey::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"> virtual void ListKey::copyFrom </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> [inline, 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 another <a class="el" href="class_s_w_key.html">SWKey</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>
other swkey object </td></tr>
</table>
</dl>
<p>
Reimplemented from <a class="el" href="class_s_w_key.html#a8">SWKey</a>.
<p>
Definition at line <a class="el" href="listkey_8h-source.html#l00090">90</a> of file <a class="el" href="listkey_8h-source.html">listkey.h</a>.
<p>
References <a class="el" href="swkey_8cpp-source.html#l00126">SWKey::copyFrom</a>().
<p>
<div class="fragment"><pre>00090 { <a class="code" href="class_s_w_key.html#a8">SWKey::copyFrom</a>(ikey); }
</pre></div>    </td>
  </tr>
</table>
<a name="a11" doxytag="ListKey::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 ListKey::copyFrom </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const ListKey &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> [virtual]</code></td>
        </tr>

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

<p>
Equates this ListKey to another ListKey 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>
other ListKey object </td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="listkey_8cpp-source.html#l00087">87</a> of file <a class="el" href="listkey_8cpp-source.html">listkey.cpp</a>.
<p>
References <a class="el" href="listkey_8h-source.html#l00044">array</a>, <a class="el" href="listkey_8h-source.html#l00043">arraycnt</a>, <a class="el" href="listkey_8h-source.html#l00042">arraymax</a>, <a class="el" href="listkey_8h-source.html#l00041">arraypos</a>, <a class="el" href="listkey_8cpp-source.html#l00064">ClearList</a>(), <a class="el" href="swkey_8cpp-source.html#l00045">SWKey::clone</a>(), and <a class="el" href="listkey_8cpp-source.html#l00199">SetToElement</a>().
<p>
<div class="fragment"><pre>00087                                           {
00088         <a class="code" href="class_list_key.html#a4">ClearList</a>();
00089 
00090         arraymax = ikey.<a class="code" href="class_list_key.html#n1">arraymax</a>;
00091         arraypos = ikey.<a class="code" href="class_list_key.html#n0">arraypos</a>;
00092         arraycnt = ikey.<a class="code" href="class_list_key.html#n2">arraycnt</a>;
00093         array = (arraymax)?(<a class="code" href="class_s_w_key.html">SWKey</a> **)malloc(ikey.<a class="code" href="class_list_key.html#n1">arraymax</a> * <font class="keyword">sizeof</font>(<a class="code" href="class_s_w_key.html">SWKey</a> *)):0;
00094         <font class="keywordflow">for</font> (<font class="keywordtype">int</font> i = 0; i &lt; arraycnt; i++)
00095                 array[i] = ikey.<a class="code" href="class_list_key.html#n3">array</a>[i]-&gt;<a class="code" href="class_s_w_key.html#a3">clone</a>();
00096 
00097         <a class="code" href="class_list_key.html#a7">SetToElement</a>(0);
00098 }
</pre></div>    </td>
  </tr>
</table>
<a name="a5" doxytag="ListKey::Count"></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 ListKey::Count </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><code> [virtual]</code></td>
        </tr>

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

<p>
Returns number of elements in list.
<p>
<dl compact><dt><b>
Returns: </b><dd>
number of elements in list </dl>
<p>
Definition at line <a class="el" href="listkey_8cpp-source.html#l00186">186</a> of file <a class="el" href="listkey_8cpp-source.html">listkey.cpp</a>.
<p>
Referenced by <a class="el" href="versekey_8cpp-source.html#l00231">VerseKey::parse</a>().
<p>
<div class="fragment"><pre>00186                    {
00187         <font class="keywordflow">return</font> arraycnt;
00188 }
</pre></div>    </td>
  </tr>
</table>
<a name="a8" doxytag="ListKey::GetElement"></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"> <a class="el" href="class_s_w_key.html">SWKey</a> * ListKey::GetElement </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>pos</em> = -1          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap><code> [virtual]</code></td>
        </tr>

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

<p>
Gets a key element number.
<p>
<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>pos</em>&nbsp;</td><td>
element number to get (or default current) </td></tr>
</table>
</dl><dl compact><dt><b>
Returns: </b><dd>
Key or null on error </dl>
<p>
Definition at line <a class="el" href="listkey_8cpp-source.html#l00233">233</a> of file <a class="el" href="listkey_8cpp-source.html">listkey.cpp</a>.
<p>
<div class="fragment"><pre>00233                                   {
00234         <font class="keywordflow">if</font> (pos &gt;=0) {
00235                 <font class="keywordflow">if</font> (pos &gt;=arraycnt)
00236                         error = KEYERR_OUTOFBOUNDS;
00237         }
00238         <font class="keywordflow">else</font> pos = arraypos;
00239         <font class="keywordflow">return</font> (error) ? 0:array[pos];
00240 }
</pre></div>    </td>
  </tr>
</table>
<a name="a18" doxytag="ListKey::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 ListKey::Index </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">long&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp; <em>index</em>          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap><code> [inline, virtual]</code></td>
        </tr>

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

<p>
Returns the index for the new one given as as parameter.
<p>
The first parameter is the new index. 
<p>
Reimplemented from <a class="el" href="class_s_w_key.html">SWKey</a>.
<p>
Definition at line <a class="el" href="listkey_8h-source.html#l00112">112</a> of file <a class="el" href="listkey_8h-source.html">listkey.h</a>.
<p>
References <a class="el" href="swkey_8h-source.html#l00208">SWKey::Index</a>().
<p>
<div class="fragment"><pre>00112 { <a class="code" href="class_list_key.html#a7">SetToElement</a> (index); <font class="keywordflow">return</font> <a class="code" href="class_list_key.html#a17">Index</a> (); }
</pre></div>    </td>
  </tr>
</table>
<a name="a17" doxytag="ListKey::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 ListKey::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 <a class="el" href="class_list_key.html#a18">Index</a>(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="listkey_8h-source.html#l00106">106</a> of file <a class="el" href="listkey_8h-source.html">listkey.h</a>.
<p>
<div class="fragment"><pre>00106 { <font class="keywordflow">return</font> arraypos; }
</pre></div>    </td>
  </tr>
</table>
<a name="a9" doxytag="ListKey::operator<<"></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"> ListKey&amp; ListKey::operator&lt;&lt; </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> [inline]</code></td>
        </tr>

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

<p>
Adds an element to the list.
<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>
the element to add </td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="listkey_8h-source.html#l00082">82</a> of file <a class="el" href="listkey_8h-source.html">listkey.h</a>.
<p>
<div class="fragment"><pre>00082 { add(ikey); <font class="keywordflow">return</font> *<font class="keyword">this</font>; }
</pre></div>    </td>
  </tr>
</table>
<a name="a13" doxytag="ListKey::setPosition"></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 ListKey::setPosition </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">SW_POSITION&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap><code> [virtual]</code></td>
        </tr>

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

<p>
Positions this key.
<p>
<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>p</em>&nbsp;</td><td>
position </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">SWKey</a>.
<p>
Definition at line <a class="el" href="listkey_8cpp-source.html#l00124">124</a> of file <a class="el" href="listkey_8cpp-source.html">listkey.cpp</a>.
<p>
References <a class="el" href="listkey_8cpp-source.html#l00199">SetToElement</a>().
<p>
<div class="fragment"><pre>00124                                        {
00125         <font class="keywordflow">switch</font> (p) {
00126         <font class="keywordflow">case</font> 1: <font class="comment">// GCC won't compile P_TOP</font>
00127                 <a class="code" href="class_list_key.html#a7">SetToElement</a>(0);
00128                 <font class="keywordflow">break</font>;
00129         <font class="keywordflow">case</font> 2: <font class="comment">// GCC won't compile P_BOTTOM</font>
00130                 <a class="code" href="class_list_key.html#a7">SetToElement</a>(arraycnt-1);
00131                 <font class="keywordflow">break</font>;
00132         }
00133 }
</pre></div>    </td>
  </tr>
</table>
<a name="a7" doxytag="ListKey::SetToElement"></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 ListKey::SetToElement </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">int&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>ielement</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>SW_POSITION&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; = TOP</td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [virtual]</code></td>
        </tr>

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

<p>
Sets key to element number.
<p>
<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>ielement</em>&nbsp;</td><td>
element number to set to </td></tr>
</table>
</dl><dl compact><dt><b>
Returns: </b><dd>
error status </dl>
<p>
Definition at line <a class="el" href="listkey_8cpp-source.html#l00199">199</a> of file <a class="el" href="listkey_8cpp-source.html">listkey.cpp</a>.
<p>
Referenced by <a class="el" href="listkey_8cpp-source.html#l00087">copyFrom</a>(), <a class="el" href="listkey_8cpp-source.html#l00163">decrement</a>(), <a class="el" href="listkey_8cpp-source.html#l00140">increment</a>(), <a class="el" href="listkey_8cpp-source.html#l00247">Remove</a>(), and <a class="el" href="listkey_8cpp-source.html#l00124">setPosition</a>().
<p>
<div class="fragment"><pre>00199                                                         {
00200         arraypos = ielement;
00201         <font class="keywordflow">if</font> (arraypos &gt;= arraycnt) {
00202                 arraypos = (arraycnt&gt;0)?arraycnt - 1:0;
00203                 error = KEYERR_OUTOFBOUNDS;
00204         }
00205         <font class="keywordflow">else</font> {
00206                 <font class="keywordflow">if</font> (arraypos &lt; 0) {
00207                         arraypos = 0;
00208                         error = KEYERR_OUTOFBOUNDS;
00209                 }
00210                 <font class="keywordflow">else</font> {
00211                         error = 0;
00212                 }
00213         }
00214         
00215         <font class="keywordflow">if</font> (arraycnt) {
00216                 (*array[arraypos]) = pos;
00217                 *<font class="keyword">this</font> = (<font class="keyword">const</font> <font class="keywordtype">char</font> *)(*array[arraypos]);
00218         }
00219         <font class="keywordflow">else</font> *<font class="keyword">this</font> = <font class="stringliteral">""</font>;
00220         
00221         <font class="keywordflow">return</font> error;
00222 }
</pre></div>    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="listkey_8h-source.html">listkey.h</a><li><a class="el" href="listkey_8cpp-source.html">listkey.cpp</a></ul>
<hr><address align="right"><small>Generated on Thu Jun 20 22:13:02 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>