| line |
true |
false |
branch |
|
14
|
0 |
3 |
$PDL::IO::CSV::Config{'ivsize'} < 8 ? : |
|
15
|
0 |
3 |
eval {
do {
require PDL::DateTime;
require Time::Moment;
1
}
} ? : |
|
16
|
0 |
3 |
$ENV{'PDL_IO_CSV_DEBUG'} ? : |
|
31
|
2 |
1 |
if grep {/^(:all|wcsv2D)$/;} @_ |
|
32
|
2 |
1 |
if grep {/^(:all|wcsv1D)$/;} @_ |
|
34
|
2 |
1 |
if @_ |
|
66
|
0 |
0 |
unless $c_pdl[$cols]->ndims == 1 |
|
73
|
0 |
0 |
if $c_pack[$cols] eq 'q' and 0 |
|
75
|
0 |
0 |
if $rows < $dim |
|
76
|
0 |
0 |
if ($bad2empty and $c_pdl[$cols]->check_badflag) |
|
84
|
0 |
0 |
unless my $csv = 'Text::CSV_XS'->new($C) |
|
85
|
0 |
0 |
if ($O->{'header'}) |
|
87
|
0 |
0 |
if $cols != $count |
|
93
|
0 |
0 |
if ($c_max_offset[$c] >= $c_offset[$c]) |
|
94
|
0 |
0 |
if ($bad2empty and $c_bad[$c]) { } |
|
96
|
0 |
0 |
if ($v ne $c_bad[$c]) |
|
98
|
0 |
0 |
if ref $c_pdl[$c] eq 'PDL::DateTime' |
|
104
|
0 |
0 |
if ref $c_pdl[$c] eq 'PDL::DateTime' |
|
118
|
0 |
0 |
unless $pdl->ndims == 2 |
|
126
|
0 |
0 |
if $pck{$type} eq 'q' and 0 |
|
132
|
0 |
0 |
if ($O->{'bad2empty'} and $p->check_badflag) |
|
138
|
0 |
0 |
unless my $csv = 'Text::CSV_XS'->new($C) |
|
139
|
0 |
0 |
if ($O->{'header'}) |
|
141
|
0 |
0 |
if $cols != $n |
|
145
|
0 |
0 |
if (defined $bad) { } |
|
146
|
0 |
0 |
$v eq $bad ? : |
|
163
|
0 |
2 |
unless my $csv = 'Text::CSV_XS'->new($C) |
|
171
|
0 |
2 |
if $O->{'debug'} |
|
175
|
0 |
2 |
if (&looks_like_number($O->{'header'})) { } |
|
|
2 |
0 |
elsif ($O->{'header'} and $O->{'header'} eq 'auto') { } |
|
176
|
0 |
0 |
if ($O->{'header'} == 1) { } |
|
194
|
3 |
0 |
if (defined $r) { } |
|
195
|
3 |
0 |
if (defined $headerdetection) |
|
198
|
8 |
3 |
if (&looks_like_number($_)) { } |
|
206
|
1 |
2 |
if ($numeric == 0) |
|
213
|
2 |
0 |
unless (defined $c_type) |
|
215
|
0 |
0 |
if $O->{'debug'} |
|
217
|
0 |
0 |
if ($dec_comma) |
|
218
|
0 |
0 |
if defined $_ |
|
220
|
0 |
0 |
if ($empty2bad) |
|
221
|
0 |
0 |
if (defined $coli) { } |
|
224
|
0 |
0 |
unless (defined $r->[$i]) |
|
229
|
0 |
0 |
unless (defined $r->[$_]) |
|
233
|
0 |
0 |
if (defined $c_dt) |
|
235
|
0 |
0 |
unless defined $c_dt->[$_] |
|
236
|
0 |
0 |
$c_dt->[$_] ne 'datetime' ? : |
|
237
|
0 |
0 |
if (defined $v) { } |
|
246
|
0 |
0 |
if ($text2bad) |
|
247
|
0 |
0 |
if (defined $coli) { } |
|
250
|
0 |
0 |
unless (&looks_like_number($r->[$i])) |
|
255
|
0 |
0 |
unless (&looks_like_number($r->[$_])) |
|
259
|
0 |
0 |
if (defined $coli) { } |
|
278
|
0 |
0 |
if ($rows > 0) |
|
280
|
0 |
0 |
if ($allocated < $processed) |
|
282
|
0 |
0 |
if $O->{'debug'} |
|
291
|
0 |
0 |
if $len != $expected_len |
|
299
|
0 |
0 |
if (ref $c_pdl eq 'ARRAY') |
|
300
|
0 |
0 |
if ($processed != $allocated) |
|
301
|
0 |
0 |
if $O->{'debug'} |
|
305
|
0 |
0 |
if (ref $headerline eq 'ARRAY') |
|
307
|
0 |
0 |
if $headerline->[$_] and $headerline->[$_] ne '' |
|
322
|
0 |
2 |
unless my $csv = 'Text::CSV_XS'->new($C) |
|
333
|
0 |
2 |
if $O->{'debug'} |
|
341
|
10 |
2 |
if (defined $r) { } |
|
342
|
2 |
8 |
unless (defined $pck) |
|
344
|
0 |
2 |
if $O->{'debug'} |
|
346
|
0 |
2 |
if $O->{'header'} |
|
348
|
0 |
10 |
if ($dec_comma) |
|
349
|
0 |
0 |
if defined $_ |
|
351
|
0 |
10 |
if ($empty2bad) |
|
352
|
0 |
0 |
if (defined $coli) { } |
|
355
|
0 |
0 |
unless (defined $r->[$i]) |
|
360
|
0 |
0 |
unless (defined $r->[$_]) |
|
364
|
0 |
10 |
if ($text2bad) |
|
365
|
0 |
0 |
if (defined $coli) { } |
|
368
|
0 |
0 |
unless (&looks_like_number($r->[$i])) |
|
373
|
0 |
0 |
unless (&looks_like_number($r->[$_])) |
|
377
|
0 |
10 |
if (defined $coli) { } |
|
396
|
2 |
0 |
if ($rows > 0) |
|
398
|
0 |
2 |
if ($allocated < $processed) |
|
400
|
0 |
0 |
if $O->{'debug'} |
|
406
|
0 |
2 |
if $len != $expected_len |
|
414
|
2 |
0 |
if (&blessed($c_pdl) and $c_pdl->isa('PDL')) |
|
415
|
2 |
0 |
if ($processed != $allocated) |
|
416
|
0 |
2 |
if $O->{'debug'} |
|
438
|
0 |
0 |
ref $_[-1] eq 'HASH' ? : |
|
439
|
0 |
0 |
!(&blessed($_[-1]) && $_[-1]->isa('PDL')) ? : |
|
446
|
0 |
0 |
unless defined $O->{'debug'} |
|
447
|
0 |
0 |
unless defined $O->{'bad2empty'} |
|
448
|
0 |
0 |
$fn eq '1D' ? : |
|
|
0 |
0 |
unless defined $O->{'header'} |
|
451
|
0 |
0 |
unless defined $C->{'sep_char'} |
|
452
|
0 |
0 |
unless defined $C->{'eol'} |
|
454
|
0 |
0 |
if (defined $O->{'header'}) |
|
455
|
0 |
0 |
unless ref $O->{'header'} eq 'ARRAY' or $O->{'header'} eq 'auto' |
|
456
|
0 |
0 |
if ($O->{'header'} eq 'auto') |
|
461
|
0 |
0 |
if defined $n |
|
463
|
0 |
0 |
$count > 0 ? : |
|
468
|
0 |
0 |
if (not defined $filename_or_fh) { } |
|
|
0 |
0 |
elsif (&openhandle($filename_or_fh)) { } |
|
475
|
0 |
0 |
unless open $fh, '>', $filename_or_fh |
|
477
|
0 |
0 |
if $O->{'encoding'} |
|
483
|
1 |
3 |
ref $_[-1] eq 'HASH' ? : |
|
486
|
0 |
4 |
if defined $coli and ref $coli ne 'ARRAY' |
|
487
|
0 |
4 |
unless defined $filename_or_fh |
|
495
|
2 |
2 |
$fn eq '1D' ? : |
|
496
|
1 |
2 |
$fn eq '1D' ? : |
|
497
|
3 |
1 |
unless defined $O->{'detect_datetime'} |
|
498
|
1 |
3 |
if ($O->{'detect_datetime'} =~ /%/) |
|
502
|
4 |
0 |
unless defined $O->{'debug'} |
|
505
|
0 |
4 |
if $O->{'reshape_inc'} < $O->{'fetch_chunk'} |
|
508
|
4 |
0 |
unless defined $C->{'sep_char'} |
|
511
|
0 |
4 |
if ($O->{'empty2bad'}) |
|
516
|
0 |
4 |
if $O->{'decimal_comma'} and $C->{'sep_char'} eq ',' |
|
519
|
0 |
4 |
if (&openhandle($filename_or_fh)) { } |
|
523
|
0 |
4 |
unless open $fh, '<', $filename_or_fh |
|
525
|
0 |
4 |
if $O->{'encoding'} |
|
534
|
2 |
0 |
if (not defined $coli) { } |
|
541
|
0 |
2 |
unless $cols and $cols > 0 and $cols <= $colcount |
|
551
|
0 |
2 |
if (ref $O->{'type'} eq 'ARRAY') { } |
|
560
|
2 |
0 |
if (not defined $c_type[$_] or $c_type[$_] eq 'auto') { } |
|
|
0 |
0 |
elsif ($c_type[$_] eq 'datetime') { } |
|
|
0 |
0 |
elsif ($c_type[$_] =~ /%/) { } |
|
562
|
2 |
0 |
if ($O->{'detect_datetime'}) |
|
564
|
0 |
0 |
$O->{'strptime'} ? : |
|
565
|
0 |
0 |
if (defined $v) |
|
566
|
0 |
0 |
$O->{'strptime'} ? : |
|
580
|
0 |
0 |
unless $c_type[$_] |
|
585
|
0 |
0 |
unless defined $c_type[$_] |
|
587
|
0 |
0 |
if $c_pack[$_] eq 'q' and 0 |
|
588
|
0 |
0 |
unless $c_pack[$_] |
|
590
|
0 |
0 |
$c_dt[$_] ? : |
|
595
|
0 |
0 |
if $big != $c_sizeof[$_] |
|
598
|
0 |
0 |
@c_dt > 0 ? : |
|
605
|
2 |
0 |
if (not defined $coli) { } |
|
612
|
0 |
2 |
unless $cols and $cols > 0 and $cols <= $colcount |
|
616
|
0 |
2 |
if $c_pack eq 'q' and 0 |
|
617
|
0 |
2 |
unless $c_pack |
|
626
|
0 |
2 |
if $big != $c_sizeof |