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 U_NAMESPACE_BEGIN
00019
00020 class UnicodeString;
00021
00057 class U_COMMON_API Replaceable {
00058
00059 public:
00064 virtual ~Replaceable();
00065
00071 inline int32_t length() const;
00072
00080 inline UChar charAt(int32_t offset) const;
00081
00091 inline UChar32 char32At(int32_t offset) const;
00092
00103 virtual void extractBetween(int32_t start,
00104 int32_t limit,
00105 UnicodeString& target) const = 0;
00106
00127 virtual void handleReplaceBetween(int32_t start,
00128 int32_t limit,
00129 const UnicodeString& text) = 0;
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00161 virtual void copy(int32_t start, int32_t limit, int32_t dest) = 0;
00162
00163 protected:
00164
00168 Replaceable();
00169
00173 virtual int32_t getLength() const = 0;
00174
00178 virtual UChar getCharAt(int32_t offset) const = 0;
00179
00183 virtual UChar32 getChar32At(int32_t offset) const = 0;
00184 };
00185
00186 inline Replaceable::Replaceable() {}
00187
00188 inline Replaceable::~Replaceable() {}
00189
00190 inline int32_t
00191 Replaceable::length() const {
00192 return getLength();
00193 }
00194
00195 inline UChar
00196 Replaceable::charAt(int32_t offset) const {
00197 return getCharAt(offset);
00198 }
00199
00200 inline UChar32
00201 Replaceable::char32At(int32_t offset) const {
00202 return getChar32At(offset);
00203 }
00204
00205 U_NAMESPACE_END
00206
00207 #endif