00001 /* 00002 * Copyright (C) 2001-2005, International Business Machines Corporation and others. All Rights Reserved. 00003 ********************************************************************** 00004 * Date Name Description 00005 * 07/18/01 aliu Creation. 00006 ********************************************************************** 00007 */ 00008 #ifndef UNIMATCH_H 00009 #define UNIMATCH_H 00010 00011 #include "unicode/utypes.h" 00012 00019 U_NAMESPACE_BEGIN 00020 00021 class Replaceable; 00022 class UnicodeString; 00023 class UnicodeSet; 00024 00030 enum UMatchDegree { 00038 U_MISMATCH, 00039 00050 U_PARTIAL_MATCH, 00051 00060 U_MATCH 00061 }; 00062 00068 class U_COMMON_API UnicodeMatcher /* not : public UObject because this is an interface/mixin class */ { 00069 00070 public: 00075 virtual ~UnicodeMatcher(); 00076 00123 virtual UMatchDegree matches(const Replaceable& text, 00124 int32_t& offset, 00125 int32_t limit, 00126 UBool incremental) = 0; 00127 00140 virtual UnicodeString& toPattern(UnicodeString& result, 00141 UBool escapeUnprintable = FALSE) const = 0; 00142 00150 virtual UBool matchesIndexValue(uint8_t v) const = 0; 00151 00158 virtual void addMatchSetTo(UnicodeSet& toUnionTo) const = 0; 00159 }; 00160 00161 U_NAMESPACE_END 00162 00163 #endif