1c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott/* 2c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott********************************************************************** 3c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott* Copyright (c) 2001-2008, International Business Machines 4c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott* Corporation and others. All Rights Reserved. 5c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott********************************************************************** 6c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott* Date Name Description 7c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott* 08/10/2001 aliu Creation. 8c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott********************************************************************** 9c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott*/ 10c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#ifndef _TRANSREG_H 11c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#define _TRANSREG_H 12c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 13c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#include "unicode/utypes.h" 14c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 15c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#if !UCONFIG_NO_TRANSLITERATION 16c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 17c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#include "unicode/uobject.h" 18c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#include "unicode/translit.h" 19c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#include "hash.h" 20c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#include "uvector.h" 21c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 22c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_NAMESPACE_BEGIN 23c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 24c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scottclass TransliteratorEntry; 25c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scottclass TransliteratorSpec; 26c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scottclass UnicodeString; 27c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 28c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott//------------------------------------------------------------------ 29c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott// TransliteratorAlias 30c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott//------------------------------------------------------------------ 31c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 32c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott/** 33c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * A TransliteratorAlias object is returned by get() if the given ID 34c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * actually translates into something else. The caller then invokes 35c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * the create() method on the alias to create the actual 36c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * transliterator, and deletes the alias. 37c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * 38c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Why all the shenanigans? To prevent circular calls between 39c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * the registry code and the transliterator code that deadlocks. 40c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 41c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scottclass TransliteratorAlias : public UMemory { 42c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott public: 43c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 44c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Construct a simple alias (type == SIMPLE) 45c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param aliasID the given id. 46c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 47c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott TransliteratorAlias(const UnicodeString& aliasID, const UnicodeSet* compoundFilter); 48c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 49c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 50c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Construct a compound RBT alias (type == COMPOUND) 51c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 52c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott TransliteratorAlias(const UnicodeString& ID, const UnicodeString& idBlocks, 53c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UVector* adoptedTransliterators, 54c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeSet* compoundFilter); 55c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 56c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 57c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Construct a rules alias (type = RULES) 58c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 59c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott TransliteratorAlias(const UnicodeString& theID, 60c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeString& rules, 61c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UTransDirection dir); 62c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 63c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott ~TransliteratorAlias(); 64c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 65c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 66c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * The whole point of create() is that the caller must invoke 67c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * it when the registry mutex is NOT held, to prevent deadlock. 68c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * It may only be called once. 69c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * 70c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Note: Only call create() if isRuleBased() returns FALSE. 71c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * 72c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * This method must be called *outside* of the TransliteratorRegistry 73c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * mutex. 74c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 75c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott Transliterator* create(UParseError&, UErrorCode&); 76c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 77c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 78c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Return TRUE if this alias is rule-based. If so, the caller 79c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * must call parse() on it, then call TransliteratorRegistry::reget(). 80c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 81c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UBool isRuleBased() const; 82c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 83c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 84c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * If isRuleBased() returns TRUE, then the caller must call this 85c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * method, followed by TransliteratorRegistry::reget(). The latter 86c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * method must be called inside the TransliteratorRegistry mutex. 87c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * 88c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Note: Only call parse() if isRuleBased() returns TRUE. 89c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * 90c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * This method must be called *outside* of the TransliteratorRegistry 91c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * mutex, because it can instantiate Transliterators embedded in 92c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * the rules via the "&Latin-Arabic()" syntax. 93c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 94c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott void parse(TransliteratorParser& parser, 95c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UParseError& pe, UErrorCode& ec) const; 96c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 97c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott private: 98c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott // We actually come in three flavors: 99c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott // 1. Simple alias 100c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott // Here aliasID is the alias string. Everything else is 101c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott // null, zero, empty. 102c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott // 2. CompoundRBT 103c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott // Here ID is the ID, aliasID is the idBlock, trans is the 104c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott // contained RBT, and idSplitPoint is the offet in aliasID 105c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott // where the contained RBT goes. compoundFilter is the 106c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott // compound filter, and it is _not_ owned. 107c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott // 3. Rules 108c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott // Here ID is the ID, aliasID is the rules string. 109c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott // idSplitPoint is the UTransDirection. 110c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UnicodeString ID; 111c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UnicodeString aliasesOrRules; 112c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UVector* transes; // owned 113c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeSet* compoundFilter; // alias 114c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UTransDirection direction; 115c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott enum { SIMPLE, COMPOUND, RULES } type; 116c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 117c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott TransliteratorAlias(const TransliteratorAlias &other); // forbid copying of this class 118c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott TransliteratorAlias &operator=(const TransliteratorAlias &other); // forbid copying of this class 119c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott}; 120c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 121c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 122c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott/** 123c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * A registry of system transliterators. This is the data structure 124c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * that implements the mapping between transliterator IDs and the data 125c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * or function pointers used to create the corresponding 126c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * transliterators. There is one instance of the registry that is 127c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * created statically. 128c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * 129c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * The registry consists of a dynamic component -- a hashtable -- and 130c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * a static component -- locale resource bundles. The dynamic store 131c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * is semantically overlaid on the static store, so the static mapping 132c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * can be dynamically overridden. 133c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * 134c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * This is an internal class that is only used by Transliterator. 135c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Transliterator maintains one static instance of this class and 136c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * delegates all registry-related operations to it. 137c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * 138c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @author Alan Liu 139c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 140c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scottclass TransliteratorRegistry : public UMemory { 141c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 142c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott public: 143c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 144c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 145c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Contructor 146c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param status Output param set to success/failure code. 147c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 148c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott TransliteratorRegistry(UErrorCode& status); 149c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 150c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 151c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Nonvirtual destructor -- this class is not subclassable. 152c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 153c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott ~TransliteratorRegistry(); 154c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 155c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott //------------------------------------------------------------------ 156c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott // Basic public API 157c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott //------------------------------------------------------------------ 158c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 159c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 160c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Given a simple ID (forward direction, no inline filter, not 161c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * compound) attempt to instantiate it from the registry. Return 162c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * 0 on failure. 163c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * 164c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Return a non-NULL aliasReturn value if the ID points to an alias. 165c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * We cannot instantiate it ourselves because the alias may contain 166c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * filters or compounds, which we do not understand. Caller should 167c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * make aliasReturn NULL before calling. 168c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param ID the given ID 169c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param aliasReturn output param to receive TransliteratorAlias; 170c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * should be NULL on entry 171c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param parseError Struct to recieve information on position 172c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * of error if an error is encountered 173c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param status Output param set to success/failure code. 174c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 175c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott Transliterator* get(const UnicodeString& ID, 176c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott TransliteratorAlias*& aliasReturn, 177c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UErrorCode& status); 178c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 179c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 180c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * The caller must call this after calling get(), if [a] calling get() 181c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * returns an alias, and [b] the alias is rule based. In that 182c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * situation the caller must call alias->parse() to do the parsing 183c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * OUTSIDE THE REGISTRY MUTEX, then call this method to retry 184c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * instantiating the transliterator. 185c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * 186c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Note: Another alias might be returned by this method. 187c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * 188c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * This method (like all public methods of this class) must be called 189c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * from within the TransliteratorRegistry mutex. 190c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * 191c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param aliasReturn output param to receive TransliteratorAlias; 192c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * should be NULL on entry 193c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 194c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott Transliterator* reget(const UnicodeString& ID, 195c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott TransliteratorParser& parser, 196c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott TransliteratorAlias*& aliasReturn, 197c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UErrorCode& status); 198c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 199c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 200c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Register a prototype (adopted). This adds an entry to the 201c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * dynamic store, or replaces an existing entry. Any entry in the 202c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * underlying static locale resource store is masked. 203c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 204c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott void put(Transliterator* adoptedProto, 205c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UBool visible, 206c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UErrorCode& ec); 207c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 208c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 209c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Register an ID and a factory function pointer. This adds an 210c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * entry to the dynamic store, or replaces an existing entry. Any 211c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * entry in the underlying static locale resource store is masked. 212c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 213c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott void put(const UnicodeString& ID, 214c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott Transliterator::Factory factory, 215c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott Transliterator::Token context, 216c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UBool visible, 217c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UErrorCode& ec); 218c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 219c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 220c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Register an ID and a resource name. This adds an entry to the 221c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * dynamic store, or replaces an existing entry. Any entry in the 222c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * underlying static locale resource store is masked. 223c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 224c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott void put(const UnicodeString& ID, 225c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeString& resourceName, 226c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UTransDirection dir, 227c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UBool readonlyResourceAlias, 228c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UBool visible, 229c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UErrorCode& ec); 230c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 231c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 232c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Register an ID and an alias ID. This adds an entry to the 233c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * dynamic store, or replaces an existing entry. Any entry in the 234c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * underlying static locale resource store is masked. 235c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 236c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott void put(const UnicodeString& ID, 237c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeString& alias, 238c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UBool readonlyAliasAlias, 239c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UBool visible, 240c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UErrorCode& ec); 241c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 242c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 243c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Unregister an ID. This removes an entry from the dynamic store 244c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * if there is one. The static locale resource store is 245c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * unaffected. 246c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param ID the given ID. 247c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 248c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott void remove(const UnicodeString& ID); 249c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 250c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott //------------------------------------------------------------------ 251c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott // Public ID and spec management 252c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott //------------------------------------------------------------------ 253c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 254c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 255c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Return a StringEnumeration over the IDs currently registered 256c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * with the system. 257c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @internal 258c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 259c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott StringEnumeration* getAvailableIDs() const; 260c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 261c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 262c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * == OBSOLETE - remove in ICU 3.4 == 263c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Return the number of IDs currently registered with the system. 264c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * To retrieve the actual IDs, call getAvailableID(i) with 265c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * i from 0 to countAvailableIDs() - 1. 266c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @return the number of IDs currently registered with the system. 267c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @internal 268c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 269c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott int32_t countAvailableIDs(void) const; 270c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 271c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 272c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * == OBSOLETE - remove in ICU 3.4 == 273c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Return the index-th available ID. index must be between 0 274c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * and countAvailableIDs() - 1, inclusive. If index is out of 275c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * range, the result of getAvailableID(0) is returned. 276c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param index the given index. 277c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @return the index-th available ID. index must be between 0 278c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * and countAvailableIDs() - 1, inclusive. If index is out of 279c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * range, the result of getAvailableID(0) is returned. 280c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @internal 281c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 282c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeString& getAvailableID(int32_t index) const; 283c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 284c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 285c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Return the number of registered source specifiers. 286c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @return the number of registered source specifiers. 287c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 288c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott int32_t countAvailableSources(void) const; 289c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 290c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 291c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Return a registered source specifier. 292c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param index which specifier to return, from 0 to n-1, where 293c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * n = countAvailableSources() 294c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param result fill-in paramter to receive the source specifier. 295c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * If index is out of range, result will be empty. 296c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @return reference to result 297c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 298c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UnicodeString& getAvailableSource(int32_t index, 299c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UnicodeString& result) const; 300c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 301c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 302c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Return the number of registered target specifiers for a given 303c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * source specifier. 304c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param source the given source specifier. 305c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @return the number of registered target specifiers for a given 306c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * source specifier. 307c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 308c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott int32_t countAvailableTargets(const UnicodeString& source) const; 309c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 310c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 311c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Return a registered target specifier for a given source. 312c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param index which specifier to return, from 0 to n-1, where 313c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * n = countAvailableTargets(source) 314c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param source the source specifier 315c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param result fill-in paramter to receive the target specifier. 316c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * If source is invalid or if index is out of range, result will 317c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * be empty. 318c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @return reference to result 319c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 320c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UnicodeString& getAvailableTarget(int32_t index, 321c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeString& source, 322c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UnicodeString& result) const; 323c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 324c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 325c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Return the number of registered variant specifiers for a given 326c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * source-target pair. There is always at least one variant: If 327c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * just source-target is registered, then the single variant 328c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * NO_VARIANT is returned. If source-target/variant is registered 329c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * then that variant is returned. 330c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param source the source specifiers 331c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param target the target specifiers 332c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @return the number of registered variant specifiers for a given 333c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * source-target pair. 334c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 335c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott int32_t countAvailableVariants(const UnicodeString& source, 336c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeString& target) const; 337c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 338c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 339c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Return a registered variant specifier for a given source-target 340c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * pair. If NO_VARIANT is one of the variants, then it will be 341c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * at index 0. 342c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param index which specifier to return, from 0 to n-1, where 343c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * n = countAvailableVariants(source, target) 344c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param source the source specifier 345c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param target the target specifier 346c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @param result fill-in paramter to receive the variant 347c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * specifier. If source is invalid or if target is invalid or if 348c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * index is out of range, result will be empty. 349c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * @return reference to result 350c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 351c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UnicodeString& getAvailableVariant(int32_t index, 352c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeString& source, 353c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeString& target, 354c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UnicodeString& result) const; 355c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 356c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott private: 357c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 358c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott //---------------------------------------------------------------- 359c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott // Private implementation 360c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott //---------------------------------------------------------------- 361c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 362c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott TransliteratorEntry* find(const UnicodeString& ID); 363c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 364c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott TransliteratorEntry* find(UnicodeString& source, 365c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UnicodeString& target, 366c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UnicodeString& variant); 367c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 368c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott TransliteratorEntry* findInDynamicStore(const TransliteratorSpec& src, 369c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const TransliteratorSpec& trg, 370c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeString& variant) const; 371c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 372c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott TransliteratorEntry* findInStaticStore(const TransliteratorSpec& src, 373c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const TransliteratorSpec& trg, 374c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeString& variant); 375c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 376c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott static TransliteratorEntry* findInBundle(const TransliteratorSpec& specToOpen, 377c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const TransliteratorSpec& specToFind, 378c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeString& variant, 379c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UTransDirection direction); 380c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 381c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott void registerEntry(const UnicodeString& source, 382c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeString& target, 383c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeString& variant, 384c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott TransliteratorEntry* adopted, 385c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UBool visible); 386c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 387c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott void registerEntry(const UnicodeString& ID, 388c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott TransliteratorEntry* adopted, 389c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UBool visible); 390c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 391c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott void registerEntry(const UnicodeString& ID, 392c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeString& source, 393c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeString& target, 394c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeString& variant, 395c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott TransliteratorEntry* adopted, 396c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UBool visible); 397c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 398c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott void registerSTV(const UnicodeString& source, 399c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeString& target, 400c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeString& variant); 401c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 402c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott void removeSTV(const UnicodeString& source, 403c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeString& target, 404c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const UnicodeString& variant); 405c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 406c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott Transliterator* instantiateEntry(const UnicodeString& ID, 407c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott TransliteratorEntry *entry, 408c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott TransliteratorAlias*& aliasReturn, 409c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UErrorCode& status); 410c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 411c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 412c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * A StringEnumeration over the registered IDs in this object. 413c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 414c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott class Enumeration : public StringEnumeration { 415c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott public: 416c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott Enumeration(const TransliteratorRegistry& reg); 417c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott virtual ~Enumeration(); 418c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott virtual int32_t count(UErrorCode& status) const; 419c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott virtual const UnicodeString* snext(UErrorCode& status); 420c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott virtual void reset(UErrorCode& status); 421c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott static UClassID U_EXPORT2 getStaticClassID(); 422c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott virtual UClassID getDynamicClassID() const; 423c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott private: 424c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott int32_t index; 425c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott const TransliteratorRegistry& reg; 426c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott }; 427c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott friend class Enumeration; 428c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 429c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott private: 430c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 431c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 432c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Dynamic registry mapping full IDs to Entry objects. This 433c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * contains both public and internal entities. The visibility is 434c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * controlled by whether an entry is listed in availableIDs and 435c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * specDAG or not. 436c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 437c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott Hashtable registry; 438c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 439c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 440c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * DAG of visible IDs by spec. Hashtable: source => (Hashtable: 441c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * target => (UVector: variant)) The UVector of variants is never 442c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * empty. For a source-target with no variant, the special 443c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * variant NO_VARIANT (the empty string) is stored in slot zero of 444c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * the UVector. 445c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 446c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott Hashtable specDAG; 447c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 448c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott /** 449c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott * Vector of public full IDs. 450c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott */ 451c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott UVector availableIDs; 452c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 453c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott TransliteratorRegistry(const TransliteratorRegistry &other); // forbid copying of this class 454c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott TransliteratorRegistry &operator=(const TransliteratorRegistry &other); // forbid copying of this class 455c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott}; 456c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 457c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick ScottU_NAMESPACE_END 458c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 459c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#endif /* #if !UCONFIG_NO_TRANSLITERATION */ 460c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott 461c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#endif 462c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott//eof 463