| 1 | package App::Followme::BinaryData; | ||
| 2 | |||
| 3 | 1 | ▶ | use 5.008005; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use integer; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | ▶ | use lib '../..'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 1 | ▶ | use base qw(App::Followme::FileData); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 1 | our $VERSION = "2.03"; | |
| 12 | |||
| 13 | #---------------------------------------------------------------------- | ||
| 14 | # Read the default parameter values | ||
| 15 | |||
| 16 | 4 | ▶ | sub parameters { |
|
Subroutine
parameters: called CC=1 SCAR=0.0
Pod
documented
| |||
| 17 | 4 | my ($self) = @_; | |
| 18 | |||
| 19 | return ( | ||
| 20 | 4 | extension => '', | |
| 21 | ); | ||
| 22 | } | ||
| 23 | |||
| 24 | #---------------------------------------------------------------------- | ||
| 25 | # Look in the file for the data (stub) | ||
| 26 | |||
| 27 | 1 | ▶ | sub fetch_from_file { |
|
Subroutine
fetch_from_file: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 28 | 1 | my ($self, $filename) = @_; | |
| 29 | 1 | return (); | |
| 30 | } | ||
| 31 | |||
| 32 | #---------------------------------------------------------------------- | ||
| 33 | # Get a url from a filename | ||
| 34 | |||
| 35 | 1 | ▶ | sub get_url { |
|
Subroutine
get_url: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 36 | 1 | my ($self, $filename) = @_; | |
| 37 | |||
| 38 | 1 | my $extension = $self->get_extension($filename); | |
| 39 | return $self->filename_to_url($self->{top_directory}, | ||
| 40 | 1 | $filename, | |
| 41 | $extension); | ||
| 42 | } | ||
| 43 | |||
| 44 | 1 | 1; | |
| 45 | |||
| 46 | =pod | ||
| 47 | |||
| 48 | =encoding utf-8 | ||
| 49 | |||
| 50 | =head1 NAME | ||
| 51 | |||
| 52 | App::Followme::BinaryData - Read metadata from a binary file | ||
| 53 | |||
| 54 | =head1 SYNOPSIS | ||
| 55 | |||
| 56 | use App::Followme::BinaryData; | ||
| 57 | my $data = App::Followme::BinaryData->new(); | ||
| 58 | my $html = App::Followme::Template->new('example.htm', $data); | ||
| 59 | |||
| 60 | =head1 DESCRIPTION | ||
| 61 | |||
| 62 | This module is a stub for binary files whose metadata cannot be read | ||
| 63 | from the file. | ||
| 64 | |||
| 65 | =head1 METHODS | ||
| 66 | |||
| 67 | All data classes are first instantiated by calling new and the object | ||
| 68 | created is passed to a template object. It calls the build method with an | ||
| 69 | argument name to retrieve that data item. The retrieve always fails for | ||
| 70 | a binary file. | ||
| 71 | |||
| 72 | =head1 VARIABLES | ||
| 73 | |||
| 74 | No variables are retrieved. It is assumed the format is opaque. | ||
| 75 | |||
| 76 | =head1 CONFIGURATION | ||
| 77 | |||
| 78 | This class has the following configuration variable: | ||
| 79 | |||
| 80 | =over 4 | ||
| 81 | |||
| 82 | =item extension | ||
| 83 | |||
| 84 | The file extension of the binary file. | ||
| 85 | |||
| 86 | =back | ||
| 87 | |||
| 88 | =head1 LICENSE | ||
| 89 | |||
| 90 | Copyright (C) Bernie Simon. | ||
| 91 | |||
| 92 | This library is free software; you can redistribute it and/or modify | ||
| 93 | it under the same terms as Perl itself. | ||
| 94 | |||
| 95 | =head1 AUTHOR | ||
| 96 | |||
| 97 | Bernie Simon E<lt>bernie.simon@gmail.comE<gt> | ||
| 98 | |||
| 99 | =cut | ||