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
00181 protected:
00182
00187 Replaceable();
00188
00193 virtual int32_t getLength() const = 0;
00194
00199 virtual UChar getCharAt(int32_t offset) const = 0;
00200
00205 virtual UChar32 getChar32At(int32_t offset) const = 0;
00206 };
00207
00208 inline Replaceable::Replaceable() {}
00209
00210 inline Replaceable::~Replaceable() {}
00211
00212 inline int32_t
00213 Replaceable::length() const {
00214 return getLength();
00215 }
00216
00217 inline UChar
00218 Replaceable::charAt(int32_t offset) const {
00219 return getCharAt(offset);
00220 }
00221
00222 inline UChar32
00223 Replaceable::char32At(int32_t offset) const {
00224 return getChar32At(offset);
00225 }
00226
00227
00228
00229 U_NAMESPACE_END
00230
00231 #endif