NAME

App::Muter::Chain - main programmatic interface to muter

VERSION

version 0.003000

SYNOPSIS

App::Muter::Registry->instance->load_backends();
my $chain = App::Muter::Chain->new($chain);
while (<$fh>) {
    print $chain->process($_);
}
print $chain->final('');

DESCRIPTION

This is the main programmatic (Perl) interface to muter. It takes an arbitrary chain and processes data incrementally, in whatever size chunks it's given.

METHODS

$class->new($chain, [$reverse])

Create a new chain object using the specified chain, which is identical to the argument to muter's -c option. If $reverse is passed, reverse the chain, as with muter's <-r> option.

$self->process($data)

Process a chunk of data. Chunks need not be all the same size. Returns the transformed data, which may be longer or shorter than the input data.

$self->final($data)

Process the final chunk of data. If all the data has already been sent via the process method, simply pass an empty string.

AUTHOR

brian m. carlson <sandals@crustytoothpaste.net>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2016–2017 by brian m. carlson.

This is free software, licensed under:

The MIT (X11) License