本文整理汇总了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");
}
示例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);
}
示例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;
}