Logo Search packages:      
Sourcecode: icu version File versions  Download package

Public Member Functions | Static Public Member Functions | Protected Member Functions

Replaceable Class Reference

#include <rep.h>

Inheritance diagram for Replaceable:
Inheritance graph
[legend]
Collaboration diagram for Replaceable:
Collaboration graph
[legend]

List of all members.

Public Member Functions

UChar32 char32At (int32_t offset) const
UChar charAt (int32_t offset) const
virtual Replaceableclone () const
virtual void copy (int32_t start, int32_t limit, int32_t dest)=0
virtual void extractBetween (int32_t start, int32_t limit, UnicodeString &target) const =0
virtual UClassID getDynamicClassID () const =0
virtual void handleReplaceBetween (int32_t start, int32_t limit, const UnicodeString &text)=0
virtual UBool hasMetaData () const
int32_t length () const
virtual ~Replaceable ()

Static Public Member Functions

static void U_EXPORT2 operator delete (void *p) U_NO_THROW
static void U_EXPORT2 operator delete (void *, void *) U_NO_THROW
static void U_EXPORT2 operator delete[] (void *p) U_NO_THROW
static void *U_EXPORT2 operator new (size_t, void *ptr) U_NO_THROW
static void *U_EXPORT2 operator new (size_t size) U_NO_THROW
static void *U_EXPORT2 operator new[] (size_t size) U_NO_THROW

Protected Member Functions

virtual UChar32 getChar32At (int32_t offset) const =0
virtual UChar getCharAt (int32_t offset) const =0
virtual int32_t getLength () const =0
 Replaceable ()

Detailed Description

Replaceable is an abstract base class representing a string of characters that supports the replacement of a range of itself with a new string of characters. It is used by APIs that change a piece of text while retaining metadata. Metadata is data other than the Unicode characters returned by char32At(). One example of metadata is style attributes; another is an edit history, marking each character with an author and revision number.

An implicit aspect of the Replaceable API is that during a replace operation, new characters take on the metadata of the old characters. For example, if the string "the <b>bold</b> font" has range (4, 8) replaced with "strong", then it becomes "the <b>strong</b> font".

Replaceable specifies ranges using a start offset and a limit offset. The range of characters thus specified includes the characters at offset start..limit-1. That is, the start offset is inclusive, and the limit offset is exclusive.

Replaceable also includes API to access characters in the string: length(), charAt(), char32At(), and extractBetween().

For a subclass to support metadata, typical behavior of replace() is the following:

If this is not the behavior, the subclass should document any differences.

Author:
Alan Liu ICU 2.0

Definition at line 71 of file rep.h.


The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index