| 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::Null; | ||
| 10 | |||
| 11 | 40 | ▶ | use base 'PDF::API2::Basic::PDF::Objind'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | 40 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | 40 | our $VERSION = '2.044'; # VERSION | |
| 16 | |||
| 17 | =head1 NAME | ||
| 18 | |||
| 19 | PDF::API2::Basic::PDF::Null - Low-level PDF null object | ||
| 20 | |||
| 21 | =head1 METHODS | ||
| 22 | |||
| 23 | =cut | ||
| 24 | |||
| 25 | # There is only one null object (section 3.2.8). | ||
| 26 | 40 | my $null_obj = bless {}, 'PDF::API2::Basic::PDF::Null'; | |
| 27 | |||
| 28 | =head2 PDF::API2::Basic::PDF::Null->new | ||
| 29 | |||
| 30 | Returns the null object. There is only one null object. | ||
| 31 | |||
| 32 | =cut | ||
| 33 | |||
| 34 | sub new { | ||
| 35 | 12 | ▶ | return $null_obj; |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 36 | } | ||
| 37 | |||
| 38 | =head2 $s->realise | ||
| 39 | |||
| 40 | Pretends to finish reading the object. | ||
| 41 | |||
| 42 | =cut | ||
| 43 | |||
| 44 | sub realise { | ||
| 45 | 0 | ▶ | return $null_obj; |
|
Subroutine
realise: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 46 | } | ||
| 47 | |||
| 48 | =head2 $s->outobjdeep | ||
| 49 | |||
| 50 | Output the object in PDF format. | ||
| 51 | |||
| 52 | =cut | ||
| 53 | |||
| 54 | sub outobjdeep { | ||
| 55 | 12 | ▶ | my ($self, $fh, $pdf) = @_; |
|
Subroutine
outobjdeep: called CC=1 SCAR=0.0
Pod
documented
| |||
| 56 | 12 | $fh->print('null'); | |
| 57 | } | ||
| 58 | |||
| 59 | =head2 $s->is_obj | ||
| 60 | |||
| 61 | Returns false because null is not a full object. | ||
| 62 | |||
| 63 | =cut | ||
| 64 | |||
| 65 | sub is_obj { | ||
| 66 | 0 | ▶ | return 0; |
|
Subroutine
is_obj: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 67 | } | ||
| 68 | |||
| 69 | =head2 $s->copy | ||
| 70 | |||
| 71 | Another no-op. | ||
| 72 | |||
| 73 | =cut | ||
| 74 | |||
| 75 | sub copy { | ||
| 76 | 0 | ▶ | return $null_obj; |
|
Subroutine
copy: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 77 | } | ||
| 78 | |||
| 79 | =head2 $s->val | ||
| 80 | |||
| 81 | Return undef. | ||
| 82 | |||
| 83 | =cut | ||
| 84 | |||
| 85 | sub val { | ||
| 86 | 0 | ▶ | return undef; ## no critic (undef is intentional) |
|
Subroutine
val: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 87 | } | ||
| 88 | |||
| 89 | 40 | 1; | |