本文整理汇总了C++中CFX_WideString::Insert方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_WideString::Insert方法的具体用法?C++ CFX_WideString::Insert怎么用?C++ CFX_WideString::Insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_WideString
的用法示例。
在下文中一共展示了CFX_WideString::Insert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetPreReplaceText
void CFDE_TxtEdtEngine::GetPreReplaceText(CFX_WideString& wsText,
int32_t nIndex,
int32_t nOriginLength,
const FX_WCHAR* lpText,
int32_t nLength) {
GetText(wsText, 0, GetTextBufLength());
int32_t nSelIndex = 0;
int32_t nSelLength = 0;
int32_t nSelCount = CountSelRanges();
while (nSelCount--) {
nSelLength = GetSelRange(nSelCount, nSelIndex);
wsText.Delete(nSelIndex, nSelLength);
}
wsText.Delete(nIndex, nOriginLength);
int32_t i = 0;
for (i = 0; i < nLength; i++) {
wsText.Insert(nIndex++, lpText[i]);
}
}
示例2: while
void CBC_Base256Encoder::Encode(CBC_EncoderContext& context, int32_t& e) {
CFX_WideString buffer;
buffer += (FX_WCHAR)'\0';
while (context.hasMoreCharacters()) {
FX_WCHAR c = context.getCurrentChar();
buffer += c;
context.m_pos++;
int32_t newMode = CBC_HighLevelEncoder::lookAheadTest(
context.m_msg, context.m_pos, getEncodingMode());
if (newMode != getEncodingMode()) {
context.signalEncoderChange(newMode);
break;
}
}
int32_t dataCount = buffer.GetLength() - 1;
FX_CHAR buf[128];
FXSYS_itoa(dataCount, buf, 10);
buffer.SetAt(0, FX_WCHAR(*buf) - '0');
int32_t lengthFieldSize = 1;
int32_t currentSize =
context.getCodewordCount() + dataCount + lengthFieldSize;
context.updateSymbolInfo(currentSize, e);
if (e != BCExceptionNO) {
return;
}
FX_BOOL mustPad = (context.m_symbolInfo->m_dataCapacity - currentSize) > 0;
if (context.hasMoreCharacters() || mustPad) {
if (dataCount <= 249) {
buffer.SetAt(0, (FX_WCHAR)dataCount);
} else if (dataCount > 249 && dataCount <= 1555) {
buffer.SetAt(0, (FX_WCHAR)((dataCount / 250) + 249));
buffer.Insert(1, (FX_WCHAR)(dataCount % 250));
} else {
e = BCExceptionIllegalStateMessageLengthInvalid;
return;
}
}
for (int32_t i = 0, c = buffer.GetLength(); i < c; i++) {
context.writeCodeword(
randomize255State(buffer.GetAt(i), context.getCodewordCount() + 1));
}
}