本文整理汇总了C++中CFX_WideString::Delete方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_WideString::Delete方法的具体用法?C++ CFX_WideString::Delete怎么用?C++ CFX_WideString::Delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_WideString
的用法示例。
在下文中一共展示了CFX_WideString::Delete方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsFitArea
FX_BOOL CFDE_TxtEdtEngine::IsFitArea(CFX_WideString& wsText) {
std::unique_ptr<CFDE_TextOut> pTextOut(new CFDE_TextOut);
pTextOut->SetLineSpace(m_Param.fLineSpace);
pTextOut->SetFont(m_Param.pFont);
pTextOut->SetFontSize(m_Param.fFontSize);
CFX_RectF rcText;
FXSYS_memset(&rcText, 0, sizeof(rcText));
uint32_t dwStyle = 0;
if (!(m_Param.dwMode & FDE_TEXTEDITMODE_MultiLines))
dwStyle |= FDE_TTOSTYLE_SingleLine;
if (m_Param.dwMode & FDE_TEXTEDITMODE_AutoLineWrap) {
dwStyle |= FDE_TTOSTYLE_LineWrap;
rcText.width = m_Param.fPlateWidth;
} else {
rcText.width = 65535;
}
pTextOut->SetStyles(dwStyle);
wsText += L"\n";
pTextOut->CalcLogicSize(wsText.c_str(), wsText.GetLength(), rcText);
wsText.Delete(wsText.GetLength() - 1);
if ((m_Param.dwMode & FDE_TEXTEDITMODE_LimitArea_Horz) &&
(rcText.width > m_Param.fPlateWidth)) {
return FALSE;
}
if ((m_Param.dwMode & FDE_TEXTEDITMODE_LimitArea_Vert) &&
(rcText.height > m_Param.fLineSpace * m_Param.nLineCount)) {
return FALSE;
}
return TRUE;
}
示例2: Encode
void CBC_EdifactEncoder::Encode(CBC_EncoderContext& context, int32_t& e) {
CFX_WideString buffer;
while (context.hasMoreCharacters()) {
FX_WCHAR c = context.getCurrentChar();
encodeChar(c, buffer, e);
if (e != BCExceptionNO) {
return;
}
context.m_pos++;
int32_t count = buffer.GetLength();
if (count >= 4) {
context.writeCodewords(encodeToCodewords(buffer, 0, e));
if (e != BCExceptionNO) {
return;
}
buffer.Delete(0, 4);
int32_t newMode = CBC_HighLevelEncoder::lookAheadTest(
context.m_msg, context.m_pos, getEncodingMode());
if (newMode != getEncodingMode()) {
context.signalEncoderChange(ASCII_ENCODATION);
break;
}
}
}
buffer += (FX_WCHAR)31;
handleEOD(context, buffer, e);
}
示例3: not_aliased
TEST(fxcrt, WideStringConcatInPlace) {
CFX_WideString fred;
fred.ConcatInPlace(4, L"FRED");
EXPECT_EQ(L"FRED", fred);
fred.ConcatInPlace(2, L"DY");
EXPECT_EQ(L"FREDDY", fred);
fred.Delete(3, 3);
EXPECT_EQ(L"FRE", fred);
fred.ConcatInPlace(1, L"D");
EXPECT_EQ(L"FRED", fred);
CFX_WideString copy = fred;
fred.ConcatInPlace(2, L"DY");
EXPECT_EQ(L"FREDDY", fred);
EXPECT_EQ(L"FRED", copy);
// Test invalid arguments.
copy = fred;
fred.ConcatInPlace(-6, L"freddy");
CFX_WideString not_aliased(L"xxxxxx");
EXPECT_EQ(L"FREDDY", fred);
EXPECT_EQ(L"xxxxxx", not_aliased);
}
示例4: 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]);
}
}
示例5: encodeChar
int32_t CBC_C40Encoder::backtrackOneCharacter(CBC_EncoderContext& context,
CFX_WideString& buffer,
CFX_WideString& removed,
int32_t lastCharSize,
int32_t& e) {
int32_t count = buffer.GetLength();
buffer.Delete(count - lastCharSize, count);
context.m_pos--;
FX_WCHAR c = context.getCurrentChar();
lastCharSize = encodeChar(c, removed, e);
BC_EXCEPTION_CHECK_ReturnValue(e, -1);
context.resetSymbolInfo();
return lastCharSize;
}
示例6: SetText
void CFDE_TxtEdtEngine::SetText(const CFX_WideString& wsText) {
ResetEngine();
int32_t nLength = wsText.GetLength();
if (nLength > 0) {
CFX_WideString wsTemp;
FX_WCHAR* lpBuffer = wsTemp.GetBuffer(nLength);
FXSYS_memcpy(lpBuffer, wsText.c_str(), nLength * sizeof(FX_WCHAR));
ReplaceParagEnd(lpBuffer, nLength, FALSE);
wsTemp.ReleaseBuffer(nLength);
if (m_nLimit > 0 && nLength > m_nLimit) {
wsTemp.Delete(m_nLimit, nLength - m_nLimit);
nLength = m_nLimit;
}
m_pTxtBuf->SetText(wsTemp);
}
m_pTxtBuf->Insert(nLength, &m_wLineEnd, 1);
RebuildParagraphs();
}
示例7: GetPreInsertText
void CFDE_TxtEdtEngine::GetPreInsertText(CFX_WideString& wsText,
int32_t nIndex,
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);
nIndex = nSelIndex;
}
CFX_WideString wsTemp;
int32_t nOldLength = wsText.GetLength();
const FX_WCHAR* pOldBuffer = wsText.c_str();
FX_WCHAR* lpBuffer = wsTemp.GetBuffer(nOldLength + nLength);
FXSYS_memcpy(lpBuffer, pOldBuffer, (nIndex) * sizeof(FX_WCHAR));
FXSYS_memcpy(lpBuffer + nIndex, lpText, nLength * sizeof(FX_WCHAR));
FXSYS_memcpy(lpBuffer + nIndex + nLength, pOldBuffer + nIndex,
(nOldLength - nIndex) * sizeof(FX_WCHAR));
wsTemp.ReleaseBuffer(nOldLength + nLength);
wsText = wsTemp;
}
示例8: GetPreDeleteText
void CFDE_TxtEdtEngine::GetPreDeleteText(CFX_WideString& wsText,
int32_t nIndex,
int32_t nLength) {
GetText(wsText, 0, GetTextBufLength());
wsText.Delete(nIndex, nLength);
}
示例9:
void CBC_C40Encoder::writeNextTriplet(CBC_EncoderContext& context,
CFX_WideString& buffer) {
context.writeCodewords(encodeToCodewords(buffer, 0));
buffer.Delete(0, 3);
}