secureswitools/swisistools/source/interpretsislib/sisregistrypackage.cpp
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2006-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 "sisregistrypackage.h"
       
    20 #include "deserialiser.h"
       
    21 #include "serialiser.h"
       
    22 
       
    23 SisRegistryPackage::SisRegistryPackage ()
       
    24 	{
       
    25 	iPackageName = new std::wstring();
       
    26 	iVendorName = new std::wstring();
       
    27 	}
       
    28 
       
    29 SisRegistryPackage::SisRegistryPackage(
       
    30 	TUint32 aIndex, 
       
    31 	const std::wstring& aVendorName,
       
    32 	const std::wstring& aPackageName,
       
    33 	TUint32 aPackageUid) 
       
    34 	: iIndex(aIndex), iUid(aPackageUid)
       
    35 {
       
    36 	iPackageName = new std::wstring(aPackageName);
       
    37 	iVendorName = new std::wstring(aVendorName);
       
    38 }
       
    39 
       
    40 
       
    41 SisRegistryPackage::~SisRegistryPackage ()
       
    42 	{
       
    43 	delete iPackageName;
       
    44 	delete iVendorName;
       
    45 	}
       
    46 
       
    47 void SisRegistryPackage::Internalize(Deserialiser& des)
       
    48 	{
       
    49 	des >> iUid
       
    50 	    >> *iPackageName
       
    51 	    >> *iVendorName
       
    52 	    >> iIndex;
       
    53 	}
       
    54 void SisRegistryPackage::Externalize(Serialiser& ser)
       
    55 	{
       
    56 	ser << iUid << *iPackageName << *iVendorName << iIndex;
       
    57 	}
       
    58 
       
    59 #ifdef _MSC_VER
       
    60 
       
    61 Deserialiser& operator>>(Deserialiser& aInput, std::vector<SisRegistryPackage*>& val)
       
    62 	{
       
    63 	TUint32 size = 0;
       
    64 	aInput>> size;
       
    65 	val.resize(size);
       
    66 	for (TUint32 i = 0; i < size ; ++i)
       
    67 		{
       
    68 		val[i] = new SisRegistryPackage;
       
    69 		aInput >> *val[i];
       
    70 		}
       
    71 	return aInput;
       
    72 	}
       
    73 #endif