line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
package Data::Dump::Streamer::_::StringPrinter; |
3
|
|
|
|
|
|
|
#$Id: Printers.pm 26 2006-04-16 15:18:52Z demerphq $# |
4
|
|
|
|
|
|
|
$VERSION= "0.1"; |
5
|
|
|
|
|
|
|
my %items; |
6
|
339
|
|
|
339
|
|
3424
|
sub DESTROY { delete $items{$_[0]} } |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
339
|
|
|
339
|
|
402
|
my $class = shift; |
10
|
339
|
|
|
|
|
315
|
my $self = bless \do { my $str = '' }, $class; |
|
339
|
|
|
|
|
1025
|
|
11
|
339
|
|
|
|
|
654
|
$self->print(@_); |
12
|
339
|
|
|
|
|
939
|
return $self; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub print { |
16
|
9474
|
|
|
9474
|
|
8017
|
my $self = shift; |
17
|
9474
|
|
|
|
|
25865
|
$items{$self} .= join "", @_; |
18
|
|
|
|
|
|
|
} |
19
|
339
|
|
|
339
|
|
1601
|
sub value { $items{$_[0]} } |
20
|
0
|
|
|
0
|
|
0
|
sub string { $_[0]->value() } |
21
|
|
|
|
|
|
|
1; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
{ |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
package Data::Dump::Streamer::_::ListPrinter; |
27
|
|
|
|
|
|
|
$VERSION= "0.1"; |
28
|
|
|
|
|
|
|
my %items; |
29
|
9
|
|
|
9
|
|
71
|
sub DESTROY { delete $items{$_[0]} } |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub new { |
32
|
9
|
|
|
9
|
|
10
|
my $class = shift; |
33
|
9
|
|
|
|
|
8
|
my $self = bless \do { my $str = '' }, $class; |
|
9
|
|
|
|
|
22
|
|
34
|
9
|
|
|
|
|
39
|
$items{$self} = []; |
35
|
9
|
|
|
|
|
21
|
$self->print(@_); |
36
|
9
|
|
|
|
|
26
|
return $self; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub print { |
40
|
117
|
|
|
117
|
|
180
|
my $self = $items{shift (@_)}; |
41
|
117
|
|
|
|
|
155
|
my $str = join ( '', @_ ); |
42
|
117
|
100
|
100
|
|
|
529
|
if ( !@$self |
|
|
|
66
|
|
|
|
|
43
|
|
|
|
|
|
|
or $self->[-1] =~ /\n/ |
44
|
|
|
|
|
|
|
or length( $self->[-1] ) > 4000 ) |
45
|
|
|
|
|
|
|
{ |
46
|
53
|
|
|
|
|
35
|
push @{$self}, $str; |
|
53
|
|
|
|
|
125
|
|
47
|
|
|
|
|
|
|
} else { |
48
|
64
|
|
|
|
|
133
|
$self->[-1] .= $str; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
} |
51
|
9
|
|
|
9
|
|
7
|
sub value { @{$items{$_[0]}} } |
|
9
|
|
|
|
|
42
|
|
52
|
0
|
|
|
0
|
|
|
sub string { join ( '', @{$items{$_[0]}} ) } |
|
0
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__END__ |