| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Protocol::XMPP::TextElement; |
|
2
|
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
246472
|
use strict; |
|
|
3
|
|
|
|
|
8
|
|
|
|
3
|
|
|
|
|
105
|
|
|
4
|
3
|
|
|
3
|
|
12
|
use warnings; |
|
|
3
|
|
|
|
|
5
|
|
|
|
3
|
|
|
|
|
227
|
|
|
5
|
3
|
|
|
3
|
|
22
|
use parent qw(Protocol::XMPP::ElementBase); |
|
|
3
|
|
|
|
|
10
|
|
|
|
3
|
|
|
|
|
46
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.007'; ## VERSION |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Protocol::XMPP::TextElement - handle a text element |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 METHODS |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
|
22
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
|
23
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new(@_); |
|
24
|
0
|
|
|
|
|
|
$self->{text_data} = ''; |
|
25
|
0
|
|
|
|
|
|
$self |
|
26
|
|
|
|
|
|
|
} |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head2 characters |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=cut |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub characters { |
|
33
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
34
|
0
|
|
|
|
|
|
my $v = shift; |
|
35
|
0
|
|
|
|
|
|
$self->{text_data} .= $v; |
|
36
|
0
|
|
|
|
|
|
$self; |
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head2 trim |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Remove all leading and trailing whitespace. |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
|
44
|
|
|
|
|
|
|
|
|
45
|
0
|
|
|
0
|
1
|
|
sub trim { $_[0] =~ s/(?:^\s*)|(?:\s*$)//g; $_[0] } |
|
|
0
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head2 end_element |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub end_element { |
|
52
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
53
|
0
|
|
|
|
|
|
my $data = trim($self->{text_data}); |
|
54
|
0
|
|
|
|
|
|
$self->on_text_complete($data); |
|
55
|
0
|
|
|
|
|
|
$self; |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
__END__ |