本文整理汇总了C++中icu::UnicodeString::remove方法的典型用法代码示例。如果您正苦于以下问题:C++ UnicodeString::remove方法的具体用法?C++ UnicodeString::remove怎么用?C++ UnicodeString::remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类icu::UnicodeString
的用法示例。
在下文中一共展示了UnicodeString::remove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConvertString
void FStringConverter::ConvertString(const TCHAR* Source, const int32 SourceStartIndex, const int32 SourceLen, icu::UnicodeString& Destination, const bool ShouldNullTerminate)
{
if (SourceLen > 0)
{
UErrorCode ICUStatus = U_ZERO_ERROR;
ucnv_reset(ICUConverter);
// Get the internal buffer of the string, we're going to use it as scratch space
const int32_t DestinationCapacityUChars = SourceLen * 2;
UChar* InternalStringBuffer = Destination.getBuffer(DestinationCapacityUChars);
// Perform the conversion into the string buffer
const int32_t SourceSizeBytes = SourceLen * sizeof(TCHAR);
const int32_t DestinationLength = ucnv_toUChars(ICUConverter, InternalStringBuffer, DestinationCapacityUChars, reinterpret_cast<const char*>(Source + SourceStartIndex), SourceSizeBytes, &ICUStatus);
// Optionally null terminate the string
if (ShouldNullTerminate)
{
InternalStringBuffer[DestinationLength] = 0;
}
// Size it back down to the correct size and release our lock on the string buffer
Destination.releaseBuffer(DestinationLength);
check(U_SUCCESS(ICUStatus));
}
else
{
Destination.remove();
}
}