| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package XML::Feed::Entry; |
|
2
|
4
|
|
|
4
|
|
3334
|
use strict; |
|
|
4
|
|
|
|
|
8
|
|
|
|
4
|
|
|
|
|
116
|
|
|
3
|
4
|
|
|
4
|
|
21
|
use warnings; |
|
|
4
|
|
|
|
|
6
|
|
|
|
4
|
|
|
|
|
172
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.53'; |
|
6
|
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
22
|
use base qw( Class::ErrorHandler ); |
|
|
4
|
|
|
|
|
6
|
|
|
|
4
|
|
|
|
|
334
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
24
|
use Scalar::Util qw( blessed ); |
|
|
4
|
|
|
|
|
8
|
|
|
|
4
|
|
|
|
|
225
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
4
|
|
|
4
|
|
43
|
use Carp; |
|
|
4
|
|
|
|
|
7
|
|
|
|
4
|
|
|
|
|
2156
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub wrap { |
|
14
|
0
|
|
|
0
|
1
|
0
|
my $class = shift; |
|
15
|
0
|
|
|
|
|
0
|
my($item) = @_; |
|
16
|
0
|
|
|
|
|
0
|
bless { entry => $item }, $class; |
|
17
|
|
|
|
|
|
|
} |
|
18
|
|
|
|
|
|
|
|
|
19
|
0
|
|
|
0
|
1
|
0
|
sub unwrap { $_[0]->{entry} } |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
|
22
|
2
|
|
|
2
|
1
|
782
|
my $class = shift; |
|
23
|
2
|
|
|
|
|
5
|
my($format) = @_; |
|
24
|
2
|
|
50
|
|
|
6
|
$format ||= 'Atom'; |
|
25
|
2
|
|
|
|
|
4
|
my $format_class = 'XML::Feed::Format::' . $format; |
|
26
|
2
|
|
|
1
|
|
136
|
eval "use $format_class"; |
|
|
1
|
|
|
1
|
|
418
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
|
1
|
|
|
|
|
18
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
27
|
2
|
50
|
|
|
|
435
|
Carp::croak("Unsupported format $format: $@") if $@; |
|
28
|
0
|
|
|
|
|
0
|
my $entry = bless {}, join('::', __PACKAGE__, "Format", $format); |
|
29
|
0
|
0
|
|
|
|
0
|
$entry->init_empty or return $class->error($entry->errstr); |
|
30
|
0
|
|
|
|
|
0
|
$entry; |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
|
|
33
|
0
|
|
|
0
|
0
|
0
|
sub init_empty { 1 } |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub convert { |
|
36
|
0
|
|
|
0
|
1
|
0
|
my $entry = shift; |
|
37
|
0
|
|
|
|
|
0
|
my($format) = @_; |
|
38
|
0
|
|
|
|
|
0
|
my $new = __PACKAGE__->new($format); |
|
39
|
0
|
|
|
|
|
0
|
for my $field (qw( title link content summary author id issued modified lat long )) { |
|
40
|
0
|
|
|
|
|
0
|
my $val = $entry->$field(); |
|
41
|
0
|
0
|
|
|
|
0
|
next unless defined $val; |
|
42
|
0
|
0
|
0
|
|
|
0
|
next if blessed $val && $val->isa('XML::Feed::Content') && ! defined $val->body; |
|
|
|
|
0
|
|
|
|
|
|
43
|
0
|
|
|
|
|
0
|
$new->$field($val); |
|
44
|
|
|
|
|
|
|
} |
|
45
|
0
|
|
|
|
|
0
|
for my $field (qw( category )) { |
|
46
|
0
|
|
|
|
|
0
|
my @val = $entry->$field(); |
|
47
|
0
|
0
|
|
|
|
0
|
next unless @val; |
|
48
|
0
|
|
|
|
|
0
|
$new->$field(@val); |
|
49
|
|
|
|
|
|
|
} |
|
50
|
0
|
|
|
|
|
0
|
$new; |
|
51
|
|
|
|
|
|
|
} |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub title; |
|
54
|
|
|
|
|
|
|
sub link; |
|
55
|
|
|
|
|
|
|
sub content; |
|
56
|
|
|
|
|
|
|
sub summary; |
|
57
|
|
|
|
|
|
|
sub category; |
|
58
|
|
|
|
|
|
|
sub author; |
|
59
|
|
|
|
|
|
|
sub id; |
|
60
|
|
|
|
|
|
|
sub issued; |
|
61
|
|
|
|
|
|
|
sub modified; |
|
62
|
|
|
|
|
|
|
sub lat; |
|
63
|
|
|
|
|
|
|
sub long; |
|
64
|
|
|
|
|
|
|
sub format; |
|
65
|
0
|
|
|
0
|
1
|
0
|
sub tags { shift->category(@_) } |
|
66
|
|
|
|
|
|
|
sub enclosure; |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; |
|
69
|
|
|
|
|
|
|
__END__ |