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


C++ TPtr::CompareF方法代码示例

本文整理汇总了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;
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:37,代码来源:aknswallpaperplugin.cpp

示例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; 
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:36,代码来源:x520ava.cpp


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