line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Gedcom::Date::Interpreted; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
21
|
use strict; |
|
6
|
|
|
|
|
6
|
|
|
6
|
|
|
|
|
158
|
|
4
|
|
|
|
|
|
|
|
5
|
6
|
|
|
6
|
|
19
|
use vars qw($VERSION @ISA); |
|
6
|
|
|
|
|
6
|
|
|
6
|
|
|
|
|
327
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.10'; |
8
|
|
|
|
|
|
|
@ISA = qw/Gedcom::Date/; |
9
|
|
|
|
|
|
|
|
10
|
6
|
|
|
6
|
|
21
|
use Gedcom::Date; |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
1664
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub parse { |
13
|
23
|
|
|
23
|
1
|
24
|
my $class = shift; |
14
|
23
|
|
|
|
|
22
|
my ($str) = @_; |
15
|
|
|
|
|
|
|
|
16
|
23
|
100
|
|
|
|
154
|
my ($date, $phrase) = $str =~ /^INT (.*?) \((.*)\)$/ |
17
|
|
|
|
|
|
|
or return; |
18
|
|
|
|
|
|
|
|
19
|
3
|
50
|
|
|
|
12
|
my $date_s = Gedcom::Date::Simple->parse($date) |
20
|
|
|
|
|
|
|
or return; |
21
|
|
|
|
|
|
|
|
22
|
3
|
|
|
|
|
10
|
my $self = bless { |
23
|
|
|
|
|
|
|
date => $date_s, |
24
|
|
|
|
|
|
|
phrase => $phrase |
25
|
|
|
|
|
|
|
}, $class; |
26
|
|
|
|
|
|
|
|
27
|
3
|
|
|
|
|
106
|
return $self; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub gedcom { |
31
|
2
|
|
|
2
|
1
|
298
|
my $self = shift; |
32
|
|
|
|
|
|
|
|
33
|
2
|
50
|
|
|
|
8
|
if (!defined $self->{gedcom}) { |
34
|
2
|
|
|
|
|
8
|
$self->{gedcom} = 'INT '.$self->{date}->gedcom(). |
35
|
|
|
|
|
|
|
" ($self->{phrase})"; |
36
|
|
|
|
|
|
|
} |
37
|
2
|
|
|
|
|
7
|
$self->{gedcom}; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub latest { |
41
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
0
|
return $self->{date}->latest; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub earliest { |
47
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
0
|
return $self->{date}->earliest; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub sort_date { |
53
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
0
|
return $self->{date}->sort_date; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
my %text = ( |
59
|
|
|
|
|
|
|
en => 'on %0', |
60
|
|
|
|
|
|
|
nl => 'op %0', |
61
|
|
|
|
|
|
|
); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub text_format { |
64
|
3
|
|
|
3
|
0
|
5
|
my ($self, $lang) = @_; |
65
|
|
|
|
|
|
|
|
66
|
3
|
|
|
|
|
10
|
return ($text{$lang}, $self->{date}); |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
__END__ |