line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
7
|
|
|
7
|
|
21685
|
use 5.006; |
|
7
|
|
|
|
|
19
|
|
2
|
7
|
|
|
7
|
|
24
|
use strict; |
|
7
|
|
|
|
|
6
|
|
|
7
|
|
|
|
|
111
|
|
3
|
7
|
|
|
7
|
|
20
|
use warnings; |
|
7
|
|
|
|
|
7
|
|
|
7
|
|
|
|
|
277
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Metabase::Fact::String; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.025'; |
8
|
|
|
|
|
|
|
|
9
|
7
|
|
|
7
|
|
22
|
use Carp (); |
|
7
|
|
|
|
|
7
|
|
|
7
|
|
|
|
|
88
|
|
10
|
|
|
|
|
|
|
|
11
|
7
|
|
|
7
|
|
1164
|
use Metabase::Fact; |
|
7
|
|
|
|
|
9
|
|
|
7
|
|
|
|
|
884
|
|
12
|
|
|
|
|
|
|
our @ISA = qw/Metabase::Fact/; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# document that content must be characters, not bytes -- dagolden, 2009-03-28 |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub validate_content { |
17
|
16
|
|
|
16
|
1
|
33
|
my ($self) = @_; |
18
|
16
|
50
|
33
|
|
|
67
|
Carp::confess "content must be scalar value" |
19
|
|
|
|
|
|
|
unless defined $self->content && ref \( $self->content ) eq 'SCALAR'; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub content_as_bytes { |
23
|
7
|
|
|
7
|
1
|
7
|
my ($self) = @_; |
24
|
7
|
|
|
|
|
16
|
my $bytes = $self->content; |
25
|
7
|
50
|
|
|
|
23
|
utf8::encode($bytes) if $] ge '5.008'; # converts in-place |
26
|
7
|
|
|
|
|
34
|
return $bytes; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub content_from_bytes { |
30
|
5
|
|
|
5
|
1
|
10
|
my ( $class, $bytes ) = @_; |
31
|
5
|
50
|
|
|
|
23
|
utf8::decode($bytes) if $] ge '5.008'; # converts in-place |
32
|
5
|
|
|
|
|
37
|
return $bytes; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# ABSTRACT: fact subtype for simple strings |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |