line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Params::Validate::XS; |
2
|
|
|
|
|
|
|
|
3
|
34
|
|
|
34
|
|
17559
|
use strict; |
|
34
|
|
|
|
|
80
|
|
|
34
|
|
|
|
|
904
|
|
4
|
34
|
|
|
34
|
|
177
|
use warnings; |
|
34
|
|
|
|
|
68
|
|
|
34
|
|
|
|
|
1258
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.29'; |
7
|
|
|
|
|
|
|
|
8
|
34
|
|
|
34
|
|
183
|
use Carp; |
|
34
|
|
|
|
|
71
|
|
|
34
|
|
|
|
|
6332
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my $default_fail = sub { |
11
|
|
|
|
|
|
|
Carp::confess( $_[0] ); |
12
|
|
|
|
|
|
|
}; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
{ |
15
|
|
|
|
|
|
|
my %defaults = ( |
16
|
|
|
|
|
|
|
ignore_case => 0, |
17
|
|
|
|
|
|
|
strip_leading => 0, |
18
|
|
|
|
|
|
|
allow_extra => 0, |
19
|
|
|
|
|
|
|
on_fail => $default_fail, |
20
|
|
|
|
|
|
|
stack_skip => 1, |
21
|
|
|
|
|
|
|
normalize_keys => undef, |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
*set_options = \&validation_options; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub validation_options { |
27
|
40
|
|
|
40
|
0
|
217686
|
my %opts = @_; |
28
|
|
|
|
|
|
|
|
29
|
40
|
|
|
|
|
125
|
my $caller = caller; |
30
|
|
|
|
|
|
|
|
31
|
40
|
|
|
|
|
154
|
foreach ( keys %defaults ) { |
32
|
240
|
100
|
|
|
|
753
|
$opts{$_} = $defaults{$_} unless exists $opts{$_}; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
40
|
|
|
|
|
147
|
$Params::Validate::OPTIONS{$caller} = \%opts; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
34
|
|
|
34
|
|
222
|
use XSLoader; |
|
34
|
|
|
|
|
74
|
|
|
34
|
|
|
|
|
3342
|
|
39
|
|
|
|
|
|
|
XSLoader::load( |
40
|
|
|
|
|
|
|
__PACKAGE__, |
41
|
|
|
|
|
|
|
exists $Params::Validate::XS::{VERSION} |
42
|
|
|
|
|
|
|
? ${ $Params::Validate::XS::{VERSION} } |
43
|
|
|
|
|
|
|
: (), |
44
|
|
|
|
|
|
|
); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub _check_regex_from_xs { |
48
|
10
|
100
|
|
10
|
|
4548
|
return ( defined $_[0] ? $_[0] : '' ) =~ /$_[1]/ ? 1 : 0; |
|
|
100
|
|
|
|
|
|
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |