line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights 2001-2023 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.03. |
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
|
|
1878
|
use vars '$VERSION'; |
|
2
|
|
|
|
|
91
|
|
|
2
|
|
|
|
|
108
|
|
11
|
|
|
|
|
|
|
$VERSION = '3.010'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
2
|
|
15
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
56
|
|
15
|
2
|
|
|
2
|
|
83
|
use warnings; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
56
|
|
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
2
|
|
15
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
903
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub TIEARRAY(@) |
21
|
1
|
|
|
1
|
|
5
|
{ my ($class, $folder) = @_; |
22
|
1
|
50
|
33
|
|
|
18
|
croak "No folder specified to tie to." |
23
|
|
|
|
|
|
|
unless ref $folder && $folder->isa('Mail::Box'); |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
7
|
bless { MBT_folder => $folder }, $class; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
#------------------------------------------- |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub FETCH($) |
32
|
3
|
|
|
3
|
|
45
|
{ my ($self, $index) = @_; |
33
|
3
|
|
|
|
|
11
|
my $msg = $self->{MBT_folder}->message($index); |
34
|
3
|
50
|
|
|
|
17
|
$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
|
|
93
|
sub FETCHSIZE() { scalar shift->{MBT_folder}->messages } |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub PUSH(@) |
56
|
2
|
|
|
2
|
|
83210
|
{ my $folder = shift->{MBT_folder}; |
57
|
2
|
|
|
|
|
26
|
$folder->addMessages(@_); |
58
|
2
|
|
|
|
|
10
|
scalar $folder->messages; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
1
|
|
|
1
|
|
7
|
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; |