]>
git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/unesctrn.h
2 **********************************************************************
3 * Copyright (c) 2001-2007, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
6 * Date Name Description
7 * 11/20/2001 aliu Creation.
8 **********************************************************************
13 #include "unicode/utypes.h"
15 #if !UCONFIG_NO_TRANSLITERATION
17 #include "unicode/translit.h"
22 * A transliterator that converts Unicode escape forms to the
23 * characters they represent. Escape forms have a prefix, a suffix, a
24 * radix, and minimum and maximum digit counts.
26 * <p>This class is package private. It registers several standard
27 * variants with the system which are then accessed via their IDs.
31 class UnescapeTransliterator
: public Transliterator
{
36 * The encoded pattern specification. The pattern consists of
37 * zero or more forms. Each form consists of a prefix, suffix,
38 * radix, minimum digit count, and maximum digit count. These
39 * values are stored as a five character header. That is, their
40 * numeric values are cast to 16-bit characters and stored in the
41 * string. Following these five characters, the prefix
42 * characters, then suffix characters are stored. Each form thus
43 * takes n+5 characters, where n is the total length of the prefix
44 * and suffix. The end is marked by a header of length one
45 * consisting of the character END.
47 UChar
* spec
; // owned; may not be NULL
52 * Registers standard variants with the system. Called by
53 * Transliterator during initialization.
55 static void registerIDs();
58 * Constructor. Takes the encoded spec array (does not adopt it).
59 * @param ID the string identifier for this transliterator
60 * @param spec the encoded spec array
62 UnescapeTransliterator(const UnicodeString
& ID
,
68 UnescapeTransliterator(const UnescapeTransliterator
&);
73 virtual ~UnescapeTransliterator();
78 virtual Transliterator
* clone() const;
81 * ICU "poor man's RTTI", returns a UClassID for the actual class.
83 virtual UClassID
getDynamicClassID() const;
86 * ICU "poor man's RTTI", returns a UClassID for this class.
88 U_I18N_API
static UClassID U_EXPORT2
getStaticClassID();
93 * Implements {@link Transliterator#handleTransliterate}.
94 * @param text the buffer holding transliterated and
95 * untransliterated text
96 * @param offset the start and limit of the text, the position
97 * of the cursor, and the start and limit of transliteration.
98 * @param incremental if true, assume more text may be coming after
99 * pos.contextLimit. Otherwise, assume the text is complete.
101 virtual void handleTransliterate(Replaceable
& text
, UTransPosition
& offset
,
102 UBool isIncremental
) const;
108 #endif /* #if !UCONFIG_NO_TRANSLITERATION */