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.95 by root, Tue Mar 25 16:56:09 2008 UTC vs.
Revision 1.97 by root, Wed Mar 26 01:43:14 2008 UTC

714return without doing anything further. This can be used to add more text 714return without doing anything further. This can be used to add more text
715in as many chunks as you want. 715in as many chunks as you want.
716 716
717If the method is called in scalar context, then it will try to extract 717If the method is called in scalar context, then it will try to extract
718exactly I<one> JSON object. If that is successful, it will return this 718exactly I<one> JSON object. If that is successful, it will return this
719object, otherwise it will return C<undef>. This is the most common way of 719object, otherwise it will return C<undef>. If there is a parse error,
720this method will croak just as C<decode> would do (one can then use
721C<incr_skip> to skip the errornous part). This is the most common way of
720using the method. 722using the method.
721 723
722And finally, in list context, it will try to extract as many objects 724And finally, in list context, it will try to extract as many objects
723from the stream as it can find and return them, or the empty list 725from the stream as it can find and return them, or the empty list
724otherwise. For this to work, there must be no separators between the JSON 726otherwise. For this to work, there must be no separators between the JSON
725objects or arrays, instead they must be concatenated back-to-back. 727objects or arrays, instead they must be concatenated back-to-back. If
728an error occurs, an exception will be raised as in the scalar context
729case. Note that in this case, any previously-parsed JSON texts will be
730lost.
726 731
727=item $lvalue_string = $json->incr_text 732=item $lvalue_string = $json->incr_text
728 733
729This method returns the currently stored JSON fragment as an lvalue, that 734This method returns the currently stored JSON fragment as an lvalue, that
730is, you can manipulate it. This I<only> works when a preceding call to 735is, you can manipulate it. This I<only> works when a preceding call to
735method before having parsed anything. 740method before having parsed anything.
736 741
737This function is useful in two cases: a) finding the trailing text after a 742This function is useful in two cases: a) finding the trailing text after a
738JSON object or b) parsing multiple JSON objects separated by non-JSON text 743JSON object or b) parsing multiple JSON objects separated by non-JSON text
739(such as commas). 744(such as commas).
745
746=item $json->incr_skip
747
748This will reset the state of the incremental parser and will remove the
749parsed text from the input buffer. This is useful after C<incr_parse>
750died, in which case the input buffer and incremental parser state is left
751unchanged, to skip the text parsed so far and to reset the parse state.
740 752
741=back 753=back
742 754
743=head2 LIMITATIONS 755=head2 LIMITATIONS
744 756

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines