/* ********************************************************************** * Copyright (C) 1999, International Business Machines Corporation and * others. All Rights Reserved. ********************************************************************** * Date Name Description * 11/17/99 aliu Creation. Ported from java. Modified to * match current UnicodeString API. Forced * to use name "handleReplaceBetween" because * of existing methods in UnicodeString. ********************************************************************** */ #ifndef REP_H #define REP_H #include "unicode/utypes.h" class UnicodeString; class U_COMMON_API Replaceable { public: virtual ~Replaceable(); virtual int32_t length() const = 0; virtual UChar charAt(UTextOffset offset) const = 0; virtual UChar32 char32At(UTextOffset offset) const = 0; virtual void extractBetween(UTextOffset srcStart, UTextOffset srcLimit, UChar* dst, UTextOffset dstStart = 0) const = 0; virtual void handleReplaceBetween(UTextOffset start, UTextOffset limit, const UnicodeString& text) = 0; // Note: All other methods in this class take the names of // existing UnicodeString methods. This method is the exception. // It is named differently because all replace methods of // UnicodeString return a UnicodeString&. The 'between' is // required in order to conform to the UnicodeString naming // convention; API taking start/length are named <operation>, and // those taking start/limit are named <operationBetween>. The // 'handle' is added because 'replaceBetween' and // 'doReplaceBetween' are already taken. virtual void copy(int32_t start, int32_t limit, int32_t dest) = 0; protected: Replaceable(); }; inline Replaceable::Replaceable() {} inline Replaceable::~Replaceable() {} #endif