本文整理汇总了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);
}
示例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);
}