installationservices/swi/source/sisfile/swtypereginfo.cpp
branchRCL_3
changeset 17 741e5bba2bd1
parent 0 ba25891c3a9e
child 25 7333d7932ef7
equal deleted inserted replaced
15:98a43fae6e2b 17:741e5bba2bd1
     1 /*
     1 /*
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008-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".
   228 	CleanupStack::PopAndDestroy(&ws);
   228 	CleanupStack::PopAndDestroy(&ws);
   229 	}
   229 	}
   230 
   230 
   231 EXPORT_C void SoftwareTypeRegInfoUtils::UnserializeArrayL(RReadStream& aStream, RPointerArray<CSoftwareTypeRegInfo>& aSwTypeRegInfoArray)
   231 EXPORT_C void SoftwareTypeRegInfoUtils::UnserializeArrayL(RReadStream& aStream, RPointerArray<CSoftwareTypeRegInfo>& aSwTypeRegInfoArray)
   232 	{
   232 	{
       
   233 	CleanupResetAndDestroyPushL(aSwTypeRegInfoArray);
   233 	const TInt numElems = aStream.ReadInt32L();
   234 	const TInt numElems = aStream.ReadInt32L();
   234 	for (TInt i=0; i<numElems; ++i)
   235 	for (TInt i=0; i<numElems; ++i)
   235 		{
   236 		{
   236 		CSoftwareTypeRegInfo* info = CSoftwareTypeRegInfo::NewL(aStream);
   237 		CSoftwareTypeRegInfo* info = CSoftwareTypeRegInfo::NewL(aStream);
   237 		CleanupStack::PushL(info);
   238 		CleanupStack::PushL(info);
   238 		aSwTypeRegInfoArray.AppendL(info);
   239 		aSwTypeRegInfoArray.AppendL(info);
   239 		CleanupStack::Pop(info);
   240 		CleanupStack::Pop(info);
   240 		}
   241 		}
       
   242 	CleanupStack::Pop(&aSwTypeRegInfoArray);
   241 	}
   243 	}
   242 
   244 
   243 EXPORT_C void SoftwareTypeRegInfoUtils::SerializeUniqueSwTypeNamesL(const RPointerArray<CSoftwareTypeRegInfo>& aSwTypeRegInfoArray, RBuf& aSerializedNames)
   245 EXPORT_C void SoftwareTypeRegInfoUtils::SerializeUniqueSwTypeNamesL(const RPointerArray<CSoftwareTypeRegInfo>& aSwTypeRegInfoArray, RBuf& aSerializedNames)
   244 	{
   246 	{
   245 	const TInt numNames = aSwTypeRegInfoArray.Count();
   247 	const TInt numNames = aSwTypeRegInfoArray.Count();
   261 		}
   263 		}
   262 	}
   264 	}
   263 
   265 
   264 EXPORT_C void SoftwareTypeRegInfoUtils::UnserializeUniqueSwTypeNamesL(const TDesC& aSerializedNames, RArray<TPtrC>& aUniqueSwTypeNames)
   266 EXPORT_C void SoftwareTypeRegInfoUtils::UnserializeUniqueSwTypeNamesL(const TDesC& aSerializedNames, RArray<TPtrC>& aUniqueSwTypeNames)
   265 	{
   267 	{
       
   268 	CleanupClosePushL(aUniqueSwTypeNames);
   266 	TPtrC buf(aSerializedNames);
   269 	TPtrC buf(aSerializedNames);
   267 	for (;;)
   270 	for (;;)
   268 		{
   271 		{
   269 		const TInt sep = buf.Locate(static_cast<TChar>(KUniqueNameSeparator));
   272 		const TInt sep = buf.Locate(static_cast<TChar>(KUniqueNameSeparator));
   270 		if (sep != KErrNotFound)
   273 		if (sep != KErrNotFound)
   279 				User::Leave(KErrGeneral);
   282 				User::Leave(KErrGeneral);
   280 				}
   283 				}
   281 			break;
   284 			break;
   282 			}
   285 			}
   283 		}
   286 		}
       
   287 	CleanupStack::Pop(&aUniqueSwTypeNames);
   284 	}
   288 	}
   285 
   289 
   286 EXPORT_C void SoftwareTypeRegInfoUtils::ExtractMimeTypesL(const RPointerArray<CSoftwareTypeRegInfo>& aSwTypeRegInfoArray, RPointerArray<HBufC8>& aMimeTypes)
   290 EXPORT_C void SoftwareTypeRegInfoUtils::ExtractMimeTypesL(const RPointerArray<CSoftwareTypeRegInfo>& aSwTypeRegInfoArray, RPointerArray<HBufC8>& aMimeTypes)
   287 	{
   291 	{
   288 	for (TInt i=0; i<aSwTypeRegInfoArray.Count(); ++i)
   292 	for (TInt i=0; i<aSwTypeRegInfoArray.Count(); ++i)