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