NAME

YAML::PP::Schema::Binary - Schema for loading and binary data

SYNOPSIS

    use YAML::PP;
    my $yp = YAML::PP->new( schema => [qw/ JSON Binary /] );
    # or

    my $binary = $yp->load_string(<<'EOM');
    # The binary value a tiny arrow encoded as a gif image.
    --- !!binary "\
      R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\
      OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\
      +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\
      AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs="
    EOM

DESCRIPTION

By prepending a base64 encoded binary string with the !!binary tag, it can be automatically decoded when loading.

If you are using this schema, any string containing [\x{7F}-\x{10FFFF}] will be dumped as binary. That also includes encoded utf8.

METHODS

register

Called by YAML::PP::Schema