Mac::CoreFoundation - CoreFoundation object wrappers.
use Mac::CoreFoundation;
my $cfarray = CFArrayCreate([CFSTR("Hello"),kCFNull], kCFTypeArrayCallBacks);
my @array = @{$cfarray->as_array()};
For detailed information on the CoreFoundation API (highly recommended, as a familiarity with CoreFoundation is assumed in the POD), see apple.com.
http://developer.apple.com/techpubs/macosx/CoreFoundation/CoreFoundation.html
The documentation is also located on your system, if you have the Developer Tools installed, at /Developer/Documentation/Carbon/.
Also of significant use are the related header files on your system. Use the `locate` command to find them. They contain current documentation and notes for the API.
as_perl() - converts any CFTypeRef to the corresponding perl data structure. It is a recursive conversion
that is a CFArrayRef containing CFStringRef's is converted to reference to a perl array containing strings.as_boolean() - converts a CFBooleanRef to a perl boolean value.as_number() - converts a CFNumberRef to a perl numeric value. TODOas_string() - converts a CFStringRef to a perl string valueas_array() - converts a CFArrayRef to a refrenece to a perl array, (non recursive).as_hash() - converts a CFDictionaryRef to a refrenece to a perl hash, (non recursive). TODOCFArrayGetLength($array) you have to call $array->CFArrayGetLength()
Constructor (and non selector) functions are expored by default:
eg.: my $array = CFArrayCreate([1,2,3], kCFTypeArrayCallBacks)
Perl->CFTypeRef conversion is supposed to be automatically. Eg: each rutine expecting a CFStringRef accepts a perl string as well. TODO
Memory management supposed to be automatic. CFTypeRef has a CFRelease method, but in most cases you shouldn't call it. When the perl object destructor is invoked an impicit CFRelease is called.
The Mac::CoreFoundation modules were written by Miklos Fazekas <boga@mac.com>.
perl(1).