GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Mac::PropertyList::WriteBinary(3) User Contributed Perl Documentation Mac::PropertyList::WriteBinary(3)

Mac::PropertyList::WriteBinary - pack data into a Mac "binary property list"

    use Mac::PropertyList::WriteBinary;

    my $data = Mac::PropertyList::dict->new( { ... => ... } );
    my $buf  = Mac::PropertyList::WriteBinary::as_string($data);

The "as_string" function converts a property list structure (composed of instances of "Mac::PropertyList::dict", "Mac::PropertyList::integer", etc.) into a binary format compatible with the Apple CoreFoundation binary property list functions.

It takes a single argument, the top-level object to write, and returns a byte string.

The property list can contain the following perl objects:

"Mac::PropertyList" value objects
These are written according to their class.
Unblessed references to Perl lists and hashes
These are written as arrays and dictionaries, respectively.
Perl scalars
All Perl scalars are written as strings; this is similar to the behavior of writing an oldstyle OpenStep property list, which does not distinguish between numbers and strings, and then reading it using CoreFoundation functions.
"undef"
This is written as the null object. CoreFoundation will read this as "kCFNull", but appears to be unable to write it.

Strings are uniqued (two equal strings will be written as references to the same object). If the same reference appears more than once in the structure, it will likewise only be represented once in the output. Although the bplist format can represent circular data structures, they cannot be written by this module (they will be detected and result in an error — they wouldn't be read correctly by CoreFoundation anyway, so you aren't missing much).

"Mac::PropertyList::date" objects are not handled yet.

Objects other than strings (and null) are not uniqued by value, only by reference equality. This may change in a future version.

Perl's dictionary keys can only be strings, but a bplist's can be any scalar object.

There is no way to write the "UID" objects used by the keyed archiver.

Perls that do not use IEEE-754 format internally for floating point numbers will produce incorrect output.

Wim Lewis, "<wiml@cpan.org>"

Copyright © 2012-2021 Wim Lewis. All rights reserved.

Tom Wyant added support for UID types.

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

Mac::PropertyList::ReadBinary for the inverse operation.

Apple's partial published CoreFoundation source code: <http://opensource.apple.com/source/CF/>

2021-01-19 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.