/* * Copyright © {1996-1999}, International Business Machines Corporation and others. All Rights Reserved. ******************************************************************************* * * 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 * 08/05/98 erm Synched with 1.2 version of RuleBasedCollator.java * 04/23/99 stephen Removed EDecompositionMode, merged with * Normalizer::EMode * 06/14/99 stephen Removed kResourceBundleSuffix * 11/02/99 helena Collator performance enhancements. Eliminates the * UnicodeString construction and special case for NO_OP. * 11/23/99 srl More performance enhancements. Updates to NormalizerIterator * internal state management. * 12/15/99 aliu Update to support Thai collation. Move NormalizerIterator * to implementation file. ******************************************************************************* */ #ifndef TBLCOLL_H #define TBLCOLL_H #include "unicode/utypes.h" #include "unicode/coll.h" #include "unicode/chariter.h" #include "unicode/unistr.h" #include "unicode/sortkey.h" #include "unicode/normlzr.h" class VectorOfPToContractElement; class VectorOfInt; class VectorOfPToContractTable; class VectorOfPToExpandTable; class MergeCollation; class CollationElementIterator; class RuleBasedCollatorStreamer; class NormalizerIterator; // see tblcoll.cpp class Collator; class TableCollationData; // This is just temporary, for prototyping. struct collIterate; typedef void * UCollator; /** * 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: *