[sword-devel] feature request for keys

Troy A. Griffitts sword-devel@crosswire.org
Tue, 01 Feb 2000 11:52:17 -0700


> Either a possibility to access the sbook struct to get the names of the
> books with additional info of how many chapters/verse per book
> or a function that gives the name (without chapter and verse) of a
> book. Otherwise I have tp parse the output again to get the bookname
> from the complete key.

Torsten,
	struct sbook VerseKey::books[int testament][int book] is public.  this
is a public static that will allow you to access the meta info for the
canon (defined in canon.h).  This will change to a NON-STATIC method in
the 5.x tree to support variant verse numberings, so you should probably
use it as such now by only accessing from an instance of the VerseKey
class.
char BMAX[2] defines the number of elements in the second subscript of
books:

VerseKey key;

for (int i = 0; i < 2; i++) {
	for (int j = 0; j < key.BMAX[i]) {
		cout << key.books[i][j].name << "\n";
	}
}


Hope this helps