| 1 | package CAD::AutoCAD::Version; | ||
| 2 | |||
| 3 | 5 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 5 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 5 | ▶ | use Class::Utils qw(set_params); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 5 | ▶ | use Readonly; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | # Constants. | ||
| 10 | # Based on https://autodesk.blogs.com/between_the_lines/autocad-release-history.html | ||
| 11 | 5 | Readonly::Hash my %ACADVER => ( | |
| 12 | # ACADVER => Version of AutoCAD | ||
| 13 | 'MC0.0' => 'Version 1.0', | ||
| 14 | 'AC1.2' => 'Version 1.2', | ||
| 15 | 'AC1.3' => 'Version 1.3', | ||
| 16 | 'AC1.40' => 'Version 1.40', | ||
| 17 | 'AC1.50' => 'Version 2.05', | ||
| 18 | 'AC2.10' => 'Version 2.10', | ||
| 19 | 'AC2.21' => 'Version 2.21', | ||
| 20 | 'AC2.22' => 'Version 2.22', | ||
| 21 | 'AC1001' => 'Version 2.22', | ||
| 22 | 'AC1002' => 'Version 2.50', | ||
| 23 | 'AC1003' => 'Version 2.60', | ||
| 24 | 'AC1004' => 'Release 9', | ||
| 25 | 'AC1006' => 'Release 10', | ||
| 26 | 'AC1009' => 'Release 11/12', | ||
| 27 | 'AC1012' => 'Release 13', | ||
| 28 | 'AC1013' => '??', | ||
| 29 | 'AC1014' => 'Release 14', | ||
| 30 | 'AC1015' => 'AutoCAD 2000', | ||
| 31 | 'AC1016' => 'AutoCAD 2000i', | ||
| 32 | 'AC1017' => 'AutoCAD 2002', | ||
| 33 | 'AC1018' => 'AutoCAD 2004', | ||
| 34 | 'AC1019' => 'AutoCAD 2005', | ||
| 35 | 'AC1020' => 'AutoCAD 2006', | ||
| 36 | 'AC1021' => 'AutoCAD 2007', | ||
| 37 | 'AC1022' => 'AutoCAD 2008', | ||
| 38 | 'AC1023' => 'AutoCAD 2009', | ||
| 39 | 'AC1024' => 'AutoCAD 2010', | ||
| 40 | 'AC1025' => 'AutoCAD 2011', | ||
| 41 | 'AC1026' => 'AutoCAD 2012', | ||
| 42 | 'AC1027' => 'AutoCAD 2013', | ||
| 43 | 'AC1028' => 'AutoCAD 2014', | ||
| 44 | 'AC1029' => 'AutoCAD 2015', | ||
| 45 | 'AC1030' => 'AutoCAD 2016', | ||
| 46 | 'AC1031' => 'AutoCAD 2017', | ||
| 47 | 'AC1032' => 'AutoCAD 2018', | ||
| 48 | 'AC1033' => 'AutoCAD 2019', | ||
| 49 | 'AC1034' => 'AutoCAD 2020', | ||
| 50 | ); | ||
| 51 | |||
| 52 | 5 | our $VERSION = 0.04; | |
| 53 | |||
| 54 | # Constructor. | ||
| 55 | sub new { | ||
| 56 | 5 | ▶ | my ($class, @params) = @_; |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 57 | |||
| 58 | # Create object. | ||
| 59 | 5 | my $self = bless {}, $class; | |
| 60 | |||
| 61 | # Process params. | ||
| 62 | 5 | set_params($self, @params); | |
| 63 | |||
| 64 | # Object. | ||
| 65 | 3 | return $self; | |
| 66 | } | ||
| 67 | |||
| 68 | sub list_of_acad_identifiers { | ||
| 69 | 1 | ▶ | my $self = shift; |
|
Subroutine
list_of_acad_identifiers: called CC=1 SCAR=0.0
Pod
documented
| |||
| 70 | |||
| 71 | 1 | return keys %ACADVER; | |
| 72 | } | ||
| 73 | |||
| 74 | sub list_of_acad_identifiers_real { | ||
| 75 | 1 | ▶ | my $self = shift; |
|
Subroutine
list_of_acad_identifiers_real: called CC=1 SCAR=0.0
Pod
documented
| |||
| 76 | |||
| 77 | 1 | my @mcs = sort grep { $_ =~ m/^MC/ms } keys %ACADVER; | |
| 78 | 1 | my @ac_dot = sort grep { $_ =~ m/^AC\d+\.\d+$/ms } keys %ACADVER; | |
| 79 | 1 | my @ac = sort grep { $_ =~ m/^AC\d+$/ms } keys %ACADVER; | |
| 80 | |||
| 81 | 1 | my @ids = (@mcs, @ac_dot, @ac); | |
| 82 | |||
| 83 | 1 | return @ids; | |
| 84 | } | ||
| 85 | |||
| 86 | 5 | 1; | |
| 87 | |||
| 88 | __END__ | ||