WriteExcel/Chart/External.pm untested

filter: Statementstmt 0.0% 0 / 33 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 46 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
_initialize
2.0
_close
2.0
CRAP 2.0
1 package Spreadsheet::WriteExcel::Chart::External;
2  
3 ###############################################################################
4 #
5 # External - A writer class for Excel external charts.
6 #
7 # Used in conjunction with Spreadsheet::WriteExcel
8 #
9 # perltidy with options: -mbl=2 -pt=0 -nola
10 #
11 # Copyright 2000-2010, John McNamara, jmcnamara@cpan.org
12 #
13 # Documentation after __END__
14 #
15  
16 require Exporter;
17  
18 use strict;
19 use Spreadsheet::WriteExcel::Chart;
20  
21  
22 use vars qw($VERSION @ISA);
23 @ISA = qw(Spreadsheet::WriteExcel::Chart Exporter);
24  
25 $VERSION = '2.40';
26  
27 ###############################################################################
28 #
29 # new()
30 #
31 #
32 sub new {
33  
34 my $class = shift;
35 my $external_filename = shift;
36 my $self = Spreadsheet::WriteExcel::Chart->new( @_ );
37  
38 $self->{_filename} = $external_filename;
39 $self->{_external_bin} = 1;
40  
41 bless $self, $class;
42 $self->_initialize(); # Requires overridden initialize().
43 return $self;
44 }
45  
46 ###############################################################################
47 #
48 # _initialize()
49 #
50 # Read all the data into memory for the external binary style chart.
51 #
52 #
53 sub _initialize {
54  
55 my $self = shift;
56  
57 my $filename = $self->{_filename};
58 my $filehandle = FileHandle->new( $filename )
59 or die "Couldn't open $filename in add_chart_ext(): $!.\n";
60  
61 binmode( $filehandle );
62  
63 $self->{_filehandle} = $filehandle;
64 $self->{_datasize} = -s $filehandle;
65 $self->{_using_tmpfile} = 0;
66  
67 # Read the entire external chart binary into the data buffer.
68 # This will be retrieved by _get_data() when the chart is closed().
69 read( $self->{_filehandle}, $self->{_data}, $self->{_datasize} );
70 }
71  
72  
73 ###############################################################################
74 #
75 # _close()
76 #
77 # We don't need to create or store Chart data structures when using an
78 # external binary, so we have a default close method.
79 #
80 sub _close {
81  
82 my $self = shift;
83  
84 return undef;
85 }
86  
87 1;
88  
89  
90 __END__