本文整理汇总了C++中TBuf16::AppendFormat方法的典型用法代码示例。如果您正苦于以下问题:C++ TBuf16::AppendFormat方法的具体用法?C++ TBuf16::AppendFormat怎么用?C++ TBuf16::AppendFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBuf16
的用法示例。
在下文中一共展示了TBuf16::AppendFormat方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExecuteL
// From MTest:
void CTestCase::ExecuteL (TTestResult& aResult)
{
TInt error = ExecuteImplL();
aResult.iResult = error;
// add the possible failure or error to the result
if (error == KErrCppUnitAssertionFailed)
{
CAssertFailure* assertFailure = AssertFailureFromTlsL ();
CleanupStack::PushL(assertFailure);
TBuf16 <0x80> convertBuf;
TBuf16 <256> temporaryBuf;
convertBuf.Copy(assertFailure->What());
temporaryBuf.Append(convertBuf);
temporaryBuf.AppendFormat(_L(" at Line %i of "), assertFailure->LineNumber());
convertBuf.Copy(assertFailure->FileName());
if (convertBuf.Length() + temporaryBuf.Length() >= 0x80)
{
TBuf <0x80> printBuf;
printBuf = convertBuf.Right(0x80 - temporaryBuf.Length() - 1 -3 );
convertBuf = _L("...");
convertBuf.Append(printBuf);
}
temporaryBuf.Append(convertBuf);
aResult.iResultDes = temporaryBuf;
CleanupStack::PopAndDestroy(assertFailure);
}
}
示例2: RunInNewThreadL
TInt CSwiEngine::RunInNewThreadL(CSwiTask* aTask)
{
CPassiveLogger* logger = aTask->Logger();
RThread installRunnerThread;
TInt status = installRunnerThread.Create(
KThreadName,
reinterpret_cast<TThreadFunction>(ThreadFunction),
KDefaultStackSize,
NULL,
aTask
);
User::LeaveIfError(status);
TRequestStatus threadStat;
threadStat=KRequestPending;
installRunnerThread.Resume();
installRunnerThread.Logon(threadStat);
User::WaitForRequest(threadStat);
installRunnerThread.Close();
TInt result = threadStat.Int();
//NOTE: if removal result==-14 (KErrInUse) it's because the VM didnt exit yet.
// Security checks if the suite is in use in a very naive way, it simply
// tries to open the Jar file..
// However, in that case, it is undefined if the removal was successfull.
if(result == KErrNone)
{
logger->AppendL(_L("Swi:Task complete"));
}
else
{
_LIT(KErrorPattern, "Swi:Task failed: %d");
TBuf16<64> buf;
buf.AppendFormat(KErrorPattern, result);
logger->AppendL(buf);
//User::Leave(error);
//not leaving to allow command response to be written back
//to the SEI
}
logger->Flush();
delete logger;
return result;
}
示例3: HandleCommandL
void CBrCtlSampleAppCommandObserver::HandleCommandL(TBrCtlDefs::TBrCtlClientCommands aCommand,
const CArrayFix<TPtrC>& /*aAttributesNames*/,
const CArrayFix<TPtrC>& /*aAttributeValues*/)
{
// Here we are creating a text string to be displayed on the screen, but if
// you were implementing this method, you would most likely be displaying a
// progress bar.
TBuf16<256> tgt;
_LIT(KHandleCommandEvent, "Command event = %d");//, size = %d, trId = %d");
tgt.AppendFormat(KHandleCommandEvent, aCommand); //, aSize, aTransactionId);
iContainer->SetText(tgt);
iContainer->DrawNow();
}