Taxi::Mysql::Format::Base - hit list formatting: base class


NAME

Taxi::Mysql::Format::Base - hit list formatting: base class

(Back to Top)


SYNOPSIS

 ##========================================================================
 ## 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);

(Back to Top)


DESCRIPTION

Taxi::Mysql::Format::Base is an abstract class which declares common API methods for formatting Taxi::Mysql::HitList objects to strings and/or filehandles.

Globals etc.

Variable: @ISA

Taxi::Mysql::Format::Base inherits from Taxi::Mysql::Base and Taxi::Mysql::Format.

Constructors etc.

reset
 $fmt = $fmt->reset();

Resets format, preparing for formatting of a new HitList. Default implementation does nothing.

free
 $fmt = $fmt->free();

Prepares format for destruction. Default implementation does nothing.

API

contentType
 $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'.

toString
 $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.

toFile
 $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.

toFh
 $bool = $fmt->toFh($hits,$fh);

Format a HitList object to an open filehandle $fh. Default implementation just calls $fh->print($fmt->toString($hits)).

(Back to Top)


ACKNOWLEDGEMENTS

Perl by Larry Wall.

(Back to Top)


AUTHOR

Bryan Jurish <moocow@ling.uni-potsdam.de>

(Back to Top)


COPYRIGHT AND LICENSE

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.

(Back to Top)


SEE ALSO

perl(1), Taxi::Mysql(3perl), Taxi::Mysql::Format(3perl).

(Back to Top)

 Taxi::Mysql::Format::Base - hit list formatting: base class