line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/local/bin/perl -w |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# Copyright (C) 1995, 1996 Systemics Ltd (http://www.systemics.com/) |
5
|
|
|
|
|
|
|
# All rights reserved. |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package Stream::StringOutputStream; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
@StringOutputStream::ISA = qw(Stream::StringOutputStream); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# |
13
|
|
|
|
|
|
|
# StringOutputStream |
14
|
|
|
|
|
|
|
# |
15
|
|
|
|
|
|
|
# Inherits from OutputStream, redefining all of it's member |
16
|
|
|
|
|
|
|
# functions: |
17
|
|
|
|
|
|
|
# write |
18
|
|
|
|
|
|
|
# |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
75
|
|
21
|
1
|
|
|
1
|
|
9
|
use Carp; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
318
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub usage |
25
|
|
|
|
|
|
|
{ |
26
|
0
|
|
|
0
|
0
|
0
|
my ($package, $filename, $line, $subr) = caller(1); |
27
|
0
|
|
|
|
|
0
|
$Carp::CarpLevel = 2; |
28
|
0
|
|
|
|
|
0
|
croak "Usage: $subr(@_)"; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub new |
32
|
|
|
|
|
|
|
{ |
33
|
7
|
50
|
|
7
|
0
|
56
|
usage("") unless @_ == 1; |
34
|
|
|
|
|
|
|
|
35
|
7
|
|
|
|
|
11
|
my $type = shift; my $self = {}; bless $self, $type; |
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
14
|
|
36
|
|
|
|
|
|
|
|
37
|
7
|
|
|
|
|
21
|
$self->{'data'} = ''; |
38
|
|
|
|
|
|
|
|
39
|
7
|
|
|
|
|
20
|
$self; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub write |
43
|
|
|
|
|
|
|
{ |
44
|
84
|
50
|
|
84
|
0
|
181
|
usage("data") unless @_ == 2; |
45
|
|
|
|
|
|
|
|
46
|
84
|
|
|
|
|
93
|
my $self = shift; |
47
|
84
|
|
33
|
|
|
173
|
my $data = shift || usage("data"); |
48
|
|
|
|
|
|
|
|
49
|
84
|
|
|
|
|
208
|
$self->{'data'} .= $data; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub data |
54
|
|
|
|
|
|
|
{ |
55
|
10
|
50
|
|
10
|
0
|
50
|
usage("") unless @_ == 1; |
56
|
|
|
|
|
|
|
|
57
|
10
|
|
|
|
|
62
|
shift->{'data'}; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |