line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Livedoor::Wiki::IDKeeper; |
2
|
|
|
|
|
|
|
|
3
|
10
|
|
|
10
|
|
52
|
use strict; |
|
10
|
|
|
|
|
18
|
|
|
10
|
|
|
|
|
331
|
|
4
|
10
|
|
|
10
|
|
49
|
use warnings; |
|
10
|
|
|
|
|
21
|
|
|
10
|
|
|
|
|
2081
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new { |
7
|
92
|
|
|
92
|
1
|
229
|
my $class = shift; |
8
|
92
|
|
|
|
|
153
|
my $self = shift ; |
9
|
92
|
|
|
|
|
449
|
bless $self , $class; |
10
|
92
|
|
|
|
|
292
|
for(1..3){ |
11
|
276
|
|
|
|
|
1071
|
$self->{level}{$_} = 0; |
12
|
|
|
|
|
|
|
} |
13
|
92
|
|
|
|
|
308
|
return $self; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub up { |
17
|
58
|
|
|
58
|
1
|
144
|
my $self = shift; |
18
|
58
|
|
|
|
|
106
|
my $level = shift ; |
19
|
58
|
|
|
|
|
268
|
$self->{level}{$level}++; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub id { |
23
|
176
|
|
|
176
|
1
|
272
|
my $self = shift; |
24
|
176
|
|
|
|
|
220
|
my $target_level = shift; |
25
|
|
|
|
|
|
|
|
26
|
176
|
|
|
|
|
498
|
my $id = $self->{name} ; |
27
|
|
|
|
|
|
|
|
28
|
176
|
|
|
|
|
232
|
foreach my $level ( sort keys %{$self->{level}} ) { |
|
176
|
|
|
|
|
801
|
|
29
|
408
|
100
|
|
|
|
1354
|
last if $level > $target_level; |
30
|
260
|
|
|
|
|
645
|
$id.= '_' . $self->{level}{$level} ; |
31
|
|
|
|
|
|
|
} |
32
|
176
|
|
|
|
|
1201
|
return $id; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 NAME |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Text::Livedoor::Wiki::IDKeeper - ID Keeper |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 DESCRIPTION |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
keep header id for #contents |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 METHOD |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head2 new |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 up |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head2 id |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 AUTHOR |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
polocky |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |