Function

CFPropertyListCreateFromStream

Creates a property list using data from a stream.

Declaration

CFPropertyListRef CFPropertyListCreateFromStream(CFAllocatorRef allocator, CFReadStreamRef stream, CFIndex streamLength, CFOptionFlags mutabilityOption, CFPropertyListFormat *format, CFStringRef *errorString);

Parameters

allocator

The allocator to use to allocate memory for the new property list. Pass NULL or kCFAllocatorDefault to use the current default allocator.

stream

The stream whose data contains the content. The stream must be opened and configured—this function simply reads bytes from the stream. The stream may contain any supported property list type (see CFPropertyListFormat).

streamLength

The number of bytes to read. If 0, this function will read to the end of the stream.

mutabilityOption

A constant that specifies the degree of mutability for the returned property list. See Property List Mutability Options for descriptions of possible values.

format

A constant that specifies the format of the property list. See CFPropertyListFormat for possible values.

errorString

On return, NULL if the conversion is successful, otherwise a string that describes the nature of the error. Error messages are not localized, but may be in the future, so they are not suitable for comparison.

Pass NULL if you do not wish to receive an error string. Ownership follows the The Create Rule.

Return Value

A new property list initialized with the data contained in stream. Ownership follows the The Create Rule.

Discussion

This function simply reads bytes from stream starting at the current location to the end, which is expected to be the end of the property list, or up to the number of bytes specified by streamLength if it is not 0.

Special Considerations

See Also

Creating a Property List

CFPropertyListCreateWithData

Creates a property list from a given CFData object.

CFPropertyListCreateWithStream

Create and return a property list with a CFReadStream input.

CFPropertyListCreateDeepCopy

Recursively creates a copy of a given property list.

CFPropertyListCreateFromXMLData

Creates a property list using the specified XML or binary property list data.

Deprecated

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software