CIsam
view release on metacpan or search on metacpan
IsamObjects.pm view on Meta::CPAN
}
}
}
sub add
{
my $this = shift;
$this->_stuff_buffer();
$this->{ISAM_OBJ}->iswrite($this->{BUFFER});
}
#this function gets the record from the database
#the object needs to be seeded with the search parameters
#and the mode of access of the db needs to be passed to get
sub get
{
my $this = shift;
my $mode = shift;
$this->_stuff_buffer();
if ( ( defined($this->{_HIDDEN_OPTIONS}->{PENDING_PATH})) ||
( ($this->{_HIDDEN_OPTIONS}->{CURRENT_MODE} != $mode) &&
( ($mode == &ISFIRST) ||
($mode == &ISLAST) ||
($mode == &ISEQUAL) ||
($mode == &ISGREAT) ||
($mode == &ISGTEQ)
)
)
)
{
$this->{_HIDDEN_OPTIONS}->{CURRENT_MODE} = $mode;
if (defined($this->{_HIDDEN_OPTIONS}->{PENDING_PATH}))
{
$this->{_HIDDEN_OPTIONS}->{ISAM_PATH} = $this->{_HIDDEN_OPTIONS}->{PENDING_PATH};
}
$this->{_HIDDEN_OPTIONS}->{PENDING_PATH} = undef;
$this->{ISAM_OBJ}->isstart($this->INDEXMAP->{$this->{_HIDDEN_OPTIONS}->{ISAM_PATH}}, 0, $this->{BUFFER}, $mode);
}
my $status = $this->{ISAM_OBJ}->isread($this->{BUFFER}, $mode);
$this->_unstuff_buffer();
return ($status);
}
#this function sets the path throught the database
sub path
{
my $this = shift;
my $path = shift;
if ($this->{_HIDDEN_OPTIONS}->{ISAM_PATH} ne $path)
{
$this->{_HIDDEN_OPTIONS}->{PENDING_PATH} = $path
}
#$this->{ISAM_OBJ}->isstart($this->INDEXMAP->{$path}, 0, $this->{BUFFER}, $mode);
}
#this function updates the record that already exists
sub update
{
my $this = shift;
$this->_stuff_buffer();
$this->{ISAM_OBJ}->isrewrite($this->{BUFFER});
}
#this function deletes the current record
sub delete
{
my $this = shift;
$this->{ISAM_OBJ}->isdelcurr();
}
#this function is just a define for a building mode
sub BUILD
{
0x45678;
}
1;
__END__;
( run in 0.549 second using v1.01-cache-2.11-cpan-524268b4103 )