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


C++ TDes::AppendNumFixedWidth方法代码示例

本文整理汇总了C++中TDes::AppendNumFixedWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ TDes::AppendNumFixedWidth方法的具体用法?C++ TDes::AppendNumFixedWidth怎么用?C++ TDes::AppendNumFixedWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TDes的用法示例。


在下文中一共展示了TDes::AppendNumFixedWidth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GenerateHashAndReturnInHexFormatL

/**
Auxilary function should be called only when we need to generate hash values from the screen and returns its hex format.
@param aHexString the output MD5 hash hex string obtained from iBitmapDevice
*/
EXPORT_C void CTHashReferenceImages::GenerateHashAndReturnInHexFormatL(TDes &aHexString)
	{
	TInt bufLen = CFbsBitmap::ScanLineLength(iBitmapDevice->SizeInPixels().iWidth, iBitmapDevice->DisplayMode());
	RBuf8 buff;
	buff.CreateL(bufLen);
	CleanupClosePushL(buff);	
	CMD5 *md = CMD5::NewL();
	CleanupStack::PushL(md);
	for (TPoint pos(0, 0); pos.iY < iBitmapDevice->SizeInPixels().iHeight; pos.iY++)
		{
		iBitmapDevice->GetScanLine(buff,pos,iBitmapDevice->SizeInPixels().iWidth,iBitmapDevice->DisplayMode());
		md->Update(buff);
		}

	TBuf8<KLengthOfHashValue> hashString;
	//md will be reset after calling CMD5::Final() as Final will call Reset.
	hashString.Copy(md->Final());
	aHexString.Zero();

	for(TInt icount=0; icount < hashString.Length(); icount++)
		{
		aHexString.AppendNumFixedWidth(hashString[icount], EHex, 4);
		}
	CleanupStack::PopAndDestroy(2, &buff);
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:29,代码来源:thashreferenceimages.cpp

示例2: GetUniqueRuleId

// ---------------------------------------------------------------------------
// CPresenceXDM::GetUniqueRuleId()
// ---------------------------------------------------------------------------
//    
void CPresenceXDM::GetUniqueRuleId(TDes& aRuleId)
    {
	OPENG_DP(D_OPENG_LIT( " CPresenceXDM::GetUniqueRuleId" ));
    aRuleId.Copy(KPresRuleIDPrefix);
    TInt myNumber;

    // make sure that newly created rule id doesnt exist in the document
    while (IsRuleExist(aRuleId))
        {
        aRuleId.Delete(KPresRuleIDPrefixLength, KPresRuleIDNumLength);
        myNumber = Math::Random() - KPresRuleIdCalc;
        aRuleId.AppendNumFixedWidth(myNumber,EDecimal,KPresRuleIDNumLength);
        }
    OPENG_DP(D_OPENG_LIT( "     aRuleId = %S" ), &aRuleId);
    }
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:19,代码来源:cpresencexdm.cpp


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