Mac::Pr...eBinary(3)
πΈ NAME πΈ
okay so bestie, this is the Mac::Pr...eBinary(3) page from User Contributed Perl Documentation β yes, the manual name is a little cursed/truncated-looking, but the actual module is:
Mac::PropertyList::WriteBinaryβ pack data into a Mac "binary property list".
β¨ SYNOPSIS β¨
use Mac::PropertyList::WriteBinary;
my $data = Mac::PropertyList::dict->new( { ... => ... } );
my $buf = Mac::PropertyList::WriteBinary::as_string($data);
π¦ DESCRIPTION π¦
okay so 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. periodt.
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::PropertyListvalue objects β these are written according to their class. slay.- 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 OpenStepproperty 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 askCFNull, 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. no cap.
π¨ real talk: 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).
π BUGS π
Mac::PropertyList::dateobjects are not handled yet. sad but true.- 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
UIDobjects used by the keyed archiver. - Perls that do not use
IEEE-754format internally for floating point numbers will produce incorrect output.
π AUTHOR π
Wim Lewis, "<wiml@cpan.org>"
Copyright Β© 2012-2024 Wim Lewis. All rights reserved.
Tom Wyant added support for UID types. iconic.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π SEE ALSO π
Mac::PropertyList::ReadBinaryβ for the inverse operation.- Apple's partial published CoreFoundation source code:
http://opensource.apple.com/source/CF/
mwah π this page was served with perl v5.42.0, dated 2024-07-27, under the manual name Mac::Pr...eBinary(3) β bye bestie! π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Mac-PropertyList 1.601.0-bp160.1.11 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms