Taxi::Mysql::Format::Base - hit list formatting: base class |
Taxi::Mysql::Format::Base - hit list formatting: base class
##======================================================================== ## PRELIMINARIES
use Taxi::Mysql::Format::Base;
##======================================================================== ## Constructors etc.
$fmt = $fmt->reset(); $fmt = $fmt->free();
##======================================================================== ## API
$mimeType = $fmt->contentType(); $str = $fmt->toString($hits); $bool = $fmt->toFile($hits,$file); $bool = $fmt->toFh($hits,$fh);
Taxi::Mysql::Format::Base is an abstract class which declares common API methods for formatting Taxi::Mysql::HitList objects to strings and/or filehandles.
Taxi::Mysql::Format::Base inherits from Taxi::Mysql::Base and Taxi::Mysql::Format.
$fmt = $fmt->reset();
Resets format, preparing for formatting of a new HitList. Default implementation does nothing.
$fmt = $fmt->free();
Prepares format for destruction. Default implementation does nothing.
$mimeType = $fmt->contentType();
Returns a MIME type string appropriate for the content returned for a formatted HitList by the formatting object. The default implementation just returns 'text/plain'.
$str = $fmt->toString($hits);
Format a Taxi::Mysql::HitList object '$hits' as a string. Default implementation uses the native perl stringification, which is probably not what you want.
$bool = $fmt->toFile($hits,$file);
Format a HitList object to a named file.
Default implementation calls $fmt->toFh($hits,$fh)
on a filehandle opened in clobbering write mode to $file.
$bool = $fmt->toFh($hits,$fh);
Format a HitList object to an open filehandle $fh. Default implementation just calls $fh->print($fmt->toString($hits)).
Perl by Larry Wall.
Bryan Jurish <moocow@ling.uni-potsdam.de>
Copyright (C) 2006 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.8.7 or, at your option, any later version of Perl 5 you may have available.
perl(1), Taxi::Mysql(3perl), Taxi::Mysql::Format(3perl).
Taxi::Mysql::Format::Base - hit list formatting: base class |