… | |
… | |
64 | |
64 | |
65 | package CBOR::XS; |
65 | package CBOR::XS; |
66 | |
66 | |
67 | use common::sense; |
67 | use common::sense; |
68 | |
68 | |
69 | our $VERSION = 1.85; |
69 | our $VERSION = 1.86; |
70 | our @ISA = qw(Exporter); |
70 | our @ISA = qw(Exporter); |
71 | |
71 | |
72 | our @EXPORT = qw(encode_cbor decode_cbor); |
72 | our @EXPORT = qw(encode_cbor decode_cbor); |
73 | |
73 | |
74 | use Exporter; |
74 | use Exporter; |
… | |
… | |
473 | Perl data structure in memory at one time, it does allow you to parse a |
473 | Perl data structure in memory at one time, it does allow you to parse a |
474 | CBOR stream incrementally, using a similar to using "decode_prefix" to see |
474 | CBOR stream incrementally, using a similar to using "decode_prefix" to see |
475 | if a full CBOR object is available, but is much more efficient. |
475 | if a full CBOR object is available, but is much more efficient. |
476 | |
476 | |
477 | It basically works by parsing as much of a CBOR string as possible - if |
477 | It basically works by parsing as much of a CBOR string as possible - if |
478 | the CBOR data is not complete yet, the pasrer will remember where it was, |
478 | the CBOR data is not complete yet, the parser will remember where it was, |
479 | to be able to restart when more data has been accumulated. Once enough |
479 | to be able to restart when more data has been accumulated. Once enough |
480 | data is available to either decode a complete CBOR value or raise an |
480 | data is available to either decode a complete CBOR value or raise an |
481 | error, a real decode will be attempted. |
481 | error, a real decode will be attempted. |
482 | |
482 | |
483 | A typical use case would be a network protocol that consists of sending |
483 | A typical use case would be a network protocol that consists of sending |
… | |
… | |
635 | create such objects. |
635 | create such objects. |
636 | |
636 | |
637 | =item Types::Serialiser::true, Types::Serialiser::false, Types::Serialiser::error |
637 | =item Types::Serialiser::true, Types::Serialiser::false, Types::Serialiser::error |
638 | |
638 | |
639 | These special values become CBOR true, CBOR false and CBOR undefined |
639 | These special values become CBOR true, CBOR false and CBOR undefined |
640 | values, respectively. You can also use C<\1>, C<\0> and C<\undef> directly |
640 | values, respectively. |
641 | if you want. |
|
|
642 | |
641 | |
643 | =item other blessed objects |
642 | =item other blessed objects |
644 | |
643 | |
645 | Other blessed objects are serialised via C<TO_CBOR> or C<FREEZE>. See |
644 | Other blessed objects are serialised via C<TO_CBOR> or C<FREEZE>. See |
646 | L<TAG HANDLING AND EXTENSIONS> for specific classes handled by this |
645 | L<TAG HANDLING AND EXTENSIONS> for specific classes handled by this |