本文整理汇总了C++中TPtrC8::FindC方法的典型用法代码示例。如果您正苦于以下问题:C++ TPtrC8::FindC方法的具体用法?C++ TPtrC8::FindC怎么用?C++ TPtrC8::FindC使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPtrC8
的用法示例。
在下文中一共展示了TPtrC8::FindC方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StateChange
void CSyncHttpConnection::StateChange(THttpEngineState aState)
{
iEngineStatus = aState;
//CommonUtils::WriteLogL(_L("CSyncHttpConnection::StateChange iEngineStatus = "), iEngineStatus);
switch (aState)
{
case EHttpError:
case EHttpGetHeaderTimeOut:
case EHttpGetBodyTimeOut:
case EHttpFinished:
if (iWait->IsStarted())
{
iWait->AsyncStop();
}
break;
case EGetHeader:
break;
case ERedirect:
{
HBufC8* head = iConnection->GetResponeHeader();
TPtrC8 redirectUrl;
if (head)
{
_LIT8(GOHREF, "Location:");
TInt redirectUrlIndex = head->FindC(GOHREF);
if (redirectUrlIndex >= 0)
{
redirectUrl.Set(head->Right(head->Length() - redirectUrlIndex - GOHREF().Length()));
_LIT8(SPACE, " ");
redirectUrlIndex = redirectUrl.FindC(SPACE);
while (redirectUrlIndex == 0)
{
redirectUrl.Set(redirectUrl.Right(redirectUrl.Length() - redirectUrlIndex - SPACE().Length()));
redirectUrlIndex = redirectUrl.FindC(SPACE);
}
redirectUrlIndex = redirectUrl.FindC(_L8("\r\n"));
if (redirectUrlIndex >= 0)
{
redirectUrl.Set(redirectUrl.Left(redirectUrlIndex));
}
}
}
if (redirectUrl.Length() > 0)
{
TBuf<200> aUri;
aUri.Copy(redirectUrl);
//CommonUtils::WriteLogL(_L("CSyncHttpConnection::StateChange redirectUrl = "), aUri);
iConnection->ResetVarible();
iConnection->Stop();
iConnection->GetRequestL(aUri, 0);
iConnection->sendRequest();
}
else
{
//CommonUtils::WriteLogL(_L("CSyncHttpConnection::StateChange ERedirect error"), _L(""));
iEngineStatus = EHttpError;
if (iWait->IsStarted())
{
iWait->AsyncStop();
}
}
}
break;
default:
if (iWait->IsStarted())
{
iWait->AsyncStop();
}
break;
}
}