本文整理汇总了C++中TBuf::AppendFill方法的典型用法代码示例。如果您正苦于以下问题:C++ TBuf::AppendFill方法的具体用法?C++ TBuf::AppendFill怎么用?C++ TBuf::AppendFill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBuf
的用法示例。
在下文中一共展示了TBuf::AppendFill方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindVariation
// ----------------------------------------------------------------------------------------
// CFMSServer::FindVariation()
// ----------------------------------------------------------------------------------------
void CFMSServer::FindVariation()
{
FLOG(_L("CFMSServer::FindVariation()"));
CRepository* centrep = NULL;
TInt variation = 1;
TRAPD( err, centrep = CRepository::NewL( KCRUidFotaServer ) );
if ( centrep )
{
FLOG(_L("CFMSServer::FindVariation()::Inside cenrep if"));
TInt err = centrep->Get( KFotaMonitoryServiceEnabled, variation );
if( err == KErrNone)
{
FLOG(_L("CFMSServer::FindVariation()::cenrep key found with %d"),variation);
}
delete centrep;
}
if ( err == KErrNone )
{
TBuf<10> var; //32-bit has max of 10 chars in Decimal
var.Num(variation,EBinary);
TInt size = var.Length(), maxlen = 4;
if( size < maxlen)
{
TBuf<4> temp;
temp.AppendFill('0',maxlen-size);
temp.Append(var);
var.Zero();
var.Append(temp);
}
var.AppendFill('0',6);
if( var[0] == '1' )//memory
{
FLOG(_L("CFMSServer::FindVariation():: memory monitor supported"));
iMemoryMon = ETrue;
}
if( var[1] == '1' ) //startup
{
FLOG(_L("CFMSServer::FindVariation()::Phone restart monitor supported"));
iPhoneRestartMon = ETrue;
}
if( var[2] == '1' )//user or charger
{
FLOG(_L("CFMSServer::FindVariation()::charger monitor supported"));
iChargerMon = ETrue;
}
if( var[3] == '1' )//newtwork
{
FLOG(_L("CFMSServer::FindVariation()::network monitor supported"));
iNetworkMon = ETrue;
}
}
}
示例2: PrintHex
EXPORT_C void CTestUtils::PrintHex(const TDesC8& aDes)
{
TBuf<256> temp;
TInt pos = 0;
const TInt len = aDes.Length();
while (pos < len)
{
temp.Zero();
TPtrC8 ptr = aDes.Mid(pos, Min(KNumberOfHex, len - pos));
const TInt ptrLen = ptr.Length();
for (TInt i = 0; i < ptrLen; i++)
{
temp.AppendFormat(_L("%2.2x "), ptr[i]);
}
if (ptrLen < KNumberOfHex)
{
temp.AppendFill(' ', (KNumberOfHex - ptrLen) * 3);
}
TBuf<KNumberOfHex> buf16;
buf16.Copy(ptr);
temp.Append(buf16);
Printf(temp);
pos += KNumberOfHex;
}
}