line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: Boolean.pm,v 1.7 2000/07/03 08:54:47 matt Exp $ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package XML::XPathEngine::Boolean; |
4
|
2
|
|
|
2
|
|
1087
|
use XML::XPathEngine::Number; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
41
|
|
5
|
2
|
|
|
2
|
|
9
|
use XML::XPathEngine::Literal; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
30
|
|
6
|
2
|
|
|
2
|
|
8
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
78
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use overload |
9
|
2
|
|
|
|
|
13
|
'""' => \&value, |
10
|
2
|
|
|
2
|
|
10
|
'<=>' => \&cmp; |
|
2
|
|
|
|
|
3
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub True { |
13
|
617
|
|
|
617
|
1
|
728
|
my $class = shift; |
14
|
617
|
|
|
|
|
682
|
my $val = 1; |
15
|
617
|
|
|
|
|
2345
|
bless \$val, $class; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub False { |
19
|
75
|
|
|
75
|
1
|
103
|
my $class = shift; |
20
|
75
|
|
|
|
|
95
|
my $val = 0; |
21
|
75
|
|
|
|
|
494
|
bless \$val, $class; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub value { |
25
|
692
|
|
|
692
|
1
|
759
|
my $self = shift; |
26
|
692
|
|
|
|
|
3095
|
$$self; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub cmp { |
30
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
31
|
0
|
|
|
|
|
0
|
my ($other, $swap) = @_; |
32
|
0
|
0
|
|
|
|
0
|
if ($swap) { |
33
|
0
|
|
|
|
|
0
|
return $other <=> $$self; |
34
|
|
|
|
|
|
|
} |
35
|
0
|
|
|
|
|
0
|
return $$self <=> $other; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
0
|
0
|
0
|
sub to_number { XML::XPathEngine::Number->new($_[0]->value); } |
39
|
20
|
|
|
20
|
0
|
53
|
sub to_boolean { $_[0]; } |
40
|
0
|
0
|
|
0
|
1
|
|
sub to_literal { XML::XPathEngine::Literal->new($_[0]->value ? "true" : "false"); } |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
0
|
0
|
|
sub string_value { return $_[0]->to_literal->value; } |
43
|
|
|
|
|
|
|
|
44
|
0
|
0
|
|
0
|
0
|
|
sub getChildNodes { return wantarray ? () : []; } |
45
|
0
|
0
|
|
0
|
0
|
|
sub getAttributes { return wantarray ? () : []; } |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
__END__ |