本文整理汇总了C++中TBuf8::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ TBuf8::Append方法的具体用法?C++ TBuf8::Append怎么用?C++ TBuf8::Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBuf8
的用法示例。
在下文中一共展示了TBuf8::Append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitL
LOCAL_C void InitL()
{
CommInitL();
CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
CActiveScheduler::Install(scheduler);
CleanupStack::PushL(scheduler);
testUtils = CEmailTestUtils::NewLC(test);
testUtils->FileSession().SetSessionPath(_L("C:\\"));
testUtils->CleanMessageFolderL();
testUtils->CreateAllTestDirectories();
testUtils->GoClientSideL();
smtpService = testUtils->CreateSmtpServiceL();
testUtils->CreatePopServiceL();
log = CImLog::NewL(_L("c:\\logs\\email\\T_IMCM.log"), EAppend);
CleanupStack::PushL(log);
log->AppendComment(_L8("********** T_SMTC_IPV6 Test SMTP Client MTM **********"));
TBuf8<80> buf;
#if defined(__WINS__)
buf.Append(_L8("WINS "));
#else
buf.Append(_L8("MARM "));
#endif
#if defined(_UNICODE)
buf.Append(_L8("U"));
#endif
#if defined(_DEBUG)
buf.Append(_L8("DEB"));
#else
buf.Append(_L8("REL"));
#endif
log->AppendComment(buf);
}
示例2: SetProxyUsageIfNeededL
void CPodcastModel::SetProxyUsageIfNeededL(RHTTPSession& aSession)
{
TBool useProxy = EFalse;
HBufC* serverName = NULL;
TUint32 port = 0;
TRAPD(err,GetProxyInformationForConnectionL(useProxy, serverName, port));
if (err == KErrNone && useProxy)
{
CleanupStack::PushL(serverName);
TBuf8<128> proxyAddr;
proxyAddr.Append(*serverName);
proxyAddr.Append(':');
proxyAddr.AppendNum(port);
RStringF prxAddr = aSession.StringPool().OpenFStringL(proxyAddr);
CleanupClosePushL(prxAddr);
THTTPHdrVal prxUsage(aSession.StringPool().StringF(HTTP::EUseProxy,RHTTPSession::GetTable()));
aSession.ConnectionInfo().SetPropertyL(
aSession.StringPool().StringF(HTTP::EProxyUsage,RHTTPSession::GetTable()),
aSession.StringPool().StringF(HTTP::EUseProxy,RHTTPSession::GetTable()));
aSession.ConnectionInfo().SetPropertyL(aSession.StringPool().StringF(HTTP::EProxyAddress,RHTTPSession::GetTable()), prxAddr);
CleanupStack::PopAndDestroy(&prxAddr);
CleanupStack::PopAndDestroy(serverName);
}
}
示例3: SendExitRequest
void CHandleLoginOrExit::SendExitRequest()
{
GetNameAndPassword();
TBuf8<200> sendData;
TBuf8<8> bufTemp;
TInt len=96;
bufTemp.AppendNum(len,EHex);
for(TInt i=0;i<8-bufTemp.Length();i++)
{
sendData.AppendNum(0);
}
sendData.Append(bufTemp);//包长度
sendData.Append(KLoginMsgType);//消息类型
sendData.Append(_L("00000001"));//消息所带个数
sendData.Append(_L("00000001"));//消息流水号
sendData.Append(iNamePassword);//帐户密码
sendData.Append(_L("10"));//协议版本号
sendData.Append(_L("10"));//校验码
//iMainEngine.WriteLog8(sendData);
iHttpManager.SendPostRequest(*this,KCONNECTURL,KLoginContentType,sendData,EHttpExit);
}
示例4: TestSendAPDUReqL
/**
* @SYMTestCaseID BA-CTSYD-DIS-SIM-NEGATIVE-UN0016
* @SYMComponent telephony_ctsy
* @SYMTestCaseDesc Test handing in CTSY dispatch when the SendAPDUReq API is disabled
* @SYMTestPriority High
* @SYMTestActions Disable API, call API, check correct error returned
* @SYMTestExpectedResults Pass
* @SYMTestType CT
*/
void CCTsySimFUNegative::TestSendAPDUReqL()
{
TConfig config;
config.SetSupportedValue(MLtsyDispatchSimSendApduRequest::KLtsyDispatchSimSendApduRequestApiId, EFalse);
config.PushL();
OpenEtelServerL(EUseExtendedError);
CleanupStack::PushL(TCleanupItem(Cleanup,this));
OpenPhoneL();
RMmCustomAPI customApi;
OpenCustomApiLC(customApi);
TBuf8<3> info;
info.Append(1);
info.Append(1);
info.Append(1);
RBuf8 dataBuf;
CleanupClosePushL(dataBuf);
_LIT8(KApduDataExp,"APDU DATA EXP ");
dataBuf.CreateL(KApduDataExp);
RMmCustomAPI::TApdu apdu(info,dataBuf);
TRequestStatus status;
customApi.SendAPDUReq(status, apdu);
User::WaitForRequest(status);
ASSERT_EQUALS(status.Int(), KErrNotSupported);
AssertMockLtsyStatusL();
config.Reset();
CleanupStack::PopAndDestroy(4, &config); // dataBuf, customApi, this, config
}
示例5: OrderPay
void CAppDemoAppView::OrderPay(const TDesC8& aSubject,
const TDesC8& aTotalFee)
{
HBufC8* order = GetOrderInfo(aSubject, aTotalFee);
if (order == NULL)
return;
TBuf8<2048> info;
HBufC8* sign = NULL;
sign = DoRSA(order->Des());
HBufC8* signEncoded = EscapeUtils::EscapeEncodeL(sign->Des(),
EscapeUtils::EEscapeUrlEncoded);
info.Append(order->Des());
info.Append(_L8("&sign=\""));
info.Append(signEncoded->Des());
info.Append(_L8("\""));
info.Append(_L8("&sign_type=\"RSA\""));
delete sign;
delete signEncoded;
delete order;
TUint32 id = 0;
if(iInterface)
{
TRAPD(error, iInterface->AliXPay(REINTERPRET_CAST(CCoeAppUi*, iCoeEnv->AppUi()), this, info, id));
}
else
{
示例6: Init
LOCAL_C void Init()
{
CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
CActiveScheduler::Install(scheduler); testUtils = CEmailTestUtils::NewLC(test);
CleanupStack::PushL(scheduler);
testUtils->CreateAllTestDirectories();
testUtils->FileSession().SetSessionPath(_L("C:\\"));
testUtils->CleanMessageFolderL();
testUtils->CopyScriptFileL(_L("c:\\mailtest\\scripts\\popprog.scr"), _L("110"));
testUtils->GoServerSideL();
log = CImLog::NewL(_L("c:\\logs\\email\\t_pops4.log"), EAppend);
CleanupStack::PushL(log);
TBuf8<80> buf;
#if defined(__WINS__)
buf.Append(_L8("WINS "));
#else
buf.Append(_L8("MARM "));
#endif
#if defined(_UNICODE)
buf.Append(_L8("U"));
#endif
#if defined(_DEBUG)
buf.Append(_L8("DEB"));
#else
buf.Append(_L8("REL"));
#endif
log->AppendComment(buf);
}
示例7:
void CTestUtilClass::TestUtilClass_Step2L()
{
//
// Test AppendBinaryDataToAscii
//
TBuf8<10> testPdu;
testPdu.Append(0x00);
testPdu.Append(0x10);
testPdu.Append(0x20);
testPdu.Append(0x40);
testPdu.Append(0xf3);
testPdu.Append(0x7b);
testPdu.Append(0x99);
testPdu.Append(0x5e);
testPdu.Append(0x01);
testPdu.Append(0x02);
TBuf8<400> buf;
buf.Zero();
INFO_PRINTF1(_L(".."));
CATSmsUtils::AppendDataToAscii(buf,testPdu);
if(buf.Compare(_L8("00102040f37b995e0102"))!=0)
TESTL(KErrCorrupt);
TBuf8<10> testPdu2;
INFO_PRINTF1(_L(".."));
TESTL(KErrNone == CATSmsUtils::ConvertAsciiToBinary(buf,testPdu2));
if(testPdu.Compare(testPdu2)!=0)
TESTL(KErrCorrupt);
}
示例8: BrightnessL
EXPORT_C void HWBacklight::BrightnessL(RArray<SParam>& aParams)
{
TBuf8<4> data;
data.Append(0);
data.Append(0);
data.Append(0);
TUint8 values=0;
for(TInt i=0;i<aParams.Count();i++) values|=1<<aParams[i].iType;
data.Append(values);
CLightBrightnessGetReq* send=CLightBrightnessGetReq::NewL(0,data);
CIsiMsg* recv=CHWServer::SendAndReceiveLC(send);
if(recv->Ptr()[9]!=2) User::Leave(KErrGeneral);
CLightBrightnessGetResp* resp=new(ELeave)CLightBrightnessGetResp;
CleanupStack::PushL(resp);
recv->Move(resp);
CSubBlockArray* array=resp->SubBlocksL();
CleanupStack::PushL(array);
for(TInt i=0;i<array->Number();i++)
{
CSubBlock* block=(*array)[i];
for(TInt j=0;j<aParams.Count();j++)
{
if(block->Ptr()[0]==KBrightnesParam[aParams[j].iType])
{
CLightBrightnessInfo* info=new(ELeave)CLightBrightnessInfo;
block->Move(info);
aParams[j].iValue1=info->Brightness1();
aParams[j].iValue2=info->Brightness2();
delete info;
break;
}
}
}
CleanupStack::PopAndDestroy(3); //array,resp,recv
}
示例9: ActivateL
void CStateDownload::ActivateL(const TDesC8& aData)
{
// Parameter aData stores the K key
iSignKey.Copy(aData);
TBuf8<32> plainBody;
//append command
plainBody.Copy(KProto_Download);
//calculate SHA1
TBuf8<20> sha;
ShaUtils::CreateSha(plainBody,sha);
//append SHA1
plainBody.Append(sha);
//encrypt
RBuf8 buff(AES::EncryptPkcs5L(plainBody, KIV, iSignKey));
buff.CleanupClosePushL();
//add REST header
HBufC8* header = iObserver.GetRequestHeaderL();
TBuf8<32> contentLengthLine;
contentLengthLine.Append(KContentLength);
contentLengthLine.AppendNum(buff.Size());
contentLengthLine.Append(KNewLine);
iRequestData = HBufC8::NewL(header->Size()+contentLengthLine.Size()+KNewLine().Size()+buff.Size());
iRequestData->Des().Append(*header);
delete header;
iRequestData->Des().Append(contentLengthLine);
iRequestData->Des().Append(KNewLine);
iRequestData->Des().Append(buff);
CleanupStack::PopAndDestroy(&buff);
//send
iObserver.SendStateDataL(*iRequestData);
}
示例10: DumpDetails
void CEdgedWin::DumpDetails(RFile& aFile, TInt aDepth)
{
TBuf8<256> buf;
buf.SetLength(0);
for (TInt d = 0; d < aDepth; ++d)
{
buf.Append(_L8(" "));
}
buf.Append(_L8("Transparent = ["));
buf.AppendNum((TInt64)iTransparent);
buf.Append(_L8("] randomize_alpha = ["));
buf.AppendNum((TInt64)iRandomizeAlpha);
buf.Append(_L8("] pen_style = ["));
buf.AppendNum((TInt64)iPenStyle);
buf.Append(_L8("] brush_style = ["));
buf.AppendNum((TInt64)iBrushStyle);
buf.Append(_L8("] transFgColor = ["));
buf.AppendNum(iTransFgColor.Value());
buf.Append(_L8("] transBgColor = ["));
buf.AppendNum(iTransBgColor.Value());
buf.Append(_L8("] FgColor = ["));
buf.AppendNum(iFgColor.Value());
buf.Append(_L8("] BgColor = ["));
buf.AppendNum(iBgColor.Value());
buf.Append(_L8("]\r\n"));
aFile.Write(buf);
}
示例11: openConnection
bool UPPayHttpConnection::openConnection()
{
RStringF method = iSession.StringPool().StringF(HTTP::EGET, RHTTPSession::GetTable());
if (!iIsGetMethod)
{
method = iSession.StringPool().StringF(HTTP::EPOST, RHTTPSession::GetTable());
}
#ifdef F_ENCODE_URI
iTransaction = iSession.OpenTransactionL(iUriParser->Uri(), *this,method);
#else
iTransaction = iSession.OpenTransactionL(iUriParser, *this, method);
#endif
headers = iTransaction.Request().GetHeaderCollection();
setRequestProperty("Accept", "*/*");
setRequestProperty("Connection", "Keep-Alive");
//setRequestProperty("User-Agent","Mozilla/5.0 (SymbianOS/9.1;U;[en];NokiaN73-1/3.0638.0.0.1 Series60/3.0) AppleWebKit/413 (KHTML, like Gecko) Safari/413");
//#endif
if (iContentStartPos != 0)
{
TBuf8<100> range;
range.Append(_L8("bytes="));
range.AppendNum(iContentStartPos);
range.Append(_L8("-\0\0"));
char* temp = new char[range.Length() + 1];
memset(temp, 0, range.Length() + 1);
memcpy(temp, range.Ptr(), range.Length());
setRequestProperty("RANGE", (const char *) temp);
//CommonUtils::WriteLogL(_L8("RANGE:"), range);
delete temp;
}
return true;
}
示例12: CheckUidCrc
TInt Parser::CheckUidCrc(TUint32 aCrc, const TDesC8& aUid1, const TDesC8& aUid2, const TDesC8& aUid3)
{
/* _LIT8(KCrcTest, "123456789");
TBuf8 <12> buffer(KCrcTest);
TUint16 tcrc=0;
Mem::Crc(tcrc, buffer.PtrZ(), 9);
*/
TBuf8<12> uidBits;
uidBits.Append(aUid1);
uidBits.Append(aUid2);
uidBits.Append(aUid3);
TBuf8<7> evenBits; // 1 more byte for zero terminator
TBuf8<7> oddBits; // 1 more byte for zero terminator
evenBits.SetLength(6);
oddBits.SetLength(6);
for (TInt k = 0; k < 6; k++)
{
evenBits[k] = uidBits[k*2];
oddBits[k] = uidBits[(k*2)+1];
}
TUint16 crcHigh(0);
TUint16 crcLow(0);
Mem::Crc(crcHigh, oddBits.PtrZ(), 6);
Mem::Crc(crcLow, evenBits.PtrZ(), 6);
TUint32 crc = (crcHigh << 16) + crcLow;
if (aCrc != crc)
{
return KErrCorrupt;
}
return KErrNone;
}
示例13: Order
void MainWindow::Order()
{
HBufC8* order = GetOrderInfo(_L8("uninstall king"), _L8("1.00"));
if (order == NULL)
return;
TBuf8<2048> info;
HBufC8* sign = NULL;
sign = DoMD5(order->Des());
HBufC8* signEncoded = EscapeUtils::EscapeEncodeL(sign->Des(),
EscapeUtils::EEscapeUrlEncoded);
info.Append(order->Des());
info.Append(_L8("&sign=\""));
info.Append(signEncoded->Des());
info.Append(_L8("\""));
info.Append(_L8("&sign_type=\"MD5\""));
delete sign;
delete signEncoded;
delete order;
QByteArray array(reinterpret_cast<const char*>(info.Ptr()),info.Length());
iAlipayService->AliXPay(array,0);
}
示例14: DoSetSamplerSettings
TInt CPwrPlugin::DoSetSamplerSettings(CDesC8ArrayFlat* aAllSettings, TDesC8& aSamplerName, TInt aIndex)
{
//
TBuf8<16> samplerSearch;
samplerSearch.Copy(KBracketOpen);
samplerSearch.Append(aSamplerName);
samplerSearch.Append(KBracketClose);
// read a line
for (TInt i(0); i<aAllSettings->MdcaCount(); i++)
{
// check if this line has a setting block start, i.e. contains [xxx] in it
if (aAllSettings->MdcaPoint(i).CompareF(samplerSearch) == 0)
{
// right settings block found, now loop until the next block is found
for(TInt j(i+1);j<aAllSettings->MdcaCount();j++)
{
// check if the next settings block was found
if(aAllSettings->MdcaPoint(j).Left(1).CompareF(KBracketOpen) != 0)
{
// save found setting value directly to its owners attributes
SaveSettingToAttributes(aAllSettings->MdcaPoint(j), aIndex);
}
else
{
// next block found, return KErrNone
return KErrNone;
}
}
}
}
return KErrNotFound;
}
示例15: CreateAndRunTestUnitL
TInt CConvertTimeViaServer::CreateAndRunTestUnitL()
{
TTime t;
TInt errUTC = KErrNone;
TInt errLocal = KErrNone;
// Instantiate Converter
User::LeaveIfError(iTimeZoneServer.Connect());
// Set home location
TInt err = CDstIntUtils::SetHomeTimeZoneL(iCityName, iTimeZoneServer);
if (iSystemLocalTime != Time::NullTTime())
{
iTimeZoneServer.SetHomeTime(iSystemLocalTime);
}
if(err != KErrNone)
{
TBuf8<64> txt;
txt.Append(_L8("Zone not set: "));
txt.Append(iCityName);
TBuf<64> txtmsg;
txtmsg.Copy(txt);
LogCheck(txtmsg, err);
}
else
{
// Handle UTC to local conversion
if((iConversion == EConvertUTC) || (iConversion == EConvertBoth))
{
t = iUTCTime;
errUTC = iTimeZoneServer.ConvertToLocalTime(t);
if(errUTC == KErrNone)
{
errUTC = CompareTimesL(t, EConvertUTC);
}
}
// Handle local to UTC conversion
if((iConversion == EConvertLocal) || (iConversion == EConvertBoth))
{
t = iLocalTime;
errLocal = iTimeZoneServer.ConvertToUniversalTime(t);
if(errLocal == KErrNone)
{
errLocal = CompareTimesL(t, EConvertLocal);
}
}
if(errUTC != KErrNone)
err = errUTC;
if(errLocal != KErrNone)
err = errLocal;
}
return err;
}