| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
#-*-perl-*- |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Unicode::GCString; |
|
4
|
|
|
|
|
|
|
require 5.008; |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=encoding utf-8 |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=cut |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
### Pragmas: |
|
11
|
21
|
|
|
21
|
|
141994
|
use strict; |
|
|
21
|
|
|
|
|
64
|
|
|
|
21
|
|
|
|
|
658
|
|
|
12
|
21
|
|
|
21
|
|
112
|
use warnings; |
|
|
21
|
|
|
|
|
41
|
|
|
|
21
|
|
|
|
|
669
|
|
|
13
|
21
|
|
|
21
|
|
114
|
use vars qw($VERSION @EXPORT_OK @ISA); |
|
|
21
|
|
|
|
|
41
|
|
|
|
21
|
|
|
|
|
1102
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
### Exporting: |
|
16
|
21
|
|
|
21
|
|
141
|
use Exporter; |
|
|
21
|
|
|
|
|
60
|
|
|
|
21
|
|
|
|
|
1708
|
|
|
17
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
|
18
|
|
|
|
|
|
|
our %EXPORT_TAGS = ('all' => [@EXPORT_OK]); |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
### Inheritance: |
|
21
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
### Other modules: |
|
24
|
21
|
|
|
21
|
|
960
|
use Unicode::LineBreak; |
|
|
21
|
|
|
|
|
56
|
|
|
|
21
|
|
|
|
|
2136
|
|
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
### Globals |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# The package version |
|
29
|
|
|
|
|
|
|
our $VERSION = '2013.10'; |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
use overload |
|
32
|
21
|
|
|
|
|
268
|
'@{}' => \&as_arrayref, |
|
33
|
|
|
|
|
|
|
'${}' => \&as_scalarref, |
|
34
|
|
|
|
|
|
|
'""' => \&as_string, |
|
35
|
|
|
|
|
|
|
'.' => \&concat, |
|
36
|
|
|
|
|
|
|
#XXX'.=' => \&concat, #FIXME:segfault |
|
37
|
|
|
|
|
|
|
'cmp' => \&cmp, |
|
38
|
|
|
|
|
|
|
'<>' => \&next, |
|
39
|
21
|
|
|
21
|
|
3936
|
; |
|
|
21
|
|
|
|
|
2965
|
|
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub new { |
|
42
|
416
|
|
|
416
|
1
|
287793
|
my $class = shift; |
|
43
|
|
|
|
|
|
|
|
|
44
|
416
|
|
|
|
|
716
|
my $self; |
|
45
|
416
|
100
|
|
|
|
1020
|
if (scalar @_ <= 2) { |
|
46
|
16
|
|
|
|
|
138
|
$self = __PACKAGE__->_new(@_); |
|
47
|
|
|
|
|
|
|
} else { |
|
48
|
400
|
|
|
|
|
670
|
my $str = shift; |
|
49
|
400
|
|
|
|
|
1279
|
my $lb = Unicode::LineBreak->new(@_); |
|
50
|
400
|
|
|
|
|
3124
|
$self = __PACKAGE__->_new($str, $lb); |
|
51
|
|
|
|
|
|
|
} |
|
52
|
416
|
|
|
|
|
2217
|
bless $self, $class; |
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub as_arrayref { |
|
56
|
356
|
|
|
356
|
1
|
3406
|
my @a = shift->as_array; |
|
57
|
356
|
|
|
|
|
1199
|
return \@a; |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |