// -----------------------------------------------------------------------------
// 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;
    }
Exemplo n.º 2
0
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; 
	}