本文整理汇总了C++中TDesC::MatchF方法的典型用法代码示例。如果您正苦于以下问题:C++ TDesC::MatchF方法的具体用法?C++ TDesC::MatchF怎么用?C++ TDesC::MatchF使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDesC
的用法示例。
在下文中一共展示了TDesC::MatchF方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetCompensationType
// -----------------------------------------------------------------------------
// CSensorDataCompensatorItem::GetCompensationType
// -----------------------------------------------------------------------------
//
TInt CSensorDataCompensatorItem::GetCompensationType( const TDesC& aType )
{
FUNC_LOG;
TInt ret( EUnknownCompensationItem );
if ( aType.MatchF(KUiOrientationTypeText) != KErrNotFound )
{
ret = EUICompensationItem;
}
else if ( aType.MatchF(KDeviceOrientationTypeText) != KErrNotFound )
{
ret = EDeviceCompensationItem;
}
return ret;
}
示例2: ParsePackageUid
TInt CSwisExpressionEnvironment::ParsePackageUid(const TDesC& aUidString, TUid& aUid)
{
// Check that the UID string matches the format
_LIT(KVersionUidFormat,"0x????????");
if(aUidString.MatchF(KVersionUidFormat) != 0)
{
return KErrNotFound;
}
/**
* Convert the string into a TUint32 representation and check that
* the string is a valid hexadecimal value
*/
TLex lexUid(aUidString.Right(8));
TUint32 uidValue = 0;
if(lexUid.Val(uidValue,EHex) == KErrNone && lexUid.Eos())
{
aUid.iUid = uidValue;
return KErrNone;
}
// Return an error if the UID value is not parsed correctly
return KErrNotFound;
}
示例3: SetMessageType
TBIOMessageType TestUniDataModelVCalPlugin::SetMessageType(
const TDesC& aFileName)
{
if (aFileName.MatchF(KBIOvCalenderPrefix) == 0)
{
return EBiovCalenderMessage;
}
return ENoMessage;
}
示例4: StringToOptionL
TInt StringToOptionL(const TDesC& aString)
{
if (aString.MatchF(_L("yes")))
return CPolicy::EYes;
else if (aString.MatchF(_L("no")))
return CPolicy::ENo;
else if (aString.MatchF(_L("session")))
return CPolicy::ESessionYes;
else if (aString.MatchF(_L("sessionyes")))
return CPolicy::ESessionYes;
else if (aString.MatchF(_L("sessionno")))
return CPolicy::ESessionNo;
else if (aString.MatchF(_L("always")))
return CPolicy::EAlways;
else if (aString.MatchF(_L("never")))
return CPolicy::ENever;
User::Leave(KErrGeneral);
/*lint -unreachable*/
return 0;
}
示例5: getByUrlL
//---------------------------------------------------------------
// CNativeMmsUtility::getByUrlL
// @see header
//---------------------------------------------------------------
const QString CNativeMmsUtility::getByUrlL(const TDesC& url)
{
#ifdef _DEBUG_TRACES_
qDebug() << " Enter CNativeMmsUtility::getByUrlL";
#endif
CMsvAttachment* targetattachment = NULL;
TBool found = EFalse;
//newlc puts it on cleanupstack
HBufC8* url8bit = HBufC8::NewLC(url.Length());
CUri16* decodedUri = NULL;
TUriParser8 parser;
//get the uri in display format
if (url.MatchF(KContentIdString) == 0)
{
//Remove "cid:" from the beginning
url8bit->Des().Copy(url.Right(url.Length()
- KContentIdString().Length() + 1));
parser.Parse(*url8bit);
}
else
{
url8bit->Des().Copy(url);
parser.Parse(*url8bit);
}
decodedUri = UriUtils::ConvertToDisplayFormL(parser);
CleanupStack::PushL(decodedUri);
//run through the attachements to check for a match
TUint count = iattachmanager->AttachmentCount();
for (int i = 0; i < count && !found; i++)
{
CMsvAttachment *attachment = iattachmanager->GetAttachmentInfoL(i);
CleanupStack::PushL(attachment);
//restore mimeheaders from the attachment
CMsvMimeHeaders* mimeheaders = CMsvMimeHeaders::NewL();
CleanupStack::PushL(mimeheaders);
mimeheaders->RestoreL(*attachment);
//check for a match with content-loc and then content-id
if (resolvedByContentLocL(mimeheaders->ContentLocation(), *decodedUri)
|| resolvedByContentIdL(mimeheaders->ContentId(), *decodedUri))
{
targetattachment = CMsvAttachment::NewL(*attachment);
found = ETrue;
}
CleanupStack::PopAndDestroy(2, attachment); //mimeheaders, attachment
}
CleanupStack::PopAndDestroy(decodedUri);
if (url8bit)
CleanupStack::PopAndDestroy(url8bit);
if (targetattachment)
{
#ifdef _DEBUG_TRACES_
qDebug() << " Exit CNativeMmsUtility::getByUrlL";
#endif
return XQConversions::s60DescToQString(targetattachment->FilePath());
}
else
{
#ifdef _DEBUG_TRACES_
qDebug() << " Exit CNativeMmsUtility::getByUrlL";
#endif
return QString();
}
}