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


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

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


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

示例1: RemoveSIPSchemaL

// ----------------------------------------------------------------------------
// CSIPProfileSIMRecord::FindSIPSchema
// ----------------------------------------------------------------------------
//
TPtrC8 CSIPProfileSIMRecord::RemoveSIPSchemaL( const TDesC8& aValue )
    {
    __ASSERT_ALWAYS (aValue.Length() > 0, User::Leave(KErrArgument));

	_LIT8(KSIPAndColon, "sip:");
	_LIT8(KSIPSAndColon, "sips:");

	TPtrC8 schemeAndColon;
	TInt sipSchemePos = aValue.FindF(KSIPAndColon);
	if (sipSchemePos < 0)
		{
		TInt sipsSchemePos = aValue.FindF(KSIPSAndColon);
		if (sipsSchemePos != 0) 
            {
            User::Leave (KErrArgument);
            }
		schemeAndColon.Set(KSIPSAndColon);
		}
	else
		{
		if (sipSchemePos != 0) 
            {
            User::Leave (KErrArgument);
            }
		schemeAndColon.Set(KSIPAndColon);
		}
	TPtrC8 remainder(aValue.Mid(schemeAndColon.Length()));
	return remainder;
    }    
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:33,代码来源:Sipimsprofilesimrecord.cpp

示例2: RecognizeRoapTrigger

TBool CApaDRMRecognizer::RecognizeRoapTrigger( const TDesC8& aBuffer )
{
        if ( aBuffer.FindF( KRoapTriggerElement() ) != KErrNotFound
             || aBuffer.FindF( KRoapTriggerElement2() ) != KErrNotFound )
        {
            iConfidence = ECertain;
            iDataType=TDataType( KRoapTriggerType() );
            return ETrue;
        }
    return EFalse;
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:11,代码来源:RecDRM.cpp

示例3: ConvertTextToUidL

void TaggedDataParser::ConvertTextToUidL(const TDesC8& aData, TUid& aUid)
	{
	// Make sure aData is in the correct format - "0x12345678"
	_LIT8(K0x, "0x");
	_LIT8(K0X, "0X");
	if ((aData.Length() == 10) && ((aData.FindF(K0x) == 0) || (aData.FindF(K0X) == 0)))
		{
		// only take the right 8 characters (ie discard the "0x")
		TLex8 lex(aData.Right(8));
		TUint32 value = 0;
		User::LeaveIfError(lex.Val(value, EHex));
		aUid.iUid = value;
		}
	else
		User::Leave(KErrCorrupt);
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:16,代码来源:mmfcontrollerpluginresolver.cpp

示例4: ConvertTextToTUintL

void TaggedDataParser::ConvertTextToTUintL(const TDesC8& aData, TUint& aUint)
	{
	// Determine whether hex or decimal then parse as such
	_LIT8(K0x, "0x");
	_LIT8(K0X, "0X");
	if (((aData.FindF(K0x) == 0) || (aData.FindF(K0X) == 0)) && (aData.Length() >= 3))
		{
		// only take the characters after "0x"
		TLex8 lex(aData.Right(aData.Length()-2));
		TUint32 value = 0;
		User::LeaveIfError(lex.Val(value, EHex));
		aUint = value;
		}
	else if (aData.Length() > 0)
		{
		TLex8 lex(aData.Right(aData.Length()));
		TUint32 value = 0;
		User::LeaveIfError(lex.Val(value, EDecimal));
		aUint = value;
		}
	else
		User::Leave(KErrCorrupt);
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:23,代码来源:mmfcontrollerpluginresolver.cpp

示例5: DoRecognizeL

/*
Attempts to recognize the data type, given the filename and data buffer.
*/
void CExampleNewRecognizer::DoRecognizeL(const TDesC& aName, const TDesC8& aBuffer)
	{
	_LIT8(KExampleData, "example");
	_LIT(KDotExample, ".Example");

	TParse parse;
	parse.Set(aName,NULL,NULL);
	TPtrC ext=parse.Ext(); // extract the extension from the filename

	if (ext.CompareF(KDotExample)==0 && aBuffer.FindF(KExampleData)!=KErrNotFound)
		{
		iConfidence=ECertain;
		iDataType=TDataType(KExampleTextMimeType);
		}
    }
开发者ID:RomanSaveljev,项目名称:raptor,代码行数:18,代码来源:plugin3.cpp

示例6: SendDataPost

/**
 *  @brief SOCKET连接建立后,发送POST请求
 *
 * SOCKET连接建立后,发送POST请求
 *
 *  @param iSockId        socket请求的id值
 *  @param sContentType   发送请求的类型
 *  @param sBuf   发送POST请求附带的请求信息
 *  @return void 
 */
void CSocketEngine::SendDataPost(TInt iSockId,const TDesC8& aContentType,const TDesC8& sBuf){
  
  iSockId=0;
  iStatus=1;
  iData1.Zero();
  
  //开始打包HTTP请求头信息

  iData1.Copy(_L8("POST "));
  iData1.Append(iAddress);
  iData1.Append(_L8(" HTTP/1.1"));
  
  if(iIsRangeDown) iData1.AppendFormat(_L8("\r\nRange: bytes=%d-%d"),iRangeBegin,iRangeEnd);
  iData1.Append(_L8("\r\n"));
  
  //如果是走网关,则通过移动网关10.0.0.172连接网络
  if(IsPassWGW){
    iData1.Append(_L8("Host:10.0.0.172:80\r\n"));
    iData1.Append(_L8("X-Online-Host:"));
    iData1.Append(iHostName);
    iData1.Append(_L8("\r\n"));
    
  }else{
    iData1.Append(_L8("Host: "));
    iData1.Append(iHostName);
    iData1.Append(_L8("\r\n"));
  }

  if(aContentType.FindF(_L8("post900"))>=0){
    iData1.Append(_L8("Accept: */*, application/vnd.wap.mms-message, application/vnd.wap.sic"));
    iData1.Append(_L8("Accept-Charset: iso-8859-1, utf-8; q=0.7, *; q=0.7"));
  }else{
    iData1.Append(_L8("Accept: text/html, application/vnd.wap.xhtml+xml, application/xhtml+xml, text/css, multipart/mixed, text/vnd.wap.wml, application/vnd.wap.wmlc, application/vnd.wap.wmlscriptc, application/java-archive, application/java, application/x-java-archive, text/vnd.sun.j2me.app-descriptor, application/vnd.oma.drm.message, application/vnd.oma.drm.content, application/vnd.wap.mms-message, application/vnd.wap.sic, text/x-co-desc, application/vnd.oma.dd+xml, text/javascript, */*, text/x-vcard, text/x-vcalendar, image/gif, image/vnd.wap.wbmp\r\n"));
    iData1.Append(_L8("Accept-Charset: iso-8859-1, utf-8, iso-10646-ucs-2; q=0.6\r\n"));
  }

  //不需要设定encoding,090417 yang
  //iData1.Append(_L8("Accept-Encoding: gzip,deflate,identity;q=0.9\r\n"));
  iData1.Append(_L8("Accept-Language: zh-cn, zh\r\n"));
  
  if(iUserAgent.Length()){
    iData1.Append(_L8("User-Agent: "));
    iData1.Append(iUserAgent);
    iData1.Append(_L8("\r\n"));
  }

  if(iCookie&&iCookie->Length()){
    //iData1.Append(_L8("Cookie: "));
    iData1.Append(*iCookie);
    //iData1.Append(_L8("\r\n"));
  }

  if(iReferer&&iReferer->Length()){
    iData1.Append(_L8("Referer: "));
    iData1.Append(*iReferer);
    iData1.Append(_L8("\r\n"));
  }

  iData1.Append(_L8("Content-Length: "));
  TInt len=sBuf.Size();
  iData1.AppendNum(len);
  iData1.Append(_L8("\r\n"));
  
  if(aContentType.FindF(_L8("post900"))>=0){
    iData1.Append(_L8("Content-Type: text/plain"));
    iData1.Append(_L8("x-wap-profile: http://nds1.nds.nokia.com/uaprof/N3250r100.xml"));
  }else{
    iData1.Append(_L8("Content-Type: application/x-www-form-urlencoded\r\n"));
  }

  iData1.Append(_L8("Connection: close\r\n"));
  iData1.Append(_L8("\r\n"));
  Log(_L8("Http(post) header:"));
  Log(iData1);
  HBufC8* buf=HBufC8::NewL(iData1.Length()+sBuf.Length()+128);
  buf->Des().Copy(iData1);
  buf->Des().Append(sBuf);
  iSocket.Write(*buf,iStatus);
  delete buf;
  SetStatus(EWritting);
  SetActive();
}
开发者ID:rusteer,项目名称:symbian,代码行数:92,代码来源:SocketEngine.cpp


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