line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package D64::Disk::Status; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
D64::Disk::Status - CBM floppy error messages and disk drive status details of miscellaneous Commodore (D64/D71/D81) disk image operations |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 SYNOPSIS |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use D64::Disk::Status; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Create a new disk status object instance: |
12
|
|
|
|
|
|
|
my $status = D64::Disk::Status->new( |
13
|
|
|
|
|
|
|
code => $code, |
14
|
|
|
|
|
|
|
error => $error, |
15
|
|
|
|
|
|
|
message => $message, |
16
|
|
|
|
|
|
|
description => $description, |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# Get error code from status object: |
20
|
|
|
|
|
|
|
my $code = $status->code(); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# Get error text from status object: |
23
|
|
|
|
|
|
|
my $error = $status->error(); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# Get error message from status object: |
26
|
|
|
|
|
|
|
my $message = $status->message(); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# Get error description from status object: |
29
|
|
|
|
|
|
|
my $describe = $status->description(); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 DESCRIPTION |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
C provides a helper class for C module that lets users easily identify CBM floppy error messages and disk drive status details (like error codes, and descriptive diagnostic messages) signalled as a result of miscellaneous Commodore (D64/D71/D81) disk image operations. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 METHODS |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
3
|
|
|
3
|
|
51576
|
use bytes; |
|
3
|
|
|
|
|
22
|
|
|
3
|
|
|
|
|
16
|
|
40
|
3
|
|
|
3
|
|
80
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
100
|
|
41
|
3
|
|
|
3
|
|
1981
|
use utf8; |
|
3
|
|
|
|
|
25
|
|
|
3
|
|
|
|
|
12
|
|
42
|
3
|
|
|
3
|
|
75
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
1342
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 new |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Create a new disk status instance: |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
my $status = D64::Disk::Status->new( |
51
|
|
|
|
|
|
|
code => $code, |
52
|
|
|
|
|
|
|
error => $error, |
53
|
|
|
|
|
|
|
message => $message, |
54
|
|
|
|
|
|
|
description => $description, |
55
|
|
|
|
|
|
|
); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub new { |
60
|
18
|
|
|
18
|
1
|
5349
|
my ($this, %args) = @_; |
61
|
18
|
|
33
|
|
|
83
|
my $class = ref ($this) || $this; |
62
|
18
|
|
|
|
|
61
|
my $object = $class->_init(%args); |
63
|
12
|
|
|
|
|
36
|
my $self = bless $object, $class; |
64
|
12
|
|
|
|
|
38
|
return $self; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub _init { |
68
|
18
|
|
|
18
|
|
58
|
my ($class, %args) = @_; |
69
|
|
|
|
|
|
|
|
70
|
18
|
100
|
|
|
|
68
|
unless (exists $args{code}) { |
71
|
2
|
|
|
|
|
25
|
die q{Failed to instantiate status object: Missing error "code" parameter}; |
72
|
|
|
|
|
|
|
} |
73
|
16
|
100
|
|
|
|
37
|
unless (exists $args{error}) { |
74
|
1
|
|
|
|
|
9
|
die q{Failed to instantiate status object: Missing "error" text parameter}; |
75
|
|
|
|
|
|
|
} |
76
|
15
|
100
|
|
|
|
35
|
unless (exists $args{message}) { |
77
|
1
|
|
|
|
|
8
|
die q{Failed to instantiate status object: Missing error "message" parameter}; |
78
|
|
|
|
|
|
|
} |
79
|
14
|
100
|
|
|
|
37
|
unless (exists $args{description}) { |
80
|
1
|
|
|
|
|
11
|
die q{Failed to instantiate status object: Missing error "description" parameter}; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
13
|
100
|
|
|
|
61
|
unless ($args{code} =~ m/^\d+$/) { |
84
|
1
|
|
|
|
|
10
|
die q{Failed to instantiate status object: Invalid error "code" parameter}; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
12
|
|
|
|
|
53
|
my %object = ( |
88
|
|
|
|
|
|
|
code => $args{code}, |
89
|
|
|
|
|
|
|
error => $args{error}, |
90
|
|
|
|
|
|
|
message => $args{message}, |
91
|
|
|
|
|
|
|
description => $args{description}, |
92
|
|
|
|
|
|
|
); |
93
|
|
|
|
|
|
|
|
94
|
12
|
|
|
|
|
36
|
return \%object; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head2 code |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Get error code from status object: |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
my $code = $status->code(); |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=cut |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
sub code { |
106
|
5
|
|
|
5
|
1
|
60
|
my ($self) = @_; |
107
|
|
|
|
|
|
|
|
108
|
5
|
|
|
|
|
33
|
return $self->{code}; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head2 error |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Get error text from status object: |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
my $error = $status->error(); |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=cut |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
sub error { |
120
|
5
|
|
|
5
|
1
|
20
|
my ($self) = @_; |
121
|
|
|
|
|
|
|
|
122
|
5
|
|
|
|
|
18
|
return $self->{error}; |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=head2 message |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
Get error message from status object: |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
my $message = $status->message(); |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=cut |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
sub message { |
134
|
5
|
|
|
5
|
1
|
19
|
my ($self) = @_; |
135
|
|
|
|
|
|
|
|
136
|
5
|
|
|
|
|
15
|
return $self->{message}; |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=head2 description |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
Get error description from status object: |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
my $describe = $status->description(); |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=cut |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
sub description { |
148
|
5
|
|
|
5
|
1
|
21
|
my ($self) = @_; |
149
|
|
|
|
|
|
|
|
150
|
5
|
|
|
|
|
18
|
return $self->{description}; |
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=head1 BUGS |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
There are no known bugs at the moment. Please report any bugs or feature requests. |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=head1 EXPORT |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
None. No method is exported into the caller's namespace neither by default nor explicitly. |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=head1 SEE ALSO |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
L, L, L. |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=head1 AUTHOR |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
Pawel Krol, Epawelkrol@cpan.orgE. |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=head1 VERSION |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
Version 0.03 (2013-03-09) |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
Copyright 2013 by Pawel Krol Epawelkrol@cpan.orgE. |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
This library is free open source software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available. |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
PLEASE NOTE THAT IT COMES WITHOUT A WARRANTY OF ANY KIND! |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=cut |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
1; |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
__END__ |