Attean::API::PushParser - Role for parsers that natively call a callback function for each parsed item
This document describes Attean::API::PushParser version 0.002_01
The Attean::API::PushParser role defines parsers that can efficiently call a callback function for each object constructed from the parsed data. This role adds methods that builds on this functionality to allow parsing data using different approaches.
This role consumes the Attean::API::Parser role.
Classes consuming this role must provide the following methods:
parse_cb_from_io( $fh )
Calls the $parser->handler function once for each object that result from parsing the data read from the IO::Handle object $fh.
$parser->handler
$fh
parse_cb_from_bytes( $data )
Calls the $parser->handler function once for each object that result from parsing the data read from the UTF-8 encoded byte string $data.
$data
This role provides default implementations of the following methods:
parse_iter_from_io( $fh )
Returns an Attean::API::Iterator that result from parsing the data read from the IO::Handle object $fh.
parse_iter_from_bytes( $data )
Returns an Attean::API::Iterator that result from parsing the data read from the UTF-8 encoded byte string $data.
parse_list_from_io( $fh )
Returns a list of all objects that result from parsing the data read from the IO::Handle object $fh.
parse_list_from_bytes( $data )
Returns a list of all objects that result from parsing the data read from the UTF-8 encoded byte string $data.
Please report any bugs or feature requests to through the GitHub web interface at https://github.com/kasei/attean/issues.
http://www.perlrdf.org/
Gregory Todd Williams <gwilliams@cpan.org>
<gwilliams@cpan.org>
Copyright (c) 2014 Gregory Todd Williams. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Attean, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Attean
CPAN shell
perl -MCPAN -e shell install Attean
For more information on module installation, please visit the detailed CPAN module installation guide.