Functions



CFURLCreateDataAndPropertiesFromResource

Abstract: Loads the data and properties referred to by the specified URL.
Boolean CFURLCreateDataAndPropertiesFromResource(CFAllocatorRef alloc, 
 CFURLRef url,
 CFDataRef *resourceData, 
 CFDictionaryRef *properties,
 CFArrayRef desiredProperties, 
 SInt32 *errorCode);

If you are interested in loading only the resource data or the resource's properties, pass NULL for one you don't want. If properties is non-NULL and desiredProperties is NULL then all properties are fetched. Note that as much work as possible is done even if FALSE is returned. For instance, if one property is not available, the others are fetched anyway.

Parameters

NameDescription
allocThe memory allocator to use. Pass kCFAllocatorDefault to use the system allocator.
urlThe URL referring to the data and/or properties you wish to load.
resourceDataOn return, a pointer to a CFData reference containing the data referred to by the specified URL. You are responsible for releasing the resource data.
propertiesOn return, a pointer to a CFDictionary reference containing the resource properties referred to by the specified URL. You are responsible for releasing the properties.
desiredPropertiesA list of the properties you wish returned to you.
errorCode0 if successful, otherwise a CFURLError error code indicating the nature of the problem.
Result: TRUE if successful, otherwise FALSE.

CFURLCreatePropertyFromResource

Abstract: Loads the specified property indicated by the the specified URL and property string.
CFTypeRef CFURLCreatePropertyFromResource(CFAllocatorRef alloc, 
 CFURLRef url, 
 CFStringRef property, 
 SInt32 *errorCode);

This is a convenience function which calls through to CFURLCreateDataAndPropertiesFromResource.

Parameters

NameDescription
allocThe memory allocator to use. Pass kCFAllocatorDefault to use the system allocator.
urlThe URL referring to the resource whose properties you wish to load.
propertyThe name of the property you wish to load. Pass one of the provided string constants indicating the property.
errorCode0 if successful, otherwise a CFURLError error code indicating the nature of the problem.
Result: TRUE if successful, otherwise FALSE.

CFURLDestroyResource

Abstract: Destroys the resource indicated by the specified URL.
Boolean CFURLDestroyResource(CFURLRef url, SInt32 *errorCode);

Parameters

NameDescription
urlThe URL of the resource you wish to destroy.
errorCodeOn return, 0 if successful, otherwise a CFURLError error code indicating the nature of the problem.
Result: TRUE if successful, otherwise FALSE.

CFURLWriteDataAndPropertiesToResource

Abstract: Writes the specified data and properties to the specified URL.
Boolean CFURLWriteDataAndPropertiesToResource(CFURLRef url, 
 CFDataRef dataToWrite, 
 CFDictionaryRef propertiesToWrite, 
 SInt32 *errorCode);

Properties not present in propertiesToWrite are left unchanged, hence if propertiesToWrite is NULL or empty, the URL's properties are not changed at all.

Parameters

NameDescription
urlThe resource you wish to write.
dataToWriteThe data to write. Pass NULL to write only properties.
propertiesToWriteThe properties to write. Pass NULL to write only data.
errorCode0 if successful, otherwise a CFURLError error code indicating the nature of the problem.
Result: TRUE if successful, otherwise FALSE.

© 2000 Apple Computer, Inc. — (Last Updated 7/20/2000)