applayerprotocols/httptransportfw/Test/T_HttpIntegration/CLabeledText.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 25 May 2010 13:17:20 +0300
branchRCL_3
changeset 18 f21293830889
parent 0 b16258d2340f
permissions -rw-r--r--
Revision: 201019 Kit: 2010121

// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// $Header$
// Include Files  
// 
//

#include <e32std.h>                     //

//-----------------------------------------------------------------------------

#include "CLabeledText.h"                    // This module

//-----------------------------------------------------------------------------

CLabeledText *CLabeledText::NewL(const TDesC& aLabel, const TDesC& aValue )
{
CLabeledText* self = NewLC(aLabel, aValue);
CleanupStack::Pop();
return self; 
}

//-----------------------------------------------------------------------------

CLabeledText* CLabeledText::NewLC(const TDesC& aLabel, const TDesC& aValue )
{
CLabeledText* self = new (ELeave) CLabeledText();
CleanupStack::PushL(self);
self->ConstructL(aLabel, aValue);
return self;
}

//-----------------------------------------------------------------------------

CLabeledText::~CLabeledText()
{
delete iLabel;
iLabel = NULL;
delete iValue;
iValue = NULL;
}

//-----------------------------------------------------------------------------

void CLabeledText::ConstructL(const TDesC& aLabel, const TDesC& aValue )
{
iLabel = aLabel.AllocL();
iValue = aValue.AllocL();
}

//-----------------------------------------------------------------------------

TPtrC CLabeledText::Label() const
{
TPtrC label(iLabel->Des());
return label;
}

//-----------------------------------------------------------------------------

TPtrC CLabeledText::Value() const
{
TPtrC value(iValue->Des());
return value;
}

//-----------------------------------------------------------------------------

void CLabeledText::SetL(const TDesC& aValue)
{
delete iValue;
iValue = NULL;
iValue = aValue.AllocL();
}

//-----------------------------------------------------------------------------
//  End of File  
//-----------------------------------------------------------------------------