|
P5EEx-Blue-0.01 | |||||||
| PREV NEXT | FRAMES NO FRAMES | |||||||
![]() |
P5EEx::Blue::Serializer::Ini |
P5EEx::Blue::Serializer::Ini - Interface for serialization and deserialization
use P5EEx::Blue::P5EE;
$context = P5EEx::Blue::P5EE->context();
$serializer = $context->service("Serializer"); # or ...
$serializer = $context->serializer();
$data = {
an => 'arbitrary',
collection => [ 'of', 'data', ],
of => {
arbitrary => 'depth',
},
};
$inidata = $serializer->serialize($data);
$data = $serializer->deserialize($inidata);
print $serializer->dump($data), "\n";
A Serializer allows you to serialize a structure of data of arbitrary depth to a scalar and deserialize it back to the structure.
The Ini serializer reads and writes data which conforms to the standards of Windows INI files.
* Throws: P5EEx::Blue::Exception::Serializer * Since: 0.01
The class is entirely made up of static (class) methods. However, they are each intended to be called as methods on the instance itself.
new()The constructor is inherited from
P5EEx::Blue::Service.
serialize()
* Signature: $inidata = $serializer->serialize($data);
* Param: $data ref
* Return: $inidata text
* Throws: P5EEx::Blue::Exception::Serializer
* Since: 0.01
Sample Usage:
$context = P5EEx::Blue::P5EE->context();
$serializer = $context->service("Serializer"); # or ...
$serializer = $context->serializer();
$data = {
an => 'arbitrary',
collection => [ 'of', 'data', ],
of => {
arbitrary => 'depth',
},
};
$inidata = $serializer->serialize($data);
deserialize()
* Signature: $data = $serializer->deserialize($inidata);
* Signature: $data = P5EEx::Blue::Serializer->deserialize($inidata);
* Param: $data ref
* Return: $inidata text
* Throws: P5EEx::Blue::Exception::Serializer
* Since: 0.01
Sample Usage:
$context = P5EEx::Blue::P5EE->context();
$serializer = $context->service("Serializer"); # or ...
$serializer = $context->serializer();
$data = $serializer->deserialize($inidata);
print $serializer->dump($data), "\n";
dump()The constructor is inherited from
P5EEx::Blue::Serializer.
* Author: Stephen Adkins <stephen.adkins@officevision.com> * License: This is free software. It is licensed under the same terms as Perl itself.