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/utypes.h"
00018 #include "unicode/uobject.h"
00019
00020 U_NAMESPACE_BEGIN
00021
00022 class UnicodeString;
00023
00067 class U_COMMON_API Replaceable : public UObject {
00068
00069 public:
00074 virtual ~Replaceable();
00075
00081 inline int32_t length() const;
00082
00090 inline UChar charAt(int32_t offset) const;
00091
00104 inline UChar32 char32At(int32_t offset) const;
00105
00116 virtual void extractBetween(int32_t start,
00117 int32_t limit,
00118 UnicodeString& target) const = 0;
00119
00140 virtual void handleReplaceBetween(int32_t start,
00141 int32_t limit,
00142 const UnicodeString& text) = 0;
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00168 virtual void copy(int32_t start, int32_t limit, int32_t dest) = 0;
00169
00179 virtual UBool hasMetaData() const;
00180
00196 virtual Replaceable *clone() const;
00197
00198 protected:
00199
00204 Replaceable();
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00221 virtual int32_t getLength() const = 0;
00222
00227 virtual UChar getCharAt(int32_t offset) const = 0;
00228
00233 virtual UChar32 getChar32At(int32_t offset) const = 0;
00234 };
00235
00236 inline Replaceable::Replaceable() {}
00237
00238 inline Replaceable::~Replaceable() {}
00239
00240 inline int32_t
00241 Replaceable::length() const {
00242 return getLength();
00243 }
00244
00245 inline UChar
00246 Replaceable::charAt(int32_t offset) const {
00247 return getCharAt(offset);
00248 }
00249
00250 inline UChar32
00251 Replaceable::char32At(int32_t offset) const {
00252 return getChar32At(offset);
00253 }
00254
00255
00256
00257 U_NAMESPACE_END
00258
00259 #endif