ICU 72.1 72.1
unifilt.h
Go to the documentation of this file.
1// © 2016 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
3/*
4**********************************************************************
5* Copyright (C) 1999-2010, International Business Machines Corporation and others.
6* All Rights Reserved.
7**********************************************************************
8* Date Name Description
9* 11/17/99 aliu Creation.
10**********************************************************************
11*/
12#ifndef UNIFILT_H
13#define UNIFILT_H
14
15#include "unicode/utypes.h"
16
17#if U_SHOW_CPLUSPLUS_API
18
19#include "unicode/unifunct.h"
20#include "unicode/unimatch.h"
21
27U_NAMESPACE_BEGIN
28
37#define U_ETHER ((char16_t)0xFFFF)
38
66
67public:
72 virtual ~UnicodeFilter();
73
80 virtual UnicodeFilter* clone() const override = 0;
81
89 virtual UBool contains(UChar32 c) const = 0;
90
96 virtual UnicodeMatcher* toMatcher() const override;
97
102 virtual UMatchDegree matches(const Replaceable& text,
103 int32_t& offset,
104 int32_t limit,
105 UBool incremental) override;
106
111 virtual void setData(const TransliterationRuleData*) override;
112
118 static UClassID U_EXPORT2 getStaticClassID();
119
120protected:
121
122 /*
123 * Since this class has pure virtual functions,
124 * a constructor can't be used.
125 * @stable ICU 2.0
126 */
127/* UnicodeFilter();*/
128};
129
130/*inline UnicodeFilter::UnicodeFilter() {}*/
131
132U_NAMESPACE_END
133
134#endif /* U_SHOW_CPLUSPLUS_API */
135
136#endif
Replaceable is an abstract base class representing a string of characters that supports the replaceme...
Definition: rep.h:77
UnicodeFilter defines a protocol for selecting a subset of the full range (U+0000 to U+10FFFF) of Uni...
Definition: unifilt.h:65
virtual void setData(const TransliterationRuleData *) override
UnicodeFunctor API.
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
virtual UnicodeFilter * clone() const override=0
Clones this object polymorphically.
virtual ~UnicodeFilter()
Destructor.
virtual UMatchDegree matches(const Replaceable &text, int32_t &offset, int32_t limit, UBool incremental) override
Implement UnicodeMatcher API.
virtual UnicodeMatcher * toMatcher() const override
UnicodeFunctor API.
virtual UBool contains(UChar32 c) const =0
Returns true for characters that are in the selected subset.
UnicodeFunctor is an abstract base class for objects that perform match and/or replace operations on ...
Definition: unifunct.h:38
UnicodeMatcher defines a protocol for objects that can match a range of characters in a Replaceable s...
Definition: unimatch.h:71
UMatchDegree
Constants returned by UnicodeMatcher::matches() indicating the degree of match.
Definition: unimatch.h:33
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition: umachine.h:461
int8_t UBool
The ICU boolean type, a signed-byte integer.
Definition: umachine.h:269
C++ API: Unicode Functor.
C++ API: Unicode Matcher.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:96
Basic definitions for ICU, for both C and C++ APIs.
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside.
Definition: utypes.h:300