package JSON;
use strict;
use Carp ();
use Exporter;
BEGIN { @JSON::ISA = 'Exporter' }
@JSON::EXPORT = qw(from_json to_json jsonToObj objToJson encode_json decode_json);
BEGIN {
$JSON::VERSION
$JSON::DEBUG = 0 unless (defined $JSON::DEBUG);
$JSON::DEBUG = $ENV{ PERL_JSON_DEBUG } if exists $ENV{ PERL_JSON_DEBUG };
}
my %RequiredVersion = (
'JSON::PP' => '2.27203',
'JSON::X
ore space_after relaxed canonical allow_nonref
allow_blessed convert_blessed filter_json_object filter_json_single_key_object
shrink max_depth max_size encode decode decode_prefix allow_unkn
package # This is JSON::backportPP
JSON::PP::Boolean;
use strict;
require overload;
local $^W;
overload::unimport('overload', qw(0+ ++ -- fallback));
overload::import('overload',
"0+" =>
${$_[0]} - 1 },
fallback => 1,
);
$JSON::backportPP::Boolean::VERSION = '4.12';
1;
__END__
=head1 NAME
JSON::PP::Boolean - dummy module providing JSON::PP::Boolean
=head1 SYNOPSIS
# do no
verload resolution for Storable and similar modules. See
L<JSON::PP> for more info about this class.
=head1 AUTHOR
This idea is from L<JSON::XS::Boolean> written by Marc Lehmann <schmorp[at]schmorp.
package # This is JSON::backportPP
JSON::backportPP5005;
use 5.005;
use strict;
my @properties;
$JSON::PP5005::VERSION = '1.10';
BEGIN {
sub utf8::is_utf8 {
0; # It is considered
JSON::PP::JSON_PP_encode_ascii = \&_encode_ascii;
*JSON::PP::JSON_PP_encode_latin1 = \&_encode_latin1;
*JSON::PP::JSON_PP_decode_surrogates = \&_decode_surrogates;
*JSON::PP::JSON
alid escaped unicode");
}
return pack('B*', $utf8bit);
}
sub JSON::PP::incr_text {
$_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new;
if ( $_[0]->{_incr_parser}->{incr_parsing} )
package # This is JSON::backportPP
JSON::backportPP56;
use 5.006;
use strict;
my @properties;
$JSON::PP56::VERSION = '1.08';
BEGIN {
sub utf8::is_utf8 {
my $len = length $_[0]; #
JSON::PP::JSON_PP_encode_ascii = \&_encode_ascii;
*JSON::PP::JSON_PP_encode_latin1 = \&_encode_latin1;
*JSON::PP::JSON_PP_decode_surrogates = \&JSON::PP::_decode_surrogates;
*JSON
::PP::JSON_PP_decode_unicode = \&JSON::PP::_decode_unicode;
unless ( defined &B::SVp_NOK ) { # missing in B module.
eval q{ sub B::SVp_NOK () { 0x02000000; } };
}
}
sub _encode
package # This is JSON::backportPP
JSON::PP;
# JSON-2.0
use 5.005;
use strict;
use Exporter ();
BEGIN { @JSON::backportPP::ISA = ('Exporter') }
use overload ();
use JSON::backportPP::Boolean;
use Carp ();
#use Devel::Peek;
$JSON::backportPP::VERSION = '4.12';
@JSON::PP::EXPORT = qw(encode_json decode_json from_json to_json);
# instead of hash-access, i tried index-access for speed.
# b
GS => 19;
use constant OLD_PERL => $] < 5.008 ? 1 : 0;
use constant USE_B => $ENV{PERL_JSON_PP_USE_B} || 0;
use constant CORE_BOOL => defined &builtin::is_bool;
my $invalid_char_re;
BEGIN