line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::KeePass::KDBX::Tie::Protected; |
2
|
|
|
|
|
|
|
# ABSTRACT: Entry memory protection flags |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
453
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
29
|
|
5
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
20
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
6
|
use boolean; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
6
|
|
8
|
1
|
|
|
1
|
|
70
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
243
|
use parent 'File::KeePass::KDBX::Tie::Hash'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.902'; # 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
|
35
|
sub getters { \%GET } |
30
|
0
|
|
|
0
|
0
|
0
|
sub setters { \%SET } |
31
|
4
|
50
|
|
4
|
0
|
13
|
sub default_getter { my $key = $_[1]; sub { $_[0]->string($key)->{protect} ? 1 : 0 } } |
|
4
|
|
|
4
|
|
7
|
|
|
4
|
|
|
|
|
18
|
|
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
|
50
|
my $self = shift; |
36
|
36
|
|
|
|
|
52
|
my ($entry) = @$self; |
37
|
36
|
|
|
|
|
42
|
my @keys; |
38
|
36
|
|
|
|
|
41
|
while (my ($key, $string) = each %{$entry->strings}) { |
|
288
|
|
|
|
|
968
|
|
39
|
252
|
100
|
|
|
|
1603
|
$key = 'comment' if $key eq 'Notes'; |
40
|
252
|
100
|
|
|
|
564
|
$key = lc($key) if $key =~ /^(?:Password|Title|URL|UserName)$/; |
41
|
252
|
100
|
|
|
|
472
|
push @keys, $key if $string->{protect}; |
42
|
|
|
|
|
|
|
} |
43
|
36
|
|
|
|
|
267
|
return \@keys; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |