[sword-devel] What is a Sword module?

Troy A. Griffitts scribe at crosswire.org
Thu Nov 4 20:04:17 MST 2010


On 11/05/2010 02:41 AM, Greg Hellings wrote:
> ... would require some effort to be
> put into the SWIG bindings to provide especially a missing binding for
> the STL multimap class.

Yeah, in C++ it is nice to be able to access entryAttributes as a
dynamic map:

SWBuf word1Morphology =
  module.getEntryAttributes()["Words"]["001"]["Morph"];

But this interface doesn't translate well to other languages.  I have
had to implement a different interface for my custom language binding
for Java-jni (used by SWORD C++ on Android) and CORBA (used by SWORDWeb).

The binding interface I usually implement is described in simple IDL
here and is a fairly concise set of methods that give access to most all
of functionality of the engine:

http://crosswire.org/svn/sword/trunk/bindings/corba/swordorb.idl

You'll notice the method for obtaining entry attributes:

StringList SWModule.getEntryAttribute(in string level1, in string
level2, in string level3, in boolean filtered);

This less exotic interface maps much easier to other languages, but
implies you know what attribute you'd like to obtain (discovery by
iteration is not supported, but really, what frontend does that anyway?)

So, in summary, maybe we should add this to swmodule.i

Any thoughts?

Troy



  I intended to tackle that after my working on
> CMake and mod2osis was complete, but I have taken on (possibly
> open-ended) module creation responsibilities for Wycliffe that come
> before the mod2osis and SWIG bindings work I have planned.
> 
> --Greg
> 
>>
>> We have found that by taking this position that we have encouraged collaboration and usage of the SWORD and JSword libraries.
>>
>> If you are thinking of contributing to the code that works with modules, we can walk you through it at that time.
>>
>> In Him,
>>        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
>>
> 
> _______________________________________________
> 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