line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::Find::Rule::DWG; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
93186
|
use base qw(File::Find::Rule); |
|
4
|
|
|
|
|
27
|
|
|
4
|
|
|
|
|
1479
|
|
4
|
4
|
|
|
4
|
|
17000
|
use strict; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
77
|
|
5
|
4
|
|
|
4
|
|
20
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
144
|
|
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
1972
|
use CAD::AutoCAD::Detect qw(detect_dwg_file); |
|
4
|
|
|
|
|
126212
|
|
|
4
|
|
|
|
|
82
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = 0.02; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Detect DWG. |
12
|
|
|
|
|
|
|
sub File::Find::Rule::dwg { |
13
|
1
|
|
|
1
|
0
|
236
|
my $file_find_rule = shift; |
14
|
1
|
|
|
|
|
5
|
my $self = $file_find_rule->_force_object; |
15
|
|
|
|
|
|
|
return $self->file->exec(sub{ |
16
|
4
|
|
|
4
|
|
1594
|
my $file = shift; |
17
|
4
|
|
|
|
|
15
|
return detect_dwg_file($file); |
18
|
1
|
|
|
|
|
44
|
}); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# Detect DWG magic. |
22
|
|
|
|
|
|
|
sub File::Find::Rule::dwg_magic { |
23
|
1
|
|
|
1
|
0
|
250
|
my ($file_find_rule, $acad_magic) = @_; |
24
|
1
|
|
|
|
|
8
|
my $self = $file_find_rule->_force_object; |
25
|
|
|
|
|
|
|
return $self->file->exec(sub{ |
26
|
4
|
|
|
4
|
|
1044
|
my $file = shift; |
27
|
4
|
|
|
|
|
15
|
my $detected_acad_magic = detect_dwg_file($file); |
28
|
4
|
100
|
100
|
|
|
800
|
if ($detected_acad_magic && $detected_acad_magic eq $acad_magic) { |
29
|
1
|
|
|
|
|
26
|
return 1; |
30
|
|
|
|
|
|
|
} else { |
31
|
3
|
|
|
|
|
75
|
return 0; |
32
|
|
|
|
|
|
|
} |
33
|
1
|
|
|
|
|
45
|
}); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |