[sword-devel] Parsing OSIS Ranges
Troy A. Griffitts
scribe at crosswire.org
Thu Feb 28 11:44:07 MST 2008
DM,
Your example shows 1 contiguous verse range, so the output of 1 is correct.
Try a call to:
cout << list.getRangeText() << endl;
A versekey can have upper and lower bounds, so your ListKey container
has 1 VerseKey with upper and lower bounds set.
Hope this helps and makes sense.
You can also have a look at:
http://crosswire.org/svn/sword/trunk/utilities/vs2osisref.cpp
and subsequently the VerseKey::convertToOSIS call:
http://crosswire.org/svn/sword/trunk/src/keys/versekey.cpp
ACK! How'd those static size buffer get in there! Well, at least this
is only a static utility function. It was probably moved directly from
a utility into VerseKey. That needs to be cleaned up...
DM Smith wrote:
> Can someone please help.
>
> I'm working on getting osis2mod to handle commentaries and
> annotateRef's argument is an osisRef.
>
> So, I am trying to parse an osisRef into a verse list with the
> following but it does not work.
>
> ListKey list = new ListKey();
>
> VerseKey verse;
> verse.AutoNormalize(0);
> verse.Headings(1);
> verse.Persist(1);
>
> ListKey list = verse.ParseVerseList("Gen.1.1-Gen.1.5", 0, true);
>
> // The following should output 3, but it outputs 1
> cout << list.Count() << endl;
>
> Many thanks,
> DM
>
>
>
>
>
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
More information about the sword-devel
mailing list