Iterating Through Available Collation Objects

Use ICollationIterator to iterate through the available collation objects. You can specify whether to look only at host objects, only at portable objects, or at both (the default). ICollationIterator provides a create function that returns the collation object currently referenced by the iterator.

To use ICollationIterator:

  1. Instantiate an ICollationIterator.
  2. Use operator++ to move forward through the list of available collation objects.
  3. Use create to get the collation object referenced by the iterator at a given point.

For example, this code shows how to iterate through the available collation objects and instantiate a collation object for French, if it is available:

ICollationIterator iter;

bool notFound = true;

ILocaleKey key;

while ( notFound && (iter) ) {

	key.setPOSIXID(iter.localePOSIXID());

	if (key.languageID == "FR") {

		ICollation* order = iter.create();

		notFound = false;

	} else {

		iter++;

	}

}

delete order;


Collation Classes