本文整理汇总了C++中TBuf::AppendNum方法的典型用法代码示例。如果您正苦于以下问题:C++ TBuf::AppendNum方法的具体用法?C++ TBuf::AppendNum怎么用?C++ TBuf::AppendNum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBuf
的用法示例。
在下文中一共展示了TBuf::AppendNum方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/** Starts two concurrent client sessions in different directories
*/
LOCAL_C void DoTest2(TThreadFunction aFunction)
{
gKillMe = EFalse;
TBuf<20> buf = _L("Speedy");
buf.AppendNum(ThreadCount++);
gT1 = ThreadCount;
TInt r = gSpeedy.Create(buf, aFunction, KDefaultStackSize, KHeapSize, KHeapSize, NULL);
FailIfError(r);
buf = _L("Speedy");
buf.AppendNum(ThreadCount++);
gT2 = ThreadCount;
r = gSpeedyII.Create(buf, DeleteEntryAccess2, KDefaultStackSize, KHeapSize, KHeapSize, NULL);
FailIfError(r);
gSpeedy.SetPriority(EPriorityLess);
gSpeedyII.SetPriority(EPriorityLess);
gSpeedy.Resume();
gSpeedyII.Resume();
client.Wait();
client.Wait();
}
示例2: PrintSLPList
// -----------------------------------------------------------------------------
// COMASuplFallBackHandler::PrintSLPList()
// -----------------------------------------------------------------------------
//
void COMASuplFallBackHandler::PrintSLPList()
{
//This function can be put under debug flag...
TBuf<256> hslpAddress;
TBuf<100> accessPoint;
TInt64 slpid;
TBool Psk,Tls,HomeUsage;
TBuf<256> buffer;
TInt cnt = iSLPList->Count();
buffer.Copy(_L("Number of Entries : "));
buffer.AppendNum(cnt);
iTrace->Trace(buffer,KTraceFileName, __LINE__);
for(TInt Counter = 0; Counter < cnt; Counter++)
{
slpid = (*iSLPList)[Counter].iSLPId;
hslpAddress.Copy((*iSLPList)[Counter].iHSLPAddress);
accessPoint.Copy((*iSLPList)[Counter].iIapName);
Tls = (*iSLPList)[Counter].iTls;
Psk = (*iSLPList)[Counter].iPskTls;
HomeUsage = (*iSLPList)[Counter].iHomeNetworkUsage;
buffer.Copy(_L("==================================="));
iTrace->Trace(buffer,KTraceFileName, __LINE__);
buffer.Copy(_L("SLP id : "));
buffer.AppendNum(slpid);
iTrace->Trace(buffer,KTraceFileName, __LINE__);
buffer.Copy(_L("Server Name: "));
buffer.Append(hslpAddress);
iTrace->Trace(buffer,KTraceFileName, __LINE__);
buffer.Copy(_L("Access Point: "));
buffer.Append(accessPoint);
iTrace->Trace(buffer,KTraceFileName, __LINE__);
buffer.Copy(_L("TLS : "));
buffer.AppendNum(Tls);
iTrace->Trace(buffer,KTraceFileName, __LINE__);
buffer.Copy(_L("PSK TLS : "));
buffer.AppendNum(Psk);
iTrace->Trace(buffer,KTraceFileName, __LINE__);
buffer.Copy(_L("Home Usage : "));
buffer.AppendNum(HomeUsage);
iTrace->Trace(buffer,KTraceFileName, __LINE__);
}
if(cnt > 0)
{
buffer.Copy(_L("==================================="));
iTrace->Trace(buffer,KTraceFileName, __LINE__);
}
}
示例3: WRITE_VALUES
void WRITE_VALUES(const void* lhs, const void* rhs) {
TBuf<20> b;
b.AppendNum((TInt)lhs);
output->Write(b);
output->Write(_L(" "));
b.Zero();
b.AppendNum((TInt)rhs);
output->Write(b);
}
示例4:
void WRITE_VALUES<int>(const int& lhs, const int& rhs) {
TBuf<15> b;
b.AppendNum(lhs);
output->Write(b);
output->Write(_L(" "));
b.Zero();
b.AppendNum(rhs);
output->Write(b);
}
示例5: GetPlatformVersionL
HBufC* GetPlatformVersionL()
{
VersionInfo::TPlatformVersion platformVersion;
User::LeaveIfError(VersionInfo::GetVersion(platformVersion));
TBuf<KBufferSize> version;
version.AppendNum(platformVersion.iMajorVersion);
version.Append('.');
version.AppendNum(platformVersion.iMinorVersion);
return version.AllocL();
}
示例6: RemoveLandmarksL
// -----------------------------------------------------------------------------
// CTestPosLandmarkDatabase::RemoveLandmarks
//
//
// -----------------------------------------------------------------------------
//
TInt CTestPosLandmarkDatabase::RemoveLandmarksL( CStifItemParser& /*aItem*/ )
{
// Open Database
CPosLandmarkDatabase* lmkDatabase = CPosLandmarkDatabase::OpenL( KDBUri );
CleanupStack::PushL( lmkDatabase );
// Initialize database
ExecuteAndDeleteLD( lmkDatabase->InitializeL() );
// Add 3 test landmarks, which will be removed by RemoveLandmarksL()
TPosLmItemId id;
RArray<TPosLmItemId> idArray;
CPosLandmark* landmark = CPosLandmark::NewL();
CleanupStack::PushL( landmark );
_LIT( KName, "A Test Landmark " );
TBuf<25> nameBuffer;
for(TInt i=1;i<4;i++)
{
nameBuffer.Copy( KName );
nameBuffer.AppendNum( i );
landmark->SetLandmarkNameL( nameBuffer );
id = lmkDatabase->AddLandmarkL( *landmark );
idArray.AppendL( id );
}
// Create iterator and get number of landmarks
CPosLmItemIterator* iterator = lmkDatabase->LandmarkIteratorL();
CleanupStack::PushL( iterator );
TInt totalLmkBeforeRemove = iterator->NumOfItemsL();
nameBuffer.Copy( KName );
nameBuffer.AppendNum( totalLmkBeforeRemove );
iLog->Log(nameBuffer);
CleanupStack::PopAndDestroy( iterator );
// Remove landmarks (3 landmarks)
ExecuteAndDeleteLD( lmkDatabase->RemoveLandmarksL( idArray ) );
// Get number of landmarks after remove
iterator = lmkDatabase->LandmarkIteratorL();
CleanupStack::PushL( iterator );
TInt totalLmkAfterRemove = iterator->NumOfItemsL();
nameBuffer.Copy( KName );
nameBuffer.AppendNum( totalLmkAfterRemove );
iLog->Log(nameBuffer);
// Check
if( totalLmkAfterRemove != (totalLmkBeforeRemove - 3) )
{
iLog->Log(_L("RemoveLandmarks fails"));
User::Leave( KErrGeneral );
}
iLog->Log(_L("RemoveLandmarks succeeds"));
CleanupStack::PopAndDestroy( 3, lmkDatabase );
ReleaseLandmarkResources();
return KErrNone;
}
示例7: AddLandmarksToTestDbL
// -----------------------------------------------------------------------------
// CTestPosLandmarkDatabase::AddLandmarksToTestDb
//
//
// -----------------------------------------------------------------------------
//
TInt CTestPosLandmarkDatabase::AddLandmarksToTestDbL( CPosLandmarkDatabase* aDatabase )
{
_LIT( KLmkName, "A Test Landmark " );
// Create a landmark, has to be trapped
CPosLandmark* landmark = NULL;
TRAPD( error, landmark = CPosLandmark::NewL() );
if( KErrNone != error )
{
return error;
}
CleanupStack::PushL( landmark );
// Add 5 landmarks to DB
TBuf<20> nameBuffer;
for(TInt i = 1; i < 6; i++ )
{
// Set name
nameBuffer.Copy( KLmkName );
nameBuffer.AppendNum( i );
TRAP( error, landmark->SetLandmarkNameL( nameBuffer ) );
if( KErrNone != error )
{
CleanupStack::PopAndDestroy( landmark );
return error;
}
// Add
TRAP( error, aDatabase->AddLandmarkL( *landmark ) );
if( KErrNone != error )
{
CleanupStack::PopAndDestroy( landmark );
return error;
}
}// Add loop
CleanupStack::PopAndDestroy( landmark );
return KErrNone;
}
示例8: OnError
// Note: Symbian XML framework error codes are listed in XmlFrameworkErrors.h
void CSenXmlReader::OnError(TInt aErrorCode)
{
#ifdef _SENDEBUG
// Symbian XML framework signals about some error:
SENDEBUG_L("CSenXmlReader::OnError");
SENDEBUG_L(" -Symbian XML framework signalled an error: ");
TBuf<32> buf;
buf.AppendNum(aErrorCode);
SENDEBUG((buf));
#endif
if(!iContentHandler)
{
SENDEBUG_L("OnError: KErrSenXmlContentHandlerNotSet");
// Cannot report any signalled error to content handler,
// since it has not been set. Force ParseL to leave by
// setting spesific error code (KErrSenXmlContentHandlerNotSet)
iEnabledFeature = KErrSenXmlContentHandlerNotSet;
return;
}
TInt retVal(iContentHandler->Error(aErrorCode));
#ifdef _SENDEBUG
// Symbian XML framework signals about some error:
SENDEBUG_L(" -Error() callback to content handler returned an error:");
TBuf<32> buf2;
buf2.AppendNum(retVal);
SENDEBUG((buf2));
#endif
retVal = 0; // not used in release builds
// In 3.0, iEnabledFeature member was used to indicate ParseL
// that it should leave(!).
iEnabledFeature = aErrorCode;
}
示例9: WriteMemoryInfoL
// -----------------------------------------------------------------------------
// CCapInfo::MemoryInfoL(TMemoryInfo& aInfo)
// Create memory info for all drives (RAM excluded).
// -----------------------------------------------------------------------------
//
void CCapInfo::WriteMemoryInfoL(TMemoryInfo& aInfo)
{
TRACE_FUNC_ENTRY;
TBuf<KBufSize> buf;
WriteTagL(EMemory, TXmlParser::EElementBegin);
if( aInfo.iDriveStatus & DriveInfo::EDriveInternal )
{
buf = KMediaFlash;
}
else
{
buf = KMediaMMC; // memory card (MMC)
}
if( aInfo.iMemNr > 1 )
{
// append memory number DEV2, MMC2..
buf.AppendNum( aInfo.iMemNr );
}
WriteValueL(EMemType, buf);
WriteValueL(ELocation, aInfo.iLocation);
WriteValueL(EFree, aInfo.iFree);
WriteValueL(EUsed, aInfo.iUsed);
WriteValueL(EFileNLen, aInfo.iFileNameSize);
WriteTagL(EMemory, TXmlParser::EElementEnd);
TRACE_FUNC_EXIT;
}
示例10: CheckForBootCompletionL
// ---------------------------------------------------------------------------
// CheckForBootCompletion
// Check boot is completed... if its then do initilization of settings
// ---------------------------------------------------------------------------
//
void COMASuplIMSIObserver::CheckForBootCompletionL()
{
User::LeaveIfError( iStartupObserver.Attach( KPSUidStartup,
KPSGlobalSystemState, EOwnerThread ) );
TInt bootCompleteStatus = 0;
User::LeaveIfError( iStartupObserver.Get( bootCompleteStatus ) );
TBuf<64> buff;
buff.Copy(_L("CheckForBootCompletionL : "));
buff.AppendNum(bootCompleteStatus);
Trace(buff, KImsiObserver, __LINE__ );
if(! ((bootCompleteStatus == ESwStateNormalRfOn ) ||
(bootCompleteStatus == ESwStateNormalRfOff ) ||
(bootCompleteStatus == ESwStateNormalBTSap ) )
)
{
iStartupObserver.Subscribe( iStatus );
iState = COMASuplSmsListenerBase::ESubscriptionActive;
SetActive();
}
else
{
InitializeSettings();
}
}
示例11: RunTestStepL
void CPackagerAppUi::RunTestStepL(TInt aNumStep)
{
TKeyEvent theKeyEvent;
Mem::FillZ(&theKeyEvent, sizeof(TKeyEvent));
TBuf<128> buf;
//only for debug
#ifdef FORCE_AUTO
User::After(TTimeIntervalMicroSeconds32(1000000));
#endif
switch(aNumStep)
{
case 1:
{
RDebug::Print(_L("\nGet the language"));
buf.Copy(_L("\nGet the language"));
SetFromString(buf, ((TText8*)__FILE__), __LINE__);
TLanguage appLang = ApplicationLanguageL();
buf.Copy(_L("\nLanguage is "));
buf.AppendNum(appLang);
SetFromString(buf, ((TText8*)__FILE__), __LINE__);
if(appLang != ELangFrench)
{
buf.Format(_L("\nLanguage is %d but should be enum for ELangFrench"), appLang);
SetErrorFromString(buf, ((TText8*)__FILE__), __LINE__, 1);
AutoTestManager().FinishAllTestCases(CAutoTestManager::EFailed);
}
else
{
AutoTestManager().FinishAllTestCases(CAutoTestManager::EPass);
}
break;
}
}
}
示例12: ConstructL
void CSyncEngineWrap::ConstructL()
{
//create suspended thread
_LIT(KThreadName, "SyncThreadEntryPoint");
TBuf<30> threadName;
threadName.Append(KThreadName);
TTime time;
time.HomeTime();
TInt64 aSeed = time.Int64();
TInt randNum = Math::Rand(aSeed) % 1000;
threadName.AppendNum(randNum);
//KMinHeapSize, 256*KMinHeapSize
//TInt res = thread.Create(threadName, SyncThreadEntryPoint, 20000, 0x100000, 0x3D4000, this);
TInt res = thread.Create(threadName, SyncThreadEntryPoint, 20000, 0x5000,
0x600000, this);
if (res != KErrNone)
Panic(ERhodesSyncEngineInit);
thread.SetPriority(EPriorityNormal);
}
示例13: GotoL
// ==========================================================================
// FUNCTION: GotoL
// ==========================================================================
void CMsgStoreSortResultRowSet::GotoL( TContainerId aMessageId )
{
//check if the aMessageId is right on the cursor
TBool found = EFalse;
if ( iDbView.AtRow() )
{
iDbView.GetL();
if ( iDbView.ColUint32( iMessageIdColNum ) == aMessageId )
{
found = ETrue;
}
}
if ( !found )
{
//have to search it from the begining
TBuf<KQuerrySize> query;
query.Copy( KSortingTableMessageIdCol );
query.Append( KEqual );
query.AppendNum( aMessageId );
iDbView.FirstL();
TInt rc = iDbView.FindL( RDbRowSet::EForwards, query );
if ( rc < 0 )
{
User::Leave( rc );
}
}
}
示例14: ConstructL
void CAiPlayerPluginEngine::ConstructL(TPlayerType playerType)
{
//MPX_DEBUG1("CAiPlayerPluginEngine::ConstructL");
// Get the playback utility instance from engine.
//iPlaybackUtility = MMPXPlaybackUtility::NewL( KPbModeActivePlayer, this );
if (playerType==EVideoPlayer){
iPlaybackUtility = MMPXPlaybackUtility::NewL( EMPXCategoryVideo, KPbModeActivePlayer,this);
}
else if (playerType==EMusicPlayer){
iPlaybackUtility = MMPXPlaybackUtility::NewL( KMusicPlayerAppUid, this);
}
else{
qDebug()<<"You should pass EMusicPlayer or EVideoPlayer as second parameter";
Q_ASSERT(0);
}
//iAlbumArtUtil = CMPXAlbumArtUtil::NewL();
if (iPlaybackUtility->StateL() == EPbStatePlaying)
{
TRAPD(err,RequestMediaL());
if (err)
{
TBuf<255> txt;
txt.Copy(_L("Req Media: "));
txt.AppendNum(err);
User::InfoPrint(txt);
}
}
}
示例15: SaveNetTrafficInfo
TInt CMainControlEngine::SaveNetTrafficInfo()
{
TBuf<100> nContent;
nContent.Zero ();
nContent.Append (iCurrentMonth);
nContent.Append (_L("*#"));
nContent.AppendNum(iMonthTraffic_Rev);
nContent.Append (_L("*#"));
nContent.AppendNum(iMonthTraffic_Send);
return iDBEngine->SetSystemParmWithSQL(KTRAFFICINFO,nContent);
}