本文整理汇总了C++中TPtrC8::Alloc方法的典型用法代码示例。如果您正苦于以下问题:C++ TPtrC8::Alloc方法的具体用法?C++ TPtrC8::Alloc怎么用?C++ TPtrC8::Alloc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPtrC8
的用法示例。
在下文中一共展示了TPtrC8::Alloc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MHFRunL
void UPPayHttpConnection::MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent)
{
switch (aEvent.iStatus)
{
case THTTPEvent::ERedirectedPermanently:
case THTTPEvent::ERedirectedTemporarily:
break;
case THTTPEvent::EGotResponseHeaders:
{
RHTTPResponse resp = aTransaction.Response();
ParaseResponseHeaders(resp);
iEngineStatus = EGetHeader;
if (iObserver)
{
iObserver->StateChange(EGetHeader);
}
AddTimer();
//iObserver.ProgressNotify(iContentLength,0);
}
break;
case THTTPEvent::EGotResponseBodyData:
{
MHTTPDataSupplier* dataSupplier = aTransaction.Response().Body();
TPtrC8 ptr;
TBool isLast = dataSupplier->GetNextDataPart(ptr);
if (iContentLength > 0)
{
if (!iResponseBuffer)
{
iResponseBuffer = HBufC8::NewL(iContentLength);
}
iResponseBuffer->Des().Append(ptr);
}
else
{
if (!iResponseBuffer)
{
iResponseBuffer = ptr.Alloc();
}
else
{
iResponseBuffer = iResponseBuffer->ReAllocL(iResponseBuffer->Length() + ptr.Length());
iResponseBuffer->Des().Append(ptr);
}
}
dataSupplier->ReleaseData();
if (iResponseBuffer && iObserver)
{
iObserver->ProgressNotify(iContentLength, iResponseBuffer->Length());
}
if (isLast)
{
iEngineStatus = EHttpFinished;
Stop();
if (iObserver)
{
iObserver->ResponseReceivedL(iResponseBuffer);
}
if (iObserver)
{
iObserver->StateChange(EHttpFinished);
}
}
else
{
iEngineStatus = EGetBody;
AddTimer();
}
}
break;
case THTTPEvent::EResponseComplete:
{
iEngineStatus = EHttpFinished;
if (iResponseBuffer && iObserver)
{
iObserver->ProgressNotify(iContentLength, iResponseBuffer->Length());
}
if (iObserver)
{
iObserver->StateChange(EHttpFinished);
}
Stop();
}
break;
case THTTPEvent::ESucceeded:
{
iEngineStatus = EHttpFinished;
if (iResponseBuffer && iObserver)
{
iObserver->ProgressNotify(iContentLength, iResponseBuffer->Length());
//.........这里部分代码省略.........