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

Comparing CBOR-XS/XS.pm (file contents):
Revision 1.59 by root, Tue Apr 26 16:25:49 2016 UTC vs.
Revision 1.62 by root, Fri Nov 25 06:13:16 2016 UTC

64 64
65package CBOR::XS; 65package CBOR::XS;
66 66
67use common::sense; 67use common::sense;
68 68
69our $VERSION = 1.5; 69our $VERSION = 1.51;
70our @ISA = qw(Exporter); 70our @ISA = qw(Exporter);
71 71
72our @EXPORT = qw(encode_cbor decode_cbor); 72our @EXPORT = qw(encode_cbor decode_cbor);
73 73
74use Exporter; 74use Exporter;
180reference to the earlier value. 180reference to the earlier value.
181 181
182This means that such values will only be encoded once, and will not result 182This means that such values will only be encoded once, and will not result
183in a deep cloning of the value on decode, in decoders supporting the value 183in a deep cloning of the value on decode, in decoders supporting the value
184sharing extension. This also makes it possible to encode cyclic data 184sharing extension. This also makes it possible to encode cyclic data
185structures (which need C<allow_cycles> to ne enabled to be decoded by this 185structures (which need C<allow_cycles> to be enabled to be decoded by this
186module). 186module).
187 187
188It is recommended to leave it off unless you know your 188It is recommended to leave it off unless you know your
189communication partner supports the value sharing extensions to CBOR 189communication partner supports the value sharing extensions to CBOR
190(L<http://cbor.schmorp.de/value-sharing>), as without decoder support, the 190(L<http://cbor.schmorp.de/value-sharing>), as without decoder support, the
440 440
441Resets the incremental decoder. This throws away any saved state, so that 441Resets the incremental decoder. This throws away any saved state, so that
442subsequent calls to C<incr_parse> or C<incr_parse_multiple> start to parse 442subsequent calls to C<incr_parse> or C<incr_parse_multiple> start to parse
443a new CBOR value from the beginning of the C<$buffer> again. 443a new CBOR value from the beginning of the C<$buffer> again.
444 444
445This method can be caled at any time, but it I<must> be called if you want 445This method can be called at any time, but it I<must> be called if you want
446to change your C<$buffer> or there was a decoding error and you want to 446to change your C<$buffer> or there was a decoding error and you want to
447reuse the C<$cbor> object for future incremental parsings. 447reuse the C<$cbor> object for future incremental parsings.
448 448
449=back 449=back
450 450
1206} 1206}
1207 1207
1208sub Math::BigRat::TO_CBOR { 1208sub Math::BigRat::TO_CBOR {
1209 my ($n, $d) = $_[0]->parts; 1209 my ($n, $d) = $_[0]->parts;
1210 1210
1211 # older versions of BigRat need *=1, as they not always return numbers 1211 # older versions of BigRat need *1, as they not always return numbers
1212 1212
1213 $d*1 == 1 1213 $d*1 == 1
1214 ? $n*1 1214 ? $n*1
1215 : tag 30, [$n*1, $d*1] 1215 : tag 30, [$n*1, $d*1]
1216} 1216}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines