line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package POE::Filter; |
2
|
|
|
|
|
|
|
|
3
|
111
|
|
|
111
|
|
28423
|
use strict; |
|
111
|
|
|
|
|
187
|
|
|
111
|
|
|
|
|
3864
|
|
4
|
|
|
|
|
|
|
|
5
|
111
|
|
|
111
|
|
469
|
use vars qw($VERSION); |
|
111
|
|
|
|
|
147
|
|
|
111
|
|
|
|
|
5367
|
|
6
|
|
|
|
|
|
|
$VERSION = '1.365'; # NOTE - Should be #.### (three decimal places) |
7
|
|
|
|
|
|
|
|
8
|
111
|
|
|
111
|
|
559
|
use Carp qw(croak); |
|
111
|
|
|
|
|
163
|
|
|
111
|
|
|
|
|
35941
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
1
|
|
|
1
|
1
|
9
|
my $type = shift; |
14
|
1
|
|
|
|
|
159
|
croak "$type is not meant to be used directly"; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# Return all the messages possible to parse in the current input |
18
|
|
|
|
|
|
|
# buffer. This uses the newer get_one_start() and get_one(), which is |
19
|
|
|
|
|
|
|
# implementation dependent. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub get { |
22
|
127
|
|
|
127
|
1
|
26878
|
my ($self, $stream) = @_; |
23
|
127
|
|
|
|
|
136
|
my @return; |
24
|
|
|
|
|
|
|
|
25
|
127
|
|
|
|
|
307
|
$self->get_one_start($stream); |
26
|
124
|
|
|
|
|
113
|
while (1) { |
27
|
244
|
|
|
|
|
559
|
my $next = $self->get_one(); |
28
|
242
|
100
|
|
|
|
678
|
last unless @$next; |
29
|
120
|
|
|
|
|
227
|
push @return, @$next; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
122
|
|
|
|
|
347
|
return \@return; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub clone { |
36
|
7
|
|
|
7
|
1
|
2414
|
my $self = shift; |
37
|
7
|
100
|
|
|
|
25
|
my $buf = (ref($self->[0]) eq 'ARRAY') ? [ ] : ''; |
38
|
7
|
|
|
|
|
39
|
my $nself = bless [ |
39
|
|
|
|
|
|
|
$buf, # BUFFER |
40
|
|
|
|
|
|
|
@$self[1..$#$self], # everything else |
41
|
|
|
|
|
|
|
], ref $self; |
42
|
7
|
|
|
|
|
26
|
return $nself; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub __param_max |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
{ |
49
|
2216
|
|
|
2216
|
|
3110
|
my( $type, $name, $default, $params ) = @_; |
50
|
2216
|
100
|
|
|
|
6362
|
return $default # 512 MB |
51
|
|
|
|
|
|
|
unless defined $params->{$name}; |
52
|
|
|
|
|
|
|
|
53
|
26
|
|
|
|
|
31
|
my $ret = $params->{$name}; |
54
|
26
|
100
|
|
|
|
1324
|
croak "$name must be a number" |
55
|
|
|
|
|
|
|
unless $ret =~ /^\d+$/; |
56
|
17
|
100
|
|
|
|
470
|
croak "$name must greater then 0" |
57
|
|
|
|
|
|
|
unless $ret > 0; |
58
|
14
|
|
|
|
|
31
|
return $ret; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |