Sword::Key - Sword keys may be used to lookup module entries
version 0.102800
use Sword; my $library = Sword::Manager->new; my $module = $library->get_module('KJV'); my $key = $module->create_key; $key->set_text('James 1:5'); $module->set_key($key);
This Perl module provides access to the SWKey class from the Sword Engine API.
SWKey
This documentation should cover everything that you can do with it. If something is wrong or missing, please report a bug.
my $new_key = $key->clone;
Clones the key to create a new identical key.
$key->set_text($key_string);
Sets the key string text.
my $key_string = $key->get_text;
Retrieve the key string text.
my $key_string = $key->get_short_text;
Retrieve a shortened key string text.
my $range_string = $key->get_range_text;
Retrieve teh key string range text.
my $comparison = $key->compare($other_key);
Performs a comparison between keys. Returns positive if $key is ahead of $other_key. Returns 0 if they are equal. Returns negative if $key is behind $other_key.
$key
$other_key
my $equals = $key->equals($other_key);
Returns true if the two keys refer to the same position.
$key->increment; $key->increment($steps); $key->decrement; $key->decrement($steps);
Use increment to select a key one or more steps forward of the current. Use decrement to select a key backward. If $steps is omitted, the increment/decrement defaults to 1.
increment
decrement
$steps
$key->top $key->bottom
These set the key to the beginning or end position, respectively.
These are analogous to:
key->setPosition(TOP); key->setPosition(BOTTOM);
in the C++ API.
my $index = $key->index; $key->index($new_index);
Retrieve the index into a module that this key represents.
Sowrd::Module
Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
This software is copyright (c) 2010 by Qubling Software LLC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Sword, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sword
CPAN shell
perl -MCPAN -e shell install Sword
For more information on module installation, please visit the detailed CPAN module installation guide.