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
00065 class U_COMMON_API Replaceable : public UObject {
00066
00067 public:
00072 virtual ~Replaceable();
00073
00079 inline int32_t length() const;
00080
00088 inline UChar charAt(int32_t offset) const;
00089
00102 inline UChar32 char32At(int32_t offset) const;
00103
00114 virtual void extractBetween(int32_t start,
00115 int32_t limit,
00116 UnicodeString& target) const = 0;
00117
00138 virtual void handleReplaceBetween(int32_t start,
00139 int32_t limit,
00140 const UnicodeString& text) = 0;
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00166 virtual void copy(int32_t start, int32_t limit, int32_t dest) = 0;
00167
00177 virtual UBool hasMetaData() const;
00178
00179 protected:
00180
00184 Replaceable();
00185
00189 virtual int32_t getLength() const = 0;
00190
00194 virtual UChar getCharAt(int32_t offset) const = 0;
00195
00199 virtual UChar32 getChar32At(int32_t offset) const = 0;
00200 };
00201
00202 inline Replaceable::Replaceable() {}
00203
00204 inline Replaceable::~Replaceable() {}
00205
00206 inline int32_t
00207 Replaceable::length() const {
00208 return getLength();
00209 }
00210
00211 inline UChar
00212 Replaceable::charAt(int32_t offset) const {
00213 return getCharAt(offset);
00214 }
00215
00216 inline UChar32
00217 Replaceable::char32At(int32_t offset) const {
00218 return getChar32At(offset);
00219 }
00220
00221
00222
00223 U_NAMESPACE_END
00224
00225 #endif