line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights 2003-2021 by [Mark Overmeer]. |
2
|
|
|
|
|
|
|
# For other contributors see ChangeLog. |
3
|
|
|
|
|
|
|
# See the manual pages for details on the licensing terms. |
4
|
|
|
|
|
|
|
# Pod stripped from pm file by OODoc 2.02. |
5
|
|
|
|
|
|
|
# This code is part of perl distribution OODoc. It is licensed under the |
6
|
|
|
|
|
|
|
# same terms as Perl itself: https://spdx.org/licenses/Artistic-2.0.html |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package OODoc::Object; |
9
|
2
|
|
|
2
|
|
16
|
use vars '$VERSION'; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
98
|
|
10
|
|
|
|
|
|
|
$VERSION = '2.02'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
36
|
|
14
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
82
|
|
15
|
|
|
|
|
|
|
|
16
|
2
|
|
|
2
|
|
1085
|
use Log::Report 'oodoc'; |
|
2
|
|
|
|
|
238973
|
|
|
2
|
|
|
|
|
13
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new(@) |
20
|
0
|
|
|
0
|
1
|
|
{ my $class = shift; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
my %args = @_; |
23
|
0
|
|
|
|
|
|
my $self = (bless {}, $class)->init(\%args); |
24
|
|
|
|
|
|
|
|
25
|
0
|
0
|
|
|
|
|
if(my @missing = keys %args) |
26
|
0
|
|
|
|
|
|
{ error __xn"unknown option {options}", "unknown options {options}" |
27
|
|
|
|
|
|
|
, scalar @missing, options => @missing; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
$self; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub init($) |
34
|
0
|
|
|
0
|
0
|
|
{ my ($self, $args) = @_; |
35
|
0
|
|
|
|
|
|
$self->{OO_extends} = []; |
36
|
0
|
|
|
|
|
|
$self; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
#------------------------------------------- |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub extends(;$) |
43
|
0
|
|
|
0
|
1
|
|
{ my $self = shift; |
44
|
0
|
|
|
|
|
|
my $ext = $self->{OO_extends}; |
45
|
0
|
|
|
|
|
|
push @$ext, @_; |
46
|
|
|
|
|
|
|
|
47
|
0
|
0
|
|
|
|
|
wantarray ? @$ext : $ext->[0]; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
#------------------------------------------- |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub mkdirhier($) |
54
|
0
|
|
|
0
|
1
|
|
{ my $thing = shift; |
55
|
0
|
|
|
|
|
|
my @dirs = File::Spec->splitdir(shift); |
56
|
0
|
0
|
|
|
|
|
my $path = $dirs[0] eq '' ? shift @dirs : '.'; |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
while(@dirs) |
59
|
0
|
|
|
|
|
|
{ $path = File::Spec->catdir($path, shift @dirs); |
60
|
0
|
0
|
0
|
|
|
|
-d $path || mkdir $path |
61
|
|
|
|
|
|
|
or fault __x"cannot create {dir}", dir => $path; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
$thing; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub filenameToPackage($) |
69
|
0
|
|
|
0
|
1
|
|
{ my ($thing, $package) = @_; |
70
|
0
|
|
|
|
|
|
$package =~ s!^lib/!!; |
71
|
0
|
|
|
|
|
|
$package =~ s#/#::#g; |
72
|
0
|
|
|
|
|
|
$package =~ s/\.(pm|pod)$//g; |
73
|
0
|
|
|
|
|
|
$package; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
#------------------------------------------- |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
my %packages; |
80
|
|
|
|
|
|
|
my %manuals; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub addManual($) |
83
|
0
|
|
|
0
|
1
|
|
{ my ($self, $manual) = @_; |
84
|
|
|
|
|
|
|
|
85
|
0
|
0
|
0
|
|
|
|
ref $manual && $manual->isa('OODoc::Manual') |
86
|
|
|
|
|
|
|
or panic "manual definition requires manual object"; |
87
|
|
|
|
|
|
|
|
88
|
0
|
|
|
|
|
|
push @{$packages{$manual->package}}, $manual; |
|
0
|
|
|
|
|
|
|
89
|
0
|
|
|
|
|
|
$manuals{$manual->name} = $manual; |
90
|
0
|
|
|
|
|
|
$self; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub mainManual($) |
95
|
0
|
|
|
0
|
1
|
|
{ my ($self, $name) = @_; |
96
|
0
|
|
|
|
|
|
(grep {$_ eq $_->package} $self->manualsForPackage($name))[0]; |
|
0
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
sub manualsForPackage($) |
101
|
0
|
|
|
0
|
1
|
|
{ my ($self,$name) = @_; |
102
|
0
|
|
0
|
|
|
|
$name ||= 'doc'; |
103
|
0
|
0
|
|
|
|
|
defined $packages{$name} ? @{$packages{$name}} : (); |
|
0
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
|
107
|
0
|
|
|
0
|
1
|
|
sub manuals() { values %manuals } |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
|
110
|
0
|
|
|
0
|
1
|
|
sub manual($) { $manuals{ $_[1] } } |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
|
113
|
0
|
|
|
0
|
1
|
|
sub packageNames() { keys %packages } |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
1; |