7
class VerseKey : public SWKey {
9
VerseKey(const char *ikey = 0);
10
VerseKey(const SWKey * ikey);
11
VerseKey(const char *min, const char *max);
12
VerseKey(const VerseKey &k);
15
virtual SWKey *clone() const;
18
// VerseKey & LowerBound(const char *lb);
19
// VerseKey & UpperBound(const char *ub);
20
VerseKey & LowerBound() const;
21
VerseKey & UpperBound() const;
25
virtual ListKey ParseVerseList (const char *buf, const char *defaultKey="Genesis 1:1", bool expandRange=false);
27
virtual void setText(const char *ikey);
28
virtual const char* getText () const;
29
virtual const char *getRangeText() const;
30
virtual const char *getShortText() const;
33
virtual char Traversable();
35
virtual void decrement(int step);
36
virtual void increment(int step);
38
virtual const char *getBookName() const;
39
virtual const char *getBookAbbrev() const;
41
virtual char Testament() const;
42
virtual char Book() const;
43
virtual int Chapter() const;
44
virtual int Verse() const;
46
//virtual char Testament(char itestament);
47
// virtual char Book(char ibook);
48
// virtual int Chapter(int ichapter);
49
// virtual int Verse(int iverse);
51
virtual void Normalize(char autocheck = 0);
52
virtual char AutoNormalize(char iautonorm = MAXPOS (char));
54
virtual char Headings(char iheadings = MAXPOS (char));
55
virtual const char *getOSISRef() const;
57
virtual int compare(const SWKey & ikey);
58
virtual int _compare(const VerseKey & ikey);
60
virtual void setLocale(const char *name);
61
virtual const char *getLocale() const;
63
// extensions to Sword's class
66
/* Get number of books in the given testament
67
* testament may be 1 (OT) or 2 (NT)
69
const int bookCount( const int testament ) {
70
if ( (testament < 1) || (testament > 2) ) {
73
return self->BMAX[testament-1];
77
* Returns the name of the booknumber in the givn testament.
78
* Testament may be 1 (OT) or 2 (NT)
79
* book may be in the range of 1 <= bookCount(testament)
81
const char* bookName( const int testament, const int book ) {
82
if ( (testament < 1) || (testament > 2) ) {
85
if ( (book < 1) || (book > self->BMAX[testament-1]) ) {
89
return self->books[testament-1][book-1].name;
92
/* Get number of chapters in the given testament and book number
93
* testament may be 1 (OT) or 2 (NT)
94
* book may be in the range 1 <= bookCount(testament)
96
const int chapterCount( const int testament, const int book ) {
97
if ( (testament < 1) || (testament > 2) ) {
100
if ( (book < 1) || (book > self->BMAX[testament-1]) ) {
104
return self->books[testament-1][book-1].chapmax;
107
/* Get number of verses in the given chapter of the given in the given testament,
108
* testament may be 1 (OT) or 2 (NT)
109
* book may be in the range 1 <= bookCount(testament)
110
* chapter may be in the range 1 <= chapterCount(testament, book)
112
const int verseCount( const int testament, const int book, const int chapter ) {
113
if ( (testament < 1) || (testament > 2) ) {
116
if ( (book < 1) || (book > self->BMAX[testament-1]) ) {
119
if ( (chapter < 1) || (chapter > self->books[testament-1][book-1].chapmax) ) {
123
return self->books[testament-1][book-1].versemax[chapter-1];