servicediscoveryandcontrol/pnp/test/upnp/upnpdescription/src/cupnpdescriptioncomposer.cpp
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <cupnpdescriptioncomposer.h>
       
    17 #include "cupnpservicecomposer.h"
       
    18 #include "cupnpdevicecomposer.h"
       
    19 
       
    20 EXPORT_C CUPnPDescriptionComposer* CUPnPDescriptionComposer::NewL(  const RStringPool& aStringPool )
       
    21 	{
       
    22 	return new ( ELeave ) CUPnPDescriptionComposer( aStringPool );
       
    23 	}
       
    24 EXPORT_C void CUPnPDescriptionComposer::ComposeDescriptionXmlL( TAny* aDescriptionObj , TUPnPDescriptionType aType , RBuf8 &aXmlData )
       
    25 	{
       
    26 	if( aType == CUPnPDescriptionComposer::EService )
       
    27 		{
       
    28 		
       
    29 		iServiceComposer = CUPnPServiceXmlComposer::NewL( iStringPool );
       
    30 		CUPnPServiceDescription* serviceDescObj = static_cast<CUPnPServiceDescription*> ( aDescriptionObj );
       
    31 		iServiceComposer->ComposeServiceXmlL(serviceDescObj, aXmlData);
       
    32 		}
       
    33 	else 
       
    34 		{
       
    35 		iDeviceComposer = CUPnPDeviceXmlComposer::NewL(  iStringPool );
       
    36 		CUPnPDeviceDescription* deviceDescObj = static_cast<CUPnPDeviceDescription*> ( aDescriptionObj );
       
    37 		iDeviceComposer->ComposeDeviceXmlL(deviceDescObj, aXmlData);
       
    38 		}
       
    39 	}
       
    40 
       
    41 EXPORT_C CUPnPDescriptionComposer::~CUPnPDescriptionComposer()
       
    42 	{
       
    43 	delete iServiceComposer;
       
    44 	delete iDeviceComposer;
       
    45 	}
       
    46 
       
    47 CUPnPDescriptionComposer::CUPnPDescriptionComposer(	const RStringPool& aStringPool): iStringPool (aStringPool)
       
    48 	{
       
    49 	
       
    50 	}
       
    51