Important: The information in this document is obsolete and should not be used for new development.
GetCollectionItemInfo
You use theGetCollectionItemInfofunction to obtain information about a specific collection item given the item's collection tag and collection ID.
OSErr GetCollectionItemInfo(Collection source, CollectionTag tag, long id, long *index, long *itemSize, long *attributes);
source- A reference to the collection object containing the item you want to obtain information about.
tag- The collection tag associated with the item you want to obtain information about.
id- The collection ID associated with the item you want to obtain information about.
index- A pointer to a
longvalue. On return, this value represents the collection index of the specified item. You may specify the constantdontWantIndexfor this parameter if you do not want to determine the specified item's collection index.itemSize- A pointer to a
longvalue. On return, this value indicates the size in bytes of the variable-length data associated with the specified item. You may specify the constantdontWantSizefor this parameter to indicate that you do not want to determine the size of this data.attributes- A pointer to a
longvalue. On return, this value contains a copy of the attributes associated with the specified item. You may specify the constantdontWantAttributesfor this parameter if you do not want a copy of the item's attributes.DESCRIPTION
TheGetCollectionItemInfofunction allows you to obtain information about a specific collection item in the collection referenced by thesourceparameter. You specify the collection item by specifying the item's collection tag and collection ID in thetagandidparameters.This function returns information in the
index,itemSize, andattributesparameters:
- If you provide a pointer in the
indexparameter, the function uses this parameter to return the collection index of the specified item. Once you have determined an item's collection index, you can use it to specify the item when calling Collection Manager functions, rather than using the item's collection tag and collection ID. Specifying collection items using their collection index, rather than using the item's collection tag and collection ID, generally results in improved performance.- If you provide a pointer in the
itemSizeparameter, the function uses this parameter to return the size in bytes of the variable-length data associated with the specified collection item.- If you provide a pointer in the
attributesparameter, the function uses this parameter to return a copy of the attributes associated with the specified collection item.
RESULT CODES
collectionItemNotFoundErr -5751 Can't locate item. SEE ALSO
For information about collection items and their associated collection tags, collection IDs, and variable-length data, see "Collection Items" beginning on page 5-8.For examples of this function, see "Determining the Collection Index of an Item" beginning on page 5-19, "Determining the Size of an Item's Variable-Length Data" beginning on page 5-22, and "Getting and Setting the Attributes of an Item" beginning on page 5-24.
To obtain information about a collection item using the collection index to specify the item, use the
GetIndexedCollectionItemInfofunction, described in the next section.To obtain information about a collection item using the collection tag and tag list position to specify the item, use the
GetTaggedCollectionItemInfofunction, described on page 5-80.