Data::Plist - object representing a property list


Data-Plist documentation  | view source Contained in the Data-Plist distribution.

Index


NAME

Top

Data::Plist - object representing a property list

SYNOPSIS

Top

 # Create a new plist containing $data
 my $plist = Data::Plist->new($data);

 # Get nested arrays containing the perl data structure's
 # information
 my $ret = $plist->raw_data;

 # Get perl data structure
 $ret = $plist->data;

 # Get an Objective C object
 $ret = $plist->object;




DESCRIPTION

Top

Plists are intermediate structures from which nested array structures of the format specified in SERIALIZED DATA, perl data structures and Objective C data structures can be obtained.

SERIALIZED DATA

Top

Perl data structures that have been serialized become nested array structures containing their data and their data type. Example:

[ array => [ string => "kitten" ], [ integer => 42], [ real => 3.14159 ] ]

Array references are passed around when dealing with serialized data.

KEYED ARCHIVES

Top

Apple uses binary property lists as a serialization format from Objective C, in a format NSKeyedArchiver. Data::Plist has the capability to recognize property lists which were generated using NSKeyedArchiver, and to construct perl objects based on the information in the property list. Objects thus created are blessed under the Data::Plist::Foundation namespace. Thus, the root ancestor of all Objective C objects thus imported is Data::Plist::Foundation::NSObject.

METHODS

Top

new

Creates a new Data::Plist object. Generally, you will not need to call this directly, as Plists are generally created by Data::Plist::Reader classes, and are not needed in serialization when using Data::Plist::Writer classes.

collapse $data

Takes an array of serialized data $data. Recursively returns the actual data, without the datatype labels.

raw_data

Returns the plist as a set of nested arrays of the format specified in SERIALIZED DATA.

data

Returns the plist as its corresponding perl data structure.

is_archive

Checks if the plist is actually an archived Objective C generated by NSKeyedArchiver. Returns true if it is. See KEYED ARCHIVES.

unref

Recursively strips references from the plist.

reify $data

Takes serialized data (see SERIALIZED DATA) $data and checks if it's a keyed archive (see SERIALIZED DATA). If the data is a keyed archive, it blesses it into the appropriate perl class.

object

If the plist is an Objective C object archive created with NSKeyedArchiver (see KEYED ARCHIVES), returns the object blessed into the corresponding class under Data::Plist::Foundation::NSOjbect. Otherwise, returns undef.

DEPENDENCIES

Top

Class::ISA, DateTime, Digest::MD5, Math::BigInt, MIME::Base64, Scalar::Util, Storable, UNIVERSAL::isa, XML::Writer

BUGS AND LIMITATIONS

Top

No XML reader is included at current.

Please report any bugs or feature requests to bug-Data-Plist@rt.cpan.org, or through the web interface at http://rt.cpan.org.

AUTHORS

Top

Alex Vandiver and Jacky Chang.

Based on plutil.pl, written by Pete Wilson <wilsonpm@gamewood.net>

LICENSE

Top

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.


Data-Plist documentation  | view source Contained in the Data-Plist distribution.