00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef REP_H
00017 #define REP_H
00018
00019 #include "unicode/utypes.h"
00020
00021 #if U_SHOW_CPLUSPLUS_API
00022
00023 #include "unicode/uobject.h"
00024
00030 U_NAMESPACE_BEGIN
00031
00032 class UnicodeString;
00033
00077 class U_COMMON_API Replaceable : public UObject {
00078
00079 public:
00084 virtual ~Replaceable();
00085
00091 inline int32_t length() const;
00092
00100 inline char16_t charAt(int32_t offset) const;
00101
00114 inline UChar32 char32At(int32_t offset) const;
00115
00126 virtual void extractBetween(int32_t start,
00127 int32_t limit,
00128 UnicodeString& target) const = 0;
00129
00150 virtual void handleReplaceBetween(int32_t start,
00151 int32_t limit,
00152 const UnicodeString& text) = 0;
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00178 virtual void copy(int32_t start, int32_t limit, int32_t dest) = 0;
00179
00189 virtual UBool hasMetaData() const;
00190
00203 virtual Replaceable *clone() const;
00204
00205 protected:
00206
00211 inline Replaceable();
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00228 virtual int32_t getLength() const = 0;
00229
00234 virtual char16_t getCharAt(int32_t offset) const = 0;
00235
00240 virtual UChar32 getChar32At(int32_t offset) const = 0;
00241 };
00242
00243 inline Replaceable::Replaceable() {}
00244
00245 inline int32_t
00246 Replaceable::length() const {
00247 return getLength();
00248 }
00249
00250 inline char16_t
00251 Replaceable::charAt(int32_t offset) const {
00252 return getCharAt(offset);
00253 }
00254
00255 inline UChar32
00256 Replaceable::char32At(int32_t offset) const {
00257 return getChar32At(offset);
00258 }
00259
00260
00261
00262 U_NAMESPACE_END
00263
00264 #endif
00265
00266 #endif