<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" />
<title>Sword API Questions / Proposal >> flatapi.cpp / flatapi.h</title>
</head>
<body dir="ltr">
<p style="margin-bottom: 0.5cm;">I have been attempting to familiarise
myself with flatapi.cpp/h for a small in house project but have come
up with a few questions about the Sword API, particularly
flatapi.cpp/h.</p>
<p style="margin-bottom: 0.5cm;">1) The function
listkey_getVerselistIterator in flatapi currently accepts two
parameters but I fail to see the difference / dissimilarity between
the two parameters “char * list” and “char * key”? Could
someone please point me in the right direction? Thank you. <br /><br />2)
Is there any reason why the function listkey_getVerselistIterator in
flatapi.h does not accept a boolean flag for normalising a bible
reference such as "John 6:1,12-16"?<br />The current call to
listkey_getVerselistIterator produces a “verses” array containing
[John 6:1, John 6:12] and not [John 6:1, John 6:12, John 6:13, John
6:14, John 6:15, John 6:16] as would be expected.<br /><br />If there is
no limiting factors I propose an update to flatapi.cpp and flatapi.h
as set out below.</p>
<p>=== flatapi.h ===========================================<br /><i><b>//
Existing //</b></i> SWHANDLE SWDLLEXPORT
listkey_getVerselistIterator(const char * list, const char * key)<br /><i><u><b>//
Proposed //</b></u></i><u> SWHANDLE SWDLLEXPORT
listkey_getVerselistIterator(const char * list, const char * key</u><u><b>,
bool expandRange</b></u><u>);</u><br />=== flatapi.h
===========================================<br /><br />=== flatapi.cpp
=========================================<br /><i><b>// Existing
//</b></i> SWHANDLE listkey_getVerselistIterator(const char * list,
const char * key)<br /><i><u><b>// Proposed //</b></u></i><u> SWHANDLE
listkey_getVerselistIterator(const char * list, const char * key</u><u><b>,
bool expandRange = false</b></u><u>) { </u><i><u><b>// set to false
by default to retain existing function call behaviour.</b></u></i><br />
VerseKey versekey;<br /> static ListKey verses;<br /><br />
versekey.setText(key);<br /> verses.ClearList();<br /><i><b>//
Existing //</b></i> verses = versekey.ParseVerseList(list,
versekey);<br /><i><u><b>// Proposed //</b></u></i><u> verses =
versekey.ParseVerseList(list, versekey</u><u><b>, expandRange</b></u><u>);</u><br />
return (SWHANDLE)&verses;<br />}<br />=== flatapi.cpp
=========================================</p>
<p><br /><br />
</p>
<p>As I am new to this group if there is a more appropriate procedure
for presenting my proposal and having it incorporated in the Sword
project please let me know.</p>
<p>Any comments would be appreciated.</p>
<p>Regards<br />Simon</p>
</body>
</html>