[sword-devel] library request

Troy A. Griffitts sword-devel@crosswire.org
Sun, 10 Feb 2002 15:49:25 -0700

	This is already there.  The real signature of the method is:

virtual ListKey ParseVerseList (const char *buf, const char *defaultKey
        "Genesis 1:1", bool expandRange = false);

this will work with code like:

VerseKey vkey = "James 1:19";
ListKey lkey = vkey.ParseVerseList("20-22; 2:17", vkey, true);

this will return:

James 1:20-22
James 2:17

(expandRange true, above, is the difference between James 1:20-22, and
James 1:20)

PS.  Your "v.12" example, I believe, is problematic due to our roman
numeral parsing.  Not sure; it may work, but I don't think so right
now.  My guess is you'll get something like 5:12 (v = 5).

Martin Gruner wrote:
> Hello all,
> due to a current need for it, I wish to request an addition to the API.
> Apart from the nice VerseKey::parseVerseList(char* )
> function we need an additional function which is able to parse an uncomplete
> reference in a given context. Something like
> VerseKey::parseVerseListInContext(VerseKey &context, char* reference).
> It should be able to parse things like
> <scripRef p="v.12">v.12</scripRef> correctly in a given context, say Matthew
> 5, resulting in a VerseKey containing "Matthew 5:12". Like parseVerseList()
> it should also parse more difficult / combined references.
> And a stupid question: what is the "bool expandRange" argument in
> parseVerseList for?
> thanks for considering,
> Martin