API2/Basic/PDF/Utils.pm

filter: Statementstmt 97.9% 47 / 48 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 95.0% 19 / 20 Podpod 88.8% 8 / 9 totaltotal 96.1% 74 / 77 CC 1 SCAR 0.5
CC
1
Cov
98%
PDFUtf
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« API2/Win32.pm ↑ Summary API2/Resource/Colors.pm »
1 # Code in the PDF::API2::Basic::PDF namespace was originally copied from the
2 # Text::PDF distribution.
3 #
4 # Copyright Martin Hosken <Martin_Hosken@sil.org>
5 #
6 # Martin Hosken's code may be used under the terms of the MIT license.
7 # Subsequent versions of the code have the same license as PDF::API2.
8  
9 package PDF::API2::Basic::PDF::Utils;
10  
11 41 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 41 our $VERSION = '2.049'; # VERSION
14  
15 =head1 NAME
16  
17 PDF::API2::Basic::PDF::Utils - Convenience functions for creating low-level PDF
18 objects
19  
20 =head1 DESCRIPTION
21  
22 A set of utility functions to save the fingers of the PDF library users!
23  
24 =head1 FUNCTIONS
25  
26 =cut
27  
28 41 ▶use PDF::API2::Basic::PDF::Array;
Subroutine BEGIN: called CC=1 SCAR=0.0
29 41 ▶use PDF::API2::Basic::PDF::Bool;
Subroutine BEGIN: called CC=1 SCAR=0.0
30 41 ▶use PDF::API2::Basic::PDF::Dict;
Subroutine BEGIN: called CC=1 SCAR=0.0
31 41 ▶use PDF::API2::Basic::PDF::Name;
Subroutine BEGIN: called CC=1 SCAR=0.0
32 41 ▶use PDF::API2::Basic::PDF::Null;
Subroutine BEGIN: called CC=1 SCAR=0.0
33 41 ▶use PDF::API2::Basic::PDF::Number;
Subroutine BEGIN: called CC=1 SCAR=0.0
34 41 ▶use PDF::API2::Basic::PDF::String;
Subroutine BEGIN: called CC=1 SCAR=0.0
35 41 ▶use PDF::API2::Basic::PDF::Literal;
Subroutine BEGIN: called CC=1 SCAR=0.0
36  
37 41 ▶use Exporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
38 41 ▶use vars qw(@EXPORT @ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
39 41 @ISA = qw(Exporter);
40 41 @EXPORT = qw(PDFBool PDFArray PDFDict PDFName PDFNull
41 PDFNum PDFStr PDFStrHex PDFUtf);
42  
43 =head2 PDFBool
44  
45 Creates a Bool via PDF::API2::Basic::PDF::Bool->new
46  
47 =cut
48  
49 3 ▶sub PDFBool {
Subroutine PDFBool: called CC=1 SCAR=0.0
Pod documented
50 3 return PDF::API2::Basic::PDF::Bool->new(@_);
51 }
52  
53 =head2 PDFArray
54  
55 Creates an array via PDF::API2::Basic::PDF::Array->new
56  
57 =cut
58  
59 773 ▶sub PDFArray {
Subroutine PDFArray: called CC=1 SCAR=0.0
Pod documented
60 773 return PDF::API2::Basic::PDF::Array->new(@_);
61 }
62  
63 =head2 PDFDict
64  
65 Creates a dict via PDF::API2::Basic::PDF::Dict->new
66  
67 =cut
68  
69 1095 ▶sub PDFDict {
Subroutine PDFDict: called CC=1 SCAR=0.0
Pod documented
70 1095 return PDF::API2::Basic::PDF::Dict->new(@_);
71 }
72  
73 =head2 PDFName
74  
75 Creates a name via PDF::API2::Basic::PDF::Name->new
76  
77 =cut
78  
79 16816 ▶sub PDFName {
Subroutine PDFName: called CC=1 SCAR=0.0
Pod documented
80 16816 return PDF::API2::Basic::PDF::Name->new(@_);
81 }
82  
83 =head2 PDFNull
84  
85 Creates a null via PDF::API2::Basic::PDF::Null->new
86  
87 =cut
88  
89 12 ▶sub PDFNull {
Subroutine PDFNull: called CC=1 SCAR=0.0
Pod documented
90 12 return PDF::API2::Basic::PDF::Null->new(@_);
91 }
92  
93 =head2 PDFNum
94  
95 Creates a number via PDF::API2::Basic::PDF::Number->new
96  
97 =cut
98  
99 13323 ▶sub PDFNum {
Subroutine PDFNum: called CC=1 SCAR=0.0
Pod documented
100 13323 return PDF::API2::Basic::PDF::Number->new(@_);
101 }
102  
103 =head2 PDFStr
104  
105 Creates a string via PDF::API2::Basic::PDF::String->new
106  
107 =cut
108  
109 185 ▶sub PDFStr {
Subroutine PDFStr: called CC=1 SCAR=0.0
Pod documented
110 185 return PDF::API2::Basic::PDF::String->new(@_);
111 }
112  
113 # Deprecated
114 0 ▶sub PDFUtf { return PDFStr(@_) }
Subroutine PDFUtf: not called CC=1 SCAR=6.9
Pod undocumented
115  
116 =head2 PDFStrHex
117  
118 Creates a hex-string via PDF::API2::Basic::PDF::String->new
119  
120 =cut
121  
122 1 ▶sub PDFStrHex {
Subroutine PDFStrHex: called CC=1 SCAR=0.0
Pod documented
123 1 my $string = PDF::API2::Basic::PDF::String->new(@_);
124 1 $string->{' ishex'} = 1;
125 1 return $string;
126 }
127  
128 41 1;
« API2/Win32.pm ↑ Summary API2/Resource/Colors.pm »