line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Toolforge::MixNMatch::Struct::Catalog; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
340404
|
use strict; |
|
4
|
|
|
|
|
40
|
|
|
4
|
|
|
|
|
118
|
|
4
|
4
|
|
|
4
|
|
26
|
use warnings; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
104
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
1727
|
use Toolforge::MixNMatch::Struct::User; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
125
|
|
7
|
4
|
|
|
4
|
|
1777
|
use Toolforge::MixNMatch::Struct::YearMonth; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
155
|
|
8
|
4
|
|
|
4
|
|
1469
|
use Toolforge::MixNMatch::Object::Catalog; |
|
4
|
|
|
|
|
4652
|
|
|
4
|
|
|
|
|
1217
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = 0.02; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub obj2struct { |
13
|
2
|
|
|
2
|
0
|
2262
|
my $obj = shift; |
14
|
|
|
|
|
|
|
|
15
|
2
|
|
|
|
|
8
|
my $struct_hr = { |
16
|
|
|
|
|
|
|
'type' => [{ |
17
|
|
|
|
|
|
|
'type' => $obj->type, |
18
|
|
|
|
|
|
|
'cnt' => $obj->count, |
19
|
|
|
|
|
|
|
}], |
20
|
|
|
|
|
|
|
'user' => [], |
21
|
|
|
|
|
|
|
'ym' => [], |
22
|
|
|
|
|
|
|
}; |
23
|
2
|
|
|
|
|
35
|
foreach my $year_month (@{$obj->year_months}) { |
|
2
|
|
|
|
|
6
|
|
24
|
2
|
|
|
|
|
13
|
push @{$struct_hr->{'ym'}}, |
|
2
|
|
|
|
|
7
|
|
25
|
|
|
|
|
|
|
Toolforge::MixNMatch::Struct::YearMonth::obj2struct($year_month); |
26
|
|
|
|
|
|
|
} |
27
|
2
|
|
|
|
|
19
|
foreach my $user (@{$obj->users}) { |
|
2
|
|
|
|
|
5
|
|
28
|
2
|
|
|
|
|
10
|
push @{$struct_hr->{'user'}}, |
|
2
|
|
|
|
|
6
|
|
29
|
|
|
|
|
|
|
Toolforge::MixNMatch::Struct::User::obj2struct($user); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
2
|
|
|
|
|
14
|
return $struct_hr; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub struct2obj { |
36
|
2
|
|
|
2
|
0
|
2916
|
my $struct_hr = shift; |
37
|
|
|
|
|
|
|
|
38
|
2
|
|
|
|
|
5
|
my $year_months = []; |
39
|
2
|
|
|
|
|
3
|
foreach my $year_month_hr (@{$struct_hr->{'ym'}}) { |
|
2
|
|
|
|
|
8
|
|
40
|
2
|
|
|
|
|
4
|
push @{$year_months}, Toolforge::MixNMatch::Struct::YearMonth::struct2obj($year_month_hr); |
|
2
|
|
|
|
|
7
|
|
41
|
|
|
|
|
|
|
} |
42
|
2
|
|
|
|
|
5
|
my $users = []; |
43
|
2
|
|
|
|
|
5
|
foreach my $user_hr (@{$struct_hr->{'user'}}) { |
|
2
|
|
|
|
|
5
|
|
44
|
2
|
|
|
|
|
4
|
push @{$users}, Toolforge::MixNMatch::Struct::User::struct2obj($user_hr); |
|
2
|
|
|
|
|
7
|
|
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
my $obj = Toolforge::MixNMatch::Object::Catalog->new( |
47
|
|
|
|
|
|
|
'count' => $struct_hr->{'type'}->[0]->{'cnt'}, |
48
|
2
|
|
|
|
|
15
|
'type' => $struct_hr->{'type'}->[0]->{'type'}, |
49
|
|
|
|
|
|
|
'users' => $users, |
50
|
|
|
|
|
|
|
'year_months' => $year_months, |
51
|
|
|
|
|
|
|
); |
52
|
|
|
|
|
|
|
|
53
|
2
|
|
|
|
|
203
|
return $obj; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |