line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
###
|
3
|
|
|
|
|
|
|
# CSS::SAC::Selector::CharacterData - SAC CharacterDataSelector
|
4
|
|
|
|
|
|
|
# Robin Berjon
|
5
|
|
|
|
|
|
|
# 24/02/2001
|
6
|
|
|
|
|
|
|
###
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package CSS::SAC::Selector::CharacterData;
|
9
|
2
|
|
|
2
|
|
14
|
use strict;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
78
|
|
10
|
2
|
|
|
2
|
|
12
|
use vars qw($VERSION);
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
146
|
|
11
|
|
|
|
|
|
|
$VERSION = $CSS::SAC::VERSION || '0.03';
|
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
10
|
use base qw(CSS::SAC::Selector::Simple);
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
200
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
17
|
|
|
|
|
|
|
# build the fields for an array based object
|
18
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
19
|
2
|
|
|
|
|
38
|
use Class::ArrayObjects extend => {
|
20
|
|
|
|
|
|
|
class => 'CSS::SAC::Selector::Simple',
|
21
|
|
|
|
|
|
|
with => [qw(
|
22
|
|
|
|
|
|
|
_data_
|
23
|
|
|
|
|
|
|
)],
|
24
|
2
|
|
|
2
|
|
11
|
};
|
|
2
|
|
|
|
|
3
|
|
25
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
### Constructor #######################################################
|
31
|
|
|
|
|
|
|
# #
|
32
|
|
|
|
|
|
|
# #
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
36
|
|
|
|
|
|
|
# CSS::SAC::Selector::CharacterData->new($type,$data)
|
37
|
|
|
|
|
|
|
# creates a new sac CharacterDataSelector object
|
38
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
39
|
|
|
|
|
|
|
sub new {
|
40
|
0
|
0
|
|
0
|
1
|
|
my $class = ref($_[0])?ref(shift):shift;
|
41
|
0
|
|
|
|
|
|
my $type = shift; # should be one of the cdata selectors
|
42
|
0
|
|
|
|
|
|
my $data = shift;
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
# create a selector
|
45
|
0
|
|
|
|
|
|
my $csel = $class->SUPER::new($type);
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# add our fields
|
48
|
0
|
0
|
|
|
|
|
$csel->[_data_] = $data if defined $data;
|
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
return $csel;
|
51
|
|
|
|
|
|
|
}
|
52
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# #
|
56
|
|
|
|
|
|
|
# #
|
57
|
|
|
|
|
|
|
### Constructor #######################################################
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
### Accessors #########################################################
|
62
|
|
|
|
|
|
|
# #
|
63
|
|
|
|
|
|
|
# #
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
*CSS::SAC::Selector::CharacterData::getData = \&Data;
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
68
|
|
|
|
|
|
|
# my $data = $csel->Data()
|
69
|
|
|
|
|
|
|
# $csel->Data($data)
|
70
|
|
|
|
|
|
|
# get/set the selector's cdata
|
71
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
72
|
|
|
|
|
|
|
sub Data {
|
73
|
0
|
0
|
|
0
|
1
|
|
(@_==2) ? $_[0]->[_data_] = $_[1] :
|
74
|
|
|
|
|
|
|
$_[0]->[_data_];
|
75
|
|
|
|
|
|
|
}
|
76
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
# #
|
80
|
|
|
|
|
|
|
# #
|
81
|
|
|
|
|
|
|
### Accessors #########################################################
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
1;
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=pod
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 NAME
|
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
CSS::SAC::Selector::CharacterData - SAC CharacterDataSelector
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
see CSS::SAC::Selector
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
This is a subclass of CSS::SAC::Selector::Simple, look there for more
|
100
|
|
|
|
|
|
|
documentation. This class adds the following methods (which also exist
|
101
|
|
|
|
|
|
|
in spec style, simply prepend them with 'get'):
|
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 METHODS
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=over
|
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=item * CSS::SAC::Selector::CharacterData->new($type,$data)
|
108
|
|
|
|
|
|
|
=item * $sel->new($type,$data)
|
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Creates a new cdata selector.
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=item * $csel->Data([$data])
|
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
get/set the selector's data
|
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=back
|
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 AUTHOR
|
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Robin Berjon
|
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
This module is licensed under the same terms as Perl itself.
|
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=cut
|
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
|