/* ***************************************************************************************** * * * COPYRIGHT: * * (C) Copyright Taligent, Inc., 1996 * * (C) Copyright International Business Machines Corporation, 1996 * * Licensed Material - Program-Property of IBM - All Rights Reserved. * * US Government Users Restricted Rights - Use, duplication, or disclosure * * restricted by GSA ADP Schedule Contract with IBM Corp. * * * ***************************************************************************************** */ //=============================================================================== // // File tblcoll.h // // // // Created by: Helena Shih // // Modification History: // // Date Name Description // 2/5/97 aliu Added streamIn and streamOut methods. Added // constructor which reads RuleBasedCollator object from // a binary file. Added writeToFile method which streams // RuleBasedCollator out to a binary file. The streamIn // and streamOut methods use istream and ostream objects // in binary mode. // 2/12/97 aliu Modified to use TableCollationData sub-object to // hold invariant data. // 2/13/97 aliu Moved several methods into this class from Collation. // Added a private RuleBasedCollator(Locale&) constructor, // to be used by Collator::createDefault(). General // clean up. // 2/20/97 helena Added clone, operator==, operator!=, operator=, and copy // constructor and getDynamicClassID. // 3/5/97 aliu Modified constructFromFile() to add parameter // specifying whether or not binary loading is to be // attempted. This is required for dynamic rule loading. // 05/07/97 helena Added memory allocation error detection. // 6/17/97 helena Added IDENTICAL strength for compare, changed getRules to // use MergeCollation::getPattern. // 6/20/97 helena Java class name change. // 8/18/97 helena Added internal API documentation. // 09/03/97 helena Added createCollationKeyValues(). // 02/10/98 damiba Added compare with "length" parameter //=============================================================================== #ifndef _TBLCOLL #define _TBLCOLL #ifndef _PTYPES #include "ptypes.h" #endif #ifndef _COLL #include "coll.h" #endif #ifndef _UNISTRING #include "unistring.h" #endif #ifndef _SORTKEY #include "sortkey.h" #endif #include class CompactIntArray; class VectorOfPToContractElement; class VectorOfInt; class VectorOfPToContractTable; class VectorOfPToExpandTable; class MergeCollation; class CollationElementIterator; /** * The RuleBasedCollator class provides the simple implementation of Collator, * using data-driven tables. The user can create a customized table-based * collation. *

* RuleBasedCollator maps characters to collation keys. *

* Table Collation has the following restrictions for efficiency (other * subclasses may be used for more complex languages) : *

1. If the French secondary ordering is specified in a collation object, * it is applied to the whole object. *

2. All non-mentioned Unicode characters are at the end of the * collation order. *

3. Private use characters are treated as identical. The private * use area in Unicode is 0xE800-0xF8FF. *

The collation table is composed of a list of collation rules, where each * rule is of three forms: *

 * .    < modifier >
 * .    < relation > < text-argument >
 * .    < reset > < text-argument >
 * 
* The following demonstrates how to create your own collation rules: *