00001 /* 00002 * Copyright (C) 2001, 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 00013 U_NAMESPACE_BEGIN 00014 00015 class Replaceable; 00016 class UnicodeString; 00017 class UnicodeSet; 00018 00023 enum UMatchDegree { 00030 U_MISMATCH, 00031 00041 U_PARTIAL_MATCH, 00042 00050 U_MATCH 00051 }; 00052 00057 class U_COMMON_API UnicodeMatcher /* not : public UObject because this is an interface/mixin class */ { 00058 00059 public: 00060 00106 virtual UMatchDegree matches(const Replaceable& text, 00107 int32_t& offset, 00108 int32_t limit, 00109 UBool incremental) = 0; 00110 00122 virtual UnicodeString& toPattern(UnicodeString& result, 00123 UBool escapeUnprintable = FALSE) const = 0; 00124 00131 virtual UBool matchesIndexValue(uint8_t v) const = 0; 00132 00138 virtual void addMatchSetTo(UnicodeSet& toUnionTo) const = 0; 00139 }; 00140 00141 U_NAMESPACE_END 00142 00143 #endif