Important: The information in this document is obsolete and should not be used for new development.
FlattenCollectionToHdl
You use theFlattenCollectionToHdl
utility function to flatten a collection into a Macintosh Memory Manager handle.
OSErr FlattenCollectionToHdl(Collection source Handle flattened);
source
- The collection that you want to flatten into a handle.
flattened
- A handle to contain the flattened data.
DESCRIPTION
This function flattens the collection referenced by thesource
parameter into a block of memory referenced by the handle you provide in theflattened
parameter.You must provide a valid collection object reference in the
source
parameter and a valid Macintosh Memory Manager handle in theflattened
parameter. You may specify a handle of size 0; this function resizes the handle as necessary to hold the flattened data.RESULT CODES
memFullErr -108 Can't allocate memory. SEE ALSO
For examples of this function, see "Reading Collections From and Writing Collections to Disk" beginning on page 5-41.For an example that shows one possible implementation of this function, see "Flattening and Unflattening a Collection" beginning on page 5-37.
To flatten a collection directly to disk, use the
FlattenCollection
function, described on page 5-88.To unflatten a collection from a block of memory referenced by a handle, use the
UnflattenCollectionFromHdl
function, described in the next section.