| 1 | # Copyrights 2001-2022 by [Mark Overmeer <markov@cpan.org>]. | ||||||||||||||||||||
| 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::Base64; | ||||||||||||||||||||
| 10 | 5 | ▶ | use vars '$VERSION'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | 5 | $VERSION = '3.012'; | |||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 5 | ▶ | use base 'Mail::Message::TransferEnc'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 5 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | 5 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | 5 | ▶ | use MIME::Base64; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | sub name() { 'base64' } | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | #------------------------------------------ | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | sub check($@) | ||||||||||||||||||||
| 26 | 0 | ▶ | { my ($self, $body, %args) = @_; | ||||||||||||||||||
|
Subroutine
check: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 27 | 0 | $body; | |||||||||||||||||||
| 28 | } | ||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | #------------------------------------------ | ||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | sub decode($@) | ||||||||||||||||||||
| 34 | 2 | ▶ | { my ($self, $body, %args) = @_; | ||||||||||||||||||
|
Subroutine
decode: called CC=4 SCAR=15.0
Pod
documented
| |||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 2 | my $lines = decode_base64($body->string); | |||||||||||||||||||
| 37 | 2 | ▶ | unless($lines) | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 38 | 0 | { $body->transferEncoding('none'); | |||||||||||||||||||
| 39 | 0 | return $body; | |||||||||||||||||||
| 40 | } | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | my $bodytype | ||||||||||||||||||||
| 43 | = defined $args{result_type} ? $args{result_type} | ||||||||||||||||||||
| 44 | 2 | ▶ | : $body->isBinary ? 'Mail::Message::Body::File' | ||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||
| 45 | : ref $body; | ||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | 2 | $bodytype->new | |||||||||||||||||||
| 48 | ( based_on => $body | ||||||||||||||||||||
| 49 | , transfer_encoding => 'none' | ||||||||||||||||||||
| 50 | , data => $lines | ||||||||||||||||||||
| 51 | ); | ||||||||||||||||||||
| 52 | } | ||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | #------------------------------------------ | ||||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | sub encode($@) | ||||||||||||||||||||
| 57 | 4 | ▶ | { my ($self, $body, %args) = @_; | ||||||||||||||||||
|
Subroutine
encode: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | 4 | ▶ | my $bodytype = $args{result_type} || ref $body; | ||||||||||||||||||
|
Condition66%2/3
$args{'result_type'} || ref $body
MC/DC0%0/2
$args{'result_type'} || ref $body
$args{'result_type'}
ref $body
Truth table66%2/3
A || B
A= $args{'result_type'}B= ref $body
| |||||||||||||||||||||
| 60 | |||||||||||||||||||||
| 61 | 4 | $bodytype->new | |||||||||||||||||||
| 62 | ( based_on => $body | ||||||||||||||||||||
| 63 | , checked => 1 | ||||||||||||||||||||
| 64 | , transfer_encoding => 'base64' | ||||||||||||||||||||
| 65 | , data => encode_base64($body->string) | ||||||||||||||||||||
| 66 | ); | ||||||||||||||||||||
| 67 | } | ||||||||||||||||||||
| 68 | |||||||||||||||||||||
| 69 | #------------------------------------------ | ||||||||||||||||||||
| 70 | |||||||||||||||||||||
| 71 | 5 | 1; | |||||||||||||||||||