本文整理汇总了C++中TPtr8::AppendNum方法的典型用法代码示例。如果您正苦于以下问题:C++ TPtr8::AppendNum方法的具体用法?C++ TPtr8::AppendNum怎么用?C++ TPtr8::AppendNum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPtr8
的用法示例。
在下文中一共展示了TPtr8::AppendNum方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetRedPayloadsL
// -----------------------------------------------------------------------------
// CMccCodecRed::SetRedCodecs
// Set the payload types used in redundancy
// -----------------------------------------------------------------------------
//
void CMccCodecRed::SetRedPayloadsL( RArray<TUint>& aRedPayloads )
{
iRedPayloads.Reset();
TInt i;
for( i = 0; i < aRedPayloads.Count(); i++ )
{
iRedPayloads.AppendL( aRedPayloads[ i ] );
}
// Convert parsed payload formats back to string and set
// the iFmtpAttr variable
const TInt KCharsPerPayload( 4 );
delete iFmtpAttr;
iFmtpAttr = NULL;
iFmtpAttr = HBufC8::NewL( iRedPayloads.Count() * KCharsPerPayload );
TPtr8 descPtr = iFmtpAttr->Des();
for( i = 0; i < iRedPayloads.Count(); i++ )
{
descPtr.AppendNum( static_cast<TUint64>( iRedPayloads[i] ), EDecimal );
descPtr.Append( KCharSlash );
}
// Remove the last slash character
descPtr.SetLength( descPtr.Length() - 1 );
}
示例2: TestingCancelled
// ---------------------------------------------------------------------------
// Provides default implementation required for cancellation of testing
// ---------------------------------------------------------------------------
//
void COMASuplPosTesterCategory::TestingCancelled(const TDesC8& aInfo)
{
if(iCallBack)
{
HBufC8* infoBuf = NULL;
TRAPD(err, infoBuf = HBufC8::NewL(aInfo.Length() + KExtraBuffer));
if(err != KErrNone)
{
iCallBack->TestingCancelled(aInfo);
}
else
{
TPtr8 info = infoBuf->Des();
info.Copy(aInfo);
info.Append(KSessionId);
info.AppendNum(iTestNo);
iCallBack->TestingComplete(info);
}
delete infoBuf;
iCallBack->UpdateSessionTestSummary(iInfo, iWarning, iError);
}
else
{
Cancel();
iTestHandler->Cancel();
iTestingStatus = ETestCancelled;
CActiveScheduler::Stop();
iInfo++;
iLogger->WriteLine(aInfo, iTestNo);
}
}
示例3: TestingAborted
// ---------------------------------------------------------------------------
//Provides implementation required for aborting testing
// ---------------------------------------------------------------------------
//
void COMASuplPositionVelocityTest::TestingAborted(const TDesC8& /*aInfo*/)
{
if(iCallBack)
{
HBufC8* infoBuf = NULL;
TRAPD(err, infoBuf = HBufC8::NewL(KPositionVelocityTestAborted().Length() + KExtraBuffer));
if(err != KErrNone)
{
iCallBack->TestingAborted(KPositionVelocityTestAborted);
}
else
{
TPtr8 info = infoBuf->Des();
info.Copy(KPositionVelocityTestAborted);
info.Append(KSessionId);
info.AppendNum(iTestNo);
iCallBack->TestingAborted(info);
}
delete infoBuf;
iCallBack->UpdateSessionTestSummary(iInfo, iWarning, iError);
}
else
{
Cancel();
iTestHandler->Cancel();
iTestingStatus = ETestAborted;
CActiveScheduler::Stop();
iError++;
iLogger->WriteLine(KPositionVelocityTestAborted, iTestNo);
}
}
示例4: CreateHashL
// -----------------------------------------------------------------------------
// TSnapshotItem::CreateHashL
// Create hash value from group content
// -----------------------------------------------------------------------------
void TSnapshotItem::CreateHashL( CContactGroup& aGroup )
{
CMessageDigest* hash = CMessageDigestFactory::NewDigestLC( CMessageDigest::EMD5 );
if ( aGroup.HasItemLabelField() )
{
TPtrC label = aGroup.GetGroupLabelL();
HBufC8* tempBuf = CnvUtfConverter::ConvertFromUnicodeToUtf8L( label );
CleanupStack::PushL( tempBuf );
hash->Update( tempBuf->Des() );
CleanupStack::PopAndDestroy( tempBuf );
}
// Create text field from items on group
CContactIdArray* contactsIdArray = aGroup.ItemsContainedLC();
const TInt idBufferMaxSize( 400 );
HBufC8* tempIdBuf = HBufC8::NewLC( idBufferMaxSize );
TPtr8 tempId = tempIdBuf->Des();
const TInt KMaxNumLength(5);
if ( contactsIdArray ) // this is NULL if there are no objects
{
tempId.AppendNum( contactsIdArray->Count(), EHex );
for (TInt i=0; i< contactsIdArray->Count(); i++ )
{
if ( tempId.Length()+KMaxNumLength > tempId.MaxLength() )
{
// buffer is almost full, don't add any new items
LOGGER_WRITE("buffer full");
break;
}
// add item id
tempId.AppendNum( (*contactsIdArray)[i] , EHex );
}
}
else
{
tempId.AppendNum( 0 );
}
// update hash
hash->Update( tempId );
iHash.Copy( hash->Final() );
CleanupStack::PopAndDestroy( tempIdBuf );
CleanupStack::PopAndDestroy( contactsIdArray );
CleanupStack::PopAndDestroy( hash );
}
示例5: AllocateChannelL
// ---------------------------------------------------------------------------
// Allocates a free channel
// ---------------------------------------------------------------------------
//
void CDunBtPlugin::AllocateChannelL( TBool& aNoFreeChans,
TBtCleanupInfo& aCleanupInfo )
{
FTRACE(FPrint(_L("CDunBtPlugin::AllocateChannelL()")));
// iDataSocket has new data socket information so copy it to iBTPorts
TBtPortEntity* foundEntity = NULL;
TInt foundIndex = GetFirstFreePort( foundEntity );
if ( !foundEntity ) // free not found so add new
{
TBtPortEntity newEntity;
iBTPorts.AppendL( newEntity );
aCleanupInfo.iNewEntity = ETrue;
aCleanupInfo.iEntityIndex = iBTPorts.Count() - 1;
foundEntity = &iBTPorts[ aCleanupInfo.iEntityIndex ];
}
else // free found so change array
{
aCleanupInfo.iNewEntity = EFalse;
aCleanupInfo.iEntityIndex = foundIndex;
foundEntity = &iBTPorts[ foundIndex ];
}
foundEntity->iChannelNum = iEntity.iChannelNum;
foundEntity->iBTPort = iEntity.iBTPort;
RSocket* socket = &foundEntity->iBTPort;
HBufC8* channelName = HBufC8::NewMaxLC( KBtChannelName().Length() +
KCharactersInTInt );
TPtr8 channelNamePtr = channelName->Des();
channelNamePtr.Copy( KBtChannelName );
channelNamePtr.AppendNum( iEntity.iChannelNum );
iTransporter->AllocateChannelL( socket,
KDunBtPluginUid,
channelNamePtr,
EFalse,
aNoFreeChans );
iTransporter->AddConnMonCallbackL( socket,
this,
EDunReaderUpstream,
EFalse );
iTransporter->AddConnMonCallbackL( socket,
this,
EDunWriterUpstream,
EFalse );
iTransporter->AddConnMonCallbackL( socket,
this,
EDunReaderDownstream,
ETrue );
iTransporter->AddConnMonCallbackL( socket,
this,
EDunWriterDownstream,
EFalse );
iTransporter->IssueTransferRequestsL( socket );
CleanupStack::PopAndDestroy( channelName );
FTRACE(FPrint(_L("CDunBtPlugin::AllocateChannelL() complete")));
}