[sword-devel] Learning the Sword API
Tim Hawes
sword-devel@crosswire.org
Mon, 05 Feb 2001 07:07:14 -0500
--------------6D51CBD3F2D0E16C6416A5FC
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I have written a small program to better understand the Sword API.
Essentially this is suppose to find a particular module, set a key and
display the bible text in that key.
#include <iostream>
using namespace std;
#include <swmgr.h>
#include <rawcom.h>
#include <rawtext.h>
#include <versekey.h>
int main(int argc, char **argv)
{
SWMgr manager; // create a default manager that looks
// in the current directory for mods.conf
SWModule *module;
ModMap::iterator I = manager.Modules.begin();
while(I != manager.Modules.end())
{
string modName = (*I).first;
// SWModule *tempmod = (*modIterator).second;
if (modName == "AKJV")
{
module = (*I).second;
}
I++;
}
module->SetKey("jas 1:19");
cout << module->Type() << endl
<< module->Name() << ": "
<< (const char *) module << endl;
return 0;
}
Can anyone tell me why this does not display the key contents? Also, is
there a way to find a particular module without having to cycle through
the entire ModMap to find it (I am green around the ears in C++)?
--
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Tim Hawes
***Althusius.net***
http://Althusius.net
thawes@althusius.net
---------------------------------------------------------
--------------6D51CBD3F2D0E16C6416A5FC
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
I have written a small program to better understand the Sword API. Essentially
this is suppose to find a particular module, set a key and display the
bible text in that key.
<br>
<pre>#include <iostream>
using namespace std;
#include <swmgr.h>
#include <rawcom.h>
#include <rawtext.h>
#include <versekey.h>
int main(int argc, char **argv)
{
SWMgr manager; // create a default manager that looks
// in the current directory for mods.conf
SWModule *module;
ModMap::iterator I = manager.Modules.begin();
while(I != manager.Modules.end())
{
string modName = (*I).first;
// SWModule *tempmod = (*modIterator).second;
if (modName == "AKJV")
{
module = (*I).second;
}
I++;
}
module->SetKey("jas 1:19");
cout << module->Type() << endl
<< module->Name() << ": "
<< (const char *) module << endl;
return 0;
}</pre>
Can anyone tell me why this does not display the key contents? Also, is
there a way to find a particular module without having to cycle through
the entire ModMap to find it (I am green around the ears in C++)?
<p>-- <br>
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\<br>
<br>
Tim Hawes<br>
<br>
***Althusius.net***<br>
<A HREF="http://Althusius.net">http://Althusius.net</A><br>
<br>
thawes@althusius.net<br>
<br>
---------------------------------------------------------<br>
<BR></html>
--------------6D51CBD3F2D0E16C6416A5FC--