line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Plist::Foundation::NSObject; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
495
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
5
|
1
|
|
|
1
|
|
754
|
use Class::ISA; |
|
1
|
|
|
|
|
2517
|
|
|
1
|
|
|
|
|
10
|
|
6
|
1
|
|
|
1
|
|
669
|
use UNIVERSAL::isa; |
|
1
|
|
|
|
|
944
|
|
|
1
|
|
|
|
|
6
|
|
7
|
1
|
|
|
1
|
|
23
|
use Scalar::Util qw//; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
337
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub init { |
10
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub replacement { |
14
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
15
|
0
|
|
|
|
|
|
$self->init; |
16
|
0
|
|
|
|
|
|
return $self; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub serialize_class { |
20
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
21
|
0
|
0
|
|
|
|
|
$self = ref $self if ref $self; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
my $short = $self; |
24
|
0
|
|
|
|
|
|
$short =~ s/^Data::Plist::Foundation:://; |
25
|
|
|
|
|
|
|
return [ |
26
|
0
|
|
|
|
|
|
UID => [ |
27
|
|
|
|
|
|
|
dict => { |
28
|
|
|
|
|
|
|
'$classes' => [ |
29
|
|
|
|
|
|
|
array => [ |
30
|
0
|
|
|
|
|
|
map { s/^Data::Plist::Foundation:://; [ string => $_ ] } |
|
0
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
grep { $_->isa("Data::Plist::Foundation::NSObject") } |
32
|
|
|
|
|
|
|
Class::ISA::self_and_super_path($self) |
33
|
|
|
|
|
|
|
] |
34
|
|
|
|
|
|
|
], |
35
|
|
|
|
|
|
|
'$classname' => [ string => $short ], |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
] |
38
|
|
|
|
|
|
|
]; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub serialize_equiv { |
42
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
43
|
0
|
|
|
|
|
|
return { %{$self} }; |
|
0
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub serialize { |
47
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
48
|
0
|
|
|
|
|
|
my %dict; |
49
|
0
|
|
|
|
|
|
$dict{'$class'} = $self->serialize_class; |
50
|
0
|
|
|
|
|
|
my $equiv = $self->serialize_equiv; |
51
|
0
|
|
|
|
|
|
for my $key ( keys %{$equiv} ) { |
|
0
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
my $value = Data::Plist::Writer->serialize_value( $equiv->{$key} ); |
53
|
0
|
0
|
|
|
|
|
if ( $value->[0] =~ /^(data|integer|real|true|false)$/ ) { |
54
|
0
|
|
|
|
|
|
$dict{$key} = $value; |
55
|
|
|
|
|
|
|
} else { |
56
|
0
|
|
|
|
|
|
$dict{$key} = [ UID => $value ]; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
} |
59
|
0
|
|
|
|
|
|
return [ dict => \%dict ]; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |