File: versekey.3

package info (click to toggle)
sword 1.5.3-3woody2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 20,484 kB
  • ctags: 11,105
  • sloc: cpp: 49,665; ansic: 13,335; sh: 8,730; pascal: 3,433; tcl: 1,602; makefile: 988; perl: 565; sed: 93
file content (650 lines) | stat: -rw-r--r-- 14,955 bytes parent folder | download
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
.TH "VerseKey" 3 "5 Oct 2001" "The Sword Project" \" -*- nroff -*-
.ad l
.nh
.SH NAME
VerseKey \- Class VerseKey The \fBSWKey\fR implementation used for verse based modules like Bibles or commentaries. 
.SH SYNOPSIS
.br
.PP
\fC#include <versekey.h>\fR
.PP
Inherits \fBSWKey\fR.
.PP
.SS Public Methods

.in +1c
.ti -1c
.RI "\fBVerseKey\fR (const char *ikey=0)"
.br
.RI "\fIVerseKey Constructor - initializes Instance of VerseKey.\fR"
.ti -1c
.RI "\fBVerseKey\fR (const \fBSWKey\fR *ikey)"
.br
.RI "\fIVerseKey Constructor - initializes instance of VerseKey.\fR"
.ti -1c
.RI "\fBVerseKey\fR (const char *min, const char *max)"
.br
.RI "\fIVerseKey Constructor - initializes instance of VerseKey with boundariess - see also \fBLowerBound\fR and \fBUpperBound\fR.\fR"
.ti -1c
.RI "\fBVerseKey\fR (VerseKey const &k)"
.br
.RI "\fIVerseKey Copy Constructor - will create a new VerseKey based on an existing one.\fR"
.ti -1c
.RI "virtual \fB~VerseKey\fR ()"
.br
.RI "\fIVerseKey Destructor Cleans up an instance of VerseKey.\fR"
.ti -1c
.RI "VerseKey& \fBLowerBound\fR (const char *lb)"
.br
.RI "\fIsets the lower boundary for this VerseKey and returns the new boundary.\fR"
.ti -1c
.RI "VerseKey& \fBUpperBound\fR (const char *ub)"
.br
.RI "\fIsets the upper boundary for this VerseKey and returns the new boundary.\fR"
.ti -1c
.RI "VerseKey& \fBLowerBound\fR () const"
.br
.RI "\fIgets the lower boundary of this VerseKey.\fR"
.ti -1c
.RI "VerseKey& \fBUpperBound\fR () const"
.br
.RI "\fIgets the upper boundary of this VerseKey.\fR"
.ti -1c
.RI "void \fBClearBounds\fR ()"
.br
.RI "\fIclears the boundaries of this VerseKey.\fR"
.ti -1c
.RI "virtual \fBSWKey\fR* \fBclone\fR () const"
.br
.RI "\fICreates a new \fBSWKey\fR based on the current VerseKey see also the Copy Constructor.\fR"
.ti -1c
.RI "virtual const char* \fBgetText\fR () const"
.br
.RI "\fIrefreshes keytext before returning if cast to a (char *) is requested.\fR"
.ti -1c
.RI "virtual void \fBsetText\fR (const char *ikey)"
.br
.RI "\fIEquates this \fBSWKey\fR to a character string.\fR"
.ti -1c
.RI "virtual void \fBcopyFrom\fR (const \fBSWKey\fR &ikey)"
.br
.RI "\fIEquates this \fBSWKey\fR to another \fBSWKey\fR object.\fR"
.ti -1c
.RI "virtual void \fBcopyFrom\fR (const VerseKey &ikey)"
.br
.RI "\fIEquates this VerseKey to another VerseKey.\fR"
.ti -1c
.RI "virtual void \fBsetPosition\fR (SW_POSITION)"
.br
.RI "\fIPositions this key.\fR"
.ti -1c
.RI "virtual void \fBdecrement\fR (int step)"
.br
.RI "\fIDecrements key a number of verses.\fR"
.ti -1c
.RI "virtual void \fBincrement\fR (int step)"
.br
.RI "\fIIncrements key a number of verses.\fR"
.ti -1c
.RI "virtual char \fBTraversable\fR ()"
.br
.ti -1c
.RI "virtual char \fBTestament\fR () const"
.br
.RI "\fIGets testament.\fR"
.ti -1c
.RI "virtual char \fBBook\fR () const"
.br
.RI "\fIGets book.\fR"
.ti -1c
.RI "virtual int \fBChapter\fR () const"
.br
.RI "\fIGets chapter.\fR"
.ti -1c
.RI "virtual int \fBVerse\fR () const"
.br
.RI "\fIGets verse.\fR"
.ti -1c
.RI "virtual char \fBTestament\fR (char itestament)"
.br
.RI "\fISets/gets testament.\fR"
.ti -1c
.RI "virtual char \fBBook\fR (char ibook)"
.br
.RI "\fISets/gets book.\fR"
.ti -1c
.RI "virtual int \fBChapter\fR (int ichapter)"
.br
.RI "\fISets/gets chapter.\fR"
.ti -1c
.RI "virtual int \fBVerse\fR (int iverse)"
.br
.RI "\fISets/gets verse.\fR"
.ti -1c
.RI "virtual void \fBNormalize\fR (char autocheck=0)"
.br
.RI "\fIchecks limits and normalizes if necessary (e.g.\fR"
.ti -1c
.RI "virtual char \fBAutoNormalize\fR (char iautonorm=MAXPOS(char))"
.br
.RI "\fISets/gets flag that tells VerseKey to automatically normalize itself when modified.\fR"
.ti -1c
.RI "virtual char \fBHeadings\fR (char iheadings=MAXPOS(char))"
.br
.RI "\fISets/gets flag that tells VerseKey to include chapter/book/testament/module headings.\fR"
.ti -1c
.RI "virtual long \fBNewIndex\fR () const"
.br
.ti -1c
.RI "virtual long \fBIndex\fR () const"
.br
.RI "\fIGets index based upon current verse.\fR"
.ti -1c
.RI "virtual long \fBIndex\fR (long iindex)"
.br
.RI "\fISets index based upon current verse.\fR"
.ti -1c
.RI "virtual \fBListKey\fR \fBParseVerseList\fR (const char *buf, const char *defaultKey="Genesis 1:1", bool expandRange=false)"
.br
.ti -1c
.RI "virtual int \fBcompare\fR (const \fBSWKey\fR &ikey)"
.br
.RI "\fICompares another \fBSWKey\fR object.\fR"
.ti -1c
.RI "virtual int \fB_compare\fR (const VerseKey &ikey)"
.br
.RI "\fICompares another VerseKey object.\fR"
.ti -1c
.RI "virtual void \fBsetBookAbbrevs\fR (const struct abbrev *bookAbbrevs, unsigned int size=0)"
.br
.ti -1c
.RI "virtual void \fBsetBooks\fR (const char *iBMAX, struct sbook **ibooks)"
.br
.ti -1c
.RI "virtual void \fBsetLocale\fR (const char *name)"
.br
.ti -1c
.RI "virtual SWKEY_OPERATORS \fBSWKey\fR& \fBoperator=\fR (const VerseKey &ikey)"
.br
.in -1c
.SS Public Attributes

.in +1c
.ti -1c
.RI "const char* \fBBMAX\fR"
.br
.ti -1c
.RI "struct sbook** \fBbooks\fR"
.br
.in -1c
.SS Static Public Attributes

.in +1c
.ti -1c
.RI "const char \fBbuiltin_BMAX\fR [2]"
.br
.ti -1c
.RI "struct sbook* \fBbuiltin_books\fR [2]"
.br
.ti -1c
.RI "const struct abbrev \fBbuiltin_abbrevs\fR []"
.br
.in -1c
.SS Private Methods

.in +1c
.ti -1c
.RI "int \fBgetBookAbbrev\fR (char *abbr)"
.br
.ti -1c
.RI "void \fBinitBounds\fR () const"
.br
.ti -1c
.RI "void \fBinitstatics\fR ()"
.br
.RI "\fIinitialize and allocate books array.\fR"
.ti -1c
.RI "void \fBinit\fR ()"
.br
.RI "\fIinitializes this \fBVerseKey\fR().\fR"
.ti -1c
.RI "void \fBfreshtext\fR () const"
.br
.RI "\fIRefresh keytext based on testament|book|chapter|verse default auto normalization to true default display headings option is false.\fR"
.ti -1c
.RI "virtual char \fBparse\fR ()"
.br
.RI "\fIParse a character array into testament|book|chapter|verse.\fR"
.ti -1c
.RI "int \fBfindindex\fR (long *array, int size, long value)"
.br
.RI "\fIBinary search to find the index closest, but less than the given value.\fR"
.in -1c
.SS Private Attributes

.in +1c
.ti -1c
.RI "\fBListKey\fR \fBinternalListKey\fR"
.br
.ti -1c
.RI "const struct abbrev* \fBabbrevs\fR"
.br
.ti -1c
.RI "int \fBabbrevsCnt\fR"
.br
.ti -1c
.RI "char \fBtestament\fR"
.br
.RI "\fIThe Testament: 0 - Old; 1 - New.\fR"
.ti -1c
.RI "char \fBbook\fR"
.br
.ti -1c
.RI "int \fBchapter\fR"
.br
.ti -1c
.RI "int \fBverse\fR"
.br
.ti -1c
.RI "char \fBautonorm\fR"
.br
.RI "\fIflag for auto normalization.\fR"
.ti -1c
.RI "char \fBheadings\fR"
.br
.RI "\fIflag for headings on/off.\fR"
.ti -1c
.RI "VerseKey* \fBlowerBound\fR"
.br
.ti -1c
.RI "VerseKey * \fBupperBound\fR"
.br
.in -1c
.SS Static Private Attributes

.in +1c
.ti -1c
.RI "\fBSWClass\fR \fBclassdef\fR"
.br
.ti -1c
.RI "long* \fBoffsets\fR [2][2]"
.br
.ti -1c
.RI "int \fBoffsize\fR [2][2]"
.br
.ti -1c
.RI "int \fBinstance\fR"
.br
.RI "\fInumber of instantiated VerseKey objects or derivitives.\fR"
.ti -1c
.RI "struct sbook \fBotbooks\fR []"
.br
.ti -1c
.RI "struct sbook \fBntbooks\fR []"
.br
.ti -1c
.RI "long \fBotbks\fR []"
.br
.ti -1c
.RI "long \fBotcps\fR []"
.br
.ti -1c
.RI "long \fBntbks\fR []"
.br
.ti -1c
.RI "long \fBntcps\fR []"
.br
.ti -1c
.RI "int \fBvm\fR []"
.br
.ti -1c
.RI "LocaleCache \fBlocaleCache\fR"
.br
.in -1c
.SH DETAILED DESCRIPTION
.PP 
Class VerseKey The \fBSWKey\fR implementation used for verse based modules like Bibles or commentaries.
.PP
Definition at line 66 of file versekey.h.
.SH CONSTRUCTOR & DESTRUCTOR DOCUMENTATION
.PP 
.SS VerseKey::VerseKey (const char * ikey = 0)
.PP
VerseKey Constructor - initializes Instance of VerseKey.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fIikey\fR\fR
text key (will take various forms of 'BOOK CH:VS'. See \fBparse\fR for more detailed information) 
.SS VerseKey::VerseKey (const \fBSWKey\fR * ikey)
.PP
VerseKey Constructor - initializes instance of VerseKey.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fIikey\fR\fR
base key (will take various forms of 'BOOK CH:VS'. See \fBparse\fR for more detailed information) 
.SS VerseKey::VerseKey (const char * min, const char * max)
.PP
VerseKey Constructor - initializes instance of VerseKey with boundariess - see also \fBLowerBound\fR and \fBUpperBound\fR.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fImin\fR\fR
the lower boundary of the new VerseKey 
.TP
\fB\fImax\fR\fR
the upper boundary of the new VerseKey 
.SS VerseKey::VerseKey (VerseKey const & k)
.PP
VerseKey Copy Constructor - will create a new VerseKey based on an existing one.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fIk\fR\fR
the VerseKey to copy from 
.SH MEMBER FUNCTION DOCUMENTATION
.PP 
.SS char VerseKey::AutoNormalize (char iautonorm = MAXPOS (char))\fC [virtual]\fR
.PP
Sets/gets flag that tells VerseKey to automatically normalize itself when modified.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fIiautonorm\fR\fR
value which to set autonorm [MAXPOS(char)] - only get 
.PP
\fBReturns: \fR
.in +1c
if unchanged -> value of autonorm, if changed -> previous value of autonorm 
.SS char VerseKey::Book (char ibook)\fC [virtual]\fR
.PP
Sets/gets book.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fIibook\fR\fR
value which to set book [MAXPOS(char)] - only get 
.PP
\fBReturns: \fR
.in +1c
if unchanged -> value of book, if changed -> previous value of book 
.SS char VerseKey::Book () const\fC [virtual]\fR
.PP
Gets book.
.PP
\fBReturns: \fR
.in +1c
value of book 
.SS int VerseKey::Chapter (int ichapter)\fC [virtual]\fR
.PP
Sets/gets chapter.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fIichapter\fR\fR
value which to set chapter [MAXPOS(int)] - only get 
.PP
\fBReturns: \fR
.in +1c
if unchanged -> value of chapter, if changed -> previous value of chapter 
.SS int VerseKey::Chapter () const\fC [virtual]\fR
.PP
Gets chapter.
.PP
\fBReturns: \fR
.in +1c
value of chapter 
.SS char VerseKey::Headings (char iheadings = MAXPOS (char))\fC [virtual]\fR
.PP
Sets/gets flag that tells VerseKey to include chapter/book/testament/module headings.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fIiheadings\fR\fR
value which to set headings [MAXPOS(char)] - only get 
.PP
\fBReturns: \fR
.in +1c
if unchanged -> value of headings, if changed -> previous value of headings 
.SS long VerseKey::Index (long index)\fC [virtual]\fR
.PP
Sets index based upon current verse.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fIiindex\fR\fR
value to set index to 
.PP
\fBReturns: \fR
.in +1c
offset 
.PP
Reimplemented from \fBSWKey\fR.
.SS long VerseKey::Index () const\fC [virtual]\fR
.PP
Gets index based upon current verse.
.PP
\fBReturns: \fR
.in +1c
offset 
.PP
Reimplemented from \fBSWKey\fR.
.SS VerseKey & VerseKey::LowerBound () const
.PP
gets the lower boundary of this VerseKey.
.PP
\fBReturns: \fR
.in +1c
the lower boundary of this VerseKey 
.SS VerseKey & VerseKey::LowerBound (const char * lb)
.PP
sets the lower boundary for this VerseKey and returns the new boundary.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fIlb\fR\fR
the new lower boundary for this VerseKey 
.PP
\fBReturns: \fR
.in +1c
the lower boundary the key was set to 
.SS void VerseKey::Normalize (char autocheck = 0)\fC [virtual]\fR
.PP
checks limits and normalizes if necessary (e.g.
.PP
Matthew 29:47 = Mark 2:2). If last verse is exceeded, key is set to last Book CH:VS
.PP
\fBReturns: \fR
.in +1c
*this 
.SS char VerseKey::Testament (char itestament)\fC [virtual]\fR
.PP
Sets/gets testament.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fIitestament\fR\fR
value which to set testament [MAXPOS(char)] - only get 
.PP
\fBReturns: \fR
.in +1c
if unchanged -> value of testament, if changed -> previous value of testament 
.SS char VerseKey::Testament () const\fC [virtual]\fR
.PP
Gets testament.
.PP
\fBReturns: \fR
.in +1c
value of testament 
.SS VerseKey & VerseKey::UpperBound () const
.PP
gets the upper boundary of this VerseKey.
.PP
\fBReturns: \fR
.in +1c
the upper boundary of this VerseKey 
.SS VerseKey & VerseKey::UpperBound (const char * ub)
.PP
sets the upper boundary for this VerseKey and returns the new boundary.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fIlb\fR\fR
the new upper boundary for this VerseKey 
.PP
\fBReturns: \fR
.in +1c
the upper boundary the key was set to 
.SS int VerseKey::Verse (int iverse)\fC [virtual]\fR
.PP
Sets/gets verse.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fIiverse\fR\fR
value which to set verse [MAXPOS(int)] - only get 
.PP
\fBReturns: \fR
.in +1c
if unchanged -> value of verse, if changed -> previous value of verse 
.SS int VerseKey::Verse () const\fC [virtual]\fR
.PP
Gets verse.
.PP
\fBReturns: \fR
.in +1c
value of verse 
.SS int VerseKey::_compare (const VerseKey & ikey)\fC [virtual]\fR
.PP
Compares another VerseKey object.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fIikey\fR\fR
key to compare with this one 
.PP
\fBReturns: \fR
.in +1c
>0 if this VerseKey is greater than compare VerseKey, <0 if this VerseKey is smaller than compare VerseKey, 0 if the keys are the same 
.SS int VerseKey::compare (const \fBSWKey\fR & ikey)\fC [virtual]\fR
.PP
Compares another \fBSWKey\fR object.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fIikey\fR\fR
key to compare with this one 
.PP
\fBReturns: \fR
.in +1c
>0 if this VerseKey is greater than compare \fBSWKey\fR, <0 if this VerseKey is smaller than compare \fBSWKey\fR, 0 if the keys are the same 
.PP
Reimplemented from \fBSWKey\fR.
.SS virtual void VerseKey::copyFrom (const \fBSWKey\fR & ikey)\fC [virtual]\fR
.PP
Equates this \fBSWKey\fR to another \fBSWKey\fR object.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fIikey\fR\fR
other swkey object 
.PP
Reimplemented from \fBSWKey\fR.
.SS void VerseKey::decrement (int step)\fC [virtual]\fR
.PP
Decrements key a number of verses.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fIdecrement\fR\fR
Number of verses to jump backward 
.PP
\fBReturns: \fR
.in +1c
*this 
.PP
Reimplemented from \fBSWKey\fR.
.SS int VerseKey::findindex (long * array, int size, long value)\fC [private]\fR
.PP
Binary search to find the index closest, but less than the given value.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fIarray\fR\fR
long * to array to search 
.TP
\fB\fIsize\fR\fR
number of elements in the array 
.TP
\fB\fIvalue\fR\fR
value to find 
.PP
\fBReturns: \fR
.in +1c
the index into the array that is less than but closest to value 
.SS void VerseKey::increment (int step)\fC [virtual]\fR
.PP
Increments key a number of verses.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fIincrement\fR\fR
Number of verses to jump forward 
.PP
\fBReturns: \fR
.in +1c
*this 
.PP
Reimplemented from \fBSWKey\fR.
.SS void VerseKey::setPosition (SW_POSITION)\fC [virtual]\fR
.PP
Positions this key.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fIp\fR\fR
position 
.PP
\fBReturns: \fR
.in +1c
*this 
.PP
Reimplemented from \fBSWKey\fR.
.SS void VerseKey::setText (const char * ikey)\fC [inline, virtual]\fR
.PP
Equates this \fBSWKey\fR to a character string.
.PP
\fBParameters: \fR
.in +1c
.TP
\fB\fIikey\fR\fR
string to set this key to 
.PP
Reimplemented from \fBSWKey\fR.
.PP
Definition at line 228 of file versekey.h.

.SH AUTHOR
.PP 
Generated automatically by Doxygen for The Sword Project from the source code.