Discussion:
[sword-devel] OSIS Verse Key
Daniel Hughes
2014-09-16 10:29:20 UTC
Permalink
I need to retrieve the KeyText in OSIS format (eg 'gal.2.3') though
the c# bindings which means through the flat API.

Would it be difficult to expose this through the flat api?

And if so is there someone with the c/c++ ability who is willing to
implement it in exchange for my my appreciation...

I will do the c# binding work as soon as it is available on flatapi.

Cheers,
Daniel
Jon Behrens
2014-09-16 14:20:20 UTC
Permalink
I've gotten the C# examples to build in Windows, however there is a
problem with
entry points to the flat API.

In the Linux version the flatapi.cpp is part of the build and included
in the libsword.so

In the Windows version, flatapi.h is available in the build, but the
.cpp file is not included.
That means that the C# examples build and run until they have actually
to use one of the
API functions. At that time, it dies saying that it can't find an entry
point for the API
function.

Trying simply to add flatapi.cpp to the libsword.dll project throws a
bunch of unresolved
external references which I've not had time to chase down.

At this point I'm (re)learning more about C++ than I had hoped to. If
anyone can give
me a clue to short cut some of this, I'd appreciate it.

Best,
Jon
Post by Daniel Hughes
I need to retrieve the KeyText in OSIS format (eg 'gal.2.3') though
the c# bindings which means through the flat API.
Would it be difficult to expose this through the flat api?
And if so is there someone with the c/c++ ability who is willing to
implement it in exchange for my my appreciation...
I will do the c# binding work as soon as it is available on flatapi.
Cheers,
Daniel
_______________________________________________
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
Troy A. Griffitts
2014-09-23 00:38:37 UTC
Permalink
Hey Daniel,

Sorry for the delay getting back with you. There is a way to retrieve
this. getKeyChildren is primarily intended for TreeKey modules, but
when called on a VerseKey it will give you a bunch components of the
current key, including the osisRef (or osisID) for that key. Have a
look at the documentation for that method in the flatapi.cpp file.

Hope this helps,

Troy
Post by Daniel Hughes
I need to retrieve the KeyText in OSIS format (eg 'gal.2.3') though
the c# bindings which means through the flat API.
Would it be difficult to expose this through the flat api?
And if so is there someone with the c/c++ ability who is willing to
implement it in exchange for my my appreciation...
I will do the c# binding work as soon as it is available on flatapi.
Cheers,
Daniel
_______________________________________________
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
Daniel Hughes
2014-09-23 21:42:24 UTC
Permalink
Thanks, that appears to meet my needs.

One question through. How do I know if its a VerseKey module? There is
the HasChildren method which checks if it is a TreeKey, If its not a
TreeKey can I assume its a VerseKey?

God Bless,
Daniel Hughes

On Tue, Sep 23, 2014 at 12:38 PM, Troy A. Griffitts
Post by Troy A. Griffitts
Hey Daniel,
Sorry for the delay getting back with you. There is a way to retrieve this.
getKeyChildren is primarily intended for TreeKey modules, but when called on
a VerseKey it will give you a bunch components of the current key, including
the osisRef (or osisID) for that key. Have a look at the documentation for
that method in the flatapi.cpp file.
Hope this helps,
Troy
Post by Daniel Hughes
I need to retrieve the KeyText in OSIS format (eg 'gal.2.3') though
the c# bindings which means through the flat API.
Would it be difficult to expose this through the flat api?
And if so is there someone with the c/c++ ability who is willing to
implement it in exchange for my my appreciation...
I will do the c# binding work as soon as it is available on flatapi.
Cheers,
Daniel
_______________________________________________
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
Troy A. Griffitts
2014-09-23 21:58:10 UTC
Permalink
Post by Daniel Hughes
Thanks, that appears to meet my needs.
One question through. How do I know if its a VerseKey module? There is
the HasChildren method which checks if it is a TreeKey, If its not a
TreeKey can I assume its a VerseKey?
No; Bibles and Verse Commentaries (anything marked as a Commentary in
SWORD) use Bible verses as their index key (VerseKey). osisRef implies
a Bible reference (debatable, but mostly). Usually frontends know if
they are dealing with Bibles or Verse Commentaries, but if you need to
check, you can use something like:

if (module.getType() == SWModule.TYPE_BIBLE || module.getType() ==
SWModule.TYPE_COMMENTARY) ...

Hope this makes sense. Let me know if we need to expose another method
for you,

Troy
Post by Daniel Hughes
God Bless,
Daniel Hughes
On Tue, Sep 23, 2014 at 12:38 PM, Troy A. Griffitts
Post by Troy A. Griffitts
Hey Daniel,
Sorry for the delay getting back with you. There is a way to retrieve this.
getKeyChildren is primarily intended for TreeKey modules, but when called on
a VerseKey it will give you a bunch components of the current key, including
the osisRef (or osisID) for that key. Have a look at the documentation for
that method in the flatapi.cpp file.
Hope this helps,
Troy
Post by Daniel Hughes
I need to retrieve the KeyText in OSIS format (eg 'gal.2.3') though
the c# bindings which means through the flat API.
Would it be difficult to expose this through the flat api?
And if so is there someone with the c/c++ ability who is willing to
implement it in exchange for my my appreciation...
I will do the c# binding work as soon as it is available on flatapi.
Cheers,
Daniel
_______________________________________________
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
_______________________________________________
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
Loading...