[sword-devel] using a zText module

Greg Hellings greg.hellings at gmail.com
Sat Aug 11 19:50:05 MST 2012


On Sat, Aug 11, 2012 at 9:38 PM, Daniel Hughes <trampster at gmail.com> wrote:
> I managed to get it working with the following code:
>
> using(SWMgr mgr = new SWMgr())
> using(SWModule module = mgr.getModule("ESV"))
> using(SWKey key = new SWKey("jas 1:18"))

In SWORD you should _never_ instantiate an instance of SWKey. You
should use the module's methods for fetching its particular instance
of the SWKey and set the value using the appropriate methods (or
assignment overload in C++).

Because each module might have a different versification scheme, the
default when you instantiate one is to follow the KJV's versification
but that can lead to improper results when assigned to a module that
does not use KJV.

> {
>    module.setKey(key);
>    Console.WriteLine (module.RenderText());
> }
>
> I wouldn't go as far as to say that I have working c# bindings, I only have
> a very small subset working. I was planning on publishing what I have on
> bitbucket under GPL3.
>
> I must confess that as a C# developer I have no understanding of how to use
> make or how to integrate what I have with the rest of your repository and
> build system.

If you publish what you have, I can work with you to integrate it into
the engine's swig bindings. I have been the "pumpkin holder" for them
for a while now as well as for the CMake system that is the main way
to build them at present.

--Greg

>
> On Sun, Aug 12, 2012 at 4:22 AM, Peter von Kaehne <refdoc at gmx.net> wrote:
>>
>> On Sat, 2012-08-11 at 20:25 +1200, Daniel Hughes wrote:
>>
>> > I'm trying to use sword from c#. I have used swig to generate a
>> > wrapper for just enough of sword to open a module and render some
>> > text.
>>
>> If you have working C# bindings, could you update the existing ones?
>> There is a not totally infrequent question on this mailing list for
>> those.
>>
>> That aside, I second the other response. No need to go into the details
>> of module construction, if you use SWMgr.
>>
>> Peter
>>
>>
>>
>>
>> _______________________________________________
>> 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