NAME

Pcapstore - Simple file storage library built for PCAP web/database use


SYNOPSIS

    use lib '/lab/share/dev/lib';
    use Pcapstore;
    my $sto = new Pcapstore;

Functions

The following functions for creating, looking up and testing for the existence of objects are called as simple functions without an object reference.

new

    $objhandle = new Pcapstore;

Creator method. Call as a function.

lookup

    $objhandle = Pcapstore::lookup( $id );

Looks up a previously stored object from the ID number $id.

exists

    $boolean = Pcapstore::exists( $oid );

Returns 1 if an object exists for the given object ID $oid or undef otherwise.

Methods

This section describes object methods which operate on specific objects and are called via an object reference.

id

    $oid = $sto->id();

Returns the ID string for the given object. Note that the ID is only defined once an object has been committed. So a brand new object has no valid ID.

gethandle

    $fh = $sto->gethandle();

Returns a filehandle for the given object.

getstring

    $scalar = $sto->getstring();

getpropset

    $hashref = $sto->getpropset();

Returns property set for given object. Note that property names will be restricted to lower-case letters and the hyphen ('-').

getprop

    $propertyvalue = $sto->getprop( $propname );

Returns property value named by $propname.

commit

    $objhandle = $sto->commit( -cgi => $cgiparam );
    $objhandle = $sto->commit( -pathname => $path );
    $objhandle = $sto->commit( -string => $stringvalue, -pathname => $p, -basename => $b, -mimetype => $m );
    $objhandle = $sto->commit( -handle => $filehandle, -pathname => $p, -basename => $b, -mimetype => $m );

Stores an object defined by the arguments. Objects may be provided as a simple string, a CGI parameter from CGI.pm (i.e. $cgiobject->param( 'paramname' )), a pathname, or an I/O handle. The first two arguments are expected to be a tag identifying the object type of the second argument, optionally followed by property names and values