line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::KeePass::KDBX::Tie::Protected; |
2
|
|
|
|
|
|
|
# ABSTRACT: Entry memory protection flags |
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
1190
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
69
|
|
5
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
42
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
8
|
use boolean; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
15
|
|
8
|
2
|
|
|
2
|
|
155
|
use namespace::clean; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
18
|
|
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
496
|
use parent 'File::KeePass::KDBX::Tie::Hash'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
12
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.900'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my %GET = ( |
15
|
|
|
|
|
|
|
comment => sub { $_[0]->string('Notes') ->{protect} ? 1 : 0 }, |
16
|
|
|
|
|
|
|
password => sub { $_[0]->string('Password') ->{protect} ? 1 : 0 }, |
17
|
|
|
|
|
|
|
title => sub { $_[0]->string('Title') ->{protect} ? 1 : 0 }, |
18
|
|
|
|
|
|
|
url => sub { $_[0]->string('URL') ->{protect} ? 1 : 0 }, |
19
|
|
|
|
|
|
|
username => sub { $_[0]->string('UserName') ->{protect} ? 1 : 0 }, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
my %SET = ( |
22
|
|
|
|
|
|
|
comment => sub { $_[0]->string('Notes') ->{protect} = boolean($_) }, |
23
|
|
|
|
|
|
|
password => sub { $_[0]->string('Password') ->{protect} = boolean($_) }, |
24
|
|
|
|
|
|
|
title => sub { $_[0]->string('Title') ->{protect} = boolean($_) }, |
25
|
|
|
|
|
|
|
url => sub { $_[0]->string('URL') ->{protect} = boolean($_) }, |
26
|
|
|
|
|
|
|
username => sub { $_[0]->string('UserName') ->{protect} = boolean($_) }, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
12
|
|
|
12
|
0
|
41
|
sub getters { \%GET } |
30
|
0
|
|
|
0
|
0
|
0
|
sub setters { \%SET } |
31
|
4
|
50
|
|
4
|
0
|
14
|
sub default_getter { my $key = $_[1]; sub { $_[0]->string($key)->{protect} ? 1 : 0 } } |
|
4
|
|
|
4
|
|
9
|
|
|
4
|
|
|
|
|
25
|
|
32
|
0
|
|
|
0
|
0
|
0
|
sub default_setter { my $key = $_[1]; sub { $_[0]->string($key)->{protect} = boolean($_) } } |
|
0
|
|
|
0
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub keys { |
35
|
36
|
|
|
36
|
0
|
47
|
my $self = shift; |
36
|
36
|
|
|
|
|
56
|
my ($entry) = @$self; |
37
|
36
|
|
|
|
|
43
|
my @keys; |
38
|
36
|
|
|
|
|
48
|
while (my ($key, $string) = each %{$entry->strings}) { |
|
288
|
|
|
|
|
1049
|
|
39
|
252
|
100
|
|
|
|
1774
|
$key = 'comment' if $key eq 'Notes'; |
40
|
252
|
100
|
|
|
|
621
|
$key = lc($key) if $key =~ /^(?:Password|Title|URL|UserName)$/; |
41
|
252
|
100
|
|
|
|
518
|
push @keys, $key if $string->{protect}; |
42
|
|
|
|
|
|
|
} |
43
|
36
|
|
|
|
|
281
|
return \@keys; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |