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.39 by root, Tue Dec 10 15:31:40 2013 UTC vs.
Revision 1.41 by root, Mon Jan 6 04:15:31 2014 UTC

64 64
65package CBOR::XS; 65package CBOR::XS;
66 66
67use common::sense; 67use common::sense;
68 68
69our $VERSION = 1.12; 69our $VERSION = 1.25;
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;
217decoded, as they need manual cleanup to avoid memory leaks, so code that 217decoded, as they need manual cleanup to avoid memory leaks, so code that
218isn't prepared for this will not leak memory. 218isn't prepared for this will not leak memory.
219 219
220If C<$enable> is false (the default), then C<decode> will throw an error 220If C<$enable> is false (the default), then C<decode> will throw an error
221when it encounters a self-referential/cyclic data structure. 221when it encounters a self-referential/cyclic data structure.
222
223FUTURE DIRECTION: the motivation behind this option is to avoid I<real>
224cycles - future versions of this module might chose to decode cyclic data
225structures using weak references when this option is off, instead of
226throwing an error.
222 227
223This option does not affect C<encode> in any way - shared values and 228This option does not affect C<encode> in any way - shared values and
224references will always be decoded properly if present. 229references will always be decoded properly if present.
225 230
226=item $cbor = $cbor->pack_strings ([$enable]) 231=item $cbor = $cbor->pack_strings ([$enable])
1136 my ($m, $e) = $_[0]->parts; 1141 my ($m, $e) = $_[0]->parts;
1137 tag 4, [$e->numify, $m] 1142 tag 4, [$e->numify, $m]
1138} 1143}
1139 1144
1140sub Time::Piece::TO_CBOR { 1145sub Time::Piece::TO_CBOR {
1141 tag 1, $_[0]->epoch 1146 tag 1, 0 + $_[0]->epoch
1142} 1147}
1143 1148
1144XSLoader::load "CBOR::XS", $VERSION; 1149XSLoader::load "CBOR::XS", $VERSION;
1145 1150
1146=head1 SEE ALSO 1151=head1 SEE ALSO

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines