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             # This code is part of Perl distribution Mail-Message version 4.04.
2             # The POD got stripped from this file by OODoc version 3.06.
3             # For contributors see file ChangeLog.
4              
5             # This software is copyright (c) 2001-2026 by Mark Overmeer.
6              
7             # This is free software; you can redistribute it and/or modify it under
8             # the same terms as the Perl 5 programming language system itself.
9             # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later
10              
11              
12             package Mail::Message::TransferEnc::QuotedPrint;{
13             our $VERSION = '4.04';
14             }
15              
16 3     3   3012 use parent 'Mail::Message::TransferEnc';
  3         8  
  3         26  
17              
18 3     3   229 use strict;
  3         7  
  3         74  
19 3     3   15 use warnings;
  3         8  
  3         190  
20              
21 3     3   18 use Log::Report 'mail-message', import => [ qw// ];
  3         6  
  3         19  
22              
23 3     3   985 use MIME::QuotedPrint qw/encode_qp decode_qp/;
  3         1695  
  3         991  
24              
25             #--------------------
26              
27             sub name() { 'quoted-printable' }
28              
29             sub check($@)
30 0     0 1 0 { my ($self, $body, %args) = @_;
31 0         0 $body;
32             }
33              
34              
35             sub decode($@)
36 2     2 1 12 { my ($self, $body, %args) = @_;
37              
38 2   66     13 my $bodytype = $args{result_type} || ref $body;
39 2         10 $bodytype->new(based_on => $body, transfer_encoding => 'none', data => decode_qp($body->string));
40             }
41              
42              
43             sub encode($@)
44 2     2 1 14 { my ($self, $body, %args) = @_;
45              
46 2   66     12 my $bodytype = $args{result_type} || ref $body;
47 2         28 $bodytype->new(based_on => $body, transfer_encoding => 'quoted-printable', data => encode_qp($body->string));
48             }
49              
50             1;