[poe-commits] poe/lib/POE Filter.pm,1.14,1.15
Brought to you by:
rcaputo
From: <rc...@us...> - 2005-06-29 04:06:20
|
Update of /cvsroot/poe/poe/lib/POE In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21844/lib/POE Modified Files: Filter.pm Log Message: Lift POE::Filter::Reference's get() to POE::Filter, and modify most of the other POE::Filter subclasses to use it. POE::Filter::HTTPD is an exception because it doesnt' have a get_one() function. POE::Filter::Stackable's get_one() was rewritten to accommodate the change. Index: Filter.pm =================================================================== RCS file: /cvsroot/poe/poe/lib/POE/Filter.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Filter.pm 16 Nov 2004 07:12:40 -0000 1.14 --- Filter.pm 29 Jun 2005 04:05:39 -0000 1.15 *************** *** 17,20 **** --- 17,38 ---- } + # Return all the messages possible to parse in the current input + # buffer. This uses the newer get_one_start() and get_one(), which is + # implementation dependent. + + sub get { + my ($self, $stream) = @_; + my @return; + + $self->get_one_start($stream); + while (1) { + my $next = $self->get_one(); + last unless @$next; + push @return, @$next; + } + + return \@return; + } + #------------------------------------------------------------------------------ 1; |