00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef REP_H
00015 #define REP_H
00016
00017 #include "unicode/uobject.h"
00018
00019 U_NAMESPACE_BEGIN
00020
00021 class UnicodeString;
00022
00066 class U_COMMON_API Replaceable : public UObject {
00067
00068 public:
00073 virtual ~Replaceable();
00074
00080 inline int32_t length() const;
00081
00089 inline UChar charAt(int32_t offset) const;
00090
00103 inline UChar32 char32At(int32_t offset) const;
00104
00115 virtual void extractBetween(int32_t start,
00116 int32_t limit,
00117 UnicodeString& target) const = 0;
00118
00139 virtual void handleReplaceBetween(int32_t start,
00140 int32_t limit,
00141 const UnicodeString& text) = 0;
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00167 virtual void copy(int32_t start, int32_t limit, int32_t dest) = 0;
00168
00178 virtual UBool hasMetaData() const;
00179
00195 virtual Replaceable *clone() const;
00196
00197 protected:
00198
00203 Replaceable();
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00220 virtual int32_t getLength() const = 0;
00221
00226 virtual UChar getCharAt(int32_t offset) const = 0;
00227
00232 virtual UChar32 getChar32At(int32_t offset) const = 0;
00233 };
00234
00235 inline Replaceable::Replaceable() {}
00236
00237 inline int32_t
00238 Replaceable::length() const {
00239 return getLength();
00240 }
00241
00242 inline UChar
00243 Replaceable::charAt(int32_t offset) const {
00244 return getCharAt(offset);
00245 }
00246
00247 inline UChar32
00248 Replaceable::char32At(int32_t offset) const {
00249 return getChar32At(offset);
00250 }
00251
00252
00253
00254 U_NAMESPACE_END
00255
00256 #endif