File::DataClass::Storage - Storage base class
Storage base class
Defines the following attributes;
backup
Extension appended to the file name. Used to create a backup of the updated file. Defaults to the null string so no backup created
encoding
Used by subclasses to encode/decode the file data on ouput/input. Defaults to the null string
extn
The filename extension for this type of file. Usually overridden in the subclass. Default to the null string
schema
A weakened schema object reference
$bool = $self->create_or_update( $path, $result, $updating, $condition );
Does the heavy lifting for "insert" and "update"
$bool = $storage->delete( $path, $result );
Deletes the specified element object returning true if successful. Throws an error otherwise. Path is an instance of File::DataClass::IO
$data = $storage->dump( $path, $data );
Dumps the data to the specified path. Path is an instance of File::DataClass::IO
$bool = $storage->insert( $path, $result );
Inserts the specified element object returning true if successful. Throws an error otherwise. Path is an instance of File::DataClass::IO
$hash_ref = $storage->load( @paths );
Loads each of the specified files merging the resultant hash ref which it returns. Paths are instances of File::DataClass::IO
($data, $mtime) = $self->read_file( $path, $for_update ):
Read a file from cache or disk
$hash_ref = $storage->select( $path );
Returns a hash ref containing all the elements of the type specified in the schema. Path is an instance of File::DataClass::IO
Executes the supplied coderef wrapped in lock on the pathname
$bool = $storage->update( $path, $result, $updating, $condition );
Updates the specified element object returning true if successful. Throws an error otherwise. Path is an instance of File::DataClass::IO
None
There are no known incompatibilities in this module
There are no known bugs in this module. Please report problems to the address below. Patches are welcome
Peter Flanigan, <pjfl@cpan.org>
<pjfl@cpan.org>
Copyright (c) 2014 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
To install File::DataClass, copy and paste the appropriate command in to your terminal.
cpanm
cpanm File::DataClass
CPAN shell
perl -MCPAN -e shell install File::DataClass
For more information on module installation, please visit the detailed CPAN module installation guide.