This adds a (very simple) versification mapping class, and fixes a slight problem in versekey with v11n of bounds.<br><br>API is something like this (I'm not sure I like the names, though...):<br><br>VerseMapMgr {<br> static VerseMapMgr* getSystemVerseMapMgr()<br>
SWVerseMapper* getMapper(char* v11n_from, char* v11n_to);<br> SWVerseMapper* getMapper(VerseMgr::System* v11n_from, VerseMgr::System* v11n_to);<br>}<br><br>SWVerseMapper {<br> VerseKey* map(VerseKey* from);<br>}<br><br>
The rules of this verse mapper are very simple (i.e. it doesn't do a proper job...)<br>
if bound set:<br> l = map(lower bound)<br> u = map(upper bound)<br> if u is NULL: set u to the end of l's book<br> if l is NULL: set l to the start of u's book<br> swap u and l if u is before l (i.e. book order is different, and bounds go across border)<br>
return versekey composed of u and l<br>otherwise:<br>if book of from key isn't in to v11n: return NULL<br>if chapter isn't in destination v11n:<br> return last verse in book in destination v11n<br>if verse isn't in destination v11n:<br>
return last verse in chapter in destination v11n<br><br>otherwise, return the same verse, but in new v11n.<br><br>This serves two purposes:<br>1) it defines an API which we can use later. By making getMapper return a more intelligent mapper, we can put proper mapping in later very easily.<br>
2) it will do a better job than just copying the text across (because it clips, not normalizes)<br><br clear="all">God Bless,<br>Ben<br>-------------------------------------------------------------------------------------------<br>
Multitudes, multitudes,<br> in the valley of decision!<br>For the day of the LORD is near<br> in the valley of decision.<br><br>Giôên 3:14 (ESV)<br><br>