1b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/* 2b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru****************************************************************************** 3fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius* Copyright (C) 1996-2014, International Business Machines Corporation and 4b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* others. All Rights Reserved. 5b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru****************************************************************************** 6b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*/ 7b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 8b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 9c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * \file 10fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * \brief C++ API: The RuleBasedCollator class implements the Collator abstract base class. 11c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru */ 12c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru 13c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru/** 14b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* File tblcoll.h 15b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 16b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* Created by: Helena Shih 17b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 18b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* Modification History: 19b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 20b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* Date Name Description 21b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 2/5/97 aliu Added streamIn and streamOut methods. Added 22b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* constructor which reads RuleBasedCollator object from 23b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* a binary file. Added writeToFile method which streams 24b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* RuleBasedCollator out to a binary file. The streamIn 25b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* and streamOut methods use istream and ostream objects 26b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* in binary mode. 27b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 2/12/97 aliu Modified to use TableCollationData sub-object to 28b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* hold invariant data. 29b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 2/13/97 aliu Moved several methods into this class from Collation. 30b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* Added a private RuleBasedCollator(Locale&) constructor, 31b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* to be used by Collator::createDefault(). General 32b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* clean up. 33b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 2/20/97 helena Added clone, operator==, operator!=, operator=, and copy 34b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* constructor and getDynamicClassID. 35b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 3/5/97 aliu Modified constructFromFile() to add parameter 36b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* specifying whether or not binary loading is to be 37b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* attempted. This is required for dynamic rule loading. 38b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 05/07/97 helena Added memory allocation error detection. 39b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 6/17/97 helena Added IDENTICAL strength for compare, changed getRules to 40b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* use MergeCollation::getPattern. 41b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 6/20/97 helena Java class name change. 42b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 8/18/97 helena Added internal API documentation. 43b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 09/03/97 helena Added createCollationKeyValues(). 44b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 02/10/98 damiba Added compare with "length" parameter 45b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 08/05/98 erm Synched with 1.2 version of RuleBasedCollator.java 46b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 04/23/99 stephen Removed EDecompositionMode, merged with 47b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* Normalizer::EMode 48b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 06/14/99 stephen Removed kResourceBundleSuffix 49b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 11/02/99 helena Collator performance enhancements. Eliminates the 50b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* UnicodeString construction and special case for NO_OP. 51b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 11/23/99 srl More performance enhancements. Updates to NormalizerIterator 52b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* internal state management. 53b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 12/15/99 aliu Update to support Thai collation. Move NormalizerIterator 54b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* to implementation file. 55b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* 01/29/01 synwee Modified into a C++ wrapper which calls C API 56b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* (ucol.h) 57fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius* 2012-2014 markus Rewritten in C++ again. 58b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*/ 59b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 60b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#ifndef TBLCOLL_H 61b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define TBLCOLL_H 62b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 63b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#include "unicode/utypes.h" 64b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 65b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#if !UCONFIG_NO_COLLATION 66b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 67b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#include "unicode/coll.h" 68fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius#include "unicode/locid.h" 69fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius#include "unicode/uiter.h" 70b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#include "unicode/ucol.h" 71b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 72b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_NAMESPACE_BEGIN 73b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 74fceb39872958b9fa2505e63f8b8699a9e0f882f4ccorneliusstruct CollationData; 75fceb39872958b9fa2505e63f8b8699a9e0f882f4ccorneliusstruct CollationSettings; 76fceb39872958b9fa2505e63f8b8699a9e0f882f4ccorneliusstruct CollationTailoring; 77b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 78b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* @stable ICU 2.0 79b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*/ 80b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruclass StringSearch; 81b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 82b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* @stable ICU 2.0 83b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*/ 84b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruclass CollationElementIterator; 85fceb39872958b9fa2505e63f8b8699a9e0f882f4ccorneliusclass CollationKey; 86fceb39872958b9fa2505e63f8b8699a9e0f882f4ccorneliusclass SortKeyByteSink; 87fceb39872958b9fa2505e63f8b8699a9e0f882f4ccorneliusclass UnicodeSet; 88fceb39872958b9fa2505e63f8b8699a9e0f882f4ccorneliusclass UnicodeString; 89fceb39872958b9fa2505e63f8b8699a9e0f882f4ccorneliusclass UVector64; 90b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 91b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** 92fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * The RuleBasedCollator class provides the implementation of 93b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Collator, using data-driven tables. The user can create a customized 94b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * table-based collation. 95b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p> 96b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * For more information about the collation service see 97fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * <a href="http://userguide.icu-project.org/collation">the User Guide</a>. 98b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p> 99b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Collation service provides correct sorting orders for most locales supported in ICU. 100b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * If specific data for a locale is not available, the orders eventually falls back 101fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * to the <a href="http://www.unicode.org/reports/tr35/tr35-collation.html#Root_Collation">CLDR root sort order</a>. 102b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p> 103b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Sort ordering may be customized by providing your own set of rules. For more on 104fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * this subject see the <a href="http://userguide.icu-project.org/collation/customization"> 105fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Collation Customization</a> section of the User Guide. 106b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p> 107b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Note, RuleBasedCollator is not to be subclassed. 108b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see Collator 109b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 110fceb39872958b9fa2505e63f8b8699a9e0f882f4ccorneliusclass U_I18N_API RuleBasedCollator : public Collator { 111b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querupublic: 112b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 113b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * RuleBasedCollator constructor. This takes the table rules and builds a 114b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * collation table out of them. Please see RuleBasedCollator class 115b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * description for more details on the collation rule syntax. 116b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param rules the collation rules to build the collation table from. 117b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status reporting a success or an error. 118b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 119b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 120b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru RuleBasedCollator(const UnicodeString& rules, UErrorCode& status); 121b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 122b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 123b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * RuleBasedCollator constructor. This takes the table rules and builds a 124b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * collation table out of them. Please see RuleBasedCollator class 125b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * description for more details on the collation rule syntax. 126b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param rules the collation rules to build the collation table from. 127dbc22bd174be483711cea006f3189d8289835830ccornelius * @param collationStrength strength for comparison 128b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status reporting a success or an error. 129b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 130b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 131b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru RuleBasedCollator(const UnicodeString& rules, 132b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru ECollationStrength collationStrength, 133b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode& status); 134b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 135b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 136b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * RuleBasedCollator constructor. This takes the table rules and builds a 137b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * collation table out of them. Please see RuleBasedCollator class 138b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * description for more details on the collation rule syntax. 139b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param rules the collation rules to build the collation table from. 140b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param decompositionMode the normalisation mode 141b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status reporting a success or an error. 142b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 143b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 144b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru RuleBasedCollator(const UnicodeString& rules, 145b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UColAttributeValue decompositionMode, 146b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode& status); 147b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 148b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 149b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * RuleBasedCollator constructor. This takes the table rules and builds a 150b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * collation table out of them. Please see RuleBasedCollator class 151b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * description for more details on the collation rule syntax. 152b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param rules the collation rules to build the collation table from. 153dbc22bd174be483711cea006f3189d8289835830ccornelius * @param collationStrength strength for comparison 154b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param decompositionMode the normalisation mode 155b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status reporting a success or an error. 156b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 157b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 158b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru RuleBasedCollator(const UnicodeString& rules, 159b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru ECollationStrength collationStrength, 160b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UColAttributeValue decompositionMode, 161b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode& status); 162b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 163fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius#ifndef U_HIDE_INTERNAL_API 164fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius /** 165fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * TODO: document & propose as public API 166fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @internal 167fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius */ 168fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius RuleBasedCollator(const UnicodeString &rules, 169fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UParseError &parseError, UnicodeString &reason, 170fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UErrorCode &errorCode); 171fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius#endif /* U_HIDE_INTERNAL_API */ 172fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius 173b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 174b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Copy constructor. 175b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param other the RuleBasedCollator object to be copied 176b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 177b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 178b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru RuleBasedCollator(const RuleBasedCollator& other); 179b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 180b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 181b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Opens a collator from a collator binary image created using 182b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * cloneBinary. Binary image used in instantiation of the 183b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * collator remains owned by the user and should stay around for 184b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * the lifetime of the collator. The API also takes a base collator 185fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * which usually should be the root collator. 186b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param bin binary image owned by the user and required through the 187b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * lifetime of the collator 188b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param length size of the image. If negative, the API will try to 189b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * figure out the length of the image 190fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param base fallback collator, usually root. The base is required to be 191b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * present through the lifetime of the collator. Currently 192b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * it cannot be NULL. 193b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status for catching errors 194b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return newly created collator 195b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see cloneBinary 196b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 3.4 197b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 198b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru RuleBasedCollator(const uint8_t *bin, int32_t length, 199b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru const RuleBasedCollator *base, 200b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode &status); 201b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 202b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 203b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Destructor. 204b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 205b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 206b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru virtual ~RuleBasedCollator(); 207b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 208b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 209b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Assignment operator. 210fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param other other RuleBasedCollator object to copy from. 211b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 212b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 213b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru RuleBasedCollator& operator=(const RuleBasedCollator& other); 214b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 215b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 216b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns true if argument is the same as this object. 217b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param other Collator object to be compared. 218b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return true if arguments is the same as this object. 219b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 220b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 221b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru virtual UBool operator==(const Collator& other) const; 222b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 223b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 22454dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * Makes a copy of this object. 22554dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * @return a copy of this object, owned by the caller 226b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 227b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 228b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru virtual Collator* clone(void) const; 229b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 230b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 231b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Creates a collation element iterator for the source string. The caller of 232b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * this method is responsible for the memory management of the return 233b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * pointer. 234b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param source the string over which the CollationElementIterator will 235b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * iterate. 236b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return the collation element iterator of the source string using this as 237b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * the based Collator. 238b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.2 239b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 240b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru virtual CollationElementIterator* createCollationElementIterator( 241b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru const UnicodeString& source) const; 242b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 243b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 244b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Creates a collation element iterator for the source. The caller of this 245b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * method is responsible for the memory management of the returned pointer. 246b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param source the CharacterIterator which produces the characters over 247b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * which the CollationElementItgerator will iterate. 248b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return the collation element iterator of the source using this as the 249b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * based Collator. 250b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.2 251b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 252b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru virtual CollationElementIterator* createCollationElementIterator( 253b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru const CharacterIterator& source) const; 254b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 25554dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius // Make deprecated versions of Collator::compare() visible. 25654dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius using Collator::compare; 257b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 258b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 259b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The comparison function compares the character data stored in two 260b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * different strings. Returns information about whether a string is less 261b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * than, greater than or equal to another string. 262b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param source the source string to be compared with. 263b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param target the string that is to be compared with the source string. 264b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status possible error code 265b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return Returns an enum value. UCOL_GREATER if source is greater 266b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * than target; UCOL_EQUAL if source is equal to target; UCOL_LESS if source is less 267b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * than target 268b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 269b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru **/ 270b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru virtual UCollationResult compare(const UnicodeString& source, 271fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius const UnicodeString& target, 272fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UErrorCode &status) const; 273b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 274b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 275b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Does the same thing as compare but limits the comparison to a specified 276b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * length 277b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param source the source string to be compared with. 278b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param target the string that is to be compared with the source string. 279b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param length the length the comparison is limited to 280b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status possible error code 281b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return Returns an enum value. UCOL_GREATER if source (up to the specified 282b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * length) is greater than target; UCOL_EQUAL if source (up to specified 283b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * length) is equal to target; UCOL_LESS if source (up to the specified 284b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * length) is less than target. 285b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 286b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 287b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru virtual UCollationResult compare(const UnicodeString& source, 288fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius const UnicodeString& target, 289fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius int32_t length, 290fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UErrorCode &status) const; 291b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 292b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 293b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The comparison function compares the character data stored in two 294b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * different string arrays. Returns information about whether a string array 295b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * is less than, greater than or equal to another string array. 296b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param source the source string array to be compared with. 297b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param sourceLength the length of the source string array. If this value 298b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * is equal to -1, the string array is null-terminated. 299b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param target the string that is to be compared with the source string. 300b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param targetLength the length of the target string array. If this value 301b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * is equal to -1, the string array is null-terminated. 302b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status possible error code 303b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return Returns an enum value. UCOL_GREATER if source is greater 304b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * than target; UCOL_EQUAL if source is equal to target; UCOL_LESS if source is less 305b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * than target 306b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.6 307b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 308b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru virtual UCollationResult compare(const UChar* source, int32_t sourceLength, 309fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius const UChar* target, int32_t targetLength, 310fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UErrorCode &status) const; 311b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 312b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 313b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Compares two strings using the Collator. 314b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * Returns whether the first one compares less than/equal to/greater than 315b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * the second one. 316b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * This version takes UCharIterator input. 317b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param sIter the first ("source") string iterator 318b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param tIter the second ("target") string iterator 319b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param status ICU status 320b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @return UCOL_LESS, UCOL_EQUAL or UCOL_GREATER 32150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @stable ICU 4.2 322b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru */ 323b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru virtual UCollationResult compare(UCharIterator &sIter, 324b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru UCharIterator &tIter, 325b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru UErrorCode &status) const; 326b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru 327b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru /** 328fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Compares two UTF-8 strings using the Collator. 329fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Returns whether the first one compares less than/equal to/greater than 330fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * the second one. 331fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * This version takes UTF-8 input. 332fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Note that a StringPiece can be implicitly constructed 333fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * from a std::string or a NUL-terminated const char * string. 334fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param source the first UTF-8 string 335fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param target the second UTF-8 string 336fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param status ICU status 337fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @return UCOL_LESS, UCOL_EQUAL or UCOL_GREATER 338fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @stable ICU 51 339fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius */ 340fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius virtual UCollationResult compareUTF8(const StringPiece &source, 341fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius const StringPiece &target, 342fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UErrorCode &status) const; 343fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius 344fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius /** 345b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Transforms a specified region of the string into a series of characters 346b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * that can be compared with CollationKey.compare. Use a CollationKey when 347b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * you need to do repeated comparisions on the same string. For a single 348b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * comparison the compare method will be faster. 349b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param source the source string. 350b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param key the transformed key of the source string. 351b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status the error code status. 352b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return the transformed key. 353b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see CollationKey 35454dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * @stable ICU 2.0 355b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 356b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru virtual CollationKey& getCollationKey(const UnicodeString& source, 357b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru CollationKey& key, 358b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode& status) const; 359b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 360b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 361b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Transforms a specified region of the string into a series of characters 362b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * that can be compared with CollationKey.compare. Use a CollationKey when 363b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * you need to do repeated comparisions on the same string. For a single 364b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * comparison the compare method will be faster. 365b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param source the source string. 366b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param sourceLength the length of the source string. 367b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param key the transformed key of the source string. 368b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status the error code status. 369b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return the transformed key. 370b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see CollationKey 37154dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * @stable ICU 2.0 372b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 373b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru virtual CollationKey& getCollationKey(const UChar *source, 374b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t sourceLength, 375b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru CollationKey& key, 376b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode& status) const; 377b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 378b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 379b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Generates the hash code for the rule-based collation object. 380b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return the hash code. 381b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 382b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 383fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius virtual int32_t hashCode() const; 384b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 385b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 386b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Gets the locale of the Collator 387b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param type can be either requested, valid or actual locale. For more 388b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * information see the definition of ULocDataLocaleType in 389b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * uloc.h 390b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status the error code status. 391b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return locale where the collation data lives. If the collator 392b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * was instantiated from rules, locale is empty. 393b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @deprecated ICU 2.8 likely to change in ICU 3.0, based on feedback 394b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 39554dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius virtual Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const; 396b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 397b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 39854dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * Gets the tailoring rules for this collator. 39954dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * @return the collation tailoring from which this collator was created 400b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 401b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 402fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius const UnicodeString& getRules() const; 403b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 404b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 405b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Gets the version information for a Collator. 406b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param info the version # information, the result will be filled in 407b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 408b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 409b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru virtual void getVersion(UVersionInfo info) const; 410b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 4118393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius#ifndef U_HIDE_DEPRECATED_API 412b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 4138393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * Returns the maximum length of any expansion sequences that end with the 414b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * specified comparison order. 4158393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * 4168393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * This is specific to the kind of collation element values and sequences 4178393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * returned by the CollationElementIterator. 4188393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * Call CollationElementIterator::getMaxExpansion() instead. 4198393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * 4208393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * @param order a collation order returned by CollationElementIterator::previous 4218393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * or CollationElementIterator::next. 422b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return maximum size of the expansion sequences ending with the collation 4238393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * element, or 1 if the collation element does not occur at the end of 424b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * any expansion sequence 425b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see CollationElementIterator#getMaxExpansion 4268393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius * @deprecated ICU 51 Use CollationElementIterator::getMaxExpansion() instead. 427b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 428b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t getMaxExpansion(int32_t order) const; 4298393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius#endif /* U_HIDE_DEPRECATED_API */ 430b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 431b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 432b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This 433b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * method is to implement a simple version of RTTI, since not all C++ 434b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * compilers support genuine RTTI. Polymorphic operator==() and clone() 435b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * methods call this method. 436b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The class ID for this object. All objects of a given class have 437b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * the same class ID. Objects of other classes have different class 438b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * IDs. 439b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 440b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 441b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru virtual UClassID getDynamicClassID(void) const; 442b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 443b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 444b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns the class ID for this class. This is useful only for comparing to 445b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * a return value from getDynamicClassID(). For example: 446b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <pre> 447b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Base* polymorphic_pointer = createPolymorphicObject(); 448b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * if (polymorphic_pointer->getDynamicClassID() == 449b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Derived::getStaticClassID()) ... 450b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * </pre> 451b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The class ID for all objects of this class. 452b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 453b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 454b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru static UClassID U_EXPORT2 getStaticClassID(void); 455b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 45659d709d503bab6e2b61931737e662dd293b40578ccornelius#ifndef U_HIDE_DEPRECATED_API 457b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 45859d709d503bab6e2b61931737e662dd293b40578ccornelius * Do not use this method: The caller and the ICU library might use different heaps. 45959d709d503bab6e2b61931737e662dd293b40578ccornelius * Use cloneBinary() instead which writes to caller-provided memory. 46059d709d503bab6e2b61931737e662dd293b40578ccornelius * 46159d709d503bab6e2b61931737e662dd293b40578ccornelius * Returns a binary format of this collator. 462b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param length Returns the length of the data, in bytes 463b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status the error code status. 464b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return memory, owned by the caller, of size 'length' bytes. 46559d709d503bab6e2b61931737e662dd293b40578ccornelius * @deprecated ICU 52. Use cloneBinary() instead. 466b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 467fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius uint8_t *cloneRuleData(int32_t &length, UErrorCode &status) const; 46859d709d503bab6e2b61931737e662dd293b40578ccornelius#endif /* U_HIDE_DEPRECATED_API */ 469b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 470b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** Creates a binary image of a collator. This binary image can be stored and 471b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * later used to instantiate a collator using ucol_openBinary. 472b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This API supports preflighting. 473b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param buffer a fill-in buffer to receive the binary image 474b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param capacity capacity of the destination buffer 475b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status for catching errors 476b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return size of the image 477b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ucol_openBinary 478b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 3.4 479b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 480fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius int32_t cloneBinary(uint8_t *buffer, int32_t capacity, UErrorCode &status) const; 481b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 482b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 483b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns current rules. Delta defines whether full rules are returned or 484b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * just the tailoring. 48554dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * 48654dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * getRules(void) should normally be used instead. 48754dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * See http://userguide.icu-project.org/collation/customization#TOC-Building-on-Existing-Locales 488b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param delta one of UCOL_TAILORING_ONLY, UCOL_FULL_RULES. 489b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param buffer UnicodeString to store the result rules 490b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.2 49154dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * @see UCOL_FULL_RULES 492b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 493fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius void getRules(UColRuleOption delta, UnicodeString &buffer) const; 494b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 495b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 496b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Universal attribute setter 497b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param attr attribute type 498b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param value attribute value 499b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status to indicate whether the operation went on smoothly or there were errors 500b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.2 501b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 502b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru virtual void setAttribute(UColAttribute attr, UColAttributeValue value, 503b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru UErrorCode &status); 504b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 505b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 506b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Universal attribute getter. 507b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param attr attribute type 508b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status to indicate whether the operation went on smoothly or there were errors 509b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return attribute value 510b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.2 511b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 512b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru virtual UColAttributeValue getAttribute(UColAttribute attr, 51354dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius UErrorCode &status) const; 514b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 515b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 516fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Sets the variable top to the top of the specified reordering group. 517fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * The variable top determines the highest-sorting character 518fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * which is affected by UCOL_ALTERNATE_HANDLING. 519fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * If that attribute is set to UCOL_NON_IGNORABLE, then the variable top has no effect. 520fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param group one of UCOL_REORDER_CODE_SPACE, UCOL_REORDER_CODE_PUNCTUATION, 521fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * UCOL_REORDER_CODE_SYMBOL, UCOL_REORDER_CODE_CURRENCY; 522fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * or UCOL_REORDER_CODE_DEFAULT to restore the default max variable group 523fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param errorCode Standard ICU error code. Its input value must 524fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * pass the U_SUCCESS() test, or else the function returns 525fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * immediately. Check for U_FAILURE() on output or use with 526fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * function chaining. (See User Guide for details.) 527fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @return *this 528fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @see getMaxVariable 529fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @draft ICU 53 530fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius */ 531fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius virtual Collator &setMaxVariable(UColReorderCode group, UErrorCode &errorCode); 532fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius 533fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius /** 534fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Returns the maximum reordering group whose characters are affected by UCOL_ALTERNATE_HANDLING. 535fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @return the maximum variable reordering group. 536fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @see setMaxVariable 537fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @draft ICU 53 538fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius */ 539fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius virtual UColReorderCode getMaxVariable() const; 540fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius 541fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius /** 542fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Sets the variable top to the primary weight of the specified string. 543fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * 544fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Beginning with ICU 53, the variable top is pinned to 545fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * the top of one of the supported reordering groups, 546fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * and it must not be beyond the last of those groups. 547fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * See setMaxVariable(). 548b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param varTop one or more (if contraction) UChars to which the variable top should be set 549b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param len length of variable top string. If -1 it is considered to be zero terminated. 550b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status error code. If error code is set, the return value is undefined. Errors set by this function are: <br> 551fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction<br> 552fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * U_ILLEGAL_ARGUMENT_ERROR if the variable top is beyond 553fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * the last reordering group supported by setMaxVariable() 554fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @return variable top primary weight 555fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @deprecated ICU 53 Call setMaxVariable() instead. 556b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 557b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru virtual uint32_t setVariableTop(const UChar *varTop, int32_t len, UErrorCode &status); 558b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 559b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 560fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Sets the variable top to the primary weight of the specified string. 561fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * 562fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Beginning with ICU 53, the variable top is pinned to 563fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * the top of one of the supported reordering groups, 564fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * and it must not be beyond the last of those groups. 565fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * See setMaxVariable(). 566fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param varTop a UnicodeString size 1 or more (if contraction) of UChars to which the variable top should be set 567b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status error code. If error code is set, the return value is undefined. Errors set by this function are: <br> 568fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction<br> 569fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * U_ILLEGAL_ARGUMENT_ERROR if the variable top is beyond 570fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * the last reordering group supported by setMaxVariable() 571fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @return variable top primary weight 572fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @deprecated ICU 53 Call setMaxVariable() instead. 573b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 57454dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius virtual uint32_t setVariableTop(const UnicodeString &varTop, UErrorCode &status); 575b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 576b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 577fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Sets the variable top to the specified primary weight. 578fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * 579fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Beginning with ICU 53, the variable top is pinned to 580fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * the top of one of the supported reordering groups, 581fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * and it must not be beyond the last of those groups. 582fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * See setMaxVariable(). 583fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param varTop primary weight, as returned by setVariableTop or ucol_getVariableTop 584fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param status error code 585fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @deprecated ICU 53 Call setMaxVariable() instead. 586b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 58754dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius virtual void setVariableTop(uint32_t varTop, UErrorCode &status); 588b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 589b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 590b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Gets the variable top value of a Collator. 591b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status error code (not changed by function). If error code is set, the return value is undefined. 592fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @return the variable top primary weight 593fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @see getMaxVariable 594b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 595b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 596b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru virtual uint32_t getVariableTop(UErrorCode &status) const; 597b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 598b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 599fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Get a UnicodeSet that contains all the characters and sequences tailored in 600b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * this collator. 601b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status error code of the operation 602b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return a pointer to a UnicodeSet object containing all the 603b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * code points and sequences that may sort differently than 604fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * in the root collator. The object must be disposed of by using delete 605b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.4 606b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 607b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru virtual UnicodeSet *getTailoredSet(UErrorCode &status) const; 608b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 609b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 610fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Get the sort key as an array of bytes from a UnicodeString. 611b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param source string to be processed. 612b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param result buffer to store result in. If NULL, number of bytes needed 613b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * will be returned. 614b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resultLength length of the result buffer. If if not enough the 615b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * buffer will be filled to capacity. 616b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return Number of bytes needed for storing the sort key 617b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0 618b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 619b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru virtual int32_t getSortKey(const UnicodeString& source, uint8_t *result, 620b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru int32_t resultLength) const; 621b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 622b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 623fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Get the sort key as an array of bytes from a UChar buffer. 624b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param source string to be processed. 625b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param sourceLength length of string to be processed. If -1, the string 626b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * is 0 terminated and length will be decided by the function. 627b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param result buffer to store result in. If NULL, number of bytes needed 628b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * will be returned. 629b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resultLength length of the result buffer. If if not enough the 630b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * buffer will be filled to capacity. 631b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return Number of bytes needed for storing the sort key 632b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.2 633b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 634b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru virtual int32_t getSortKey(const UChar *source, int32_t sourceLength, 635b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru uint8_t *result, int32_t resultLength) const; 636b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 637b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 638b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * Retrieves the reordering codes for this collator. 63927f654740f2a26ad62a5c155af9199af9e69b889claireho * @param dest The array to fill with the script ordering. 640b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @param destCapacity The length of dest. If it is 0, then dest may be NULL and the function 641b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * will only return the length of the result without writing any of the result string (pre-flighting). 642b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @param status A reference to an error code value, which must not indicate 643b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * a failure before the function call. 644b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @return The length of the script ordering array. 645b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @see ucol_setReorderCodes 646b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @see Collator#getEquivalentReorderCodes 647b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @see Collator#setReorderCodes 648103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * @stable ICU 4.8 64927f654740f2a26ad62a5c155af9199af9e69b889claireho */ 65054dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius virtual int32_t getReorderCodes(int32_t *dest, 65154dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius int32_t destCapacity, 65254dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius UErrorCode& status) const; 65327f654740f2a26ad62a5c155af9199af9e69b889claireho 65427f654740f2a26ad62a5c155af9199af9e69b889claireho /** 655b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * Sets the ordering of scripts for this collator. 656b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @param reorderCodes An array of script codes in the new order. This can be NULL if the 657b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * length is also set to 0. An empty array will clear any reordering codes on the collator. 65827f654740f2a26ad62a5c155af9199af9e69b889claireho * @param reorderCodesLength The length of reorderCodes. 659b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @param status error code 660b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @see Collator#getReorderCodes 661b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho * @see Collator#getEquivalentReorderCodes 662103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius * @stable ICU 4.8 663b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho */ 66454dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius virtual void setReorderCodes(const int32_t* reorderCodes, 66554dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius int32_t reorderCodesLength, 66654dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius UErrorCode& status) ; 667b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho 668b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho /** 669fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Implements ucol_strcollUTF8(). 670fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @internal 67127f654740f2a26ad62a5c155af9199af9e69b889claireho */ 672fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius virtual UCollationResult internalCompareUTF8( 673fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius const char *left, int32_t leftLength, 674fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius const char *right, int32_t rightLength, 675fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UErrorCode &errorCode) const; 676b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 677fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius /** Get the short definition string for a collator. This internal API harvests the collator's 678fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * locale and the attribute set and produces a string that can be used for opening 679fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * a collator with the same attributes using the ucol_openFromShortString API. 680fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * This string will be normalized. 681fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * The structure and the syntax of the string is defined in the "Naming collators" 682fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * section of the users guide: 683fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * http://userguide.icu-project.org/collation/concepts#TOC-Collator-naming-scheme 684fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * This function supports preflighting. 685fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * 686fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * This is internal, and intended to be used with delegate converters. 687fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * 688fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param locale a locale that will appear as a collators locale in the resulting 689fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * short string definition. If NULL, the locale will be harvested 690fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * from the collator. 691fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param buffer space to hold the resulting string 692fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param capacity capacity of the buffer 693fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param status for returning errors. All the preflighting errors are featured 694fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @return length of the resulting string 695fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @see ucol_openFromShortString 696fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @see ucol_normalizeShortDefinitionString 697fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @see ucol_getShortDefinitionString 698fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @internal 699fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius */ 700fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius virtual int32_t internalGetShortDefinitionString(const char *locale, 701fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius char *buffer, 702fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius int32_t capacity, 703fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UErrorCode &status) const; 704b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 705b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 706fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Implements ucol_nextSortKeyPart(). 707fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @internal 708fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius */ 709fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius virtual int32_t internalNextSortKeyPart( 710fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UCharIterator *iter, uint32_t state[2], 711fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius uint8_t *dest, int32_t count, UErrorCode &errorCode) const; 712b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 713fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius#ifndef U_HIDE_INTERNAL_API 714b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 715fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Only for use in ucol_openRules(). 716fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @internal 717b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 718b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru RuleBasedCollator(); 719b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 720b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 721fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Implements ucol_getLocaleByType(). 722fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Needed because the lifetime of the locale ID string must match that of the collator. 723fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * getLocale() returns a copy of a Locale, with minimal lifetime in a C wrapper. 724fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @internal 725b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 726fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius const char *internalGetLocaleID(ULocDataLocaleType type, UErrorCode &errorCode) const; 727b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 728b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 729fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Implements ucol_getContractionsAndExpansions(). 730fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Gets this collator's sets of contraction strings and/or 731fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * characters and strings that map to multiple collation elements (expansions). 732fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * If addPrefixes is TRUE, then contractions that are expressed as 733fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * prefix/pre-context rules are included. 734fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param contractions if not NULL, the set to hold the contractions 735fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param expansions if not NULL, the set to hold the expansions 736fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param addPrefixes include prefix contextual mappings 737fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param errorCode in/out ICU error code 738fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @internal 739b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 740fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius void internalGetContractionsAndExpansions( 741fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UnicodeSet *contractions, UnicodeSet *expansions, 742fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UBool addPrefixes, UErrorCode &errorCode) const; 743b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 744b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 745fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Adds the contractions that start with character c to the set. 746fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Ignores prefixes. Used by AlphabeticIndex. 747fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @internal 748fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius */ 749fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius void internalAddContractions(UChar32 c, UnicodeSet &set, UErrorCode &errorCode) const; 750b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 751b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 752fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Implements from-rule constructors, and ucol_openRules(). 753fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @internal 754fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius */ 755fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius void internalBuildTailoring( 756fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius const UnicodeString &rules, 757fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius int32_t strength, 758fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UColAttributeValue decompositionMode, 759fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UParseError *outParseError, UnicodeString *outReason, 760fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UErrorCode &errorCode); 761b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 762fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius /** @internal */ 763fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius static inline RuleBasedCollator *rbcFromUCollator(UCollator *uc) { 764fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius return dynamic_cast<RuleBasedCollator *>(fromUCollator(uc)); 765fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius } 766fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius /** @internal */ 767fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius static inline const RuleBasedCollator *rbcFromUCollator(const UCollator *uc) { 768fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius return dynamic_cast<const RuleBasedCollator *>(fromUCollator(uc)); 769fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius } 770b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 771b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 772fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Appends the CEs for the string to the vector. 773fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @internal for tests & tools 774fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius */ 775fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius void internalGetCEs(const UnicodeString &str, UVector64 &ces, UErrorCode &errorCode) const; 776fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius#endif // U_HIDE_INTERNAL_API 777b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 778b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruprotected: 779b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru /** 780fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Used internally by registration to define the requested and valid locales. 781fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param requestedLocale the requested locale 782b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param validLocale the valid locale 783c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru * @param actualLocale the actual locale 784b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @internal 785b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */ 786c69afcec261fc345fda8daf46f0ea6b4351dc777Jean-Baptiste Queru virtual void setLocales(const Locale& requestedLocale, const Locale& validLocale, const Locale& actualLocale); 787b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 788b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruprivate: 789fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius friend class CollationElementIterator; 790fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius friend class Collator; 791b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 792fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius RuleBasedCollator(const CollationTailoring *t, const Locale &vl); 793b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 794fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius /** 795fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Enumeration of attributes that are relevant for short definition strings 796fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * (e.g., ucol_getShortDefinitionString()). 797fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Effectively extends UColAttribute. 798103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius */ 799fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius enum Attributes { 800fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius ATTR_VARIABLE_TOP = UCOL_ATTRIBUTE_COUNT, 801fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius ATTR_LIMIT 802fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius }; 803fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius 804fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius void adoptTailoring(CollationTailoring *t); 805b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 806fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius // Both lengths must be <0 or else both must be >=0. 807fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UCollationResult doCompare(const UChar *left, int32_t leftLength, 808fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius const UChar *right, int32_t rightLength, 809fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UErrorCode &errorCode) const; 810fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UCollationResult doCompare(const uint8_t *left, int32_t leftLength, 811fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius const uint8_t *right, int32_t rightLength, 812fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UErrorCode &errorCode) const; 813b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 814fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius void writeSortKey(const UChar *s, int32_t length, 815fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius SortKeyByteSink &sink, UErrorCode &errorCode) const; 816b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 817fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius void writeIdenticalLevel(const UChar *s, const UChar *limit, 818fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius SortKeyByteSink &sink, UErrorCode &errorCode) const; 819b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 820fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius const CollationSettings &getDefaultSettings() const; 821b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 822fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius void setAttributeDefault(int32_t attribute) { 823fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius explicitlySetAttributes &= ~((uint32_t)1 << attribute); 824fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius } 825fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius void setAttributeExplicitly(int32_t attribute) { 826fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius explicitlySetAttributes |= (uint32_t)1 << attribute; 827fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius } 828fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UBool attributeHasBeenSetExplicitly(int32_t attribute) const { 829fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius // assert(0 <= attribute < ATTR_LIMIT); 830fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius return (UBool)((explicitlySetAttributes & ((uint32_t)1 << attribute)) != 0); 831b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru } 832b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 833fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius /** 834fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * Tests whether a character is "unsafe" for use as a collation starting point. 835fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * 836fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @param c code point or code unit 837fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @return TRUE if c is unsafe 838fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius * @see CollationElementIterator#setOffset(int) 839fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius */ 840fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UBool isUnsafe(UChar32 c) const; 841b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 842fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius static void computeMaxExpansions(const CollationTailoring *t, UErrorCode &errorCode); 843fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UBool initMaxExpansions(UErrorCode &errorCode) const; 844fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius 845fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius void setFastLatinOptions(CollationSettings &ownedSettings) const; 846b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 847fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius const CollationData *data; 848fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius const CollationSettings *settings; // reference-counted 849fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius const CollationTailoring *tailoring; // reference-counted 850fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius Locale validLocale; 851fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius uint32_t explicitlySetAttributes; 852fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius 853fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius UBool actualLocaleIsSameAsValid; 854fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius}; 855fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius 856fceb39872958b9fa2505e63f8b8699a9e0f882f4ccorneliusU_NAMESPACE_END 857b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru 858fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius#endif // !UCONFIG_NO_COLLATION 859fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius#endif // TBLCOLL_H 860