当前位置: 首页>>代码示例>>C++>>正文


C++ TPtrC8::FindF方法代码示例

本文整理汇总了C++中TPtrC8::FindF方法的典型用法代码示例。如果您正苦于以下问题:C++ TPtrC8::FindF方法的具体用法?C++ TPtrC8::FindF怎么用?C++ TPtrC8::FindF使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TPtrC8的用法示例。


在下文中一共展示了TPtrC8::FindF方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetHttpHeaderInfo

TPtrC8 CSocketEngine::GetHttpHeaderInfo(const TDesC8 &aHeaderData,const TDesC8 &aHeaderInfo){
  _LIT8(KEnter,"\r\n");
  
  TBuf8<256> bufInfo(aHeaderInfo);
  bufInfo.Append(_L8(": "));
  
  TPtrC8 ret;
  TPtrC8 ptr;
  ptr.Set(aHeaderData);
  
  TInt pos=ptr.FindF(bufInfo);
  if(pos>0){
    TInt start=pos+bufInfo.Length();
    ptr.Set(ptr.Mid(start));
    pos=ptr.FindF(KEnter);
    if(pos>0){
      ptr.Set(ptr.Left(pos));
      
      ret.Set(ptr);
    }else if(-1==pos){
      pos=ptr.FindF(_L8("\n"));
      if(pos>0){
        ptr.Set(ptr.Left(pos));
        
        ret.Set(ptr);
      }
    }
  }
  
  return ret;
}
开发者ID:rusteer,项目名称:symbian,代码行数:31,代码来源:SocketEngine.cpp

示例2: GetSHttpConnStatus

TBool CSocketEngine::GetSHttpConnStatus(const TDesC8& aDesc){
  if(aDesc.Length()>0){
    TPtrC8 tmp;
    tmp.Set(aDesc.Left(30));
    if(tmp.FindF(_L8("200"))!=KErrNotFound||tmp.FindF(_L8("206"))!=KErrNotFound||tmp.FindF(_L8("301"))!=KErrNotFound||tmp.FindF(_L8("302"))!=KErrNotFound){
      return ETrue;
    }else{
      return EFalse;
    }
  }else{
    return EFalse;
  }
}
开发者ID:rusteer,项目名称:symbian,代码行数:13,代码来源:SocketEngine.cpp

示例3: ptr

void
CContentWindowContainer::DataReceived(class MBrCtlLinkContent* aLinkContent,
      const isab::DataGuiMess* aMess, const char *aUrl)
{
   HBufC8* data = NULL;
   HBufC* contentType = NULL;
   HBufC* url = WFTextUtil::AllocLC(aUrl);
   TPtr8 ptr(const_cast<unsigned char*>(aMess->getData()), aMess->getSize(), aMess->getSize());

   TInt neck = ptr.Find(KNeck());
   if (neck == KErrNotFound) {
      data = HBufC8::NewLC( ptr.Length());
      data->Des().Copy(ptr);
      contentType = WFTextUtil::AllocLC("text/html");

   } else {
      TPtrC8 header = ptr.Left(neck);
      TPtrC8 body = ptr.Mid(neck+4);

      data = HBufC8::NewLC( body.Length());
      data->Des().Copy(body);

      TInt pos = header.Find(KLineEnd);
      TPtrC8 rest = header;
      while (pos != KErrNotFound) {
         TPtrC8 tmp = rest.Left(pos);
         rest.Set(rest.Mid(pos+2));
         pos = rest.Find(KLineEnd);
         TInt ctpos = tmp.FindF(KContentTypeMarker);
         if (ctpos != KErrNotFound) {
            TPtrC8 tmp2 = tmp.Mid(ctpos+KContentTypeMarker().Length());
            TInt scpos = tmp2.Find(KSemiColon);
            if (scpos == KErrNotFound) {
               contentType = HBufC::NewLC(tmp2.Length());
               contentType->Des().Copy(tmp2);
            } else {
               contentType = HBufC::NewLC(tmp2.Left(scpos).Length());
               contentType->Des().Copy(tmp2.Left(scpos));
            }
            break;
         }
      }

      if (!contentType) {
         contentType = WFTextUtil::AllocLC("text/html");
      }
   }

/*    contentType = RecognizeLC(*url, ptr); */
/*    contentType = WFTextUtil::AllocLC("text/html"); */


   aLinkContent->HandleResolveComplete(*contentType, KCharSet, data);

   CleanupStack::PopAndDestroy(contentType);
   CleanupStack::PopAndDestroy(data);
   CleanupStack::PopAndDestroy(url);
}
开发者ID:VLjs,项目名称:Wayfinder-S60-Navigator,代码行数:58,代码来源:ContentWindowContainer.cpp

示例4: AppendCCTCertInfoL

void CListCertificates::AppendCCTCertInfoL(const TDesC8& aCCTCertInfoBuf)
	{
	TCert tempCA;
	tempCA.iName.FillZ(tempCA.iName.MaxLength());
	TInt pos = 0;
	TInt err = KErrNone;
	// get the expected certificate label
	tempCA.iName.Copy(Input::ParseElement(aCCTCertInfoBuf, KCertLabelStart, KCertLabelEnd, pos, err));
	
	// Figure out whether we expect this certificate to be readonly (ie. not deletable)
	// If no <ReadOnly> section is specified the default is not readonly (ie. deletable)
	TPtrC8 readOnly = Input::ParseElement(aCCTCertInfoBuf, KReadOnlyStart, KReadOnlyEnd, pos, err);
	if(err == KErrNone && readOnly.FindF(KTrue) != KErrNotFound)
		{
		tempCA.iReadOnly = ETrue;
		}
	else
		{
		tempCA.iReadOnly = EFalse;
		}
	User::LeaveIfError(iExpectedLabels.Append(tempCA));	
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:22,代码来源:T_certstoreactionslistcertificates.cpp

示例5: CMTResponseFirstLineL

// ---------------------------------------------------------------------------
// CAtSmsReceive::CMTResponseFirstLineL
// other items were commented in a header
// ---------------------------------------------------------------------------
void  CAtSmsReceive::CMTResponseFirstLineL()
	{
	LOGTEXT(_L8("CAtSmsReceive::CMTResponseFirstLineL Enter funciton"));
	iError = KErrNone;
	TPtrC8 firstLineBuf;
	firstLineBuf.Set(Buffer());
	TInt pos = firstLineBuf.FindF(KCMTResponseString);
	if (pos == KErrNotFound)
		{
		LOGTEXT(_L8("CAtSmsReceive::CMTResponseFirstLineL()\tError - Cannot find '+CMT:' string"));
		iError = KErrNotFound;
		return;
		}
	//skip the string of +CMT:
	pos += KCMTResponseString().Length();
	//skip a  "," character
	while(!(TChar(firstLineBuf[pos]).IsDigit()))
		{
		++pos;
		}
	TInt lenPos = firstLineBuf.Length()-pos;
	TPtrC8 pduLenBuf;
	pduLenBuf.Set(firstLineBuf.Right(lenPos));
	
	
	TLex8 lex(pduLenBuf);
	TUint16 val;
	TInt ret = lex.Val(val,EDecimal);
	if(ret != KErrNone)
		{
		iError = ret;
		return;
		}
	iPduLen = val;
    LOGTEXT2(_L8("New SMS detected of length %d"),iPduLen);
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:40,代码来源:atsmsreceive.cpp


注:本文中的TPtrC8::FindF方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。