Function

CFPropertyListWriteToStream

Writes the bytes of a property list serialization out to a stream.

Declaration

CFIndex CFPropertyListWriteToStream(CFPropertyListRef propertyList, CFWriteStreamRef stream, CFPropertyListFormat format, CFStringRef *errorString);

Parameters

propertyList

The property list to write out.

stream

The stream to write to. The stream must be opened and configured—this function simply writes bytes to the stream.

format

A constant that specifies the format used to write propertyList. See CFPropertyListFormat for possible values.

errorString

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

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

Return Value

The number of bytes written, or 0 if an error occurred. If 0 is returned, errorString will contain an error message.

Discussion

This function leaves the stream open after reading the content. When reading a property list, this function expects the reading stream to end wherever the writing ended, so that the end of the property list data can be identified.

Special Considerations

See Also

Exporting a Property List

CFPropertyListCreateData

Returns a CFData object containing a serialized representation of a given property list in a specified format.

CFPropertyListWrite

Write the bytes of a serialized property list out to a stream.

CFPropertyListCreateXMLData

Creates an XML representation of the specified property list.

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