Accessing property values

MPropertyStore contains the protocol for storing and retrieving properties individually or in batches. To facilitate batch operations, the Properties interface provides two collection classes: TPropertySet and TPropertyIDSet. TPropertySet collects TProperty instances and TPropertyIDSet collects TPropertyID instances.

Both of these collection classes include constructors that allow conversion to the other type of collection. For example, the TPropertyIDSet constructor allows conversion to TPropertySet. Both classes also have Add member functions that accept instances of either TPropertyID or TPropertySet as members.

"Using properties and property identifiers" on page 140 provides examples of accessing properties. "Using property collections" on page 143 describes how to define a property or property identifier set.

Property and property identifier collections differ from other collection classes in that they do not use aliases. Instead of a set containing aliases to the actual properties or property identifiers, sets of this interface actually own copies of each of the members. This simplifies memory management.

Property iterators

The Properties interface includes two iterators: TPropertySetIterator and TPropertyIDSetIterator. TPropertySetIterator iterates through a property set, and TPropertyIDSetIterator iterates through a property identifier set.

Read "Iterating through property and property identifier sets" on page 145 for examples of how to use these iterators.

Property queries

Using the properties interface, you can build property queries. When you iterate over a collection of instances that derive from MPropertyStore (instances that manage multiple properties) you can use a property query to filter for any MPropertyStore instances that contain the specific property values in which you are interested.

The File System interface uses properties in association with file system entities (TDirectory, TVolume, and TFile instances). The file system entities use MPropertyStore as a mix in to manage the properties associated with each entity. The File System interface also defines iterators that allow you to iterate through the file system entities in a directory, or through volumes. By using a property query with a directory iterator, you can filter for only those file system entities that contain properties with the values you want.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker