本文整理汇总了C++中TPtr::CompareF方法的典型用法代码示例。如果您正苦于以下问题:C++ TPtr::CompareF方法的具体用法?C++ TPtr::CompareF怎么用?C++ TPtr::CompareF使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPtr
的用法示例。
在下文中一共展示了TPtr::CompareF方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsMimeTypeSupportedL
// -----------------------------------------------------------------------------
// Implements checking if a given MIME type is supported or not
// -----------------------------------------------------------------------------
//
TBool CAknsWallpaperPlugin::IsMimeTypeSupportedL(const TDesC& aMimeTypeString)
{
// Check for a type separator in the string
TInt pos = aMimeTypeString.Find(KAknsWallpaperPluginSeparator);
// Leave if no separator was found.. the MIME
// standard requires it
if (pos == KErrNotFound)
{
User::Leave(KErrArgument);
}
// Copy the full Mime type string (needed for uppercase)
HBufC* fullBuf = aMimeTypeString.AllocLC();
TPtr fullString = fullBuf->Des();
fullString.UpperCase();
// Construct the compare string
TPtrC compareString(aMimeTypeString.Left(pos));
// Perform the comparison
TBool ret = EFalse;
// Mime type case: IMAGE/* except IMAGE/X-OTA-BITMAP
if (compareString.CompareF(KAknsWallpaperPluginMimeTypeImage) == 0 &&
!(fullString.CompareF(KAknsWallpaperPluginMimeTypeOTABitmap) == 0))
{
ret = ETrue;
}
CleanupStack::PopAndDestroy(fullBuf);
return ret;
}
示例2:
EXPORT_C TBool CX520AttributeTypeAndValue::ExactMatchL(const CX520AttributeTypeAndValue& aElement) const
{
TBool res = EFalse;
if (*(iType) != *(aElement.iType))
{
return res;
}
HBufC* lhs = this->ValueL();
CleanupStack::PushL(lhs);
HBufC* rhs = aElement.ValueL();
TPtr plhs = lhs->Des();
TPtr prhs = rhs->Des();
plhs.TrimAll();
prhs.TrimAll();
// DEF124902: Certificate name matching done in accordance to RFC3280
// RFC3280: Printable String and Email address(of value type 'IA5String') will
// be compared case-insensitively.
if (IsCaseInSensitiveL(iValue->Des()))
{
//case insensitive comparison for Printable String and IA5String (EmailAdress only).
res = (plhs.CompareF(prhs) == 0);
}
else
{
// case-sensitive comparison for strings other than printable string
// Exception: This may include IA5Stings other than 'EmailAddress' attiribute types.
res = (plhs.Compare(prhs) == 0);
}
CleanupStack::PopAndDestroy();
delete rhs;
return res;
}