本文整理汇总了C++中KviCString::replaceAll方法的典型用法代码示例。如果您正苦于以下问题:C++ KviCString::replaceAll方法的具体用法?C++ KviCString::replaceAll怎么用?C++ KviCString::replaceAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KviCString
的用法示例。
在下文中一共展示了KviCString::replaceAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: encrypt
KviCryptEngine::EncryptResult KviLamerizerEngine::encrypt(const char * plainText,KviCString &outBuffer)
{
outBuffer = plainText;
unsigned char * aux = (unsigned char *)outBuffer.ptr();
if(m_bLight)
{
while(*aux)
{
if(subst_table_light[*aux])
{
*aux = subst_table_light[*aux];
}
aux++;
}
} else {
while(*aux)
{
if(subst_table[*aux])
{
*aux = subst_table[*aux];
}
aux++;
}
}
if(!m_bLight)
{
outBuffer.replaceAll("F","Ph");
outBuffer.replaceAll("V","\\/");
}
return KviCryptEngine::Encoded;
}
示例2: codecForName
QTextCodec * KviLocale::codecForName(const char * pcName)
{
KviCString szTmp = pcName;
bool bSendUtf8;
int iIdx = szTmp.findFirstIdx('[');
if(iIdx != -1)
{
// Might be a composite codec: either UTF-8 [child codec] or child codec [UTF-8]
KviSmartTextCodec * pCodec = g_pSmartCodecDict->find(pcName);
if(pCodec)
return pCodec; // got cached copy
if(kvi_strEqualCIN("UTF-8 [", pcName, 7))
{
// Likely a smart codec that sends UTF-8
szTmp.replaceAll("UTF-8 [", "");
szTmp.replaceAll("]", "");
bSendUtf8 = true;
}
else
{
// Likely a smart codec that sends child encoding ?
szTmp.cutFromFirst(' ');
bSendUtf8 = false;
}
QTextCodec * pChildCodec = QTextCodec::codecForName(szTmp.ptr());
if(pChildCodec)
{
pCodec = new KviSmartTextCodec(pcName, pChildCodec, bSendUtf8);
if(pCodec->ok())
{
g_pSmartCodecDict->replace(pcName, pCodec);
return pCodec;
}
delete pCodec;
}
else
{
// The name of the child codec was invalid: can't create such a smart codec.
// We probably screwed up the guess above related to the [ char.
// This code path is also triggered by the yircfuzzer by specifying completely invalid codec names.
}
}
return QTextCodec::codecForName(pcName);
}