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.71 by root, Sun Nov 29 21:32:01 2020 UTC vs.
Revision 1.72 by root, Sun Nov 29 21:35:06 2020 UTC

716 716
717The following casts are currently available (all of which are unary operators): 717The following casts are currently available (all of which are unary operators):
718 718
719=over 719=over
720 720
721=item CBOR::XS::as_int $value
722
723Forces the value to be encoded as some form of (basic, not bignum) integer
724type.
725
721=item CBOR::XS::as_text $value 726=item CBOR::XS::as_text $value
722 727
723Forces the value to be encoded as (UTF-8) text values. 728Forces the value to be encoded as (UTF-8) text values.
724 729
725=item CBOR::XS::as_bytes $value 730=item CBOR::XS::as_bytes $value
753 758
754 CBOR::XS->new->text_strings->encode ([4, "text", CBOR::XS::bytes "bytevalue"]); 759 CBOR::XS->new->text_strings->encode ([4, "text", CBOR::XS::bytes "bytevalue"]);
755 760
756=cut 761=cut
757 762
763sub CBOR::XS::as_int ($) { bless [$_[0], 0, undef], CBOR::XS::Tagged:: }
758sub CBOR::XS::as_cbor ($) { bless [$_[0], 0, undef], CBOR::XS::Tagged:: } 764sub CBOR::XS::as_cbor ($) { bless [$_[0], 1, undef], CBOR::XS::Tagged:: }
759sub CBOR::XS::as_bytes ($) { bless [$_[0], 1, undef], CBOR::XS::Tagged:: } 765sub CBOR::XS::as_bytes ($) { bless [$_[0], 2, undef], CBOR::XS::Tagged:: }
760sub CBOR::XS::as_text ($) { bless [$_[0], 2, undef], CBOR::XS::Tagged:: } 766sub CBOR::XS::as_text ($) { bless [$_[0], 3, undef], CBOR::XS::Tagged:: }
761sub CBOR::XS::as_float16 ($) { bless [$_[0], 3, undef], CBOR::XS::Tagged:: } 767sub CBOR::XS::as_float16 ($) { bless [$_[0], 4, undef], CBOR::XS::Tagged:: }
762sub CBOR::XS::as_float32 ($) { bless [$_[0], 4, undef], CBOR::XS::Tagged:: } 768sub CBOR::XS::as_float32 ($) { bless [$_[0], 5, undef], CBOR::XS::Tagged:: }
763sub CBOR::XS::as_float64 ($) { bless [$_[0], 5, undef], CBOR::XS::Tagged:: } 769sub CBOR::XS::as_float64 ($) { bless [$_[0], 6, undef], CBOR::XS::Tagged:: }
764 770
765=head2 OBJECT SERIALISATION 771=head2 OBJECT SERIALISATION
766 772
767This module implements both a CBOR-specific and the generic 773This module implements both a CBOR-specific and the generic
768L<Types::Serialier> object serialisation protocol. The following 774L<Types::Serialier> object serialisation protocol. The following

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines