| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# $Id: Message.pm,v 1.5 2002/08/30 10:19:36 joern Exp $ |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package CIPP::Compile::Message; |
|
4
|
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
292
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# This minimum interface must be provided for Message |
|
8
|
|
|
|
|
|
|
# classes, which are used by new.spirit. |
|
9
|
|
|
|
|
|
|
|
|
10
|
0
|
|
|
0
|
0
|
|
sub get_name { shift->{name} } |
|
11
|
0
|
|
|
0
|
0
|
|
sub get_type { shift->{type} } |
|
12
|
0
|
|
|
0
|
0
|
|
sub get_message { shift->{message} } |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# Additional CIPP specific information |
|
15
|
|
|
|
|
|
|
|
|
16
|
0
|
|
|
0
|
0
|
|
sub get_line_nr { shift->{line_nr} } |
|
17
|
0
|
|
|
0
|
0
|
|
sub get_tag { shift->{tag} } |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new { |
|
20
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
|
21
|
0
|
|
|
|
|
|
my %par = @_; |
|
22
|
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
my ($type, $message, $name, $line_nr, $tag) = |
|
24
|
|
|
|
|
|
|
@par{'type','message','name','line_nr','tag'}; |
|
25
|
|
|
|
|
|
|
|
|
26
|
0
|
0
|
0
|
|
|
|
confess "Message type '$type' must be 'warn', 'perl_err', 'cipp_err'" |
|
|
|
|
0
|
|
|
|
|
|
27
|
|
|
|
|
|
|
unless $type eq 'warn' or |
|
28
|
|
|
|
|
|
|
$type eq 'perl_err' or |
|
29
|
|
|
|
|
|
|
$type eq 'cipp_err'; |
|
30
|
|
|
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
confess "No message given" |
|
32
|
|
|
|
|
|
|
if not defined $message; |
|
33
|
|
|
|
|
|
|
|
|
34
|
0
|
0
|
|
|
|
|
confess "No name given" |
|
35
|
|
|
|
|
|
|
if not defined $name; |
|
36
|
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
my $self = { |
|
38
|
|
|
|
|
|
|
type => $type, |
|
39
|
|
|
|
|
|
|
message => $message, |
|
40
|
|
|
|
|
|
|
name => $name, |
|
41
|
|
|
|
|
|
|
line_nr => $line_nr, |
|
42
|
|
|
|
|
|
|
tag => uc($tag), |
|
43
|
|
|
|
|
|
|
}; |
|
44
|
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
return bless $self, $class; |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |