line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl -w |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# $Id: Null.pm,v 1.1.1.1 2003/10/28 16:04:37 andy Exp $ |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# This code is copyright 1999-2000 by Scott Guelich |
6
|
|
|
|
|
|
|
# and is distributed according to the same conditions as Perl itself |
7
|
|
|
|
|
|
|
# Please visit http://www.scripted.com/wddx/ for more information |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
package WDDX::Null; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Auto-inserted by build scripts |
13
|
|
|
|
|
|
|
$VERSION = "1.01"; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
1814
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
16
|
1
|
|
|
1
|
|
4
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
582
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
require WDDX; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
{ my $i_hate_the_w_flag_sometimes = [ |
21
|
|
|
|
|
|
|
$WDDX::PACKET_HEADER, |
22
|
|
|
|
|
|
|
$WDDX::PACKET_FOOTER, |
23
|
|
|
|
|
|
|
$WDDX::Null::VERSION |
24
|
|
|
|
|
|
|
] } |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
#/----------------------------------------------------------------------- |
30
|
|
|
|
|
|
|
# Public Methods |
31
|
|
|
|
|
|
|
# |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub new { |
34
|
0
|
|
|
0
|
|
|
return bless { value => undef }, shift; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub type { |
39
|
0
|
|
|
0
|
|
|
return "null"; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub as_packet { |
44
|
0
|
|
|
0
|
|
|
my( $self ) = @_; |
45
|
0
|
|
|
|
|
|
my $output = $WDDX::PACKET_HEADER . |
46
|
|
|
|
|
|
|
$self->_serialize . |
47
|
|
|
|
|
|
|
$WDDX::PACKET_FOOTER; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub as_scalar { |
52
|
0
|
|
|
0
|
|
|
my( $self ) = @_; |
53
|
0
|
|
|
|
|
|
return $self->_deserialize; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub as_javascript { |
58
|
0
|
|
|
0
|
|
|
my( $self, $js_var ) = @_; |
59
|
0
|
|
|
|
|
|
return "$js_var=null;"; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
#/----------------------------------------------------------------------- |
64
|
|
|
|
|
|
|
# Private Methods |
65
|
|
|
|
|
|
|
# |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub is_parser { |
68
|
0
|
|
|
0
|
|
|
return 0; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub _serialize { |
73
|
0
|
|
|
0
|
|
|
return ""; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub _deserialize { |
78
|
0
|
|
|
0
|
|
|
return undef; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
#/----------------------------------------------------------------------- |
83
|
|
|
|
|
|
|
# Parsing Code |
84
|
|
|
|
|
|
|
# |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
package WDDX::Null::Parser; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub new { |
90
|
0
|
|
|
0
|
|
|
return bless { value => undef }, shift; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub start_tag { |
95
|
0
|
|
|
0
|
|
|
my( $self, $element, $attribs ) = @_; |
96
|
|
|
|
|
|
|
|
97
|
0
|
0
|
|
|
|
|
die "<$element> not allowed within element\n" unless $element eq "null"; |
98
|
0
|
|
|
|
|
|
return $self; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub end_tag { |
103
|
0
|
|
|
0
|
|
|
my( $self, $element ) = @_; |
104
|
|
|
|
|
|
|
|
105
|
0
|
0
|
|
|
|
|
if ( $element eq "null" ) { |
106
|
0
|
|
|
|
|
|
$self = new WDDX::Null(); |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
else { |
109
|
0
|
|
|
|
|
|
die "$element> not allowed within element\n"; |
110
|
|
|
|
|
|
|
} |
111
|
0
|
|
|
|
|
|
return $self; |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
sub append_data { |
116
|
0
|
|
|
0
|
|
|
my( $self, $data ) = @_; |
117
|
0
|
0
|
|
|
|
|
die "No data is allowed between tags\n" if $data =~ /\S/; |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub is_parser { |
122
|
0
|
|
|
0
|
|
|
return 1; |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|