contentmgmt/contentaccessfwfordrm/source/cafutils/stringattribute.cpp
changeset 0 2c201484c85f
child 8 35751d3474b7
equal deleted inserted replaced
-1:000000000000 0:2c201484c85f
       
     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 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "stringAttribute.h"
       
    20 
       
    21 
       
    22 using namespace ContentAccess;
       
    23 
       
    24 CStringAttribute* CStringAttribute::NewL(TInt aAttribute, const TDesC& aValue, TInt aError)
       
    25 	{
       
    26 	CStringAttribute* self = new (ELeave) CStringAttribute(aAttribute, aError);
       
    27 	CleanupStack::PushL(self);
       
    28 	self->ConstructL(aValue);
       
    29 	CleanupStack::Pop(self);
       
    30 	return self;
       
    31 	}
       
    32 
       
    33 CStringAttribute::CStringAttribute(TInt aAttribute, TInt aError) : iAttribute(aAttribute), iError(aError)
       
    34 	{
       
    35 	}
       
    36 
       
    37 CStringAttribute::~CStringAttribute()
       
    38 	{
       
    39 	delete iValue;
       
    40 	}
       
    41 
       
    42 TInt CStringAttribute::Attribute() const
       
    43 	{
       
    44 	return iAttribute;
       
    45 	}
       
    46 
       
    47 const TDesC& CStringAttribute::Value() const
       
    48 	{
       
    49 	return *iValue;
       
    50 	}
       
    51 
       
    52 TInt CStringAttribute::Error() const
       
    53 	{
       
    54 	return iError;
       
    55 	}
       
    56 
       
    57 void CStringAttribute::ConstructL(const TDesC& aValue)
       
    58 	{
       
    59 	iValue = aValue.AllocL();
       
    60 	}