line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights 2001-2019 by [Mark Overmeer]. |
2
|
|
|
|
|
|
|
# For other contributors see ChangeLog. |
3
|
|
|
|
|
|
|
# See the manual pages for details on the licensing terms. |
4
|
|
|
|
|
|
|
# Pod stripped from pm file by OODoc 2.02. |
5
|
|
|
|
|
|
|
# This code is part of distribution Mail-Box. Meta-POD processed with |
6
|
|
|
|
|
|
|
# OODoc into POD and HTML manual-pages. See README.md |
7
|
|
|
|
|
|
|
# Copyright Mark Overmeer. Licensed under the same terms as Perl itself. |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Mail::Box::Tie::ARRAY; |
10
|
2
|
|
|
2
|
|
1466
|
use vars '$VERSION'; |
|
2
|
|
|
|
|
95
|
|
|
2
|
|
|
|
|
87
|
|
11
|
|
|
|
|
|
|
$VERSION = '3.008'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
33
|
|
15
|
2
|
|
|
2
|
|
67
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
54
|
|
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
2
|
|
10
|
use Carp; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
656
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub TIEARRAY(@) |
21
|
1
|
|
|
1
|
|
3
|
{ my ($class, $folder) = @_; |
22
|
1
|
50
|
33
|
|
|
13
|
croak "No folder specified to tie to." |
23
|
|
|
|
|
|
|
unless ref $folder && $folder->isa('Mail::Box'); |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
5
|
bless { MBT_folder => $folder }, $class; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
#------------------------------------------- |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub FETCH($) |
32
|
3
|
|
|
3
|
|
24
|
{ my ($self, $index) = @_; |
33
|
3
|
|
|
|
|
9
|
my $msg = $self->{MBT_folder}->message($index); |
34
|
3
|
50
|
|
|
|
14
|
$msg->isDeleted ? undef : $msg; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
#------------------------------------------- |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub STORE($$) |
41
|
0
|
|
|
0
|
|
0
|
{ my ($self, $index, $msg) = @_; |
42
|
0
|
|
|
|
|
0
|
my $folder = $self->{MBT_folder}; |
43
|
|
|
|
|
|
|
|
44
|
0
|
0
|
|
|
|
0
|
croak "Cannot simply replace messages in a folder: use delete old, then push new." |
45
|
|
|
|
|
|
|
unless $index == $folder->messages; |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
0
|
$folder->addMessages($msg); |
48
|
0
|
|
|
|
|
0
|
$msg; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
4
|
|
|
4
|
|
70
|
sub FETCHSIZE() { scalar shift->{MBT_folder}->messages } |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub PUSH(@) |
56
|
2
|
|
|
2
|
|
59594
|
{ my $folder = shift->{MBT_folder}; |
57
|
2
|
|
|
|
|
20
|
$folder->addMessages(@_); |
58
|
2
|
|
|
|
|
8
|
scalar $folder->messages; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
1
|
|
|
1
|
|
5
|
sub DELETE($) { shift->{MBT_folder}->message(shift)->delete } |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub STORESIZE($) |
66
|
0
|
|
|
0
|
|
|
{ my $folder = shift->{MBT_folder}; |
67
|
0
|
|
|
|
|
|
my $length = shift; |
68
|
0
|
|
|
|
|
|
$folder->message($_) foreach $length..$folder->messages; |
69
|
0
|
|
|
|
|
|
$length; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
# DESTROY is implemented in Mail::Box |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
#------------------------------------------- |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |