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.167 by root, Tue Aug 28 16:16:17 2018 UTC vs.
Revision 1.168 by root, Thu Nov 15 20:13:03 2018 UTC

515 515
516This setting has no effect on C<decode>. 516This setting has no effect on C<decode>.
517 517
518=item $json = $json->allow_tags ([$enable]) 518=item $json = $json->allow_tags ([$enable])
519 519
520=item $enabled = $json->allow_tags 520=item $enabled = $json->get_allow_tags
521 521
522See L<OBJECT SERIALISATION> for details. 522See L<OBJECT SERIALISATION> for details.
523 523
524If C<$enable> is true (or missing), then C<encode>, upon encountering a 524If C<$enable> is true (or missing), then C<encode>, upon encountering a
525blessed object, will check for the availability of the C<FREEZE> method on 525blessed object, will check for the availability of the C<FREEZE> method on
534in C<decode>, as if tags were not part of the grammar. 534in C<decode>, as if tags were not part of the grammar.
535 535
536=item $json = $json->filter_json_object ([$coderef->($hashref)]) 536=item $json = $json->filter_json_object ([$coderef->($hashref)])
537 537
538When C<$coderef> is specified, it will be called from C<decode> each 538When C<$coderef> is specified, it will be called from C<decode> each
539time it decodes a JSON object. The only argument is a reference to the 539time it decodes a JSON object. The only argument is a reference to
540newly-created hash. If the code references returns a single scalar (which 540the newly-created hash. If the code reference returns a single scalar
541need not be a reference), this value (i.e. a copy of that scalar to avoid 541(which need not be a reference), this value (or rather a copy of it) is
542aliasing) is inserted into the deserialised data structure. If it returns 542inserted into the deserialised data structure. If it returns an empty
543an empty list (NOTE: I<not> C<undef>, which is a valid scalar), the 543list (NOTE: I<not> C<undef>, which is a valid scalar), the original
544original deserialised hash will be inserted. This setting can slow down 544deserialised hash will be inserted. This setting can slow down decoding
545decoding considerably. 545considerably.
546 546
547When C<$coderef> is omitted or undefined, any existing callback will 547When C<$coderef> is omitted or undefined, any existing callback will
548be removed and C<decode> will not change the deserialised hash in any 548be removed and C<decode> will not change the deserialised hash in any
549way. 549way.
550 550

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines