[sword-devel] Verse ranges and linkage information

Troy A. Griffitts scribe at crosswire.org
Mon May 22 07:10:37 MST 2017


If SWModule::setSkipConsecutiveLinks(true) then SWModule::increment() 
(and operator ++) will skip to the next verse which is not a link to the 
current verse.

Typically usage is that a chapter will simply do a for (;;) loop through 
the verses in the chapter and it all just works.

There is also a method which was added, I think by Ben Morgan a while 
back: SWModule::isLinked, though I'm not sure why it was needed and I've 
never had a need in any frontend I've written to use it.

Tech details about links:

There is often no way to really tell if a verse is a link.  Some module 
drivers implement this the same as filesystem inodes, which basically 
resemble hard links (not symbolic links)-- basically, just reusing the 
same data pointer in the index.  But since links are almost exclusively 
consecutive, a practical check can be performed to see if the current 
entry is the same as the next entry.


On 05/22/2017 02:48 AM, Manfred Bergmann wrote:
> Hi.
>
> Not entirely sure I’m understanding correctly.
>
> In Eloquent I’m maintaining a map/dictionary per ’show verses’ request where basically only the reference is stored in some normalized way.
> So I can check on that dictionary and see whether a certain verse was already added to the output buffer.
>
>
>
> Manfred
>
>
>> Am 22.05.2017 um 08:56 schrieb refdoc at gmx.net:
>>
>> How do front-ends know not to double/triple/quadruple...a verse range? Diatheke fails at that right now and I would like to fix this.
>>
>> Peter
>>
>> Sent from my mobile. Please forgive shortness, typos and weird autocorrects.
>> _______________________________________________
>> 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
>
> _______________________________________________
> 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