Home | History | Annotate | Download | only in perl5

Lines Matching defs:Backend

53 unless ($JSON::Backend) {
56 my $backend = exists $ENV{PERL_JSON_BACKEND} ? $ENV{PERL_JSON_BACKEND} : 1;
58 if ($backend eq '1' or $backend =~ /JSON::XS\s*,\s*JSON::PP/) {
61 elsif ($backend eq '0' or $backend eq 'JSON::PP') {
64 elsif ($backend eq '2' or $backend eq 'JSON::XS') {
67 elsif ($backend eq 'JSON::backportPP') {
85 JSON::Backend::XS
86 ->support_by_pp(@PPOnlyMethods) if ($JSON::Backend eq $Module_XS);
184 sub backend {
186 $JSON::Backend;
189 #*module = *backend;
265 _set_module( $JSON::Backend = $Module_XS );
269 JSON::Backend::XS->init;
278 my $backend = $_USSING_bpPP ? $Module_bp : $Module_PP;
280 $JSON::DEBUG and Carp::carp "Load $backend.";
284 JSON::Boolean::_overrride_overload($backend);
287 eval qq| require $backend |;
290 eval qq| use $backend $PP_Version () |;
294 if ( $backend eq $Module_PP ) {
297 $backend = $Module_bp;
298 JSON::Boolean::_overrride_overload($backend);
306 _set_module( $JSON::Backend = $Module_PP ); # even if backportPP, set $Backend with 'JSON::PP'
307 JSON::Backend::PP->init;
391 # Helper classes for Backend Module (PP)
394 package JSON::Backend::PP;
398 no strict qw(refs); # this routine may be called after JSON::Backend::XS init was called.
407 # To save memory, the below lines are read only when XS backend is used.
417 # Helper classes for Backend Module (XS)
420 package JSON::Backend::XS;
461 *JSON::XS::decode = \&JSON::Backend::XS::Supportable::_decode;
462 *JSON::XS::encode = \&JSON::Backend::XS::Supportable::_encode;
463 *JSON::XS::incr_parse = \&JSON::Backend::XS::Supportable::_incr_parse;
469 push @JSON::Backend::XS::Supportable::ISA, 'JSON';
471 my $pkg = 'JSON::Backend::XS::Supportable';
504 package JSON::Backend::XS::Supportable;
506 $Carp::Internal{'JSON::Backend::XS::Supportable'} = 1;
543 my $unsupported = $type eq 'encode' ? JSON::Backend::XS::UNSUPPORTED_ENCODE_FLAG
544 : JSON::Backend::XS::UNSUPPORTED_DECODE_FLAG;
608 ${$_[0]} &= ~ JSON::Backend::XS::INDENT_LENGTH_FLAG;
610 *JSON::XS::encode = \&JSON::Backend::XS::Supportable::_encode;
705 See to L<BACKEND MODULE DECISION>.
721 This module (i.e. backend modules) knows how to handle Unicode, documents
727 C<JSON> should call JSON::PP as the backend which can be used since Perl 5.005.
994 See to L<JSON::PP/UNICODE HANDLING ON PERLS> if the backend is PP.
1043 See to L<JSON::PP/UNICODE HANDLING ON PERLS> if the backend is PP.
1421 With JSON::PP as the backend, when a large value (100 or more) was set and
1517 The backend module will only attempt to parse the JSON text once it is sure it
1621 are available even with JSON::XS. See to L<USE PP FEATURES EVEN THOUGH XS BACKEND>.
1704 JSON backend modules encode strings without escaping slash.
1790 If the backend is JSON::PP and C<allow_bignum> is enable, the big integers
1813 C<JSON> will install these missing overloading features to the backend modules.
1928 If the backend is JSON::PP and C<allow_bignum> is enable,
1945 =head1 BACKEND MODULE DECISION
1950 The C<JSON> constructor method returns an object inherited from the backend module,
1954 So, your program should not depend on the backend module, especially
1960 To check the backend module, there are some methods - C<backend>, C<is_pp> and C<is_xs>.
1962 JSON->backend; # 'JSON::XS' or 'JSON::PP'
1964 JSON->backend->is_pp: # 0 or 1
1966 JSON->backend->is_xs: # 1 or 0
2007 =head1 USE PP FEATURES EVEN THOUGH XS BACKEND
2010 when the backend module is JSON::XS, if any JSON::PP specific (i.e. JSON::XS unsupported)
2022 At this time, the returned object is a C<JSON::Backend::XS::Supportable>
2030 C<-support_by_pp> is effective only when the backend module is JSON::XS
2203 Needless. C<JSON> backend modules have the round-trip integrity.