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.75 by root, Mon Nov 30 20:38:25 2020 UTC vs.
Revision 1.76 by root, Tue Dec 1 01:49:47 2020 UTC

64 64
65package CBOR::XS; 65package CBOR::XS;
66 66
67use common::sense; 67use common::sense;
68 68
69our $VERSION = 1.81; 69our $VERSION = 1.82;
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;
732Forces the value to be encoded as a (binary) string value. 732Forces the value to be encoded as a (binary) string value.
733 733
734=item CBOR::XS::as_bool $value 734=item CBOR::XS::as_bool $value
735 735
736Converts a Perl boolean (which can be any kind of scalar) into a CBOR 736Converts a Perl boolean (which can be any kind of scalar) into a CBOR
737boolean. Exactly the same, but shorter to write, than: 737boolean. Strictly the same, but shorter to write, than:
738 738
739 $value ? Types::Serialiser::true : Types::Serialiser::false 739 $value ? Types::Serialiser::true : Types::Serialiser::false
740 740
741=item CBOR::XS::as_float16 $value 741=item CBOR::XS::as_float16 $value
742 742
773sub CBOR::XS::as_text ($) { bless [$_[0], 3, undef], CBOR::XS::Tagged:: } 773sub CBOR::XS::as_text ($) { bless [$_[0], 3, undef], CBOR::XS::Tagged:: }
774sub CBOR::XS::as_float16 ($) { bless [$_[0], 4, undef], CBOR::XS::Tagged:: } 774sub CBOR::XS::as_float16 ($) { bless [$_[0], 4, undef], CBOR::XS::Tagged:: }
775sub CBOR::XS::as_float32 ($) { bless [$_[0], 5, undef], CBOR::XS::Tagged:: } 775sub CBOR::XS::as_float32 ($) { bless [$_[0], 5, undef], CBOR::XS::Tagged:: }
776sub CBOR::XS::as_float64 ($) { bless [$_[0], 6, undef], CBOR::XS::Tagged:: } 776sub CBOR::XS::as_float64 ($) { bless [$_[0], 6, undef], CBOR::XS::Tagged:: }
777 777
778sub CBOR::XS::as_bool ($) { $_[0] ? Types::Serialiser::true : Types::Serialiser::false } 778sub CBOR::XS::as_bool ($) { $_[0] ? $Types::Serialiser::true : $Types::Serialiser::false }
779 779
780=head2 OBJECT SERIALISATION 780=head2 OBJECT SERIALISATION
781 781
782This module implements both a CBOR-specific and the generic 782This module implements both a CBOR-specific and the generic
783L<Types::Serialier> object serialisation protocol. The following 783L<Types::Serialier> object serialisation protocol. The following

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines