AnyData2

 view release on metacpan or  search on metacpan

lib/AnyData2/Storage.pm  view on Meta::CPAN

package AnyData2::Storage;

use 5.008001;
use strict;
use warnings FATAL => 'all';

use Carp 'croak';

=head1 NAME

AnyData2::Storage - AnyData2 storage base class

=cut

our $VERSION = '0.002';

=head1 METHODS

AnyData2::Storage is intended to handle the data I/O for L<AnyData2::Format>s.
Thus implies, an C<AnyData2::Format> instance has requirements for it's
storage backend. Not every tuple might work well together.

=head2 new

constructs a storage.

=cut

sub new
{
    my ($class) = @_;
    bless {}, $class;
}

=head2 read

  my $buf = $stor->read(<characters>)

Use binmode for characters as synonymous for bytes.

=cut

sub read
{
    croak "missing overwritten method";
}

=head2 write

  $stor->write($buf)

Writes the buf out

=cut

sub write
{
    croak "missing overwritten method";
}

=head2 seek

  $stor->seek(pos,whence)

Moves the storage pointer to given position

=cut

sub seek
{
    croak "missing overwritten method";
}

=head2 truncate

  $stor->truncate

Truncates the underlying storage backend at it's current position.

=cut

sub truncate
{
    croak "missing overwritten method";
}

=head2 drop

  $stor->drop

Drops the underlying storage (e.g. delete file)

=cut

sub drop
{
    croak "missing overwritten method";
}



( run in 1.339 second using v1.01-cache-2.11-cpan-524268b4103 )