Logo Search packages:      
Sourcecode: icu version File versions

UnicodeString & UnicodeString::fastCopyFrom ( const UnicodeString src )

Almost the same as the assignment operator. Replace the characters in this UnicodeString with the characters from srcText.

This function works the same for all strings except for ones that are readonly aliases. Starting with ICU 2.4, the assignment operator and the copy constructor allocate a new buffer and copy the buffer contents even for readonly aliases. This function implements the old, more efficient but less safe behavior of making this string also a readonly alias to the same buffer. The fastCopyFrom function must be used only if it is known that the lifetime of this UnicodeString is at least as long as the lifetime of the aliased buffer including its contents, for example for strings from resource bundles or aliases to string contents.

Parameters:
srcThe text containing the characters to replace.
Returns:
a reference to this ICU 2.4

Definition at line 458 of file unistr.cpp.

References TRUE.

Referenced by DateFormatSymbols::assignArray(), DateFormatSymbols::copyData(), DateFormatSymbols::createZoneStrings(), TimeZone::getCanonicalID(), TimeZone::getEquivalentID(), DateFormatSymbols::getLocalPatternChars(), SimpleDateFormat::matchQuarterString(), SimpleDateFormat::matchString(), and DecimalFormatSymbols::operator=().

                                                    {
  return copyFrom(src, TRUE);
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index