File Coverage

blib/lib/Mail/Message/TransferEnc/QuotedPrint.pm
Criterion Covered Total %
statement 21 23 91.3
branch n/a
condition 4 6 66.6
subroutine 7 8 87.5
pod 3 3 100.0
total 35 40 87.5


line stmt bran cond sub pod time code
1             # Copyrights 2001-2021 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-Message. 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::Message::TransferEnc::QuotedPrint;
10 3     3   1852 use vars '$VERSION';
  3         7  
  3         177  
11             $VERSION = '3.011';
12              
13 3     3   20 use base 'Mail::Message::TransferEnc';
  3         6  
  3         1076  
14              
15 3     3   22 use strict;
  3         6  
  3         59  
16 3     3   15 use warnings;
  3         6  
  3         73  
17              
18 3     3   526 use MIME::QuotedPrint;
  3         1384  
  3         740  
19              
20              
21             sub name() { 'quoted-printable' }
22              
23             sub check($@)
24 0     0 1 0 { my ($self, $body, %args) = @_;
25 0         0 $body;
26             }
27              
28              
29             sub decode($@)
30 2     2 1 10 { my ($self, $body, %args) = @_;
31              
32 2   66     11 my $bodytype = $args{result_type} || ref $body;
33              
34 2         10 $bodytype->new
35             ( based_on => $body
36             , transfer_encoding => 'none'
37             , data => decode_qp($body->string)
38             );
39             }
40              
41              
42             sub encode($@)
43 2     2 1 12 { my ($self, $body, %args) = @_;
44              
45 2   66     11 my $bodytype = $args{result_type} || ref $body;
46              
47 2         10 $bodytype->new
48             ( based_on => $body
49             , transfer_encoding => 'quoted-printable'
50             , data => encode_qp($body->string)
51             );
52             }
53              
54             1;