API3/Compat/API2/Basic/PDF/Bool.pm

filter: Statementstmt 77.7% 14 / 18 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 57.1% 4 / 7 Podpod 66.6% 2 / 3 totaltotal 66.6% 20 / 30 CC 2 SCAR 9.2
CC
2
Cov
70%
as_pdf
6.0
convert
2.0
outxmldeep
2.0
CRAP 2.5
« API3/Compat/API2/Basic/TTF/Kern/CompactClassArray.pm ↑ Summary API3/Compat/API2/Resource/ExtGState.pm »
1 #=======================================================================
2 # ____ ____ _____ _ ____ ___ ____
3 # | _ \| _ \| ___| _ _ / \ | _ \_ _| |___ \
4 # | |_) | | | | |_ (_) (_) / _ \ | |_) | | __) |
5 # | __/| |_| | _| _ _ / ___ \| __/| | / __/
6 # |_| |____/|_| (_) (_) /_/ \_\_| |___| |_____|
7 #
8 # A Perl Module Chain to faciliate the Creation and Modification
9 # of High-Quality "Portable Document Format (PDF)" Files.
10 #
11 #=======================================================================
12 #
13 # THIS IS A REUSED PERL MODULE, FOR PROPER LICENCING TERMS SEE BELOW:
14 #
15 #
16 # Copyright Martin Hosken <Martin_Hosken@sil.org>
17 #
18 # No warranty or expression of effectiveness, least of all regarding
19 # anyone's safety, is implied in this software or documentation.
20 #
21 # This specific module is licensed under the Perl Artistic License.
22 #
23 #
24 # $Id: Bool.pm,v 2.0 2005/11/16 02:16:00 areibens Exp $
25 #
26 #=======================================================================
27 package PDF::API3::Compat::API2::Basic::PDF::Bool;
28
29 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
30 1 ▶use vars qw(@ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
31 1 ▶no warnings qw[ deprecated recursion uninitialized ];
Subroutine BEGIN: called CC=1 SCAR=0.0
32
33 1 ▶use PDF::API3::Compat::API2::Basic::PDF::String;
Subroutine BEGIN: called CC=1 SCAR=0.0
34 1 @ISA = qw(PDF::API3::Compat::API2::Basic::PDF::String);
35
36 =head1 NAME
37
38 PDF::API3::Compat::API2::Basic::PDF::Bool - A special form of L<PDF::String> which holds the strings
39 B<true> or B<false>
40
41 =head1 METHODS
42
43 =head2 $b->convert($str)
44
45 Converts a string into the string which will be stored.
46
47 =cut
48
49 sub convert
50 0 ▶{ return $_[1] eq "true"; }
Subroutine convert: not called CC=1 SCAR=6.9
Pod documented
51
52
53 =head2 as_pdf
54
55 Converts the value to a PDF output form
56
57 =cut
58
59 sub as_pdf
60 0 ▶{ $_[0]->{'val'} ? "true" : "false"; }
Subroutine as_pdf: not called CC=2 SCAR=17.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
$_[0]{'val'} ? : 0 0 0
61
62 sub outxmldeep
63 0 ▶{
Subroutine outxmldeep: not called CC=1 SCAR=6.9
Pod undocumented
64 0 my ($self, $fh, $pdf, %opts) = @_;
65
66 0 $opts{-xmlfh}->print("<Bool>".$self->as_pdf."</Bool>\n");
67 }
68
69 1 1;
70
« API3/Compat/API2/Basic/TTF/Kern/CompactClassArray.pm ↑ Summary API3/Compat/API2/Resource/ExtGState.pm »