[sword-devel] General Book Support

Daniel Glassey sword-devel@crosswire.org
Thu, 24 Jan 2002 18:09:17 -0000


On 24 Jan 2002 at 2:20, Troy A. Griffitts sent forth the message:

> Me and Chris are out here in Dallas at Wycliffe and have had some time
> to work together.  TreeKey and general book support are now checked in
> to cvs.  Try them out and let me know what you think.

what can I say but great :) Thanks guys.

> There are test tools in the tests directory.  There is a genbooktest.cpp
> that should be of interest.  Try something like:
> 
> cd sword/tests
> mkdir yoyo
> ./genbooktest ./yoyo/mybook
> ?
> 
> The ? will give you a small menu of some stuff to try.  You should be
> able to build a tree index and add and view text on your new book.  The
> driver for the .conf file (when you finish and would like to check it
> out with swmgr) is RawGenBook

ok, couple of things after playing with genbooktest

did you mean this instead? (set text doesn't work unless you enter "." ;) )

genbooktest: 56: 
-if ((buf[0] != '.') || (buf[1] != 0))
+if ((buf[0] == '.') && (buf[1] == 0))

when you get the text back after entering it, the newlines are stripped, dunno if this is good or 
bad.

In RawGenBook::getRawEntry
there is a local variable key as well as the class variable key. This is confusing. (at least I think 
that is what is happening, I think this may be causing problems but I'm not sure).

The rest is working great.

> The iteration of the tree is a little different in a few points.  look
> at the printTree method in the test program to see.
> 
> There is also a treeidxtest program.  It was done first and tests the
> TreeKeyIdx implementation of the TreeKey interface (which general book
> support uses).  It may be useful to see how to use TreeKeyIdx by
> itself.  Many (maybe all) functions in this program are also present in
> genbooktest, so refer the genbooktest for the latest version of each
> function;  I'll probably back-copy them when I'm not so sleepy.  

Hope you had a good sleep :)

> TreeKey allows for _USER DATA_ to be stored with each key entry.  We use
> this to store the offset and size of the book entry in the rawgenbook
> driver.  We can also use this for all kinds of other things.  One
> possible thought is for bookmark data.
> 
> Hope you all enjoy it.  Please keep our meetings in prayer over the next
> couple days.  OSIS will be a great tool for us, Lord willing, if we do
> it right!

btw, I haven't noticed you saying. What are you out there for, what are the meetings about if 
you can say?

Regards,
Daniel

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com