line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Wikibase::Datatype::Print::Value::String; |
2
|
|
|
|
|
|
|
|
3
|
44
|
|
|
44
|
|
364487
|
use base qw(Exporter); |
|
44
|
|
|
|
|
143
|
|
|
44
|
|
|
|
|
3931
|
|
4
|
44
|
|
|
44
|
|
349
|
use strict; |
|
44
|
|
|
|
|
122
|
|
|
44
|
|
|
|
|
878
|
|
5
|
44
|
|
|
44
|
|
264
|
use warnings; |
|
44
|
|
|
|
|
106
|
|
|
44
|
|
|
|
|
1874
|
|
6
|
|
|
|
|
|
|
|
7
|
44
|
|
|
44
|
|
1238
|
use Error::Pure qw(err); |
|
44
|
|
|
|
|
23278
|
|
|
44
|
|
|
|
|
1812
|
|
8
|
44
|
|
|
44
|
|
409
|
use Readonly; |
|
44
|
|
|
|
|
118
|
|
|
44
|
|
|
|
|
6763
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Readonly::Array our @EXPORT_OK => qw(print); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = 0.09; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub print { |
15
|
19
|
|
|
19
|
1
|
1132
|
my ($obj, $opts_hr) = @_; |
16
|
|
|
|
|
|
|
|
17
|
19
|
100
|
|
|
|
159
|
if (! $obj->isa('Wikibase::Datatype::Value::String')) { |
18
|
1
|
|
|
|
|
5
|
err "Object isn't 'Wikibase::Datatype::Value::String'."; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
18
|
|
|
|
|
106
|
return $obj->value; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__END__ |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=pod |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=encoding utf8 |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 NAME |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Wikibase::Datatype::Print::Value::String - Wikibase string value pretty print helpers. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 SYNOPSIS |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
use Wikibase::Datatype::Print::Value::String qw(print); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
my $pretty_print_string = print($obj, $opts_hr); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 SUBROUTINES |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head2 C<print> |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
my $pretty_print_string = print($obj, $opts_hr); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Construct pretty print output for L<Wikibase::Datatype::Value::String> |
49
|
|
|
|
|
|
|
object. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Returns string. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 ERRORS |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
print(): |
56
|
|
|
|
|
|
|
Object isn't 'Wikibase::Datatype::Value::String'. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 EXAMPLE |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=for comment filename=create_and_print_value_string.pl |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
use strict; |
63
|
|
|
|
|
|
|
use warnings; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
use Wikibase::Datatype::Print::Value::String; |
66
|
|
|
|
|
|
|
use Wikibase::Datatype::Value::String; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
# Object. |
69
|
|
|
|
|
|
|
my $obj = Wikibase::Datatype::Value::String->new( |
70
|
|
|
|
|
|
|
'value' => 'foo', |
71
|
|
|
|
|
|
|
); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# Print. |
74
|
|
|
|
|
|
|
print Wikibase::Datatype::Print::Value::String::print($obj)."\n"; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
# Output: |
77
|
|
|
|
|
|
|
# foo |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 DEPENDENCIES |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
L<Error::Pure>, |
82
|
|
|
|
|
|
|
L<Exporter>, |
83
|
|
|
|
|
|
|
L<Readonly>. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 SEE ALSO |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=over |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=item L<Wikibase::Datatype::Value::String> |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Wikibase string value datatype. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=back |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head1 REPOSITORY |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
L<https://github.com/michal-josef-spacek/Wikibase-Datatype-Print> |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head1 AUTHOR |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Michal Josef Špaček L<mailto:skim@cpan.org> |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
L<http://skim.cz> |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
© 2020-2023 Michal Josef Špaček |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
BSD 2-Clause License |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 VERSION |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
0.09 |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=cut |