DDC::Format - Abstract output formatting API for DDC hits
use DDC::Concordance; $hitList = DDC::Client::Distributed->new()->query('foo&&bar'); ##-- get some hits $fmt = DDC::Format->new(%some_args); ##-- new format $str = $fmt->toString($hitList); ##-- conversion to string $fmt->toFile($hitList,$filename); ##-- output to file $fmt->toFh($hitList,$fh); ##-- output to filehandle
Abstract class for hit formatting.
$fmt = $CLASS_OR_OBJ->new(%args);
Derived classes may accept keyword arguments in %args. The abstract implementation interprets them as literal keys in the underlying object structure (a HASH-ref).
$fmt = $fmt->reset();
Reset counters, etc.
$str = $fmt->toString($hitList);
Should format a DDC::HitList object $hitList to a string representation.
$hitList
Dummy implementation.
undef = $fmt->toFile($hitList,$file);
Should format a DDC::HitList object $hitList to a named file $file.
$file
Default implementation calls $fmt->toFh().
undef = $fmt->toFh($hitList,$fh);
Should format a DDC::HitList object $hitList to a filehandle $fh opened for output.
$fh
Default implementation calls $fmt->toString().
Bryan Jurish <moocow@cpan.org>
Copyright (C) 2006-2016 by Bryan Jurish
This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.
To install DDC::Concordance, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DDC::Concordance
CPAN shell
perl -MCPAN -e shell install DDC::Concordance
For more information on module installation, please visit the detailed CPAN module installation guide.