1 // © 2016 and later: Unicode, Inc. and others. 2 // License & terms of use: http://www.unicode.org/copyright.html 4 ************************************************************************** 5 * Copyright (C) 1999-2012, International Business Machines Corporation and 6 * others. All Rights Reserved. 7 ************************************************************************** 8 * Date Name Description 9 * 11/17/99 aliu Creation. Ported from java. Modified to 10 * match current UnicodeString API. Forced 11 * to use name "handleReplaceBetween" because 12 * of existing methods in UnicodeString. 13 ************************************************************************** 21 #if U_SHOW_CPLUSPLUS_API 91 inline int32_t length()
const;
100 inline char16_t charAt(int32_t offset)
const;
114 inlineUChar32 char32At(int32_t offset)
const;
153 // Note: All other methods in this class take the names of 154 // existing UnicodeString methods. This method is the exception. 155 // It is named differently because all replace methods of 156 // UnicodeString return a UnicodeString&. The 'between' is 157 // required in order to conform to the UnicodeString naming 158 // convention; API taking start/length are named <operation>, and 159 // those taking start/limit are named <operationBetween>. The 160 // 'handle' is added because 'replaceBetween' and 161 // 'doReplaceBetween' are already taken. 178 virtualvoidcopy(int32_t start, int32_t limit, int32_t dest) = 0;
214 * Assignment operator not declared. The compiler will provide one 215 * which does nothing since this class does not contain any data members. 216 * API/code coverage may show the assignment operator as present and 218 * Subclasses need this assignment operator if they use compiler-provided 219 * assignment operators of their own. An alternative to not declaring one 220 * here would be to declare and empty-implement a protected or public one. 221 Replaceable &Replaceable::operator=(const Replaceable &); 243 inline Replaceable::Replaceable() {}
246 Replaceable::length()
const{
251 Replaceable::charAt(int32_t offset)
const{
252 return getCharAt(offset);
256 Replaceable::char32At(int32_t offset)
const{
257 return getChar32At(offset);
260 // There is no rep.cpp, see unistr.cpp for Replaceable function implementations. 264 #endif/* U_SHOW_CPLUSPLUS_API */ Replaceable is an abstract base class representing a string of characters that supports the replaceme...
virtual ~Replaceable()
Destructor.
virtual void extractBetween(int32_t start, int32_t limit, UnicodeString &target) const =0
Copies characters in the range [start, limit) into the UnicodeString target.
virtual UChar32 getChar32At(int32_t offset) const =0
Virtual version of char32At().
virtual void copy(int32_t start, int32_t limit, int32_t dest)=0
Copies a substring of this object, retaining metadata.
virtual void handleReplaceBetween(int32_t start, int32_t limit, const UnicodeString &text)=0
Replaces a substring of this object with the given text.
virtual char16_t getCharAt(int32_t offset) const =0
Virtual version of charAt().
virtual int32_t getLength() const =0
Virtual version of length().
virtual Replaceable * clone() const
Clone this object, an instance of a subclass of Replaceable.
virtual UBool hasMetaData() const
Returns true if this object contains metadata.
UObject is the common ICU "boilerplate" class.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
int8_t UBool
The ICU boolean type, a signed-byte integer.
C++ API: Common ICU base class UObject.
Basic definitions for ICU, for both C and C++ APIs.
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside.