/usr/share/perl5/Mail/Message/Head/FieldGroup.pm is in libmail-box-perl 2.099-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | # Copyrights 2001-2011 by Mark Overmeer.
# For other contributors see ChangeLog.
# See the manual pages for details on the licensing terms.
# Pod stripped from pm file by OODoc 2.00.
package Mail::Message::Head::FieldGroup;
use vars '$VERSION';
$VERSION = '2.099';
use base 'Mail::Reporter';
use strict;
use warnings;
sub new(@)
{ my $class = shift;
my @fields;
push @fields, shift while ref $_[0];
$class->SUPER::new(@_, fields => \@fields);
}
sub init($$)
{ my ($self, $args) = @_;
$self->SUPER::init($args);
my $head = $self->{MMHF_head}
= $args->{head} || Mail::Message::Head::Partial->new;
$self->add($_) # add specified object fields
foreach @{$args->{fields}};
$self->add($_, delete $args->{$_}) # add key-value paired fields
foreach grep m/^[A-Z]/, keys %$args;
$self->{MMHF_version} = $args->{version} if defined $args->{version};
$self->{MMHF_software} = $args->{software} if defined $args->{software};
$self->{MMHF_type} = $args->{type} if defined $args->{type};
$self->{MMHF_fns} = [];
$self;
}
#------------------------------------------
sub implementedTypes() { shift->notImplemented }
#------------------------------------------
sub from($) { shift->notImplemented }
#------------------------------------------
sub clone()
{ my $self = shift;
my $clone = bless %$self, ref $self;
$clone->{MMHF_fns} = [ $self->fieldNames ];
$clone;
}
#------------------------------------------
sub head() { shift->{MMHF_head} }
#------------------------------------------
sub attach($)
{ my ($self, $head) = @_;
$head->add($_->clone) for $self->fields;
$self;
}
#------------------------------------------
sub delete()
{ my $self = shift;
my $head = $self->head;
$head->removeField($_) foreach $self->fields;
$self;
}
#------------------------------------------
sub add(@)
{ my $self = shift;
my $field = $self->head->add(@_) or return ();
push @{$self->{MMHF_fns}}, $field->name;
$self;
}
#------------------------------------------
sub fields()
{ my $self = shift;
my $head = $self->head;
map { $head->get($_) } $self->fieldNames;
}
#------------------------------------------
sub fieldNames() { @{shift->{MMHF_fns}} }
#------------------------------------------
sub addFields(@)
{ my $self = shift;
my $head = $self->head;
push @{$self->{MMHF_fns}}, @_;
@_;
}
#------------------------------------------
sub version() { shift->{MMHF_version} }
#------------------------------------------
sub software() { shift->{MMHF_software} }
#------------------------------------------
sub type() { shift->{MMHF_type} }
#------------------------------------------
sub detected($$$)
{ my $self = shift;
@$self{ qw/MMHF_type MMHF_software MMHF_version/ } = @_;
}
#------------------------------------------
sub collectFields(;$) { shift->notImplemented }
#------------------------------------------
sub print(;$)
{ my $self = shift;
my $out = shift || select;
$_->print($out) foreach $self->fields;
}
#------------------------------------------
sub details()
{ my $self = shift;
my $type = $self->type || 'Unknown';
my $software = $self->software;
undef $software if defined($software) && $type eq $software;
my $version = $self->version;
my $release
= defined $software
? (defined $version ? " ($software $version)" : " ($software)")
: (defined $version ? " ($version)" : '');
my $fields = scalar $self->fields;
"$type $release, $fields fields";
}
#------------------------------------------
1;
|