installationservices/swi/source/sisregistry/common/sisregistryproperty.cpp
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2004-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 * CSisRegistryProperty class implementation
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file 
       
    22  @released
       
    23  @internalComponent
       
    24 */
       
    25 #include <s32strm.h>
       
    26 #include "sisregistryproperty.h"
       
    27 #include "sisproperty.h"
       
    28 
       
    29 using namespace Swi;
       
    30 
       
    31 
       
    32 EXPORT_C CSisRegistryProperty* CSisRegistryProperty::NewL(const Sis::CProperty& aProperty)
       
    33 	{
       
    34 	CSisRegistryProperty* self = NewLC(aProperty);
       
    35 	CleanupStack::Pop(self);
       
    36 	return self;
       
    37 	}
       
    38 
       
    39 EXPORT_C CSisRegistryProperty* CSisRegistryProperty::NewLC(const Sis::CProperty& aProperty)
       
    40 	{
       
    41 	CSisRegistryProperty* self = new(ELeave) CSisRegistryProperty();
       
    42 	CleanupStack::PushL(self);
       
    43 	self->ConstructL(aProperty);
       
    44 	return self;
       
    45 	}
       
    46 
       
    47 EXPORT_C CSisRegistryProperty* CSisRegistryProperty::NewL(RReadStream& aStream)
       
    48 	{
       
    49 	CSisRegistryProperty* self = NewLC(aStream);
       
    50 	CleanupStack::Pop(self);
       
    51 	return self;
       
    52 	}
       
    53 
       
    54 EXPORT_C CSisRegistryProperty* CSisRegistryProperty::NewLC(RReadStream& aStream)
       
    55 	{
       
    56 	CSisRegistryProperty* self = new(ELeave) CSisRegistryProperty();
       
    57 	CleanupStack::PushL(self);
       
    58 	self->ConstructL(aStream);
       
    59 	return self;
       
    60 	}
       
    61 
       
    62 
       
    63 void CSisRegistryProperty::ConstructL(const Sis::CProperty& aProperty)
       
    64 	{
       
    65 	iKey = aProperty.Key();
       
    66 	iValue = aProperty.Value();
       
    67 	}
       
    68 
       
    69 void CSisRegistryProperty::ConstructL(RReadStream& aStream)
       
    70 	{
       
    71 	InternalizeL(aStream);
       
    72 	}
       
    73 
       
    74 EXPORT_C void CSisRegistryProperty::InternalizeL(RReadStream& aStream)
       
    75 	{
       
    76 	iKey = aStream.ReadInt32L();
       
    77 	iValue = aStream.ReadInt32L();
       
    78 	}
       
    79 	
       
    80 EXPORT_C void CSisRegistryProperty::ExternalizeL(RWriteStream& aStream) const
       
    81 	{
       
    82 	aStream.WriteInt32L(iKey);
       
    83 	aStream.WriteInt32L(iValue);
       
    84 	}