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


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

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


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

示例1: ChildURIListL

void  CNSmlDmDevDetailAdapter::ChildURIListL( const TDesC8& aURI, 
                                              const TDesC8& /*aLUID*/, 
                                              const CArrayFix<TSmlDmMappingInfo>& /*aPreviousURISegmentList*/, 
                                              const TInt aResultsRef, 
                                              const TInt aStatusRef )
    {
    _DBG_FILE("CNSmlDmDevDetailAdapter::ChildURIListL(): begin");
    CSmlDmAdapter::TError retValue = CSmlDmAdapter::EOk;
    CBufBase *currentURISegmentList = CBufFlat::NewL(64);
    CleanupStack::PushL(currentURISegmentList);

    TInt ret = aURI.LocateReverse(KNSmlDMDevDetailSeparator()[0]);
    if ( ret == KErrNotFound ) 
        {
        ret = -1;
        }
    TInt len = aURI.Length() - ( ret + 1 );
    TPtrC8 segment = aURI.Right( len );

    if ( segment == KNSmlDMDevDetailNodeName )
        {
        currentURISegmentList->InsertL( currentURISegmentList->Size(), KNSmlDMDevDetailDevTypNodeName() );
        currentURISegmentList->InsertL( currentURISegmentList->Size(), KNSmlDMDevDetailSeparator() );
        currentURISegmentList->InsertL( currentURISegmentList->Size(), KNSmlDMDevDetailOEMNodeName() );
        currentURISegmentList->InsertL( currentURISegmentList->Size(), KNSmlDMDevDetailSeparator() );
        currentURISegmentList->InsertL( currentURISegmentList->Size(), KNSmlDMDevDetailFwVNodeName() );
        currentURISegmentList->InsertL( currentURISegmentList->Size(), KNSmlDMDevDetailSeparator() );
        currentURISegmentList->InsertL( currentURISegmentList->Size(), KNSmlDMDevDetailSwVNodeName() );
        currentURISegmentList->InsertL( currentURISegmentList->Size(), KNSmlDMDevDetailSeparator() );
         currentURISegmentList->InsertL( currentURISegmentList->Size(), KNSmlDMDevDetailHwVNodeName() );
        currentURISegmentList->InsertL( currentURISegmentList->Size(), KNSmlDMDevDetailSeparator() );
        currentURISegmentList->InsertL( currentURISegmentList->Size(), KNSmlDMDevDetailLrgObjNodeName() );
        currentURISegmentList->InsertL( currentURISegmentList->Size(), KNSmlDMDevDetailSeparator() );
         currentURISegmentList->InsertL( currentURISegmentList->Size(), KNSmlDMDevDetailURINodeName() );
        }
    else
    if ( segment == KNSmlDMDevDetailURINodeName )
        {
        currentURISegmentList->InsertL( currentURISegmentList->Size(), KNSmlDMDevDetailMaxDepthNodeName() );
        currentURISegmentList->InsertL( currentURISegmentList->Size(), KNSmlDMDevDetailSeparator() );
        currentURISegmentList->InsertL( currentURISegmentList->Size(), KNSmlDMDevDetailMaxTotLenNodeName() );
        currentURISegmentList->InsertL( currentURISegmentList->Size(), KNSmlDMDevDetailSeparator() );
        currentURISegmentList->InsertL( currentURISegmentList->Size(), KNSmlDMDevDetailMaxSegLenNodeName() );
        }
    else
        {
        retValue = CSmlDmAdapter::EError;
        }

    iDmCallback->SetStatusL(aStatusRef,retValue);
    iDmCallback->SetResultsL(aResultsRef,*currentURISegmentList,KNullDesC8);
    CleanupStack::PopAndDestroy(); //currentURISegmentList;
    _DBG_FILE("CNSmlDmDevDetailAdapter::ChildURIListL(): end");
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:54,代码来源:nsmldmdevdetailadapter.cpp

示例2: ptr

void CDebugLogPrint::WriteToLog8L(const TDesC8 &aDes, const TDesC8 &aDes2)
	{
	TBuf16<256> buf;
	TInt pos=aDes.LocateReverse(' ');
	if (pos<0)
		pos=0;
	buf.Copy(aDes.Mid(pos));
	buf.Append(' ');
	TInt bufLen=buf.Length();
	TPtr16 ptr(&buf[bufLen],buf.MaxLength()-bufLen);
	ptr.Copy(aDes2);
	buf.SetLength(bufLen+aDes2.Length());
	_LIT(KDebugFormatString, "%S");
	RDebug::Print(KDebugFormatString, &buf);	
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:15,代码来源:DebLogRD.CPP

示例3: FetchLeafObjectL

// -----------------------------------------------------------------------------
// CNSmlDmDevDetailAdapter::FetchLeafObjectL()
// -----------------------------------------------------------------------------
CSmlDmAdapter::TError CNSmlDmDevDetailAdapter::FetchLeafObjectL( const TDesC8& aURI, 
                                                                 CBufBase& aObject )
    {
    _DBG_FILE("CNSmlDmDevDetailAdapter::FetchLeafObjectL(): begin");
    CSmlDmAdapter::TError retValue = CSmlDmAdapter::EOk;

    TInt ret = aURI.LocateReverse(KNSmlDMDevDetailSeparator()[0]);
    if ( ret == KErrNotFound ) 
        {
        ret = -1;
        }
    TInt len = aURI.Length() - ( ret + 1 );
    TPtrC8 segment = aURI.Right( len );
    if ( segment == KNSmlDMDevDetailDevTypNodeName )
        {
        aObject.InsertL( 0, KNSmlDMDevDetailDevTypValue );
        }
    else
    if ( segment == KNSmlDMDevDetailOEMNodeName )
        {
        CNSmlPhoneInfo* phoneInfo = CNSmlPhoneInfo::NewLC();
        HBufC* manufacturer = HBufC::NewLC( 50 );
        TPtr manufacturerPtr = manufacturer->Des();  
        phoneInfo->PhoneDataL( CNSmlPhoneInfo::EPhoneManufacturer, manufacturerPtr );
        HBufC8* manufacturerInUTF8 = NULL;
        NSmlUnicodeConverter::HBufC8InUTF8LC( *manufacturer, manufacturerInUTF8 );
        aObject.InsertL( 0, *manufacturerInUTF8 );
        CleanupStack::PopAndDestroy( 3 ); //manufacturerInUTF8, manufacturer, phoneInfo
        }
    else
    if ( segment == KNSmlDMDevDetailSwVNodeName )
        {
        // fetch software version
        GetDevDetailDataL( aObject, ESwVersion );
        }
    else
    if ( segment == KNSmlDMDevDetailHwVNodeName )
        {
        // fetch hardware version
        GetDevDetailDataL( aObject, EHwVersion );
        }
    else
    if ( segment == KNSmlDMDevDetailLrgObjNodeName )
        {
        aObject.InsertL( 0, KNSmlDMDevDetailLrgObjValue );
        }
    else
    if ( segment == KNSmlDMDevDetailMaxDepthNodeName )
        {
        aObject.InsertL( 0, KNSmlDMDevDetailMaxDepthValue );
        }
    else
    if ( segment == KNSmlDMDevDetailMaxTotLenNodeName )
        {
        aObject.InsertL( 0, KNSmlDMDevDetailMaxTotLenValue );
        }
    else
    if ( segment == KNSmlDMDevDetailMaxSegLenNodeName )
        {
        aObject.InsertL( 0, KNSmlDMDevDetailMaxSegLenValue );
        }
    else
    if ( segment != KNSmlDMDevDetailFwVNodeName )
        {
        retValue = CSmlDmAdapter::EError;
        }
        
    _DBG_FILE("CNSmlDmDevDetailAdapter::FetchLeafObjectL(): end");
    return retValue;
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:73,代码来源:nsmldmdevdetailadapter.cpp


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