1 package HTML::Zoom::StreamBase;
4 use warnings FATAL => 'all';
5 use HTML::Zoom::MatchWithoutFilter;
7 sub _zconfig { shift->{_zconfig} }
11 if (exists $self->{_peeked}) {
12 return ($self->{_peeked});
14 if (my ($peeked) = $self->next) {
15 return ($self->{_peeked} = $peeked);
22 require HTML::Zoom::FlattenedStream;
23 HTML::Zoom::FlattenedStream->new({
25 zconfig => $self->_zconfig
30 my ($self, $mapper) = @_;
31 require HTML::Zoom::MappedStream;
32 HTML::Zoom::MappedStream->new({
33 source => $self, mapper => $mapper, zconfig => $self->_zconfig
38 my ($self, $selector, $filter) = @_;
39 my $match = $self->_parse_selector($selector);
40 $self->_zconfig->stream_utils->wrap_with_filter($self, $match, $filter);
44 my ($self, $selector) = @_;
45 my $match = $self->_parse_selector($selector);
46 return HTML::Zoom::MatchWithoutFilter->construct(
47 $self, $match, $self->_zconfig->filter_builder,
52 my ($self, $selector) = @_;
53 return $selector if ref($selector); # already a match sub
54 $self->_zconfig->selector_parser->parse_selector($selector);
58 my ($self, $code) = @_;