unimatch.h
Go to the documentation of this file.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
* Copyright (C) 2001-2005, International Business Machines Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
* 07/18/01 aliu Creation.
**********************************************************************
*/
#ifndef UNIMATCH_H
#define UNIMATCH_H
#include "unicode/utypes.h"
#if U_SHOW_CPLUSPLUS_API
U_NAMESPACE_BEGIN
class Replaceable;
class UnicodeString;
class UnicodeSet;
enum UMatchDegree {
U_MISMATCH,
U_PARTIAL_MATCH,
U_MATCH
};
class U_COMMON_API UnicodeMatcher /* not : public UObject because this is an interface/mixin class */ {
public:
virtual ~UnicodeMatcher();
virtual UMatchDegree matches(const Replaceable& text,
int32_t& offset,
int32_t limit,
UBool incremental) = 0;
virtual UnicodeString& toPattern(UnicodeString& result,
UBool escapeUnprintable = false) const = 0;
virtual UBool matchesIndexValue(uint8_t v) const = 0;
virtual void addMatchSetTo(UnicodeSet& toUnionTo) const = 0;
};
U_NAMESPACE_END
#endif /* U_SHOW_CPLUSPLUS_API */
#endif
icu::Replaceable
Replaceable is an abstract base class representing a string of characters that supports the replaceme...
Definition: rep.h:77
icu::UnicodeMatcher
UnicodeMatcher defines a protocol for objects that can match a range of characters in a Replaceable s...
Definition: unimatch.h:71
icu::UnicodeMatcher::toPattern
virtual UnicodeString & toPattern(UnicodeString &result, UBool escapeUnprintable=false) const =0
Returns a string representation of this matcher.
icu::UnicodeMatcher::~UnicodeMatcher
virtual ~UnicodeMatcher()
Destructor.
icu::UnicodeMatcher::matches
virtual UMatchDegree matches(const Replaceable &text, int32_t &offset, int32_t limit, UBool incremental)=0
Return a UMatchDegree value indicating the degree of match for the given text at the given offset.
icu::UnicodeMatcher::addMatchSetTo
virtual void addMatchSetTo(UnicodeSet &toUnionTo) const =0
Union the set of all characters that may be matched by this object into the given set.
icu::UnicodeMatcher::matchesIndexValue
virtual UBool matchesIndexValue(uint8_t v) const =0
Returns true if this matcher will match a character c, where c & 0xFF == v, at offset,...
icu::UnicodeSet
A mutable set of Unicode characters and multicharacter strings.
Definition: uniset.h:285
icu::UnicodeString
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:296
icu::UMatchDegree
UMatchDegree
Constants returned by UnicodeMatcher::matches() indicating the degree of match.
Definition: unimatch.h:33
icu::U_MISMATCH
@ U_MISMATCH
Constant returned by matches() indicating a mismatch between the text and this matcher.
Definition: unimatch.h:41
icu::U_PARTIAL_MATCH
@ U_PARTIAL_MATCH
Constant returned by matches() indicating a partial match between the text and this matcher.
Definition: unimatch.h:53
icu::U_MATCH
@ U_MATCH
Constant returned by matches() indicating a complete match between the text and this matcher.
Definition: unimatch.h:63
UBool
int8_t UBool
The ICU boolean type, a signed-byte integer.
Definition: umachine.h:247
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
U_COMMON_API
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside.
Definition: utypes.h:300