ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/JSON-XS/XS.pm
(Generate patch)

Comparing JSON-XS/XS.pm (file contents):
Revision 1.170 by root, Thu Nov 15 22:35:35 2018 UTC vs.
Revision 1.171 by root, Thu Nov 15 22:49:06 2018 UTC

521them via a call to the C<THAW> method. 521them via a call to the C<THAW> method.
522 522
523If C<$enable> is false (the default), then C<encode> will not consider 523If C<$enable> is false (the default), then C<encode> will not consider
524this type of conversion, and tagged JSON values will cause a parse error 524this type of conversion, and tagged JSON values will cause a parse error
525in C<decode>, as if tags were not part of the grammar. 525in C<decode>, as if tags were not part of the grammar.
526
527=item $json->boolean_values ([$false, $true])
528
529=item ($false, $true) = $json->get_boolean_values
530
531By default, JSON booleans will be decoded as overloaded
532C<$Types::Serialiser::false> and C<$Types::Serialiser::true> objects.
533
534With this method you can specify your own boolean values for decoding -
535on decode, JSON C<false> will be decoded as a copy of C<$false>, and JSON
536C<true> will be decoded as C<$true> ("copy" here is the same thing as
537assigning a value to another variable, i.e. C<$copy = $false>).
538
539Calling this method without any arguments will reset the booleans
540to their default values.
541
542C<get_boolean_values> will return both C<$false> and C<$true> values, or
543the empty list when they are set to the default.
526 544
527=item $json = $json->filter_json_object ([$coderef->($hashref)]) 545=item $json = $json->filter_json_object ([$coderef->($hashref)])
528 546
529When C<$coderef> is specified, it will be called from C<decode> each 547When C<$coderef> is specified, it will be called from C<decode> each
530time it decodes a JSON object. The only argument is a reference to 548time it decodes a JSON object. The only argument is a reference to

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines