Data::Serializer::Config::Wrest - Creates bridge between Data::Serializer and Config::Wrest


Config-Wrest documentation Contained in the Config-Wrest distribution.

Index


Code Index:

NAME

Top

Data::Serializer::Config::Wrest - Creates bridge between Data::Serializer and Config::Wrest

SYNOPSIS

Top

	use Data::Serializer;
	my $ser = Data::Serializer->new(
		serializer => 'Config::Wrest',
		options => {
			Escapes => 1,
			UseQuotes => 1,
			WriteWithEquals => 1,
		}
	);
	my $serialized = $ser->serialize({ foo => 'bar' });
	my $deserialized = $ser->deserialize($serialized);

DESCRIPTION

Top

Module is used internally to Data::Serializer. Use it through the Data::Serializer constructor.

The 'options' hash reference is passed to the Config::Wrest constructor. Please see the documentation for that module for details about the possible options and the defaults.

METHODS

Top

serialize( \%DATA )

For use by Data::Serializer. Serializes the hash reference into a string.

deserialize( $STRING )

For use by Data::Serializer. Deserializes the string into a hash reference.

options()

Retrieves the constructor options for Config::Wrest.

CAVEAT

Top

Base data structure to serialize must be a hash reference

SEE ALSO

Top

Data::Serializer, Config::Wrest

VERSION

Top

$Revision: 1.2 $ on $Date: 2005/09/23 10:30:23 $ by $Author: piersk $

AUTHOR

Top

IF&L Software Engineers <cpan _at_ bbc _dot_ co _dot_ uk>

COPYRIGHT

Top


Config-Wrest documentation Contained in the Config-Wrest distribution.

package Data::Serializer::Config::Wrest;
BEGIN { @Data::Serializer::Config::Wrest::ISA = qw(Data::Serializer) }
use strict;
use Config::Wrest;
use vars qw($VERSION @ISA);

$VERSION = sprintf('%d.%03d', q$Revision: 1.2 $ =~ /: (\d+)\.(\d+)/);

sub serialize {
	my ($self, $ref) = @_;

	TRACE(__PACKAGE__."::serialize");
	my $o = new Config::Wrest(%{$self->options()});
	return $o->serialize($ref);
}

sub deserialize {
	my ($self, $ref) = @_;

	TRACE(__PACKAGE__."::deserialize");
	my $o = new Config::Wrest(%{$self->options()});
	return $o->deserialize($ref);
}

sub options {
	return (shift)->{options};
}

sub TRACE {}
sub DUMP {}

1;

__END__