line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::FreeDB2::Site; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Copyright 2002, Vincenzo Zocca. |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# See LICENSE section for usage and distribution rights. |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
require 5.005_62; |
8
|
4
|
|
|
4
|
|
176
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
154
|
|
9
|
4
|
|
|
4
|
|
20
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
365
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
require Exporter; |
12
|
4
|
|
|
4
|
|
2092
|
use AutoLoader qw(AUTOLOAD); |
|
4
|
|
|
|
|
5823
|
|
|
4
|
|
|
|
|
26
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# Items to export into callers namespace by default. Note: do not export |
17
|
|
|
|
|
|
|
# names by default without a very good reason. Use EXPORT_OK instead. |
18
|
|
|
|
|
|
|
# Do not simply export all your public functions/methods/constants. |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# This allows declaration use Net::FreeDB2::Site ':all'; |
21
|
|
|
|
|
|
|
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK |
22
|
|
|
|
|
|
|
# will save memory. |
23
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw( |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
) ] ); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
our @EXPORT = qw( |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
our ( $VERSION ) = '$Revision: 0.9 $ ' =~ /\$Revision:\s+([^\s]+)/; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub new { |
35
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
my $self = {}; |
38
|
0
|
|
0
|
|
|
|
bless ($self, (ref($class) || $class)); |
39
|
0
|
|
|
|
|
|
return ($self->_initialize (@_)); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub _initialize { |
43
|
0
|
|
|
0
|
|
|
my $self = shift; |
44
|
0
|
|
0
|
|
|
|
my $opt = shift || {}; |
45
|
|
|
|
|
|
|
|
46
|
0
|
0
|
|
|
|
|
defined ($opt->{site}) && $self->setSite ($opt->{site}); |
47
|
0
|
0
|
|
|
|
|
defined ($opt->{port}) && $self->setPort ($opt->{port}); |
48
|
0
|
0
|
|
|
|
|
defined ($opt->{latitude}) && $self->setLatitude ($opt->{latitude}); |
49
|
0
|
0
|
|
|
|
|
defined ($opt->{longitude}) && $self->setLongitude ($opt->{longitude}); |
50
|
0
|
0
|
|
|
|
|
defined ($opt->{description}) && $self->setDescription ($opt->{description}); |
51
|
0
|
|
|
|
|
|
return ($self); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub setSite { |
55
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
$self->{Net_FreeDB2_Site}{site} = shift; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub getSite { |
61
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
return ($self->{Net_FreeDB2_Site}{site}); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub setPort { |
67
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
68
|
|
|
|
|
|
|
|
69
|
0
|
|
|
|
|
|
$self->{Net_FreeDB2_Site}{port} = shift; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub getPort { |
73
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
74
|
|
|
|
|
|
|
|
75
|
0
|
|
|
|
|
|
return ($self->{Net_FreeDB2_Site}{port}); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub setLatitude { |
79
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
80
|
|
|
|
|
|
|
|
81
|
0
|
|
|
|
|
|
$self->{Net_FreeDB2_Site}{latitude} = shift; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub getLatitude { |
85
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
86
|
|
|
|
|
|
|
|
87
|
0
|
|
|
|
|
|
return ($self->{Net_FreeDB2_Site}{latitude}); |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub setLongitude { |
91
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
92
|
|
|
|
|
|
|
|
93
|
0
|
|
|
|
|
|
$self->{Net_FreeDB2_Site}{longitude} = shift; |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub getLongitude { |
97
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
98
|
|
|
|
|
|
|
|
99
|
0
|
|
|
|
|
|
return ($self->{Net_FreeDB2_Site}{longitude}); |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub setDescription { |
103
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
104
|
|
|
|
|
|
|
|
105
|
0
|
|
|
|
|
|
$self->{Net_FreeDB2_Site}{description} = shift; |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub getDescription { |
109
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
110
|
|
|
|
|
|
|
|
111
|
0
|
|
|
|
|
|
return ($self->{Net_FreeDB2_Site}{description}); |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
1; |
115
|
|
|
|
|
|
|
__END__ |