line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#=============================================================================== |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# FILE: Mapper.pm |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# BUGS: --- |
6
|
|
|
|
|
|
|
# NOTES: --- |
7
|
|
|
|
|
|
|
# AUTHOR: Grishayev Anatoliy (), |
8
|
|
|
|
|
|
|
# COMPANY: |
9
|
|
|
|
|
|
|
# VERSION: 1.0 |
10
|
|
|
|
|
|
|
# CREATED: 01/24/2011 02:36:47 PM |
11
|
|
|
|
|
|
|
# REVISION: --- |
12
|
|
|
|
|
|
|
#=============================================================================== |
13
|
|
|
|
|
|
|
package Storable::AMF::Mapper; |
14
|
3
|
|
|
3
|
|
1539
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
76
|
|
15
|
3
|
|
|
3
|
|
292
|
use Storable::AMF qw(parse_serializator_option); |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
128
|
|
16
|
3
|
|
|
3
|
|
9
|
use Carp qw(croak); |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
374
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub new{ |
19
|
4
|
|
|
4
|
0
|
14083
|
my $class = shift; |
20
|
4
|
50
|
|
|
|
18
|
if ( @_ % 2 ){ |
21
|
0
|
|
|
|
|
0
|
croak( "Usage Storable::AMF::Mapper->new( to_amf => 0 | 1, option => ...)"); |
22
|
|
|
|
|
|
|
} |
23
|
4
|
|
|
|
|
11
|
my %options = @_; |
24
|
4
|
|
|
|
|
40
|
my $option_int = parse_serializator_option( 'prefer_number'); |
25
|
4
|
50
|
|
|
|
14
|
if ( my $option_str = delete $options{ option } ){ |
26
|
0
|
|
|
|
|
0
|
$option_int = parse_serializator_option( $option_str ); |
27
|
|
|
|
|
|
|
} |
28
|
4
|
100
|
|
|
|
10
|
if ( delete $options{ to_amf } ){ |
29
|
3
|
|
|
|
|
5
|
$option_int |= 128 ; |
30
|
|
|
|
|
|
|
} |
31
|
4
|
50
|
|
|
|
10
|
if (keys %options ){ |
32
|
0
|
|
|
|
|
0
|
croak( "Unknown option: ". join (" ", keys %options )); |
33
|
|
|
|
|
|
|
} |
34
|
4
|
|
|
|
|
17
|
return $option_int; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__END__ |