installationservices/swi/source/sisregistry/server_legacy/sisregistryutil.cpp
branchRCL_3
changeset 66 8b7f4e561641
parent 65 7333d7932ef7
equal deleted inserted replaced
65:7333d7932ef7 66:8b7f4e561641
     1 /*
     1 /*
     2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   121 	if (err != KErrNone && err != KErrAlreadyExists)
   121 	if (err != KErrNone && err != KErrAlreadyExists)
   122 		{
   122 		{
   123 		User::LeaveIfError(err);
   123 		User::LeaveIfError(err);
   124 		}
   124 		}
   125 	}
   125 	}
       
   126 
       
   127 void SisRegistryUtil::CreateFileWithAttributesL(RFs& aFs, const TDesC& aPath, const TUint aAttributesMask)
       
   128     {
       
   129     // Creates the folder structure by ignoring the filename at the end.
       
   130     EnsureDirExistsL(aFs, aPath);
       
   131 
       
   132     RFile file;
       
   133     CleanupClosePushL(file);
       
   134     User::LeaveIfError(file.Create(aFs, aPath, EFileWrite));
       
   135    
       
   136     if(aAttributesMask != 0)
       
   137         {
       
   138         file.SetAtt(aAttributesMask, 0); // Ignoring return value.
       
   139         }
       
   140     CleanupStack::PopAndDestroy(&file);
       
   141     }
       
   142 
       
   143 TInt SisRegistryUtil::DeleteFile(RFs& aFs, const TDesC& aPath)
       
   144     {
       
   145     TInt err = aFs.Delete(aPath);
       
   146     
       
   147     if(KErrNone != err)
       
   148         {
       
   149         DEBUG_PRINTF2(_L("Failed to delete file %S."), &aPath);
       
   150         }
       
   151     else
       
   152         {
       
   153         DEBUG_PRINTF2(_L("Deleted file %S successfully."), &aPath);
       
   154         }
       
   155     
       
   156     return err;
       
   157     }
   126 
   158 
   127 // Processes the ROM stub files. Retuns ETrue if the aUid or aName
   159 // Processes the ROM stub files. Retuns ETrue if the aUid or aName
   128 // is found in any of the ROM stub files, else returns EFalse.
   160 // is found in any of the ROM stub files, else returns EFalse.
   129 TBool SisRegistryUtil::RomBasedPackageL(const TUid& aUid)
   161 TBool SisRegistryUtil::RomBasedPackageL(const TUid& aUid)
   130 	{	
   162 	{