line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Farly::Value::String;
|
2
|
|
|
|
|
|
|
|
3
|
17
|
|
|
17
|
|
17995
|
use 5.008008;
|
|
17
|
|
|
|
|
52
|
|
|
17
|
|
|
|
|
652
|
|
4
|
17
|
|
|
17
|
|
86
|
use strict;
|
|
17
|
|
|
|
|
29
|
|
|
17
|
|
|
|
|
571
|
|
5
|
17
|
|
|
17
|
|
73
|
use warnings;
|
|
17
|
|
|
|
|
26
|
|
|
17
|
|
|
|
|
458
|
|
6
|
17
|
|
|
17
|
|
80
|
use Carp;
|
|
17
|
|
|
|
|
29
|
|
|
17
|
|
|
|
|
8060
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.26';
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new {
|
11
|
2325
|
|
|
2325
|
1
|
4098
|
my ( $class, $string ) = @_;
|
12
|
|
|
|
|
|
|
|
13
|
2325
|
100
|
|
|
|
4957
|
confess "string required"
|
14
|
|
|
|
|
|
|
unless defined($string);
|
15
|
|
|
|
|
|
|
|
16
|
2324
|
|
|
|
|
8159
|
$string =~ s/^\s+|\s+$//g;
|
17
|
|
|
|
|
|
|
|
18
|
2324
|
|
|
|
|
10427
|
return bless( \$string, $class );
|
19
|
|
|
|
|
|
|
}
|
20
|
|
|
|
|
|
|
|
21
|
10466
|
|
|
10466
|
1
|
10076
|
sub as_string { return ${ $_[0] } }
|
|
10466
|
|
|
|
|
39186
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub equals {
|
24
|
3882
|
|
|
3882
|
1
|
5303
|
my ( $self, $other ) = @_;
|
25
|
|
|
|
|
|
|
|
26
|
3882
|
100
|
|
|
|
16861
|
if ( $other->isa('Farly::Value::String') ) {
|
27
|
2903
|
|
|
|
|
4909
|
return $self->as_string() eq $other->as_string();
|
28
|
|
|
|
|
|
|
}
|
29
|
|
|
|
|
|
|
}
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub contains {
|
32
|
20
|
|
|
20
|
1
|
39
|
my ( $self, $other ) = @_;
|
33
|
20
|
|
|
|
|
39
|
return $self->equals($other);
|
34
|
|
|
|
|
|
|
}
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub intersects {
|
37
|
12
|
|
|
12
|
1
|
19
|
my ( $self, $other ) = @_;
|
38
|
12
|
|
|
|
|
23
|
return $self->equals($other);
|
39
|
|
|
|
|
|
|
}
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub compare {
|
42
|
1708
|
|
|
1708
|
0
|
2326
|
my ( $self, $other ) = @_;
|
43
|
|
|
|
|
|
|
|
44
|
1708
|
50
|
|
|
|
9122
|
if ( $other->isa('Farly::Value::String') ) {
|
45
|
1708
|
|
|
|
|
2947
|
return $self->as_string() cmp $other->as_string();
|
46
|
|
|
|
|
|
|
}
|
47
|
|
|
|
|
|
|
}
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1;
|
50
|
|
|
|
|
|
|
__END__
|