--- CBOR-XS/XS.pm 2013/11/22 15:28:38 1.22 +++ CBOR-XS/XS.pm 2013/11/22 16:00:30 1.23 @@ -120,7 +120,6 @@ The mutators for flags all return the CBOR object again and thus calls can be chained: -#TODO my $cbor = CBOR::XS->new->encode ({a => [1,2]}); =item $cbor = $cbor->max_depth ([$maximum_nesting_depth]) @@ -232,6 +231,12 @@ This option does not affect C in any way - string references will always be decoded properly if present. +=item $cbor = $cbor->filter ([$cb->($tag, $value)]) + +=item $cb_or_undef = $cbor->get_filter + +TODO + =item $cbor_data = $cbor->encode ($perl_scalar) Converts the given Perl data structure (a scalar value) to its CBOR @@ -309,24 +314,12 @@ C<1> and C<0> (for true and false) or to throw an exception on access (for error). See the L manpage for details. -=item CBOR tag 256 (perl object) - -The tag value C<256> (TODO: pending iana registration) will be used -to deserialise a Perl object serialised with C. See L, below, for details. +=item tagged values -=item CBOR tag 55799 (magic header) +Tagged items consists of a numeric tag and another CBOR value. -The tag 55799 is ignored (this tag implements the magic header). - -=item other CBOR tags - -Tagged items consists of a numeric tag and another CBOR value. Tags not -handled internally are currently converted into a L -object, which is simply a blessed array reference consisting of the -numeric tag value followed by the (decoded) CBOR value. - -In the future, support for user-supplied conversions might get added. +See L and the description of C<< ->filter >> +for details. =item anything else @@ -379,11 +372,11 @@ =item other blessed objects Other blessed objects are serialised via C or C. See -L, below, for details. +L for specific classes handled by this +module, and L for generic object serialisation. =item simple scalars -TODO Simple Perl scalars (any scalar that is not a reference) are the most difficult objects to encode: CBOR::XS will encode undefined scalars as CBOR null values, scalars that have last been used in a string context @@ -635,6 +628,10 @@ CBOR::XS::Tagged object on decoding, and only encoding the tag when explicitly requested). +Tags not handled specifically are currently converted into a +L object, which is simply a blessed array reference +consisting of the numeric tag value followed by the (decoded) CBOR value. + Future versions of this module reserve the right to special case additional tags (such as base64url). @@ -647,9 +644,9 @@ =item (perl-object, L) -These tags are automatically created for serialisable objects using the -C methods (the L object serialisation -protocol). +These tags are automatically created (and decoded) for serialisable +objects using the C methods (the L object +serialisation protocol). See L for details. =item , (sharable, sharedref, L )