当前位置: 首页>>代码示例>>C++>>正文


C++ KviCString::replaceAll方法代码示例

本文整理汇总了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;
	}
开发者ID:netrunner-debian-kde-extras,项目名称:kvirc,代码行数:33,代码来源:libkvilamerizer.cpp

示例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);
}
开发者ID:AndrioCelos,项目名称:KVIrc,代码行数:50,代码来源:KviLocale.cpp


注:本文中的KviCString::replaceAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。