]>
git.saurik.com Git - apple/icu.git/blob - icuSources/samples/translit/unaccent.h
1 /********************************************************************
3 * Copyright (c) 1999-2003, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 ********************************************************************/
7 #include "unicode/translit.h"
8 #include "unicode/normlzr.h"
10 class UnaccentTransliterator
: public Transliterator
{
17 UnaccentTransliterator();
22 virtual ~UnaccentTransliterator();
27 * Implement Transliterator API
29 virtual void handleTransliterate(Replaceable
& text
,
30 UTransPosition
& index
,
31 UBool incremental
) const;
36 * Unaccent a single character using normalizer.
38 UChar
unaccent(UChar c
) const;
40 Normalizer normalizer
;
45 * Return the class ID for this class. This is useful only for
46 * comparing to a return value from getDynamicClassID(). For example:
48 * . Base* polymorphic_pointer = createPolymorphicObject();
49 * . if (polymorphic_pointer->getDynamicClassID() ==
50 * . Derived::getStaticClassID()) ...
52 * @return The class ID for all objects of this class.
55 static inline UClassID
getStaticClassID(void) { return (UClassID
)&fgClassID
; };
58 * Returns a unique class ID <b>polymorphically</b>. This method
59 * is to implement a simple version of RTTI, since not all C++
60 * compilers support genuine RTTI. Polymorphic operator==() and
61 * clone() methods call this method.
63 * <p>Concrete subclasses of Transliterator that wish clients to
64 * be able to identify them should implement getDynamicClassID()
65 * and also a static method and data member:
68 * static UClassID getStaticClassID() { return (UClassID)&fgClassID; }
69 * static char fgClassID;
72 * Subclasses that do not implement this method will have a
73 * dynamic class ID of Transliterator::getStatisClassID().
75 * @return The class ID for this object. All objects of a given
76 * class have the same class ID. Objects of other classes have
77 * different class IDs.
80 virtual UClassID
getDynamicClassID(void) const { return getStaticClassID(); };
85 * Class identifier for subclasses of Transliterator that do not
86 * define their class (anonymous subclasses).
88 static const char fgClassID
;