]>
git.saurik.com Git - apple/icu.git/blob - icuSources/samples/translit/unaccent.h
1 /***********************************************************************
2 * © 2016 and later: Unicode, Inc. and others.
3 * License & terms of use: http://www.unicode.org/copyright.html#License
4 ***********************************************************************
5 ***********************************************************************
7 * Copyright (c) 1999-2003, International Business Machines Corporation and
8 * others. All Rights Reserved.
9 ***********************************************************************/
11 #include "unicode/translit.h"
12 #include "unicode/normlzr.h"
16 class UnaccentTransliterator
: public Transliterator
{
23 UnaccentTransliterator();
28 virtual ~UnaccentTransliterator();
33 * Implement Transliterator API
35 virtual void handleTransliterate(Replaceable
& text
,
36 UTransPosition
& index
,
37 UBool incremental
) const;
42 * Unaccent a single character using normalizer.
44 UChar
unaccent(UChar c
) const;
46 Normalizer normalizer
;
51 * Return the class ID for this class. This is useful only for
52 * comparing to a return value from getDynamicClassID(). For example:
54 * . Base* polymorphic_pointer = createPolymorphicObject();
55 * . if (polymorphic_pointer->getDynamicClassID() ==
56 * . Derived::getStaticClassID()) ...
58 * @return The class ID for all objects of this class.
61 static inline UClassID
getStaticClassID(void) { return (UClassID
)&fgClassID
; };
64 * Returns a unique class ID <b>polymorphically</b>. This method
65 * is to implement a simple version of RTTI, since not all C++
66 * compilers support genuine RTTI. Polymorphic operator==() and
67 * clone() methods call this method.
69 * <p>Concrete subclasses of Transliterator that wish clients to
70 * be able to identify them should implement getDynamicClassID()
71 * and also a static method and data member:
74 * static UClassID getStaticClassID() { return (UClassID)&fgClassID; }
75 * static char fgClassID;
78 * Subclasses that do not implement this method will have a
79 * dynamic class ID of Transliterator::getStatisClassID().
81 * @return The class ID for this object. All objects of a given
82 * class have the same class ID. Objects of other classes have
83 * different class IDs.
86 virtual UClassID
getDynamicClassID(void) const { return getStaticClassID(); };
91 * Class identifier for subclasses of Transliterator that do not
92 * define their class (anonymous subclasses).
94 static const char fgClassID
;