line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package POE::Filter; |
2
|
|
|
|
|
|
|
|
3
|
112
|
|
|
112
|
|
23766
|
use strict; |
|
112
|
|
|
|
|
179
|
|
|
112
|
|
|
|
|
3500
|
|
4
|
|
|
|
|
|
|
|
5
|
112
|
|
|
112
|
|
459
|
use vars qw($VERSION); |
|
112
|
|
|
|
|
146
|
|
|
112
|
|
|
|
|
5016
|
|
6
|
|
|
|
|
|
|
$VERSION = '1.366'; # NOTE - Should be #.### (three decimal places) |
7
|
|
|
|
|
|
|
|
8
|
112
|
|
|
112
|
|
532
|
use Carp qw(croak); |
|
112
|
|
|
|
|
156
|
|
|
112
|
|
|
|
|
33094
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
1
|
|
|
1
|
1
|
10
|
my $type = shift; |
14
|
1
|
|
|
|
|
179
|
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
|
140
|
|
|
140
|
1
|
22793
|
my ($self, $stream) = @_; |
23
|
140
|
|
|
|
|
182
|
my @return; |
24
|
|
|
|
|
|
|
|
25
|
140
|
|
|
|
|
333
|
$self->get_one_start($stream); |
26
|
137
|
|
|
|
|
118
|
while (1) { |
27
|
267
|
|
|
|
|
505
|
my $next = $self->get_one(); |
28
|
265
|
100
|
|
|
|
658
|
last unless @$next; |
29
|
130
|
|
|
|
|
217
|
push @return, @$next; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
135
|
|
|
|
|
365
|
return \@return; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub clone { |
36
|
7
|
|
|
7
|
1
|
1910
|
my $self = shift; |
37
|
7
|
100
|
|
|
|
24
|
my $buf = (ref($self->[0]) eq 'ARRAY') ? [ ] : ''; |
38
|
7
|
|
|
|
|
31
|
my $nself = bless [ |
39
|
|
|
|
|
|
|
$buf, # BUFFER |
40
|
|
|
|
|
|
|
@$self[1..$#$self], # everything else |
41
|
|
|
|
|
|
|
], ref $self; |
42
|
7
|
|
|
|
|
15
|
return $nself; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub __param_max |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
{ |
49
|
2280
|
|
|
2280
|
|
3164
|
my( $type, $name, $default, $params ) = @_; |
50
|
2280
|
100
|
|
|
|
6421
|
return $default # 512 MB |
51
|
|
|
|
|
|
|
unless defined $params->{$name}; |
52
|
|
|
|
|
|
|
|
53
|
26
|
|
|
|
|
30
|
my $ret = $params->{$name}; |
54
|
26
|
100
|
|
|
|
1059
|
croak "$name must be a number" |
55
|
|
|
|
|
|
|
unless $ret =~ /^\d+$/; |
56
|
17
|
100
|
|
|
|
346
|
croak "$name must greater then 0" |
57
|
|
|
|
|
|
|
unless $ret > 0; |
58
|
14
|
|
|
|
|
31
|
return $ret; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |