line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Params::Validate::XS; |
2
|
|
|
|
|
|
|
|
3
|
34
|
|
|
34
|
|
18025
|
use strict; |
|
34
|
|
|
|
|
75
|
|
|
34
|
|
|
|
|
984
|
|
4
|
34
|
|
|
34
|
|
168
|
use warnings; |
|
34
|
|
|
|
|
68
|
|
|
34
|
|
|
|
|
1608
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.31'; |
7
|
|
|
|
|
|
|
|
8
|
34
|
|
|
34
|
|
178
|
use Carp; |
|
34
|
|
|
|
|
72
|
|
|
34
|
|
|
|
|
7202
|
|
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
|
185762
|
my %opts = @_; |
28
|
|
|
|
|
|
|
|
29
|
40
|
|
|
|
|
102
|
my $caller = caller; |
30
|
|
|
|
|
|
|
|
31
|
40
|
|
|
|
|
138
|
foreach ( keys %defaults ) { |
32
|
240
|
100
|
|
|
|
533
|
$opts{$_} = $defaults{$_} unless exists $opts{$_}; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
40
|
|
|
|
|
148
|
$Params::Validate::OPTIONS{$caller} = \%opts; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
34
|
|
|
34
|
|
264
|
use XSLoader; |
|
34
|
|
|
|
|
67
|
|
|
34
|
|
|
|
|
4329
|
|
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
|
9
|
100
|
|
9
|
|
5151
|
return ( defined $_[0] ? $_[0] : '' ) =~ /$_[1]/ ? 1 : 0; |
|
|
100
|
|
|
|
|
|
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |