line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Spreadsheet::XLSX::Reader::LibXML::Types; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:JANDREW'; |
3
|
9
|
|
|
9
|
|
130048
|
use version; our $VERSION = qv('v0.38.18'); |
|
9
|
|
|
|
|
3408
|
|
|
9
|
|
|
|
|
92
|
|
4
|
|
|
|
|
|
|
###LogSD warn "You uncovered internal logging statements for Spreadsheet::XLSX::Reader::LibXML::Types-$VERSION"; |
5
|
|
|
|
|
|
|
|
6
|
9
|
|
|
9
|
|
1002
|
use strict; |
|
9
|
|
|
|
|
19
|
|
|
9
|
|
|
|
|
257
|
|
7
|
9
|
|
|
9
|
|
49
|
use warnings; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
299
|
|
8
|
9
|
|
|
9
|
|
1949
|
use Type::Utils -all; |
|
9
|
|
|
|
|
24139
|
|
|
9
|
|
|
|
|
87
|
|
9
|
|
|
|
|
|
|
use Type::Library 1.000 |
10
|
9
|
|
|
|
|
72
|
-base, |
11
|
|
|
|
|
|
|
-declare => qw( |
12
|
|
|
|
|
|
|
XMLFile XLSXFile ParserType |
13
|
|
|
|
|
|
|
NegativeNum ZeroOrUndef NotNegativeNum |
14
|
|
|
|
|
|
|
IOFileType ErrorString SubString |
15
|
|
|
|
|
|
|
CellID PositiveNum Excel_number_0 |
16
|
|
|
|
|
|
|
SpecialZeroScientific SpecialOneScientific SpecialTwoScientific |
17
|
|
|
|
|
|
|
SpecialThreeScientific SpecialFourScientific SpecialFiveScientific |
18
|
|
|
|
|
|
|
SpecialDecimal |
19
|
9
|
|
|
9
|
|
26045
|
);# |
|
9
|
|
|
|
|
261
|
|
20
|
9
|
|
|
9
|
|
25300
|
use IO::File; |
|
9
|
|
|
|
|
61621
|
|
|
9
|
|
|
|
|
1462
|
|
21
|
9
|
|
|
9
|
|
59
|
BEGIN{ extends "Types::Standard" }; |
22
|
|
|
|
|
|
|
my $try_xs = |
23
|
|
|
|
|
|
|
exists($ENV{PERL_TYPE_TINY_XS}) ? !!$ENV{PERL_TYPE_TINY_XS} : |
24
|
|
|
|
|
|
|
exists($ENV{PERL_ONLY}) ? !$ENV{PERL_ONLY} : |
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
if( $try_xs and exists $INC{'Type/Tiny/XS.pm'} ){ |
27
|
|
|
|
|
|
|
eval "use Type::Tiny::XS 0.010"; |
28
|
|
|
|
|
|
|
if( $@ ){ |
29
|
|
|
|
|
|
|
die "You have loaded Type::Tiny::XS but versions prior to 0.010 will cause this module to fail"; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
#########1 Package Variables 3#########4#########5#########6#########7#########8#########9 |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
#########1 Type Library 3#########4#########5#########6#########7#########8#########9 |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
declare XMLFile, |
40
|
|
|
|
|
|
|
as Str, |
41
|
|
|
|
|
|
|
where{ $_ =~ /\.xml$/i and -r $_}, |
42
|
|
|
|
|
|
|
message{ |
43
|
|
|
|
|
|
|
( $_ !~ /\.xml$/i ) ? |
44
|
|
|
|
|
|
|
"The string -$_- does not have an xml file extension" : |
45
|
|
|
|
|
|
|
( !-r $_ ) ? |
46
|
|
|
|
|
|
|
"Could not find / read the file: $_" : |
47
|
|
|
|
|
|
|
'No value passed to the XMLFile test'; |
48
|
|
|
|
|
|
|
}; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
declare XLSXFile, |
51
|
|
|
|
|
|
|
as Str, |
52
|
|
|
|
|
|
|
where{ $_ =~ /\.xls(x|m)$/i and -r $_ }, |
53
|
|
|
|
|
|
|
message{ |
54
|
|
|
|
|
|
|
my $test = $_; |
55
|
|
|
|
|
|
|
my $return = |
56
|
|
|
|
|
|
|
( !defined $test ) ? |
57
|
|
|
|
|
|
|
"Empty filename" : |
58
|
|
|
|
|
|
|
( ref $test ) ? |
59
|
|
|
|
|
|
|
"'" . $test . "' is not a string value" : |
60
|
|
|
|
|
|
|
( $test !~ /\.xls(x|m)$/i ) ? |
61
|
|
|
|
|
|
|
"The string -$test- does not have an xlsx file extension" : |
62
|
|
|
|
|
|
|
( -r $test) ? |
63
|
|
|
|
|
|
|
"Could not find / read the file: $test" : |
64
|
|
|
|
|
|
|
"Unmanageable value '" . ($test ? $test : '' ) . "' passed" ; |
65
|
|
|
|
|
|
|
return $return; |
66
|
|
|
|
|
|
|
}; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
declare IOFileType, |
69
|
|
|
|
|
|
|
as InstanceOf[ 'IO::File' ]; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
coerce IOFileType, |
72
|
|
|
|
|
|
|
from GlobRef, |
73
|
|
|
|
|
|
|
via{ bless $_, 'IO::File' }; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
coerce IOFileType, |
76
|
|
|
|
|
|
|
from XLSXFile, |
77
|
|
|
|
|
|
|
via{ IO::File->new( $_, 'r' ); }; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
coerce IOFileType, |
80
|
|
|
|
|
|
|
from XMLFile, |
81
|
|
|
|
|
|
|
via{ IO::File->new( $_, 'r' ); }; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
declare ParserType, |
84
|
|
|
|
|
|
|
as Enum[qw( reader )];#dom sax |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
coerce ParserType, |
87
|
|
|
|
|
|
|
from Str, |
88
|
|
|
|
|
|
|
via{ lc( $_ ) }; |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
declare CellID, |
91
|
|
|
|
|
|
|
as StrMatch[ qr/^[A-Z]{1,3}[1-9]\d*$/ ]; |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
declare PositiveNum, |
94
|
|
|
|
|
|
|
as Num, |
95
|
|
|
|
|
|
|
where{ $_ > 0 }; |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
declare NegativeNum, |
98
|
|
|
|
|
|
|
as Num, |
99
|
|
|
|
|
|
|
where{ $_ < 0 }; |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
declare ZeroOrUndef, |
102
|
|
|
|
|
|
|
as Maybe[Num], |
103
|
|
|
|
|
|
|
where{ !$_ }; |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
declare NotNegativeNum, |
106
|
|
|
|
|
|
|
as Num, |
107
|
|
|
|
|
|
|
where{ $_ > -1 }; |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
declare SubString, |
110
|
|
|
|
|
|
|
as Str; |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
declare ErrorString, |
113
|
|
|
|
|
|
|
as SubString, |
114
|
|
|
|
|
|
|
where{ $_ !~ /\)\n;/ }; |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
coerce SubString, |
117
|
|
|
|
|
|
|
from Object, |
118
|
|
|
|
|
|
|
via{ |
119
|
|
|
|
|
|
|
my $object = $_; |
120
|
|
|
|
|
|
|
if( $object->can( 'as_string' ) ){ |
121
|
|
|
|
|
|
|
return $object->as_string; |
122
|
|
|
|
|
|
|
}elsif( $object->can( 'message' ) ){ |
123
|
|
|
|
|
|
|
return $object->message; |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
return $object; |
126
|
|
|
|
|
|
|
}; |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
coerce ErrorString, |
129
|
|
|
|
|
|
|
from SubString->coercibles, |
130
|
|
|
|
|
|
|
via{ |
131
|
|
|
|
|
|
|
my $tmp = to_SubString($_); |
132
|
|
|
|
|
|
|
$tmp =~ s/\)\n;/\);/g; |
133
|
|
|
|
|
|
|
return $tmp; |
134
|
|
|
|
|
|
|
}; |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
declare SpecialZeroScientific, |
137
|
|
|
|
|
|
|
as Str, |
138
|
|
|
|
|
|
|
where{ return $_ =~ /^\-?[0-9]+E-?\d{2,50}/i };#print "--$_\n"; |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
coerce SpecialZeroScientific, |
141
|
|
|
|
|
|
|
from Str, |
142
|
|
|
|
|
|
|
via{ |
143
|
|
|
|
|
|
|
my $string = $_; |
144
|
|
|
|
|
|
|
$string =~ /([\-\d\.]+)[Ee](-)?(\d+)/i;# |
145
|
|
|
|
|
|
|
#~ print "$1\n"; |
146
|
|
|
|
|
|
|
#~ print "$2\n"; |
147
|
|
|
|
|
|
|
#~ print "$3\n"; |
148
|
|
|
|
|
|
|
my $return = sprintf '%.0f', $1; |
149
|
|
|
|
|
|
|
#~ print "$return\n"; |
150
|
|
|
|
|
|
|
$return .= 'E' . sprintf '%s%02d', $2, $3; |
151
|
|
|
|
|
|
|
#~ print "$return\n"; |
152
|
|
|
|
|
|
|
return $return; |
153
|
|
|
|
|
|
|
}; |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
declare SpecialOneScientific, |
156
|
|
|
|
|
|
|
as Str, |
157
|
|
|
|
|
|
|
where{ return $_ =~ /^\-?[0-9]+\.\dE-?\d{2,50}/i };#print "--$_\n"; |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
coerce SpecialOneScientific, |
160
|
|
|
|
|
|
|
from Str, |
161
|
|
|
|
|
|
|
via{ |
162
|
|
|
|
|
|
|
my $string = $_; |
163
|
|
|
|
|
|
|
$string =~ /([\-\d\.]+)[Ee](-)?(\d+)/i;# |
164
|
|
|
|
|
|
|
#~ print "$1\n"; |
165
|
|
|
|
|
|
|
#~ print "$2\n"; |
166
|
|
|
|
|
|
|
#~ print "$3\n"; |
167
|
|
|
|
|
|
|
my $return = sprintf '%.1f', $1; |
168
|
|
|
|
|
|
|
#~ print "$return\n"; |
169
|
|
|
|
|
|
|
$return .= 'E' . sprintf '%s%02d', $2, $3; |
170
|
|
|
|
|
|
|
#~ print "$return\n"; |
171
|
|
|
|
|
|
|
return $return; |
172
|
|
|
|
|
|
|
}; |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
declare SpecialTwoScientific, |
175
|
|
|
|
|
|
|
as Str, |
176
|
|
|
|
|
|
|
where{ return $_ =~ /^\-?[0-9]+\.\d{2}E-?\d{2,50}/i };#print "--$_\n"; |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
coerce SpecialTwoScientific, |
179
|
|
|
|
|
|
|
from Str, |
180
|
|
|
|
|
|
|
via{ |
181
|
|
|
|
|
|
|
my $string = $_; |
182
|
|
|
|
|
|
|
$string =~ /([\-\d\.]+)[Ee](-)?(\d+)/i;# |
183
|
|
|
|
|
|
|
#~ print "$1\n"; |
184
|
|
|
|
|
|
|
#~ print "$2\n"; |
185
|
|
|
|
|
|
|
#~ print "$3\n"; |
186
|
|
|
|
|
|
|
my $return = sprintf '%.2f', $1; |
187
|
|
|
|
|
|
|
#~ print "$return\n"; |
188
|
|
|
|
|
|
|
$return .= 'E' . sprintf '%s%02d', $2, $3; |
189
|
|
|
|
|
|
|
#~ print "$return\n"; |
190
|
|
|
|
|
|
|
return $return; |
191
|
|
|
|
|
|
|
}; |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
declare SpecialThreeScientific, |
194
|
|
|
|
|
|
|
as Str, |
195
|
|
|
|
|
|
|
where{ return $_ =~ /^\-?[0-9]+\.\d{3}E-?\d{2,50}/i };#print "--$_\n"; |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
coerce SpecialThreeScientific, |
198
|
|
|
|
|
|
|
from Str, |
199
|
|
|
|
|
|
|
via{ |
200
|
|
|
|
|
|
|
my $string = $_; |
201
|
|
|
|
|
|
|
$string =~ /([\-\d\.]+)[Ee](-)?(\d+)/i;# |
202
|
|
|
|
|
|
|
#~ print "$1\n"; |
203
|
|
|
|
|
|
|
#~ print "$2\n"; |
204
|
|
|
|
|
|
|
#~ print "$3\n"; |
205
|
|
|
|
|
|
|
my $return = sprintf '%.3f', $1; |
206
|
|
|
|
|
|
|
#~ print "$return\n"; |
207
|
|
|
|
|
|
|
$return .= 'E' . sprintf '%s%02d', $2, $3; |
208
|
|
|
|
|
|
|
#~ print "$return\n"; |
209
|
|
|
|
|
|
|
return $return; |
210
|
|
|
|
|
|
|
}; |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
declare SpecialFourScientific, |
213
|
|
|
|
|
|
|
as Str, |
214
|
|
|
|
|
|
|
where{ return $_ =~ /^\-?[0-9]+\.\d{4}E-?\d{2,50}/i };#print "--$_\n"; |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
coerce SpecialFourScientific, |
217
|
|
|
|
|
|
|
from Str, |
218
|
|
|
|
|
|
|
via{ |
219
|
|
|
|
|
|
|
my $string = $_; |
220
|
|
|
|
|
|
|
$string =~ /([\-\d\.]+)[Ee](-)?(\d+)/i;# |
221
|
|
|
|
|
|
|
#~ print "$1\n"; |
222
|
|
|
|
|
|
|
#~ print "$2\n"; |
223
|
|
|
|
|
|
|
#~ print "$3\n"; |
224
|
|
|
|
|
|
|
my $return = sprintf '%.4f', $1; |
225
|
|
|
|
|
|
|
#~ print "$return\n"; |
226
|
|
|
|
|
|
|
$return .= 'E' . sprintf '%s%02d', $2, $3; |
227
|
|
|
|
|
|
|
#~ print "$return\n"; |
228
|
|
|
|
|
|
|
return $return; |
229
|
|
|
|
|
|
|
}; |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
declare SpecialFiveScientific, |
232
|
|
|
|
|
|
|
as Str, |
233
|
|
|
|
|
|
|
where{ return $_ =~ /^\-?[0-9]+\.\d{5}E-?\d{2,50}/i };#print "--$_\n"; |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
coerce SpecialFiveScientific, |
236
|
|
|
|
|
|
|
from Str, |
237
|
|
|
|
|
|
|
via{ |
238
|
|
|
|
|
|
|
my $string = $_; |
239
|
|
|
|
|
|
|
$string =~ /([\-\d\.]+)[Ee](-)?(\d+)/i;# |
240
|
|
|
|
|
|
|
#~ print "$1\n"; |
241
|
|
|
|
|
|
|
#~ print "$2\n"; |
242
|
|
|
|
|
|
|
#~ print "$3\n"; |
243
|
|
|
|
|
|
|
my $return = sprintf '%.5f', $1; |
244
|
|
|
|
|
|
|
#~ print "$return\n"; |
245
|
|
|
|
|
|
|
$return .= 'E' . sprintf '%s%02d', $2, $3; |
246
|
|
|
|
|
|
|
#~ print "$return\n"; |
247
|
|
|
|
|
|
|
return $return; |
248
|
|
|
|
|
|
|
}; |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
declare SpecialDecimal, |
251
|
|
|
|
|
|
|
as Str, |
252
|
|
|
|
|
|
|
where{ return $_ =~ /\.\d{1,9}$/i };#print "--$_\n"; |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
coerce SpecialDecimal, |
255
|
|
|
|
|
|
|
from Str, |
256
|
|
|
|
|
|
|
via{ |
257
|
|
|
|
|
|
|
my $string = $_; |
258
|
|
|
|
|
|
|
my $return = sprintf '%.9f', $string; |
259
|
|
|
|
|
|
|
#~ print "$return\n"; |
260
|
|
|
|
|
|
|
$return =~ /(.*[1-9])(0*)$/; |
261
|
|
|
|
|
|
|
my $significant_decimal = $1; |
262
|
|
|
|
|
|
|
#~ print "$significant_decimal\n"; |
263
|
|
|
|
|
|
|
return $significant_decimal; |
264
|
|
|
|
|
|
|
}; |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
#########1 Excel Defined Converions 4#########5#########6#########7#########8#########9 |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
declare_coercion Excel_number_0, |
270
|
|
|
|
|
|
|
to_type Any, from Maybe[Any], |
271
|
|
|
|
|
|
|
via{ $_ }; |
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
#########1 Public Attributes 3#########4#########5#########6#########7#########8#########9 |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
#########1 Private Methods 3#########4#########5#########6#########7#########8#########9 |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
#########1 Phinish 3#########4#########5#########6#########7#########8#########9 |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
283
|
|
|
|
|
|
|
1; |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
#########1 Documentation 3#########4#########5#########6#########7#########8#########9 |
286
|
|
|
|
|
|
|
__END__ |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
=head1 NAME |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
Spreadsheet::XLSX::Reader::LibXML::Types - A type library for the LibXML xlsx reader |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
=head1 DESCRIPTION |
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
This documentation is written to explain ways to use this module. To use the general |
295
|
|
|
|
|
|
|
package for excel parsing out of the box please review the documentation for L<Workbooks |
296
|
|
|
|
|
|
|
|Spreadsheet::XLSX::Reader::LibXML>, L<Worksheets |
297
|
|
|
|
|
|
|
|Spreadsheet::XLSX::Reader::LibXML::Worksheet>, and |
298
|
|
|
|
|
|
|
L<Cells|Spreadsheet::XLSX::Reader::LibXML::Cell>. |
299
|
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
This is a L<Type::Library|Type::Tiny::Manual::Libraries> for this package. There are no |
301
|
|
|
|
|
|
|
real tricks here outside of the standard Type::Tiny stuf. For the cool number and date |
302
|
|
|
|
|
|
|
formatting implementation see L<Spreadsheet::XLSX::Reader::LibXML::ParseExcelFormatStrings>. |
303
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
=head1 TYPES |
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
=head2 XMLFile |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
This type checks that the value is a readable file (full path - no file find magic |
309
|
|
|
|
|
|
|
used) with an \.xml extention |
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
=head3 coercions |
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
none |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
=head2 XLSXFile |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
This type checks that the value is a readable file (full path - no file find magic |
318
|
|
|
|
|
|
|
used) with an \.xlsx or \.xlsm extention |
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
=head3 coercions |
321
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
none |
323
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
=head2 IOFileType |
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
This is set as an L<instance of|Types::Standard/InstanceOf[`a]> 'IO::File' |
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
=head3 coercions |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
=over |
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
B<GlobRef:> by blessing it into an IO::File instance 'via{ bless $_, 'IO::File' }' |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
B<XLSXFile:> by opening it as an IO::File instance 'via{ IO::File->new( $_, 'r' ); }' |
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
B<XMLFile:> by opening it as an IO::File instance 'via{ IO::File->new( $_, 'r' ); }' |
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
=back |
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
=head2 ParserType |
341
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
For now this type checks that the parser type string == 'reader'. As future parser |
343
|
|
|
|
|
|
|
types are added to the package I will update this type. |
344
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
=head3 coercions |
346
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
=over |
348
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
B<Str:> this will lower case any other version of the string 'reader' (Reader| READER) |
350
|
|
|
|
|
|
|
to get it to pass |
351
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
=back |
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
=head2 PositiveNum |
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
This type checks that the value is a number and is greater than 0 |
357
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
=head3 coercions |
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
none |
361
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
=head2 NegativeNum |
363
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
This type checks that the value is a number and is less than 0 |
365
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
=head3 coercions |
367
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
none |
369
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
=head2 ZeroOrUndef |
371
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
This type allows the value to be the number 0 or undef |
373
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
=head3 coercions |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
none |
377
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
=head2 NotNegativeNum |
379
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
This type checks that the value is a number and that the number is greater than |
381
|
|
|
|
|
|
|
or equal to 0 |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
=head3 coercions |
384
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
none |
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
=head2 CellID |
388
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
this is a value that passes the following regular expression test; qr/^[A-Z]{1,3}[1-9]\d*$/ |
390
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
=head3 coercions |
392
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
none |
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
=head2 SubString |
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
This is a precurser type to ErrorString. It is used to perform the first layer of coersions |
398
|
|
|
|
|
|
|
so that error objects can be consumed as-is in this package when a subcomponent throws an |
399
|
|
|
|
|
|
|
object rather than a string as an error. |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
=head3 coercions |
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
=over |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
B<Object:> it will test the object for two methods and if either one is present it will use |
406
|
|
|
|
|
|
|
the results of that method as the string. The methods in order are; 'as_string' and 'message' |
407
|
|
|
|
|
|
|
|
408
|
|
|
|
|
|
|
=back |
409
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
=head2 ErrorString |
411
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
This is a string that can't match the following sequence /\)\n;/ |
413
|
|
|
|
|
|
|
#I don't even remember why that sequence is bad but it is |
414
|
|
|
|
|
|
|
|
415
|
|
|
|
|
|
|
=head3 coercions |
416
|
|
|
|
|
|
|
|
417
|
|
|
|
|
|
|
=over |
418
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
B<SubString:> by using the following substitution on the string; s/\)\n;/\);/g |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
=back |
422
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
=head1 NAMED COERCIONS |
424
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
=head2 Excel_number_0 |
426
|
|
|
|
|
|
|
|
427
|
|
|
|
|
|
|
This is essentially a pass through coercion used as a convenience rather than writing the |
428
|
|
|
|
|
|
|
pass through each time a coercion is needed but no actual work should be performed on the |
429
|
|
|
|
|
|
|
value |
430
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
=head1 SUPPORT |
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
=over |
434
|
|
|
|
|
|
|
|
435
|
|
|
|
|
|
|
L<github Spreadsheet::XLSX::Reader::LibXML/issues |
436
|
|
|
|
|
|
|
|https://github.com/jandrew/Spreadsheet-XLSX-Reader-LibXML/issues> |
437
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
=back |
439
|
|
|
|
|
|
|
|
440
|
|
|
|
|
|
|
=head1 TODO |
441
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
=over |
443
|
|
|
|
|
|
|
|
444
|
|
|
|
|
|
|
B<1.> The ErrorString type tests still needs a 'fail' case |
445
|
|
|
|
|
|
|
|
446
|
|
|
|
|
|
|
=back |
447
|
|
|
|
|
|
|
|
448
|
|
|
|
|
|
|
=head1 AUTHOR |
449
|
|
|
|
|
|
|
|
450
|
|
|
|
|
|
|
=over |
451
|
|
|
|
|
|
|
|
452
|
|
|
|
|
|
|
=item Jed Lund |
453
|
|
|
|
|
|
|
|
454
|
|
|
|
|
|
|
=item jandrew@cpan.org |
455
|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
=back |
457
|
|
|
|
|
|
|
|
458
|
|
|
|
|
|
|
=head1 COPYRIGHT |
459
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
This program is free software; you can redistribute |
461
|
|
|
|
|
|
|
it and/or modify it under the same terms as Perl itself. |
462
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
The full text of the license can be found in the |
464
|
|
|
|
|
|
|
LICENSE file included with this module. |
465
|
|
|
|
|
|
|
|
466
|
|
|
|
|
|
|
This software is copyrighted (c) 2014, 2015 by Jed Lund |
467
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
=head1 DEPENDENCIES |
469
|
|
|
|
|
|
|
|
470
|
|
|
|
|
|
|
=over |
471
|
|
|
|
|
|
|
|
472
|
|
|
|
|
|
|
L<Spreadsheet::XLSX::Reader::LibXML> |
473
|
|
|
|
|
|
|
|
474
|
|
|
|
|
|
|
=back |
475
|
|
|
|
|
|
|
|
476
|
|
|
|
|
|
|
=head1 SEE ALSO |
477
|
|
|
|
|
|
|
|
478
|
|
|
|
|
|
|
=over |
479
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
L<Spreadsheet::ParseExcel> - Excel 2003 and earlier |
481
|
|
|
|
|
|
|
|
482
|
|
|
|
|
|
|
L<Spreadsheet::XLSX> - 2007+ |
483
|
|
|
|
|
|
|
|
484
|
|
|
|
|
|
|
L<Spreadsheet::ParseXLSX> - 2007+ |
485
|
|
|
|
|
|
|
|
486
|
|
|
|
|
|
|
L<Log::Shiras|https://github.com/jandrew/Log-Shiras> |
487
|
|
|
|
|
|
|
|
488
|
|
|
|
|
|
|
=over |
489
|
|
|
|
|
|
|
|
490
|
|
|
|
|
|
|
All lines in this package that use Log::Shiras are commented out |
491
|
|
|
|
|
|
|
|
492
|
|
|
|
|
|
|
=back |
493
|
|
|
|
|
|
|
|
494
|
|
|
|
|
|
|
=back |
495
|
|
|
|
|
|
|
|
496
|
|
|
|
|
|
|
=cut |
497
|
|
|
|
|
|
|
|
498
|
|
|
|
|
|
|
#########1#########2 main pod documentation end 5#########6#########7#########8#########9 |