line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::Followme::BinaryData; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
573
|
use 5.008005; |
|
1
|
|
|
|
|
15
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
25
|
|
6
|
1
|
|
|
1
|
|
8
|
use integer; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
7
|
1
|
|
|
1
|
|
46
|
use lib '../..'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
140
|
use base qw(App::Followme::FileData); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
484
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = "2.03"; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
#---------------------------------------------------------------------- |
14
|
|
|
|
|
|
|
# Read the default parameter values |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub parameters { |
17
|
4
|
|
|
4
|
1
|
9
|
my ($self) = @_; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
return ( |
20
|
4
|
|
|
|
|
11
|
extension => '', |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
#---------------------------------------------------------------------- |
25
|
|
|
|
|
|
|
# Look in the file for the data (stub) |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub fetch_from_file { |
28
|
1
|
|
|
1
|
0
|
2
|
my ($self, $filename) = @_; |
29
|
1
|
|
|
|
|
3
|
return (); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
#---------------------------------------------------------------------- |
33
|
|
|
|
|
|
|
# Get a url from a filename |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub get_url { |
36
|
1
|
|
|
1
|
0
|
989
|
my ($self, $filename) = @_; |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
7
|
my $extension = $self->get_extension($filename); |
39
|
|
|
|
|
|
|
return $self->filename_to_url($self->{top_directory}, |
40
|
1
|
|
|
|
|
8
|
$filename, |
41
|
|
|
|
|
|
|
$extension); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
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 |