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
00024 U_NAMESPACE_BEGIN
00025
00026 class UnicodeString;
00027
00071 class U_COMMON_API Replaceable : public UObject {
00072
00073 public:
00078 virtual ~Replaceable();
00079
00085 inline int32_t length() const;
00086
00094 inline UChar charAt(int32_t offset) const;
00095
00108 inline UChar32 char32At(int32_t offset) const;
00109
00120 virtual void extractBetween(int32_t start,
00121 int32_t limit,
00122 UnicodeString& target) const = 0;
00123
00144 virtual void handleReplaceBetween(int32_t start,
00145 int32_t limit,
00146 const UnicodeString& text) = 0;
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00172 virtual void copy(int32_t start, int32_t limit, int32_t dest) = 0;
00173
00183 virtual UBool hasMetaData() const;
00184
00200 virtual Replaceable *clone() const;
00201
00202 protected:
00203
00208 inline Replaceable();
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00225 virtual int32_t getLength() const = 0;
00226
00231 virtual UChar getCharAt(int32_t offset) const = 0;
00232
00237 virtual UChar32 getChar32At(int32_t offset) const = 0;
00238 };
00239
00240 inline Replaceable::Replaceable() {}
00241
00242 inline int32_t
00243 Replaceable::length() const {
00244 return getLength();
00245 }
00246
00247 inline UChar
00248 Replaceable::charAt(int32_t offset) const {
00249 return getCharAt(offset);
00250 }
00251
00252 inline UChar32
00253 Replaceable::char32At(int32_t offset) const {
00254 return getChar32At(offset);
00255 }
00256
00257
00258
00259 U_NAMESPACE_END
00260
00261 #endif