The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

List::Filter::Storage::CODE - reads in standard libraries of filters from code

SYNOPSIS

   # This is a plugin, not intended for direct use.
   # See: List:Filter:Storage

   use List::Filter::Storage::CODE;

   # load all of transforms from standard library module location
   my $storage = List::Filter::Storage::CODE->new({
             type       => 'transform',
           });

   # load just the specified filter libraries
   # (Note: allows non-standard locations, and/or conserves memory)
   my $storage = List::Filter::Storage::CODE->new({
            connect_to => [ Some::Odd::Library::Module And::Another ],
            type       => 'filter',
          });

   # Retrieving a filter
   my $filter = $storage->lookup( ':omit' );

DESCRIPTION

The List::Filter project ships with some standard filters defined in perl code. The "CODE" storage location format allows these filters to be looked up by name using the standard storage interface.

This format may be used in two ways:

(1) by default it will slurp in all definitions found in all of the modules found in the standard library location for the data type (e.g. for "filter" it will look in "List::Filter::Library::*" , for "transform" it will look in "List::Filter::Transform::Library::*").

(2) It can be provided with a list of libary names, (which should correspond to file names: <*>.pm), and it will only load the filters from those particular files.

METHODS

new

Instantiates a new List::Filter::Storage::CODE object.

With no arguments, the newly created profile will be loaded with all filters from the appropriate installed code libraries.

If connect_to is defined as a list of library module names, it will load only those library modules.

init

Initialize object attributes and then lock them down to prevent accidental creation of new ones.

Note: there is no leading underscore on name "init", though it's arguably an "internal" routine (i.e. not likely to be of use to client code).

lookup

See "lookup" in "lookup" in List::Filter::Storage::MEM

save

internally used methods

define_library_location

From the type of the stored filters (e.g. 'filter', 'transform'), determine the appropriate filter library location in the perl module namespace.

This implements the convention:

List::Filter::<upper-case type>::Library, except that for type 'filter' the class is just "List::Filter::Library::".

Gets "type" from the object data, unless supplied as an argument.

load_all_libraries

Loads all available libraries of filters.

The type ('filter', 'transform', etc.) will come from the object data, unless passed in as a second argument.

load_given_libraries

Loads all requested libraries of filters, from the tree of libraries for the type ('filter', 'transform'). This type must be passed in in the attributes hash reference. The given list of names should be an aref of module names.

The type ('filter', 'transform', etc.) will come from the object data, unless passed in as a second argument.

proceedural routines

merge_hash

This routine does hash addition, merging the key-value pairs of one hash into another.

It takes two hash references, and adds the values of the second into the first.

Inputs: (1) the summation href, (2) the href to be added into the first.

Return: a copy of the summation href, for convenience: don't assume that the first argument isn't modified.

basic setters and getters

See List::Filter::StorageBase for the basic accessors.

SEE ALSO

List::Filter::Project List:Filter:Storage List::Filter

AUTHOR

Joseph Brenner, <doom@kzsu.stanford.edu>, 24 May 2007

COPYRIGHT AND LICENSE

Copyright (C) 2007 by Joseph Brenner

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.2 or, at your option, any later version of Perl 5 you may have available.

BUGS

None reported... yet.