[sword-devel] (Perl) Getting list of modules

Joachim Ansorg sword-devel@crosswire.org
Sat, 28 Jun 2003 16:26:51 +0200


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Christian,
Using

use Sword;
my $mgr = Sword::SWMgr->new();
for (my $i = 0; $i < $mgr->moduleCount(); ++$i) {
        my $m = $mgr->getModuleAt($i);
        print $m->Name() . " \n";
}

works for me. Seems like we have to write a Perl wrapper class for some Swig 
bindings so it's easier to use. Or we have to dive into the complicated world 
of Swig :)

I have no yet figured out how to return a list which will work in Perl from 
the Swig binding.

Let me know what you think,
Joachim

> How can I get a list of all modules that are installed using the Perl
> library? I'd like to be able to do something like this:
>
> my $SWMgr = Sword::SWMgr->new();
> print SWMgr->modules();
>
> =>
> ChiUns
> KJV
> ZhEnglish
> GerElb
> ...
>
> Greetings,
>    Christian

- -- 
<>< Re: deemed!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)

iD8DBQE+/aWrEyRIb2AZBB0RAm4BAKChRJVfbQcRFwOsKZv7SaoPiS0qAwCdHNql
HVE+lfzFW2sn/PrW/SPnk80=
=v1q2
-----END PGP SIGNATURE-----