[sword-devel] Understanding the structure of generic books and their relationship with TreeKey.
junk_and_mail at yahoo.com
Sun Nov 1 15:01:06 MST 2009
Through browsing through some source code i've managed to figure out that you need to convert a SWKey (SWModule::getKey()) to a TreeKey to be able to iterate through the sections/chapters of a GenBook. However, i have yet to figure out how to obtain the children for each section/chapter. Rather than taking a guess with trial and error and searching through more Sword frontends' source code, i would prefer to have a _full_ understanding on how Sword handles GenBooks and how frontends can make use of those methods.
My questions: Is TreeKey the only way to obtain the sections/chapters of a Genbook? And how do i get a list of the children for each section/chapter? Am i right to assume that i have to use SWModule::setKey() to set the current key to one of the root sections and then re-cast SWModule::getKey() to a TreeKey and iterate through that? Or is another method required?
More information about the sword-devel