The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Config::Apple::Profile::Payload::Types::Serialize - Convert common payload types to plist form.

DESCRIPTION

This module contains code that is used to convert common payload types into plist form.

FUNCTIONS

serialize

    my $plist_fragment = serialize($type, $value, [$subtype]);

Given $value, returns a Mac::PropertyList object containing the contents of $value. $type must be one of the types listed in Config::Apple::Profile::Payload::Types, and is used to identify which type of plist item to create (string, number, array, etc.).

If $type is $ProfileArray or $ProfileDict, then $subtype must be defined. serialize will recurse into the structure, serialize it, and then put everything into the appropriate plist array or dictionary, which will be returned. $subtype is used to tell serialize what type of data is being used within the array or dictionary.

If $type is $ProfileClass, then $value->plist will be called, and the result will be returned.

An exception will be thrown if $type or $subtype are not recognized.

ACKNOWLEDGEMENTS

Refer to the Config::Apple::Profile for acknowledgements.

AUTHOR

A. Karl Kornel, <karl at kornel.us>

COPYRIGHT AND LICENSE

Copyright © 2014 A. Karl Kornel.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.