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-2022 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-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   1690 use vars '$VERSION';
  3         7  
  3         163  
11             $VERSION = '3.012';
12              
13 3     3   15 use base 'Mail::Message::TransferEnc';
  3         6  
  3         951  
14              
15 3     3   18 use strict;
  3         6  
  3         46  
16 3     3   13 use warnings;
  3         5  
  3         56  
17              
18 3     3   459 use MIME::QuotedPrint;
  3         1320  
  3         594  
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     9 my $bodytype = $args{result_type} || ref $body;
33              
34 2         8 $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 10 { my ($self, $body, %args) = @_;
44              
45 2   66     9 my $bodytype = $args{result_type} || ref $body;
46              
47 2         8 $bodytype->new
48             ( based_on => $body
49             , transfer_encoding => 'quoted-printable'
50             , data => encode_qp($body->string)
51             );
52             }
53              
54             1;