line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Amuse::String; |
2
|
20
|
|
|
20
|
|
139
|
use strict; |
|
20
|
|
|
|
|
33
|
|
|
20
|
|
|
|
|
599
|
|
3
|
20
|
|
|
20
|
|
98
|
use warnings; |
|
20
|
|
|
|
|
33
|
|
|
20
|
|
|
|
|
422
|
|
4
|
20
|
|
|
20
|
|
86
|
use utf8; |
|
20
|
|
|
|
|
32
|
|
|
20
|
|
|
|
|
97
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
Text::Amuse::String - Process one-line muse strings. |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 SYNOPSIS |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
This module provides a minimal class compatible with |
13
|
|
|
|
|
|
|
Text::Amuse::Document to process single strings passed via value. |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 CONSTRUCTORS |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=over 4 |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=item new ($string) |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Constructor |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub new { |
26
|
29
|
|
|
29
|
1
|
80
|
my ($class, $string, $lang) = @_; |
27
|
29
|
|
100
|
|
|
108
|
my $self = { |
28
|
|
|
|
|
|
|
_raw_string => $string, |
29
|
|
|
|
|
|
|
_lang => $lang || 'en', |
30
|
|
|
|
|
|
|
}; |
31
|
29
|
|
|
|
|
53
|
bless $self, $class; |
32
|
29
|
|
|
|
|
53
|
return $self; |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=back |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 METHODS |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=over 4 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=item string |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
The string stored |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=cut |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub string { |
48
|
29
|
|
|
29
|
1
|
82
|
return shift->{_raw_string}; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=item elements |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
It returns the only L which composes the body. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub elements { |
59
|
29
|
|
|
29
|
1
|
34
|
my $self = shift; |
60
|
29
|
|
|
|
|
53
|
my $el = Text::Amuse::Element->new(type => 'standalone', |
61
|
|
|
|
|
|
|
string => $self->string); |
62
|
29
|
|
|
|
|
68
|
return ($el); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=back |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 Fake methods |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
They return nothing, but nevertheless the Output module won't complain. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=over 4 |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=item raw_header |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item get_footnote |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=item attachments |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item language_code |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=item set_bidi_document |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=back |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=cut |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub raw_header { |
89
|
0
|
|
|
0
|
1
|
0
|
return; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub get_footnote { |
93
|
8
|
|
|
8
|
1
|
21
|
return; |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub attachments { |
97
|
0
|
|
|
0
|
1
|
0
|
return; |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
sub language_code { |
101
|
29
|
|
|
29
|
1
|
61
|
shift->{_lang}; |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub set_bidi_document { |
105
|
4
|
|
|
4
|
1
|
6
|
return; |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
1; |