installationservices/swi/test/testapps/testappwithoutrc.cpp
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <e32std.h>
       
    20 #include <e32uid.h>
       
    21 #include <e32base.h>
       
    22 #include <e32test.h>
       
    23 #include <swi/pkgremover.h>
       
    24 #include "cleanuputils.h"
       
    25 //#include <swispubsubdefs.h>
       
    26 
       
    27 using namespace Swi;
       
    28 
       
    29 _LIT(KTxtEPOC32EX," mainL failed");
       
    30 
       
    31 LOCAL_C void mainL();
       
    32 TInt E32Main() // main function called by E32
       
    33 	{
       
    34 	CTrapCleanup* cleanup=CTrapCleanup::New(); // get clean-up stack
       
    35 	TRAPD(error,mainL()); // more initialization, then do example
       
    36 	if(error!=KErrPermissionDenied)
       
    37 	__ASSERT_ALWAYS(!error,User::Panic(KTxtEPOC32EX,error));
       
    38 	delete cleanup; // destroy clean-up stack
       
    39 	return 0; // and return
       
    40 	}
       
    41 
       
    42 LOCAL_C void mainL() // initialize and call example code under cleanup stack
       
    43 	{
       
    44 	RPointerArray<CUninstalledPackageEntry> uninstalledPkgEntry;
       
    45 	CleanupResetAndDestroy<RPointerArray<CUninstalledPackageEntry> >::PushL(uninstalledPkgEntry);
       
    46 
       
    47 	TDriveNumber drive = EDriveX;
       
    48 	TRAPD(err,UninstalledSisPackages::ListL(drive, uninstalledPkgEntry));
       
    49 
       
    50 	if(err==KErrPermissionDenied)
       
    51 		{
       
    52 		User::LeaveIfError(KErrPermissionDenied);
       
    53 		}
       
    54 	CleanupStack::PopAndDestroy(&uninstalledPkgEntry);
       
    55 	}
       
    56