| Protocol-XMLRPC documentation | Contained in the Protocol-XMLRPC distribution. |
Protocol::XMLRPC::Value::Base64 - XML-RPC array
my $base64 = Protocol::XMLRPC::Value::Base64->new('foo');
my $base64 = Protocol::XMLRPC::Value::Base64->parse("Zm9v\n");
XML-RPC base64
newCreates new Protocol::XMLRPC::Value::Base64 instance.
parseParses base64 string and creates a new Protocol::XMLRPC:::Value::Base64 instance.
typeReturns 'base64'.
value my $base64 = Protocol::XMLRPC::Value::Base64->new('foo');
# $base64->value returns 'Zm9v\n'
Returns serialized Perl5 scalar.
to_string my $base64 = Protocol::XMLRPC::Value::Base64->new('foo');
# $base64->to_string is now
# '<base64>Zm9v
# </base64>'
XML-RPC base64 string representation.
Viacheslav Tykhanovskyi, vti@cpan.org.
Copyright (C) 2009, Viacheslav Tykhanovskyi.
This program is free software, you can redistribute it and/or modify it under the same terms as Perl 5.10.
| Protocol-XMLRPC documentation | Contained in the Protocol-XMLRPC distribution. |
package Protocol::XMLRPC::Value::Base64; use strict; use warnings; use base 'Protocol::XMLRPC::Value'; require MIME::Base64; sub type {'base64'} sub parse { my $class = shift; my ($value) = @_; return $class->new(MIME::Base64::decode_base64($value)); } sub to_string { my $self = shift; my $value = $self->value; $value = MIME::Base64::encode_base64($value); return "<base64>$value</base64>"; } 1; __END__