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

void UnicodeString::copy ( int32_t  start,
int32_t  limit,
int32_t  dest 
) [virtual]

Copy a substring of this object, retaining attribute (out-of-band) information. This method is used to duplicate or reorder substrings. The destination index must not overlap the source range.

start the beginning index, inclusive; 0 <= start <= limit.
limit the ending index, exclusive; start <= limit <= length().
dest the destination index. The characters from start..limit-1 will be copied to dest. Implementations of this method may assume that dest <= start || dest >= limit. ICU 2.0
Replaceable API

Implements Replaceable.

Definition at line 1348 of file unistr.cpp.

References extractBetween(), and insert().

Referenced by TestReplaceable::copy().

    if (limit <= start) {
        return; // Nothing to do; avoid bogus malloc call
    UChar* text = (UChar*) uprv_malloc( sizeof(UChar) * (limit - start) );
    // Check to make sure text is not null.
    if (text != NULL) {
          extractBetween(start, limit, text, 0);
          insert(dest, text, 0, limit - start);    

Generated by  Doxygen 1.6.0   Back to index