| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package File::Find::Rule::DWG; |
|
2
|
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
95518
|
use base qw(File::Find::Rule); |
|
|
4
|
|
|
|
|
30
|
|
|
|
4
|
|
|
|
|
1547
|
|
|
4
|
4
|
|
|
4
|
|
17267
|
use strict; |
|
|
4
|
|
|
|
|
9
|
|
|
|
4
|
|
|
|
|
82
|
|
|
5
|
4
|
|
|
4
|
|
20
|
use warnings; |
|
|
4
|
|
|
|
|
7
|
|
|
|
4
|
|
|
|
|
148
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
2026
|
use CAD::AutoCAD::Detect qw(detect_dwg_file); |
|
|
4
|
|
|
|
|
133237
|
|
|
|
4
|
|
|
|
|
75
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = 0.03; |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Detect DWG. |
|
12
|
|
|
|
|
|
|
sub File::Find::Rule::dwg { |
|
13
|
1
|
|
|
1
|
0
|
239
|
my $file_find_rule = shift; |
|
14
|
1
|
|
|
|
|
5
|
my $self = $file_find_rule->_force_object; |
|
15
|
|
|
|
|
|
|
return $self->file->exec(sub{ |
|
16
|
4
|
|
|
4
|
|
1658
|
my $file = shift; |
|
17
|
4
|
|
|
|
|
16
|
return detect_dwg_file($file); |
|
18
|
1
|
|
|
|
|
43
|
}); |
|
19
|
|
|
|
|
|
|
} |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# Detect DWG magic. |
|
22
|
|
|
|
|
|
|
sub File::Find::Rule::dwg_magic { |
|
23
|
1
|
|
|
1
|
0
|
251
|
my ($file_find_rule, $acad_magic) = @_; |
|
24
|
1
|
|
|
|
|
6
|
my $self = $file_find_rule->_force_object; |
|
25
|
|
|
|
|
|
|
return $self->file->exec(sub{ |
|
26
|
4
|
|
|
4
|
|
1035
|
my $file = shift; |
|
27
|
4
|
|
|
|
|
15
|
my $detected_acad_magic = detect_dwg_file($file); |
|
28
|
4
|
100
|
100
|
|
|
809
|
if ($detected_acad_magic && $detected_acad_magic eq $acad_magic) { |
|
29
|
1
|
|
|
|
|
26
|
return 1; |
|
30
|
|
|
|
|
|
|
} else { |
|
31
|
3
|
|
|
|
|
73
|
return 0; |
|
32
|
|
|
|
|
|
|
} |
|
33
|
1
|
|
|
|
|
45
|
}); |
|
34
|
|
|
|
|
|
|
} |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |